LogsQueryClientBuilder Class

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

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 LogsQueryClientBuilder.

Method Summary

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

Adds a custom Http pipeline policy.

LogsQueryAsyncClient buildAsyncClient()

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

LogsQueryClient buildClient()

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

LogsQueryClientBuilder clientOptions(ClientOptions clientOptions)

Set the ClientOptions used for creating the client.

LogsQueryClientBuilder configuration(Configuration configuration)

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

LogsQueryClientBuilder credential(TokenCredential tokenCredential)

Sets The TokenCredential used for authentication.

LogsQueryClientBuilder endpoint(String endpoint)

Sets the log query endpoint.

LogsQueryClientBuilder httpClient(HttpClient httpClient)

Sets The HTTP client used to send the request.

LogsQueryClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)

Sets The logging configuration for HTTP requests and responses.

LogsQueryClientBuilder pipeline(HttpPipeline pipeline)

Sets The HTTP pipeline to send requests through.

LogsQueryClientBuilder retryOptions(RetryOptions retryOptions)

Sets the RetryOptions used for creating the client.

LogsQueryClientBuilder retryPolicy(RetryPolicy retryPolicy)

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

LogsQueryClientBuilder 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:

customPolicy - The custom Http pipeline policy to add.

Returns:

buildAsyncClient

public LogsQueryAsyncClient buildAsyncClient()

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

Returns:

An asynchronous LogsQueryAsyncClient.

buildClient

public LogsQueryClient buildClient()

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

Returns:

A synchronous LogsQueryClient.

clientOptions

public LogsQueryClientBuilder clientOptions(ClientOptions clientOptions)

Set the ClientOptions used for creating the client.

Parameters:

clientOptions - The ClientOptions.

Returns:

configuration

public LogsQueryClientBuilder configuration(Configuration configuration)

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

Parameters:

configuration - the configuration value.

Returns:

credential

public LogsQueryClientBuilder credential(TokenCredential tokenCredential)

Sets The TokenCredential used for authentication.

Parameters:

tokenCredential - the tokenCredential value.

Returns:

endpoint

public LogsQueryClientBuilder endpoint(String endpoint)

Sets the log query endpoint.

Parameters:

endpoint - the host value.

Returns:

httpClient

public LogsQueryClientBuilder httpClient(HttpClient httpClient)

Sets The HTTP client used to send the request.

Parameters:

httpClient - the httpClient value.

Returns:

httpLogOptions

public LogsQueryClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)

Sets The logging configuration for HTTP requests and responses.

Parameters:

httpLogOptions - the httpLogOptions value.

Returns:

pipeline

public LogsQueryClientBuilder pipeline(HttpPipeline pipeline)

Sets The HTTP pipeline to send requests through.

Parameters:

pipeline - the pipeline value.

Returns:

retryOptions

public LogsQueryClientBuilder retryOptions(RetryOptions retryOptions)

Sets the RetryOptions used for creating the client.

Parameters:

retryOptions - The RetryOptions.

Returns:

retryPolicy

public LogsQueryClientBuilder retryPolicy(RetryPolicy retryPolicy)

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

Parameters:

retryPolicy - the retryPolicy value.

Returns:

serviceVersion

public LogsQueryClientBuilder serviceVersion(LogsQueryServiceVersion serviceVersion)

The service version to use when creating the client.

Parameters:

serviceVersion - The LogsQueryServiceVersion.

Returns:

Applies to