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 TypeMethodDescriptionvoid
close()
Shutdown and close the client.Disable Gzip compress for http request body.Enable Gzip compress for http requests.Create a newAuthorization
client.Create a newBucket
client.Create a newCheck
client.Create a newDashboard
client.Create a new Delete client.TheInfluxQL
can be used with/query compatibility
endpoint which uses thedatabase
andretention policy
specified in the query request to map the request to an InfluxDB bucket.Create an InvokableScripts API instance.Create a newLabel
client.Create a newNotificationEndpoint
client.Create a newNotificationRules
client.Create a newOrganization
client.Create a new Query client.Create a newScraperTargetResponse
client.<S> S
getService
(Class<S> service) Create an implementation of the API endpoints defined by theservice
interface.Create a newSource
client.Create a newTask
client.Create a newTelegraf
client.Create a newUser
client.Create a newVariable
client.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()
boolean
Returns 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
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
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
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
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
Create a new synchronous blocking Write client.- Returns:
- the new client instance for the Write API
-
getAuthorizationsApi
Create a newAuthorization
client.- Returns:
- the new client instance for Authorization API
-
getBucketsApi
Create a newBucket
client.- Returns:
- the new client instance for Bucket API
-
getOrganizationsApi
Create a newOrganization
client.- Returns:
- the new client instance for Organization API
-
getSourcesApi
Create a newSource
client.- Returns:
- the new client instance for Source API
-
getTasksApi
Create a newTask
client.- Returns:
- the new client instance for Task API
-
getUsersApi
Create a newUser
client.- Returns:
- the new client instance for User API
-
getScraperTargetsApi
Create a newScraperTargetResponse
client.- Returns:
- the new client instance for Scraper API
-
getTelegrafsApi
Create a newTelegraf
client.- Returns:
- the new client instance for Telegrafs API
-
getLabelsApi
Create a newLabel
client.- Returns:
- the new client instance for Label API
-
getVariablesApi
Create a newVariable
client.- Returns:
- the new client instance for Variable API
-
getDashboardsApi
Create a newDashboard
client.- Returns:
- the new client instance for Dashboard API
-
getChecksApi
Create a newCheck
client.- Returns:
- the new client instance for Checks API
-
getNotificationEndpointsApi
Create a newNotificationEndpoint
client.- Returns:
- the new client instance for NotificationEndpoint API
-
getNotificationRulesApi
Create a newNotificationRules
client.- 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
TheInfluxQL
can be used with/query compatibility
endpoint which uses thedatabase
andretention policy
specified 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 theservice
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
Get the health of an instance.- Returns:
- health of an instance
-
ping
Check the status of InfluxDB Server.- Returns:
Boolean.TRUE
if 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.FALSE
if onboarding has already been completed otherwiseBoolean.FALSE
.
-
getLogLevel
- Returns:
- the
LogLevel
that 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
InfluxDBClient
instance to be able to use it in a fluent manner.
-
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 interfaceAutoCloseable
-
makeWriteApi()
, the API is subject to removal in a next major release