@ThreadSafe public interface InfluxDBClient extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close()
Shutdown and close the client.
|
InfluxDBClient |
disableGzip()
Disable Gzip compress for http request body.
|
InfluxDBClient |
enableGzip()
Enable Gzip compress for http requests.
|
AuthorizationsApi |
getAuthorizationsApi()
Create a new
Authorization client. |
BucketsApi |
getBucketsApi()
Create a new
Bucket client. |
ChecksApi |
getChecksApi()
Create a new
Check client. |
DashboardsApi |
getDashboardsApi()
Create a new
Dashboard client. |
DeleteApi |
getDeleteApi()
Create a new Delete client.
|
LabelsApi |
getLabelsApi()
Create a new
Label client. |
LogLevel |
getLogLevel() |
NotificationEndpointsApi |
getNotificationEndpointsApi()
Create a new
NotificationEndpoint client. |
NotificationRulesApi |
getNotificationRulesApi()
Create a new
NotificationRules client. |
OrganizationsApi |
getOrganizationsApi()
Create a new
Organization client. |
QueryApi |
getQueryApi()
Create a new Query client.
|
ScraperTargetsApi |
getScraperTargetsApi()
Create a new
ScraperTargetResponse client. |
<S> S |
getService(Class<S> service)
Create an implementation of the API endpoints defined by the
service interface. |
SourcesApi |
getSourcesApi()
Create a new
Source client. |
TasksApi |
getTasksApi()
Create a new
Task client. |
TelegrafsApi |
getTelegrafsApi()
Create a new
Telegraf client. |
UsersApi |
getUsersApi()
Create a new
User client. |
VariablesApi |
getVariablesApi()
Create a new
Variable client. |
WriteApi |
getWriteApi()
Deprecated.
use
makeWriteApi() , the API is subject to removal in a next major release |
WriteApi |
getWriteApi(WriteOptions writeOptions)
Deprecated.
use
makeWriteApi(WriteOptions) , the API is subject to removal in a next major release |
WriteApiBlocking |
getWriteApiBlocking()
Create a new synchronous blocking Write client.
|
HealthCheck |
health()
|
boolean |
isGzipEnabled()
Returns whether Gzip compress for http request body is enabled.
|
Boolean |
isOnboardingAllowed()
Check if database has default user, org, bucket created, returns true if not.
|
WriteApi |
makeWriteApi()
Create a new asynchronous non-blocking Write client.
|
WriteApi |
makeWriteApi(WriteOptions writeOptions)
Create a new asynchronous non-blocking Write client.
|
OnboardingResponse |
onBoarding(OnboardingRequest onboarding)
Post onboarding request, to setup initial user, org and bucket.
|
Boolean |
ping()
Check the status of InfluxDB Server.
|
Ready |
ready()
The readiness of the InfluxDB 2.0.
|
InfluxDBClient |
setLogLevel(LogLevel logLevel)
Set the log level for the request and response information.
|
String |
version()
Returns the version of the connected InfluxDB Server.
|
@Nonnull QueryApi getQueryApi()
@Nonnull @Deprecated WriteApi getWriteApi()
makeWriteApi()
, the API is subject to removal in a next major release
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.
@Nonnull WriteApi makeWriteApi()
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.
@Nonnull @Deprecated WriteApi getWriteApi(@Nonnull WriteOptions writeOptions)
makeWriteApi(WriteOptions)
, the API is subject to removal in a next major releasewriteOptions
- the writes configuration@Nonnull WriteApi makeWriteApi(@Nonnull WriteOptions writeOptions)
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.
writeOptions
- the writes configuration@Nonnull WriteApiBlocking getWriteApiBlocking()
@Nonnull AuthorizationsApi getAuthorizationsApi()
Authorization
client.@Nonnull BucketsApi getBucketsApi()
Bucket
client.@Nonnull OrganizationsApi getOrganizationsApi()
Organization
client.@Nonnull SourcesApi getSourcesApi()
Source
client.@Nonnull TasksApi getTasksApi()
Task
client.@Nonnull UsersApi getUsersApi()
User
client.@Nonnull ScraperTargetsApi getScraperTargetsApi()
ScraperTargetResponse
client.@Nonnull TelegrafsApi getTelegrafsApi()
Telegraf
client.@Nonnull LabelsApi getLabelsApi()
Label
client.@Nonnull VariablesApi getVariablesApi()
Variable
client.@Nonnull DashboardsApi getDashboardsApi()
Dashboard
client.@Nonnull ChecksApi getChecksApi()
Check
client.@Nonnull NotificationEndpointsApi getNotificationEndpointsApi()
NotificationEndpoint
client.@Nonnull NotificationRulesApi getNotificationRulesApi()
NotificationRules
client.@Nonnull DeleteApi getDeleteApi()
@Nonnull <S> S getService(@Nonnull Class<S> service)
service
interface.
The endpoints are defined in com.influxdb.client.service
.
S
- type of serviceservice
- service to instantiate@Nonnull @Deprecated HealthCheck health()
@Nonnull Boolean ping()
Boolean.TRUE
if server is healthy otherwise return Boolean.FALSE
@Nonnull String version()
@Nullable Ready ready()
@Nonnull OnboardingResponse onBoarding(@Nonnull OnboardingRequest onboarding) throws UnprocessableEntityException
onboarding
- to setup defaultsUnprocessableEntityException
- when an onboarding has already been completed@Nonnull Boolean isOnboardingAllowed()
Boolean.FALSE
if onboarding has already been completed otherwise Boolean.FALSE
.@Nonnull LogLevel getLogLevel()
LogLevel
that is used for logging requests and responses@Nonnull InfluxDBClient setLogLevel(@Nonnull LogLevel logLevel)
logLevel
- the log level to set.@Nonnull InfluxDBClient enableGzip()
Currently only the "Write" and "Query" endpoints supports the Gzip compression.
InfluxDBClient
instance to be able to use it in a fluent manner.@Nonnull InfluxDBClient disableGzip()
InfluxDBClient
instance to be able to use it in a fluent manner.boolean isGzipEnabled()
void close()
close
in interface AutoCloseable
Copyright © 2018–2022 InfluxData, Inc.. All rights reserved.