Package com.influxdb.client
Interface InfluxDBClient
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
InfluxDBClientImpl
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 Summary
Modifier and TypeMethodDescriptionvoidclose()Shutdown and close the client.Disable Gzip compress for http request body.Enable Gzip compress for http requests.Create a newAuthorizationclient.Create a newBucketclient.Create a newCheckclient.Create a newDashboardclient.Create a new Delete client.TheInfluxQLcan be used with/query compatibilityendpoint which uses thedatabaseandretention policyspecified in the query request to map the request to an InfluxDB bucket.Create an InvokableScripts API instance.Create a newLabelclient.Create a newNotificationEndpointclient.Create a newNotificationRulesclient.Create a newOrganizationclient.Create a new Query client.Create a newScraperTargetResponseclient.<S> SgetService(Class<S> service) Create an implementation of the API endpoints defined by theserviceinterface.Create a newSourceclient.Create a newTaskclient.Create a newTelegrafclient.Create a newUserclient.Create a newVariableclient.Deprecated.getWriteApi(WriteOptions writeOptions) Deprecated.usemakeWriteApi(WriteOptions), the API is subject to removal in a next major releaseCreate a new synchronous blocking Write client.health()booleanReturns whether Gzip compress for http request body is enabled.Check if database has default user, org, bucket created, returns true if not.Create a new asynchronous non-blocking Write client.makeWriteApi(WriteOptions writeOptions) Create a new asynchronous non-blocking Write client.onBoarding(OnboardingRequest onboarding) Post onboarding request, to setup initial user, org and bucket.ping()Check the status of InfluxDB Server.ready()The readiness of the InfluxDB 2.x.setLogLevel(LogLevel logLevel) Set the log level for the request and response information.version()Returns the version of the connected InfluxDB Server.
-
Method Details
-
getQueryApi
Create a new Query client.- Returns:
- the new client instance for the Query API
-
getWriteApi
Deprecated.usemakeWriteApi(), the API is subject to removal in a next major releaseCreate a new asynchronous non-blocking Write client.The
WriteApiuses 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
Create a new asynchronous non-blocking Write client.The
WriteApiuses 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
Deprecated.usemakeWriteApi(WriteOptions), the API is subject to removal in a next major releaseCreate a new asynchronous non-blocking Write client.- Parameters:
writeOptions- the writes configuration- Returns:
- the new client instance for the Write API
-
makeWriteApi
Create a new asynchronous non-blocking Write client.The
WriteApiuses 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
Create a new synchronous blocking Write client.- Returns:
- the new client instance for the Write API
-
getAuthorizationsApi
Create a newAuthorizationclient.- Returns:
- the new client instance for Authorization API
-
getBucketsApi
Create a newBucketclient.- Returns:
- the new client instance for Bucket API
-
getOrganizationsApi
Create a newOrganizationclient.- Returns:
- the new client instance for Organization API
-
getSourcesApi
Create a newSourceclient.- Returns:
- the new client instance for Source API
-
getTasksApi
Create a newTaskclient.- Returns:
- the new client instance for Task API
-
getUsersApi
Create a newUserclient.- Returns:
- the new client instance for User API
-
getScraperTargetsApi
Create a newScraperTargetResponseclient.- Returns:
- the new client instance for Scraper API
-
getTelegrafsApi
Create a newTelegrafclient.- Returns:
- the new client instance for Telegrafs API
-
getLabelsApi
Create a newLabelclient.- Returns:
- the new client instance for Label API
-
getVariablesApi
Create a newVariableclient.- Returns:
- the new client instance for Variable API
-
getDashboardsApi
Create a newDashboardclient.- Returns:
- the new client instance for Dashboard API
-
getChecksApi
Create a newCheckclient.- Returns:
- the new client instance for Checks API
-
getNotificationEndpointsApi
Create a newNotificationEndpointclient.- Returns:
- the new client instance for NotificationEndpoint API
-
getNotificationRulesApi
Create a newNotificationRulesclient.- Returns:
- the new client instance for NotificationRules API
-
getDeleteApi
Create a new Delete client.- Returns:
- the new client instance for the Delete API
-
getInvokableScriptsApi
Create an InvokableScripts API instance.- Returns:
- InvokableScripts API instance
-
getInfluxQLQueryApi
TheInfluxQLcan be used with/query compatibilityendpoint which uses thedatabaseandretention policyspecified in the query request to map the request to an InfluxDB bucket.
For more information, see:- Returns:
- InfluxQLQuery API instance
-
getService
Create an implementation of the API endpoints defined by theserviceinterface.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
Get the health of an instance.- Returns:
- health of an instance
-
ping
Check the status of InfluxDB Server.- Returns:
Boolean.TRUEif server is healthy otherwise returnBoolean.FALSE
-
version
Returns the version of the connected InfluxDB Server.- Returns:
- the version String, otherwise unknown.
-
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
Check if database has default user, org, bucket created, returns true if not.- Returns:
Boolean.FALSEif onboarding has already been completed otherwiseBoolean.FALSE.
-
getLogLevel
- Returns:
- the
LogLevelthat is used for logging requests and responses
-
setLogLevel
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
Enable Gzip compress for http requests.Currently only the "Write" and "Query" endpoints supports the Gzip compression.
- Returns:
- the
InfluxDBClientinstance to be able to use it in a fluent manner.
-
disableGzip
Disable Gzip compress for http request body.- Returns:
- the
InfluxDBClientinstance 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:
closein interfaceAutoCloseable
-
makeWriteApi(), the API is subject to removal in a next major release