Class LogsQueryClientBuilder

java.lang.Object
com.azure.monitor.query.LogsQueryClientBuilder
All Implemented Interfaces:
com.azure.core.client.traits.ConfigurationTrait<LogsQueryClientBuilder>, com.azure.core.client.traits.EndpointTrait<LogsQueryClientBuilder>, com.azure.core.client.traits.HttpTrait<LogsQueryClientBuilder>, com.azure.core.client.traits.TokenCredentialTrait<LogsQueryClientBuilder>

public final class LogsQueryClientBuilder extends Object implements com.azure.core.client.traits.EndpointTrait<LogsQueryClientBuilder>, com.azure.core.client.traits.HttpTrait<LogsQueryClientBuilder>, com.azure.core.client.traits.ConfigurationTrait<LogsQueryClientBuilder>, com.azure.core.client.traits.TokenCredentialTrait<LogsQueryClientBuilder>
Fluent builder for creating instances of LogsQueryClient and LogsQueryAsyncClient.

Instantiating an asynchronous Logs query Client

 LogsQueryAsyncClient logsQueryAsyncClient = new LogsQueryClientBuilder()
         .credential(tokenCredential)
         .buildAsyncClient();
 

Instantiating a synchronous Logs query Client

 LogsQueryClient logsQueryClient = new LogsQueryClientBuilder()
         .credential(tokenCredential)
         .buildClient();
 
  • Constructor Details

    • LogsQueryClientBuilder

      public LogsQueryClientBuilder()
  • Method Details

    • endpoint

      public LogsQueryClientBuilder endpoint(String endpoint)
      Sets the log query endpoint.
      Specified by:
      endpoint in interface com.azure.core.client.traits.EndpointTrait<LogsQueryClientBuilder>
      Parameters:
      endpoint - the host value.
      Returns:
      the LogsQueryClientBuilder.
    • pipeline

      public LogsQueryClientBuilder pipeline(com.azure.core.http.HttpPipeline pipeline)
      Sets The HTTP pipeline to send requests through.
      Specified by:
      pipeline in interface com.azure.core.client.traits.HttpTrait<LogsQueryClientBuilder>
      Parameters:
      pipeline - the pipeline value.
      Returns:
      the LogsQueryClientBuilder.
    • httpClient

      public LogsQueryClientBuilder httpClient(com.azure.core.http.HttpClient httpClient)
      Sets The HTTP client used to send the request.
      Specified by:
      httpClient in interface com.azure.core.client.traits.HttpTrait<LogsQueryClientBuilder>
      Parameters:
      httpClient - the httpClient value.
      Returns:
      the LogsQueryClientBuilder.
    • configuration

      public LogsQueryClientBuilder configuration(com.azure.core.util.Configuration configuration)
      Sets The configuration store that is used during construction of the service client.
      Specified by:
      configuration in interface com.azure.core.client.traits.ConfigurationTrait<LogsQueryClientBuilder>
      Parameters:
      configuration - the configuration value.
      Returns:
      the LogsQueryClientBuilder.
    • httpLogOptions

      public LogsQueryClientBuilder httpLogOptions(com.azure.core.http.policy.HttpLogOptions httpLogOptions)
      Sets The logging configuration for HTTP requests and responses.
      Specified by:
      httpLogOptions in interface com.azure.core.client.traits.HttpTrait<LogsQueryClientBuilder>
      Parameters:
      httpLogOptions - the httpLogOptions value.
      Returns:
      the LogsQueryClientBuilder.
    • retryPolicy

      public LogsQueryClientBuilder retryPolicy(com.azure.core.http.policy.RetryPolicy retryPolicy)
      Sets The retry policy that will attempt to retry failed requests, if applicable.
      Parameters:
      retryPolicy - the retryPolicy value.
      Returns:
      the LogsQueryClientBuilder.
    • retryOptions

      public LogsQueryClientBuilder retryOptions(com.azure.core.http.policy.RetryOptions retryOptions)
      Sets the RetryOptions used for creating the client.
      Specified by:
      retryOptions in interface com.azure.core.client.traits.HttpTrait<LogsQueryClientBuilder>
      Parameters:
      retryOptions - The RetryOptions.
      Returns:
      the updated LogsQueryClientBuilder.
    • addPolicy

      public LogsQueryClientBuilder addPolicy(com.azure.core.http.policy.HttpPipelinePolicy customPolicy)
      Adds a custom Http pipeline policy.
      Specified by:
      addPolicy in interface com.azure.core.client.traits.HttpTrait<LogsQueryClientBuilder>
      Parameters:
      customPolicy - The custom Http pipeline policy to add.
      Returns:
      the LogsQueryClientBuilder.
    • credential

      public LogsQueryClientBuilder credential(com.azure.core.credential.TokenCredential tokenCredential)
      Sets The TokenCredential used for authentication.
      Specified by:
      credential in interface com.azure.core.client.traits.TokenCredentialTrait<LogsQueryClientBuilder>
      Parameters:
      tokenCredential - the tokenCredential value.
      Returns:
      the LogsQueryClientBuilder.
    • clientOptions

      public LogsQueryClientBuilder clientOptions(com.azure.core.util.ClientOptions clientOptions)
      Set the ClientOptions used for creating the client.
      Specified by:
      clientOptions in interface com.azure.core.client.traits.HttpTrait<LogsQueryClientBuilder>
      Parameters:
      clientOptions - The ClientOptions.
      Returns:
      the LogsQueryClientBuilder.
      See Also:
      • HttpClientOptions
    • serviceVersion

      public LogsQueryClientBuilder serviceVersion(LogsQueryServiceVersion serviceVersion)
      The service version to use when creating the client.
      Parameters:
      serviceVersion - The LogsQueryServiceVersion.
      Returns:
      the LogsQueryClientBuilder.
    • buildClient

      public LogsQueryClient buildClient()
      Creates a synchronous client with the configured options in this builder.
      Returns:
      A synchronous LogsQueryClient.
    • buildAsyncClient

      public LogsQueryAsyncClient buildAsyncClient()
      Creates an asynchronous client with the configured options in this builder.
      Returns:
      An asynchronous LogsQueryAsyncClient.