public final class InfluxDBClientFactory extends Object
| Modifier and Type | Method and Description |
|---|---|
static InfluxDBClient |
create()
Create an instance of the InfluxDB 2.0 client that is configured via
influx2.properties. |
static InfluxDBClient |
create(InfluxDBClientOptions options)
Create an instance of the InfluxDB 2.0 client.
|
static InfluxDBClient |
create(String connectionString)
Create an instance of the InfluxDB 2.0 client.
|
static InfluxDBClient |
create(String url,
char[] token)
Create an instance of the InfluxDB 2.0 client.
|
static InfluxDBClient |
create(String url,
char[] token,
String org)
Create an instance of the InfluxDB 2.0 client.
|
static InfluxDBClient |
create(String url,
char[] token,
String org,
String bucket)
Create an instance of the InfluxDB 2.0 client.
|
static InfluxDBClient |
create(String url,
String username,
char[] password)
Create an instance of the InfluxDB 2.0 client.
|
static InfluxDBClient |
createV1(String url,
String username,
char[] password,
String database,
String retentionPolicy)
Create a instance of the InfluxDB 2.0 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.
url - the url to connect to the InfluxDBusername - 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)
url - the url to connect to the InfluxDBtoken - the token to use for the authorizationInfluxDBClientOptions.Builder.url(String)@Nonnull public static InfluxDBClient create(@Nonnull String url, @Nonnull char[] token, @Nullable String org)
url - the url to connect to the InfluxDBtoken - 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)
url - the url to connect to the InfluxDBtoken - 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)
url - the url to connect to the InfluxDB 1.8username - authorization usernamepassword - authorization passworddatabase - database nameretentionPolicy - retention policy@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–2021 InfluxData, Inc.. All rights reserved.