Interface InfluxDBClient

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
InfluxDBClientImpl

@ThreadSafe public interface InfluxDBClient extends AutoCloseable
The client of theInfluxDB 2.x for Time Series that implements HTTP API defined by Influx API Service swagger.yml.
Author:
Jakub Bednar (bednar@github) (11/10/2018 08:56)
  • Method Details

    • getQueryApi

      @Nonnull QueryApi getQueryApi()
      Create a new Query client.
      Returns:
      the new client instance for the Query API
    • getWriteApi

      @Nonnull @Deprecated WriteApi getWriteApi()
      Deprecated.
      use makeWriteApi(), the API is subject to removal in a next major release
      Create a new asynchronous non-blocking Write client.

      The WriteApi uses background thread to ingesting data into InfluxDB and is suppose to run as a singleton. Don't create new instance for every write.

      Returns:
      the new client instance for the Write API
    • makeWriteApi

      @Nonnull WriteApi makeWriteApi()
      Create a new asynchronous non-blocking Write client.

      The WriteApi uses background thread to ingesting data into InfluxDB and is suppose to run as a singleton. Don't create new instance for every write.

      Returns:
      the new client instance for the Write API
    • getWriteApi

      @Nonnull @Deprecated WriteApi getWriteApi(@Nonnull WriteOptions writeOptions)
      Deprecated.
      use makeWriteApi(WriteOptions), the API is subject to removal in a next major release
      Create a new asynchronous non-blocking Write client.
      Parameters:
      writeOptions - the writes configuration
      Returns:
      the new client instance for the Write API
    • makeWriteApi

      @Nonnull WriteApi makeWriteApi(@Nonnull WriteOptions writeOptions)
      Create a new asynchronous non-blocking Write client.

      The WriteApi uses background thread to ingesting data into InfluxDB and is suppose to run as a singleton. Don't create new instance for every write.

      Parameters:
      writeOptions - the writes configuration
      Returns:
      the new client instance for the Write API
    • getWriteApiBlocking

      @Nonnull WriteApiBlocking getWriteApiBlocking()
      Create a new synchronous blocking Write client.
      Returns:
      the new client instance for the Write API
    • getAuthorizationsApi

      @Nonnull AuthorizationsApi getAuthorizationsApi()
      Create a new Authorization client.
      Returns:
      the new client instance for Authorization API
    • getBucketsApi

      @Nonnull BucketsApi getBucketsApi()
      Create a new Bucket client.
      Returns:
      the new client instance for Bucket API
    • getOrganizationsApi

      @Nonnull OrganizationsApi getOrganizationsApi()
      Create a new Organization client.
      Returns:
      the new client instance for Organization API
    • getSourcesApi

      @Nonnull SourcesApi getSourcesApi()
      Create a new Source client.
      Returns:
      the new client instance for Source API
    • getTasksApi

      @Nonnull TasksApi getTasksApi()
      Create a new Task client.
      Returns:
      the new client instance for Task API
    • getUsersApi

      @Nonnull UsersApi getUsersApi()
      Create a new User client.
      Returns:
      the new client instance for User API
    • getScraperTargetsApi

      @Nonnull ScraperTargetsApi getScraperTargetsApi()
      Create a new ScraperTargetResponse client.
      Returns:
      the new client instance for Scraper API
    • getTelegrafsApi

      @Nonnull TelegrafsApi getTelegrafsApi()
      Create a new Telegraf client.
      Returns:
      the new client instance for Telegrafs API
    • getLabelsApi

      @Nonnull LabelsApi getLabelsApi()
      Create a new Label client.
      Returns:
      the new client instance for Label API
    • getVariablesApi

      @Nonnull VariablesApi getVariablesApi()
      Create a new Variable client.
      Returns:
      the new client instance for Variable API
    • getDashboardsApi

      @Nonnull DashboardsApi getDashboardsApi()
      Create a new Dashboard client.
      Returns:
      the new client instance for Dashboard API
    • getChecksApi

      @Nonnull ChecksApi getChecksApi()
      Create a new Check client.
      Returns:
      the new client instance for Checks API
    • getNotificationEndpointsApi

      @Nonnull NotificationEndpointsApi getNotificationEndpointsApi()
      Create a new NotificationEndpoint client.
      Returns:
      the new client instance for NotificationEndpoint API
    • getNotificationRulesApi

      @Nonnull NotificationRulesApi getNotificationRulesApi()
      Create a new NotificationRules client.
      Returns:
      the new client instance for NotificationRules API
    • getDeleteApi

      @Nonnull DeleteApi getDeleteApi()
      Create a new Delete client.
      Returns:
      the new client instance for the Delete API
    • getInvokableScriptsApi

      @Nonnull InvokableScriptsApi getInvokableScriptsApi()
      Create an InvokableScripts API instance.
      Returns:
      InvokableScripts API instance
    • getInfluxQLQueryApi

      @Nonnull InfluxQLQueryApi getInfluxQLQueryApi()
      The InfluxQL can be used with /query compatibility endpoint which uses the database and retention policy specified in the query request to map the request to an InfluxDB bucket.
      For more information, see:
      Returns:
      InfluxQLQuery API instance
    • getService

      @Nonnull <S> S getService(@Nonnull Class<S> service)
      Create an implementation of the API endpoints defined by the service interface.

      The endpoints are defined in com.influxdb.client.service.

      Type Parameters:
      S - type of service
      Parameters:
      service - service to instantiate
      Returns:
      instance of service
    • health

      @Nonnull @Deprecated HealthCheck health()
      Deprecated.
      use ping() or version(), the API is subject to removal in a next major release
      Get the health of an instance.
      Returns:
      health of an instance
    • ping

      @Nonnull Boolean ping()
      Check the status of InfluxDB Server.
      Returns:
      Boolean.TRUE if server is healthy otherwise return Boolean.FALSE
    • version

      @Nonnull String version()
      Returns the version of the connected InfluxDB Server.
      Returns:
      the version String, otherwise unknown.
    • ready

      @Nullable Ready ready()
      The readiness of the InfluxDB 2.x.
      Returns:
      return null if the InfluxDB is not ready
    • onBoarding

      @Nonnull OnboardingResponse onBoarding(@Nonnull OnboardingRequest onboarding) throws UnprocessableEntityException
      Post onboarding request, to setup initial user, org and bucket.
      Parameters:
      onboarding - to setup defaults
      Returns:
      defaults for first run
      Throws:
      UnprocessableEntityException - when an onboarding has already been completed
    • isOnboardingAllowed

      @Nonnull Boolean isOnboardingAllowed()
      Check if database has default user, org, bucket created, returns true if not.
      Returns:
      Boolean.FALSE if onboarding has already been completed otherwise Boolean.FALSE.
    • getLogLevel

      @Nonnull LogLevel getLogLevel()
      Returns:
      the LogLevel that is used for logging requests and responses
    • setLogLevel

      @Nonnull InfluxDBClient setLogLevel(@Nonnull LogLevel logLevel)
      Set the log level for the request and response information.
      Parameters:
      logLevel - the log level to set.
      Returns:
      the InfluxDBClient instance to be able to use it in a fluent manner.
    • enableGzip

      @Nonnull InfluxDBClient enableGzip()
      Enable Gzip compress for http requests.

      Currently only the "Write" and "Query" endpoints supports the Gzip compression.

      Returns:
      the InfluxDBClient instance to be able to use it in a fluent manner.
    • disableGzip

      @Nonnull InfluxDBClient disableGzip()
      Disable Gzip compress for http request body.
      Returns:
      the InfluxDBClient instance to be able to use it in a fluent manner.
    • isGzipEnabled

      boolean isGzipEnabled()
      Returns whether Gzip compress for http request body is enabled.
      Returns:
      true if gzip is enabled.
    • close

      void close()
      Shutdown and close the client.
      Specified by:
      close in interface AutoCloseable