Skip to content

Commit

Permalink
feat: use InfluxDB OSS API definitions to generated APIs (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar authored Jul 7, 2021
1 parent 9b5a4bc commit b251542
Show file tree
Hide file tree
Showing 316 changed files with 10,293 additions and 2,061 deletions.
28 changes: 25 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 2.4.0 [unreleased]
## 3.0.0 [unreleased]

### Breaking Changes

Expand All @@ -7,6 +7,25 @@
The `micrometer` v1.7.0 brings [support](https://github.com/micrometer-metrics/micrometer/issues/1974) for InfluxDB 2.
That is a reason why the [influxdb-spring](./spring) no longer needs provide a custom Micrometer metrics exporter.
Now you are able to use `micrometer-registry-influx`, for more info [see our docs](./spring/README.md#actuator-for-influxdb2-micrometer-registry).

#### Management API
This release introduces a support for new InfluxDB OSS API definitions - [oss.yml](https://github.com/influxdata/openapi/blob/master/contracts/oss.yml). The following breaking changes are in underlying API services and doesn't affect common apis such as - `WriteApi`, `QueryApi`, `BucketsApi`, `OrganizationsApi`...

- `UsersService` uses `PostUser` to create `User`
- `AuthorizationsService` uses `AuthorizationPostRequest` to create `Authorization`
- `BucketsService` uses `PatchBucketRequest` to update `Bucket`
- `OrganizationsService` uses `PostOrganizationRequest` to create `Organization`
- `OrganizationsService` uses `PatchOrganizationRequest` to update `Organization`
- `DashboardsService` uses `PatchDashboardRequest` to update `Dashboard`
- `DeleteService` is used to delete time series data instead of `DefaultService`
- `Run` contains list of `LogEvent` in `Log` property
- `DBRPs` contains list of `DBRP` in `Content` property
- `DbrPsService` uses `DBRPCreate` to create `DBRP`
- Inheritance structure:
- `Check` <- `CheckDiscriminator` <- `CheckBase`
- `NotificationEndpoint` <- `NotificationEndpointDiscriminator` <- `NotificationEndpointBase`
- `NotificationRule` <- `NotificationRuleDiscriminator` <- `NNotificationRuleBase`
- Flux AST literals extends the AST `Expression` object

#### FluxDSL
The `shift()` function renamed to `timeShift()`.
Expand All @@ -20,9 +39,12 @@ The `shift()` function renamed to `timeShift()`.
1. [#236](https://github.com/influxdata/influxdb-client-java/pull/236): Rename `shift()` to `timeShift()` [FluxDSL]

### Dependencies
1. [#227](https://github.com/influxdata/influxdb-client-csharp/pull/227): Update dependencies:
1. [#227](https://github.com/influxdata/influxdb-client-java/pull/227): Update dependencies:
- Kotlin to 1.5.10


### API
1. [#233](https://github.com/influxdata/influxdb-client-java/pull/233): Use InfluxDB OSS API definitions to generated APIs

## 2.3.0 [2021-06-04]

### Features
Expand Down
2 changes: 1 addition & 1 deletion client-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>2.4.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>influxdb-client-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client-kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>2.4.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion client-legacy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client</artifactId>
<version>2.4.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>influxdb-client-flux</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client-osgi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>2.4.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>influxdb-client-osgi</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client-reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>2.4.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion client-scala/cross/2.12/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>2.4.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion client-scala/cross/2.13/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>2.4.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion client-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>2.4.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>influxdb-client-test</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>2.4.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
55 changes: 47 additions & 8 deletions client/src/generated/java/com/influxdb/client/JSON.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Influx API Service
* Influx OSS API Service
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* OpenAPI spec version: 0.1.0
* OpenAPI spec version: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -53,31 +53,75 @@ public class JSON {

public static GsonBuilder createGson() {
GsonFireBuilder fireBuilder = new GsonFireBuilder()
.registerTypeSelector(Check.class, new TypeSelector() {
@Override
public Class getClassForElement(JsonElement readElement) {
Map classByDiscriminatorValue = new HashMap();
classByDiscriminatorValue.put("deadman".toUpperCase(Locale.ROOT), DeadmanCheck.class);
classByDiscriminatorValue.put("threshold".toUpperCase(Locale.ROOT), ThresholdCheck.class);
classByDiscriminatorValue.put("custom".toUpperCase(Locale.ROOT), CustomCheck.class);
classByDiscriminatorValue.put("Check".toUpperCase(Locale.ROOT), Check.class);
return getClassByDiscriminator(
classByDiscriminatorValue,
getDiscriminatorValue(readElement, "type"));
}
})
.registerTypeSelector(CheckDiscriminator.class, new TypeSelector() {
@Override
public Class getClassForElement(JsonElement readElement) {
Map classByDiscriminatorValue = new HashMap();
classByDiscriminatorValue.put("deadman".toUpperCase(Locale.ROOT), DeadmanCheck.class);
classByDiscriminatorValue.put("threshold".toUpperCase(Locale.ROOT), ThresholdCheck.class);
classByDiscriminatorValue.put("custom".toUpperCase(Locale.ROOT), CustomCheck.class);
classByDiscriminatorValue.put("CheckDiscriminator".toUpperCase(Locale.ROOT), CheckDiscriminator.class);
return getClassByDiscriminator(
classByDiscriminatorValue,
getDiscriminatorValue(readElement, "type"));
}
})
.registerTypeSelector(NotificationEndpoint.class, new TypeSelector() {
@Override
public Class getClassForElement(JsonElement readElement) {
Map classByDiscriminatorValue = new HashMap();
classByDiscriminatorValue.put("slack".toUpperCase(Locale.ROOT), SlackNotificationEndpoint.class);
classByDiscriminatorValue.put("pagerduty".toUpperCase(Locale.ROOT), PagerDutyNotificationEndpoint.class);
classByDiscriminatorValue.put("http".toUpperCase(Locale.ROOT), HTTPNotificationEndpoint.class);
classByDiscriminatorValue.put("telegram".toUpperCase(Locale.ROOT), TelegramNotificationEndpoint.class);
classByDiscriminatorValue.put("NotificationEndpoint".toUpperCase(Locale.ROOT), NotificationEndpoint.class);
return getClassByDiscriminator(
classByDiscriminatorValue,
getDiscriminatorValue(readElement, "type"));
}
})
.registerTypeSelector(NotificationEndpointDiscriminator.class, new TypeSelector() {
@Override
public Class getClassForElement(JsonElement readElement) {
Map classByDiscriminatorValue = new HashMap();
classByDiscriminatorValue.put("slack".toUpperCase(Locale.ROOT), SlackNotificationEndpoint.class);
classByDiscriminatorValue.put("pagerduty".toUpperCase(Locale.ROOT), PagerDutyNotificationEndpoint.class);
classByDiscriminatorValue.put("http".toUpperCase(Locale.ROOT), HTTPNotificationEndpoint.class);
classByDiscriminatorValue.put("telegram".toUpperCase(Locale.ROOT), TelegramNotificationEndpoint.class);
classByDiscriminatorValue.put("NotificationEndpointDiscriminator".toUpperCase(Locale.ROOT), NotificationEndpointDiscriminator.class);
return getClassByDiscriminator(
classByDiscriminatorValue,
getDiscriminatorValue(readElement, "type"));
}
})
.registerTypeSelector(NotificationRule.class, new TypeSelector() {
@Override
public Class getClassForElement(JsonElement readElement) {
Map classByDiscriminatorValue = new HashMap();
classByDiscriminatorValue.put("slack".toUpperCase(Locale.ROOT), SlackNotificationRule.class);
classByDiscriminatorValue.put("smtp".toUpperCase(Locale.ROOT), SMTPNotificationRule.class);
classByDiscriminatorValue.put("pagerduty".toUpperCase(Locale.ROOT), PagerDutyNotificationRule.class);
classByDiscriminatorValue.put("http".toUpperCase(Locale.ROOT), HTTPNotificationRule.class);
classByDiscriminatorValue.put("telegram".toUpperCase(Locale.ROOT), TelegramNotificationRule.class);
classByDiscriminatorValue.put("NotificationRule".toUpperCase(Locale.ROOT), NotificationRule.class);
return getClassByDiscriminator(
classByDiscriminatorValue,
getDiscriminatorValue(readElement, "type"));
}
})
.registerTypeSelector(NotificationRuleDiscriminator.class, new TypeSelector() {
@Override
public Class getClassForElement(JsonElement readElement) {
Expand All @@ -86,6 +130,7 @@ public Class getClassForElement(JsonElement readElement) {
classByDiscriminatorValue.put("smtp".toUpperCase(Locale.ROOT), SMTPNotificationRule.class);
classByDiscriminatorValue.put("pagerduty".toUpperCase(Locale.ROOT), PagerDutyNotificationRule.class);
classByDiscriminatorValue.put("http".toUpperCase(Locale.ROOT), HTTPNotificationRule.class);
classByDiscriminatorValue.put("telegram".toUpperCase(Locale.ROOT), TelegramNotificationRule.class);
classByDiscriminatorValue.put("NotificationRuleDiscriminator".toUpperCase(Locale.ROOT), NotificationRuleDiscriminator.class);
return getClassByDiscriminator(
classByDiscriminatorValue,
Expand Down Expand Up @@ -132,12 +177,6 @@ public JSON() {
.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter)
.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter)
.registerTypeAdapter(LocalDate.class, localDateTypeAdapter)
.registerTypeAdapter(PostNotificationEndpoint.class, (JsonSerializer<PostNotificationEndpoint>)
(src, type, context) -> context.serialize(src, src.getClass()))
.registerTypeAdapter(PostNotificationRule.class, (JsonSerializer<PostNotificationRule>)
(src, type, context) -> context.serialize(src, src.getClass()))
.registerTypeAdapter(PostCheck.class, (JsonSerializer<PostCheck>)
(src, type, context) -> context.serialize(src, src.getClass()))
.create();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Influx API Service
* Influx OSS API Service
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* OpenAPI spec version: 0.1.0
* OpenAPI spec version: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Influx API Service
* Influx OSS API Service
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* OpenAPI spec version: 0.1.0
* OpenAPI spec version: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Influx API Service
* Influx OSS API Service
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* OpenAPI spec version: 0.1.0
* OpenAPI spec version: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Influx API Service
* Influx OSS API Service
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* OpenAPI spec version: 0.1.0
* OpenAPI spec version: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Influx API Service
* Influx OSS API Service
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* OpenAPI spec version: 0.1.0
* OpenAPI spec version: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -172,6 +172,9 @@ private Object deserialize(final String[] types, final JsonElement json, final J
if (Arrays.equals(new String[]{ "ArrayExpression" }, types)) {
return context.deserialize(json, ArrayExpression.class);
}
if (Arrays.equals(new String[]{ "DictExpression" }, types)) {
return context.deserialize(json, DictExpression.class);
}
if (Arrays.equals(new String[]{ "FunctionExpression" }, types)) {
return context.deserialize(json, FunctionExpression.class);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Influx API Service
* Influx OSS API Service
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* OpenAPI spec version: 0.1.0
* OpenAPI spec version: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Influx API Service
* Influx OSS API Service
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* OpenAPI spec version: 0.1.0
* OpenAPI spec version: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Loading

0 comments on commit b251542

Please sign in to comment.