Package com.azure.monitor.query
Class MetricsQueryClientBuilder
java.lang.Object
com.azure.monitor.query.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPolicy(com.azure.core.http.policy.HttpPipelinePolicy customPolicy) Adds a custom Http pipeline policy.Creates an asynchronous client with the configured options in this builder.Creates a synchronous client with the configured options in this builder.clientOptions(com.azure.core.util.ClientOptions clientOptions) Set theClientOptionsused for creating the client.configuration(com.azure.core.util.Configuration configuration) Sets The configuration store that is used during construction of the service client.credential(com.azure.core.credential.TokenCredential tokenCredential) Sets The TokenCredential used for authentication.Sets the metrics query endpoint.httpClient(com.azure.core.http.HttpClient httpClient) Sets The HTTP client used to send the request.httpLogOptions(com.azure.core.http.policy.HttpLogOptions httpLogOptions) Sets The logging configuration for HTTP requests and responses.pipeline(com.azure.core.http.HttpPipeline pipeline) Sets The HTTP pipeline to send requests through.retryPolicy(com.azure.core.http.policy.RetryPolicy retryPolicy) Sets The retry policy that will attempt to retry failed requests, if applicable.serviceVersion(MetricsQueryServiceVersion serviceVersion) The service version to use when creating the client.
-
Constructor Details
-
MetricsQueryClientBuilder
public MetricsQueryClientBuilder()
-
-
Method Details
-
endpoint
Sets the metrics query endpoint.- Parameters:
endpoint- the host value.- Returns:
- the MetricsClientBuilder.
-
pipeline
Sets The HTTP pipeline to send requests through.- Parameters:
pipeline- the pipeline value.- Returns:
- the MetricsClientBuilder.
-
httpClient
Sets The HTTP client used to send the request.- Parameters:
httpClient- the httpClient value.- Returns:
- the MetricsClientBuilder.
-
configuration
Sets The configuration store that is used during construction of the service client.- Parameters:
configuration- the configuration value.- Returns:
- the MetricsClientBuilder.
-
httpLogOptions
public MetricsQueryClientBuilder httpLogOptions(com.azure.core.http.policy.HttpLogOptions httpLogOptions) Sets The logging configuration for HTTP requests and responses.- Parameters:
httpLogOptions- the httpLogOptions value.- Returns:
- the MetricsClientBuilder.
-
retryPolicy
Sets The retry policy that will attempt to retry failed requests, if applicable.- Parameters:
retryPolicy- the retryPolicy value.- Returns:
- the MetricsClientBuilder.
-
addPolicy
public MetricsQueryClientBuilder addPolicy(com.azure.core.http.policy.HttpPipelinePolicy customPolicy) Adds a custom Http pipeline policy.- Parameters:
customPolicy- The custom Http pipeline policy to add.- Returns:
- the MetricsClientBuilder.
-
credential
public MetricsQueryClientBuilder credential(com.azure.core.credential.TokenCredential tokenCredential) Sets The TokenCredential used for authentication.- Parameters:
tokenCredential- the tokenCredential value.- Returns:
- the MetricsClientBuilder.
-
clientOptions
Set theClientOptionsused for creating the client.- Parameters:
clientOptions- TheClientOptions.- Returns:
- the
MetricsQueryClientBuilder
-
serviceVersion
The service version to use when creating the client.- Parameters:
serviceVersion- TheMetricsQueryServiceVersion.- Returns:
- the
MetricsQueryClientBuilder
-
buildClient
Creates a synchronous client with the configured options in this builder.- Returns:
- A synchronous
MetricsQueryClient.
-
buildAsyncClient
Creates an asynchronous client with the configured options in this builder.- Returns:
- An asynchronous
MetricsQueryAsyncClient.
-