public final class InfluxDBClientFactory extends Object
| Modifier and Type | Method and Description |
|---|---|
static InfluxDBClient |
create()
Create an instance of the InfluxDB 2.x client that is configured via
influx2.properties. |
static InfluxDBClient |
create(InfluxDBClientOptions options)
Create an instance of the InfluxDB 2.x client.
|
static InfluxDBClient |
create(String connectionString)
Create an instance of the InfluxDB 2.x client.
|
static InfluxDBClient |
create(String url,
char[] token)
Create an instance of the InfluxDB 2.x client.
|
static InfluxDBClient |
create(String url,
char[] token,
String org)
Create an instance of the InfluxDB 2.x client.
|
static InfluxDBClient |
create(String url,
char[] token,
String org,
String bucket)
Create an instance of the InfluxDB 2.x client.
|
static InfluxDBClient |
create(String url,
String username,
char[] password)
Create an instance of the InfluxDB 2.x client.
|
static InfluxDBClient |
createV1(String url,
String username,
char[] password,
String database,
String retentionPolicy)
Create an instance of the InfluxDB 2.x client to connect into InfluxDB 1.8.
|
static InfluxDBClient |
createV1(String url,
String username,
char[] password,
String database,
String retentionPolicy,
WriteConsistency consistency)
Create an instance of the InfluxDB 2.x client to connect into InfluxDB 1.8.
|
static OnboardingResponse |
onBoarding(String url,
OnboardingRequest onboarding)
Post onboarding request, to setup initial user, org and bucket.
|
static OnboardingResponse |
onBoarding(String url,
String username,
String password,
String org,
String bucket)
Post onboarding request, to setup initial user, org and bucket.
|
@Nonnull public static InfluxDBClient create()
influx2.properties.
The influx2.properties has to be located on classpath.@Nonnull public static InfluxDBClient create(@Nonnull String connectionString)
e.g.: "http://localhost:8086?readTimeout=5000&connectTimeout=5000&logLevel=BASIC
connectionString - connection string with various configurations.@Nonnull public static InfluxDBClient create(@Nonnull String url, @Nonnull String username, @Nonnull char[] password)
The username/password auth is based on
HTTP "Basic" authentication. The authorization expires when the
time-to-live (TTL) (default 60 minutes) is reached
and client produces UnauthorizedException.
The url could be a connection string with various configurations. For more info
see: InfluxDBClientOptions.Builder.connectionString(String).
url - url the url to connect to InfluxDB (required). Example: http://localhost:8086?readTimeout=5000username - the username to use in the basic authpassword - the password to use in the basic authInfluxDBClientOptions.Builder.url(String)@Nonnull public static InfluxDBClient create(@Nonnull String url, @Nonnull char[] token)
The url could be a connection string with various configurations. For more info
see: InfluxDBClientOptions.Builder.connectionString(String).
url - url the url to connect to InfluxDB (required). Example: http://localhost:8086?readTimeout=5000token - the token to use for the authorizationInfluxDBClientOptions.Builder.url(String)@Nonnull public static InfluxDBClient create(@Nonnull String url, @Nonnull char[] token, @Nullable String org)
The url could be a connection string with various configurations. For more info
see: InfluxDBClientOptions.Builder.connectionString(String).
url - url the url to connect to InfluxDB (required). Example: http://localhost:8086?readTimeout=5000token - the token to use for the authorizationorg - the name of an organizationInfluxDBClientOptions.Builder.url(String)@Nonnull public static InfluxDBClient create(@Nonnull String url, @Nonnull char[] token, @Nullable String org, @Nullable String bucket)
The url could be a connection string with various configurations. For more info
see: InfluxDBClientOptions.Builder.connectionString(String).
url - url the url to connect to InfluxDB (required). Example: http://localhost:8086?readTimeout=5000token - the token to use for the authorizationorg - the name of an organizationbucket - the name of a bucketInfluxDBClientOptions.Builder.url(String)@Nonnull public static InfluxDBClient createV1(@Nonnull String url, @Nullable String username, char[] password, @Nonnull String database, @Nullable String retentionPolicy)
The url could be a connection string with various configurations. For more info
see: InfluxDBClientOptions.Builder.connectionString(String).
url - the url to connect to InfluxDB 1.8 (required). http://localhost:8086?readTimeout=5000username - authorization usernamepassword - authorization passworddatabase - database nameretentionPolicy - retention policy@Nonnull public static InfluxDBClient createV1(@Nonnull String url, @Nullable String username, char[] password, @Nonnull String database, @Nullable String retentionPolicy, @Nullable WriteConsistency consistency)
The url could be a connection string with various configurations. For more info
see: InfluxDBClientOptions.Builder.connectionString(String).
url - the url to connect to InfluxDB 1.8 (required). http://localhost:8086?readTimeout=5000username - authorization usernamepassword - authorization passworddatabase - database nameretentionPolicy - retention policyconsistency - Specify the write consistency for the point.
InfluxDB assumes that the write consistency is WriteConsistency.ONE if you
do not specify consistency. See the
InfluxDB Enterprise documentation for detailed descriptions of each consistency
option. Available with InfluxDB Enterprise clusters only!@Nonnull public static InfluxDBClient create(@Nonnull InfluxDBClientOptions options)
options - the connection configuration@Nonnull public static OnboardingResponse onBoarding(@Nonnull String url, @Nonnull String username, @Nonnull String password, @Nonnull String org, @Nonnull String bucket)
url - the url to connect to the InfluxDBusername - the name of an userpassword - the password to connect as an userorg - the name of an organizationbucket - the name of a bucket@Nonnull public static OnboardingResponse onBoarding(@Nonnull String url, @Nonnull OnboardingRequest onboarding)
url - the url to connect to the InfluxDBonboarding - the defaultsCopyright © 2018–2023 InfluxData, Inc.. All rights reserved.