Share via


MetricsQueryClientBuilder Class

  • java.lang.Object
    • com.azure.monitor.query.MetricsQueryClientBuilder

Implements

public final class MetricsQueryClientBuilder
implements EndpointTrait<MetricsQueryClientBuilder>, HttpTrait<MetricsQueryClientBuilder>, ConfigurationTrait<MetricsQueryClientBuilder>, TokenCredentialTrait<MetricsQueryClientBuilder>

Fluent builder for creating instances of MetricsQueryClient and MetricsQueryAsyncClient.

Instantiating an asynchronous Metrics query Client

MetricsQueryAsyncClient metricsQueryAsyncClient = new MetricsQueryClientBuilder()
         .credential(tokenCredential)
         .buildAsyncClient();

Instantiating a synchronous Metrics query Client

MetricsQueryClient metricsQueryClient = new MetricsQueryClientBuilder()
         .credential(tokenCredential)
         .buildClient();

Constructor Summary

Constructor Description
MetricsQueryClientBuilder()

Method Summary

Modifier and Type Method and Description
MetricsQueryClientBuilder addPolicy(HttpPipelinePolicy customPolicy)

Adds a custom Http pipeline policy.

MetricsQueryAsyncClient buildAsyncClient()

Creates an asynchronous client with the configured options in this builder.

MetricsQueryClient buildClient()

Creates a synchronous client with the configured options in this builder.

MetricsQueryClientBuilder clientOptions(ClientOptions clientOptions)

Set the ClientOptions used for creating the client.

MetricsQueryClientBuilder configuration(Configuration configuration)

Sets The configuration store that is used during construction of the service client.

MetricsQueryClientBuilder credential(TokenCredential tokenCredential)

Sets The TokenCredential used for authentication.

MetricsQueryClientBuilder endpoint(String endpoint)

Sets the metrics query endpoint.

MetricsQueryClientBuilder httpClient(HttpClient httpClient)

Sets The HTTP client used to send the request.

MetricsQueryClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)

Sets The logging configuration for HTTP requests and responses.

MetricsQueryClientBuilder pipeline(HttpPipeline pipeline)

Sets The HTTP pipeline to send requests through.

MetricsQueryClientBuilder retryOptions(RetryOptions retryOptions)

Sets the RetryOptions used for creating the client.

MetricsQueryClientBuilder retryPolicy(RetryPolicy retryPolicy)

Sets The retry policy that will attempt to retry failed requests, if applicable.

MetricsQueryClientBuilder serviceVersion(MetricsQueryServiceVersion serviceVersion)

The service version to use when creating the client.

Methods inherited from java.lang.Object

Constructor Details

MetricsQueryClientBuilder

public MetricsQueryClientBuilder()

Method Details

addPolicy

public MetricsQueryClientBuilder addPolicy(HttpPipelinePolicy customPolicy)

Adds a custom Http pipeline policy.

Parameters:

customPolicy - The custom Http pipeline policy to add.

Returns:

the MetricsClientBuilder.

buildAsyncClient

public MetricsQueryAsyncClient buildAsyncClient()

Creates an asynchronous client with the configured options in this builder.

Returns:

An asynchronous MetricsQueryAsyncClient.

buildClient

public MetricsQueryClient buildClient()

Creates a synchronous client with the configured options in this builder.

Returns:

A synchronous MetricsQueryClient.

clientOptions

public MetricsQueryClientBuilder clientOptions(ClientOptions clientOptions)

Set the ClientOptions used for creating the client.

Parameters:

clientOptions - The ClientOptions.

Returns:

configuration

public MetricsQueryClientBuilder configuration(Configuration configuration)

Sets The configuration store that is used during construction of the service client.

Parameters:

configuration - the configuration value.

Returns:

the MetricsClientBuilder.

credential

public MetricsQueryClientBuilder credential(TokenCredential tokenCredential)

Sets The TokenCredential used for authentication.

Parameters:

tokenCredential - the tokenCredential value.

Returns:

the MetricsClientBuilder.

endpoint

public MetricsQueryClientBuilder endpoint(String endpoint)

Sets the metrics query endpoint.

Parameters:

endpoint - the host value.

Returns:

the MetricsClientBuilder.

httpClient

public MetricsQueryClientBuilder httpClient(HttpClient httpClient)

Sets The HTTP client used to send the request.

Parameters:

httpClient - the httpClient value.

Returns:

the MetricsClientBuilder.

httpLogOptions

public MetricsQueryClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)

Sets The logging configuration for HTTP requests and responses.

Parameters:

httpLogOptions - the httpLogOptions value.

Returns:

the MetricsClientBuilder.

pipeline

public MetricsQueryClientBuilder pipeline(HttpPipeline pipeline)

Sets The HTTP pipeline to send requests through.

Parameters:

pipeline - the pipeline value.

Returns:

the MetricsClientBuilder.

retryOptions

public MetricsQueryClientBuilder retryOptions(RetryOptions retryOptions)

Sets the RetryOptions used for creating the client.

Parameters:

retryOptions - The RetryOptions.

Returns:

retryPolicy

public MetricsQueryClientBuilder retryPolicy(RetryPolicy retryPolicy)

Sets The retry policy that will attempt to retry failed requests, if applicable.

Parameters:

retryPolicy - the retryPolicy value.

Returns:

the MetricsClientBuilder.

serviceVersion

public MetricsQueryClientBuilder serviceVersion(MetricsQueryServiceVersion serviceVersion)

The service version to use when creating the client.

Parameters:

serviceVersion - The MetricsQueryServiceVersion.

Returns:

Applies to