MetricsClientBuilder Class
- java.
lang. Object - com.
azure. monitor. query. MetricsClientBuilder
- com.
Implements
public final class MetricsClientBuilder
implements EndpointTrait<MetricsClientBuilder>, HttpTrait<MetricsClientBuilder>, ConfigurationTrait<MetricsClientBuilder>, TokenCredentialTrait<MetricsClientBuilder>
Fluent builder for creating instances of MetricsClient and MetricsAsyncClient.
Constructor Summary
Constructor | Description |
---|---|
MetricsClientBuilder() |
Creates an instance of Metrics |
Method Summary
Modifier and Type | Method and Description |
---|---|
Metrics |
addPolicy(HttpPipelinePolicy customPolicy)
Adds a custom Http pipeline policy. |
Metrics |
audience(MetricsAudience audience)
Sets the metrics audience. |
Metrics |
buildAsyncClient()
Creates an asynchronous client with the configured options in this builder. |
Metrics |
buildClient()
Creates a synchronous client with the configured options in this builder. |
Metrics |
clientOptions(ClientOptions clientOptions)
Set the ClientOptions used for creating the client. |
Metrics |
configuration(Configuration configuration)
Sets The configuration store that is used during construction of the service client. |
Metrics |
credential(TokenCredential tokenCredential)
Sets The Token |
Metrics |
endpoint(String endpoint)
Sets the metrics endpoint. |
Metrics |
httpClient(HttpClient httpClient)
Sets The HTTP client used to send the request. |
Metrics |
httpLogOptions(HttpLogOptions httpLogOptions)
Sets The logging configuration for HTTP requests and responses. |
Metrics |
pipeline(HttpPipeline pipeline)
Sets The HTTP pipeline to send requests through. |
Metrics |
retryOptions(RetryOptions retryOptions)
Sets the RetryOptions used for creating the client. |
Metrics |
retryPolicy(RetryPolicy retryPolicy)
Sets The retry policy that will attempt to retry failed requests, if applicable. |
Metrics |
serviceVersion(MetricsServiceVersion serviceVersion)
The service version to use when creating the client. |
Methods inherited from java.lang.Object
Constructor Details
MetricsClientBuilder
public MetricsClientBuilder()
Creates an instance of MetricsClientBuilder.
Method Details
addPolicy
public MetricsClientBuilder addPolicy(HttpPipelinePolicy customPolicy)
Adds a custom Http pipeline policy.
Parameters:
Returns:
audience
public MetricsClientBuilder audience(MetricsAudience audience)
Sets the metrics audience.
Parameters:
Returns:
buildAsyncClient
public MetricsAsyncClient buildAsyncClient()
Creates an asynchronous client with the configured options in this builder.
Returns:
buildClient
public MetricsClient buildClient()
Creates a synchronous client with the configured options in this builder.
Returns:
clientOptions
public MetricsClientBuilder clientOptions(ClientOptions clientOptions)
Set the ClientOptions used for creating the client.
Parameters:
Returns:
configuration
public MetricsClientBuilder configuration(Configuration configuration)
Sets The configuration store that is used during construction of the service client.
Parameters:
Returns:
credential
public MetricsClientBuilder credential(TokenCredential tokenCredential)
Sets The TokenCredential used for authentication.
Parameters:
Returns:
endpoint
public MetricsClientBuilder endpoint(String endpoint)
Sets the metrics endpoint.
Parameters:
Returns:
httpClient
public MetricsClientBuilder httpClient(HttpClient httpClient)
Sets The HTTP client used to send the request.
Parameters:
Returns:
httpLogOptions
public MetricsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)
Sets The logging configuration for HTTP requests and responses.
Parameters:
Returns:
pipeline
public MetricsClientBuilder pipeline(HttpPipeline pipeline)
Sets The HTTP pipeline to send requests through.
Parameters:
Returns:
retryOptions
public MetricsClientBuilder retryOptions(RetryOptions retryOptions)
Sets the RetryOptions used for creating the client.
Parameters:
Returns:
retryPolicy
public MetricsClientBuilder retryPolicy(RetryPolicy retryPolicy)
Sets The retry policy that will attempt to retry failed requests, if applicable.
Parameters:
Returns:
serviceVersion
public MetricsClientBuilder serviceVersion(MetricsServiceVersion serviceVersion)
The service version to use when creating the client.
Parameters:
Returns:
Applies to
Azure SDK for Java