LogsQueryClientBuilder Class
- java.
lang. Object - com.
azure. monitor. query. LogsQueryClientBuilder
- com.
Implements
public final class LogsQueryClientBuilder
implements EndpointTrait<LogsQueryClientBuilder>, HttpTrait<LogsQueryClientBuilder>, ConfigurationTrait<LogsQueryClientBuilder>, TokenCredentialTrait<LogsQueryClientBuilder>
Fluent builder for creating instances of LogsQueryClient and LogsQueryAsyncClient.
The LogsQueryClientBuilder is responsible for authenticating a building instances of LogsQueryClient and LogsQueryAsyncClient. Customizations can be applied to clients through the builder using the various options available.
Getting Started
To create instances of the clients, sufficient authentication credentials are required. TokenCredential is a common form of authentication. The resource / workspace is not required for client creation, but the authentication credentials must have access to the resources / workspaces utilized by the client.
Client Builder Usage
The following sample shows instantiating an asynchronous Logs query Client using Token Credential
LogsQueryAsyncClient logsQueryAsyncClient = new LogsQueryClientBuilder()
.credential(tokenCredential)
.buildAsyncClient();
The following sample shows instantiating a synchronous Logs query Client using Token Credential
LogsQueryClient logsQueryClient = new LogsQueryClientBuilder()
.credential(tokenCredential)
.buildClient();
For more information about the other types of credentials that can be used to authenticate your client, please see this documentation: Azure Identity
Constructor Summary
Constructor | Description |
---|---|
LogsQueryClientBuilder() |
Creates an instance of Logs |
Method Summary
Modifier and Type | Method and Description |
---|---|
Logs |
addPolicy(HttpPipelinePolicy customPolicy)
Adds a custom Http pipeline policy. |
Logs |
buildAsyncClient()
Creates an asynchronous client with the configured options in this builder. |
Logs |
buildClient()
Creates a synchronous client with the configured options in this builder. |
Logs |
clientOptions(ClientOptions clientOptions)
Set the ClientOptions used for creating the client. |
Logs |
configuration(Configuration configuration)
Sets The configuration store that is used during construction of the service client. |
Logs |
credential(TokenCredential tokenCredential)
Sets The Token |
Logs |
endpoint(String endpoint)
Sets the log query endpoint. |
Logs |
httpClient(HttpClient httpClient)
Sets The HTTP client used to send the request. |
Logs |
httpLogOptions(HttpLogOptions httpLogOptions)
Sets The logging configuration for HTTP requests and responses. |
Logs |
pipeline(HttpPipeline pipeline)
Sets The HTTP pipeline to send requests through. |
Logs |
retryOptions(RetryOptions retryOptions)
Sets the RetryOptions used for creating the client. |
Logs |
retryPolicy(RetryPolicy retryPolicy)
Sets The retry policy that will attempt to retry failed requests, if applicable. |
Logs |
serviceVersion(LogsQueryServiceVersion serviceVersion)
The service version to use when creating the client. |
Methods inherited from java.lang.Object
Constructor Details
LogsQueryClientBuilder
public LogsQueryClientBuilder()
Creates an instance of LogsQueryClientBuilder.
Method Details
addPolicy
public LogsQueryClientBuilder addPolicy(HttpPipelinePolicy customPolicy)
Adds a custom Http pipeline policy.
Parameters:
Returns:
buildAsyncClient
public LogsQueryAsyncClient buildAsyncClient()
Creates an asynchronous client with the configured options in this builder.
Returns:
buildClient
public LogsQueryClient buildClient()
Creates a synchronous client with the configured options in this builder.
Returns:
clientOptions
public LogsQueryClientBuilder clientOptions(ClientOptions clientOptions)
Set the ClientOptions used for creating the client.
Parameters:
Returns:
configuration
public LogsQueryClientBuilder configuration(Configuration configuration)
Sets The configuration store that is used during construction of the service client.
Parameters:
Returns:
credential
public LogsQueryClientBuilder credential(TokenCredential tokenCredential)
Sets The TokenCredential used for authentication.
Parameters:
Returns:
endpoint
public LogsQueryClientBuilder endpoint(String endpoint)
Sets the log query endpoint.
Parameters:
Returns:
httpClient
public LogsQueryClientBuilder httpClient(HttpClient httpClient)
Sets The HTTP client used to send the request.
Parameters:
Returns:
httpLogOptions
public LogsQueryClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)
Sets The logging configuration for HTTP requests and responses.
Parameters:
Returns:
pipeline
public LogsQueryClientBuilder pipeline(HttpPipeline pipeline)
Sets The HTTP pipeline to send requests through.
Parameters:
Returns:
retryOptions
public LogsQueryClientBuilder retryOptions(RetryOptions retryOptions)
Sets the RetryOptions used for creating the client.
Parameters:
Returns:
retryPolicy
public LogsQueryClientBuilder retryPolicy(RetryPolicy retryPolicy)
Sets The retry policy that will attempt to retry failed requests, if applicable.
Parameters:
Returns:
serviceVersion
public LogsQueryClientBuilder serviceVersion(LogsQueryServiceVersion serviceVersion)
The service version to use when creating the client.
Parameters:
Returns:
Applies to
Azure SDK for Java