From a745aadee511b534729635256a9e1a7f3937dfab Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Mon, 21 Jun 2021 14:08:07 +0200 Subject: [PATCH 1/2] feat: add ping endpoint --- contracts/cloud.yml | 33 +++++++++++++++++++++++++++++++++ contracts/common.yml | 33 +++++++++++++++++++++++++++++++++ contracts/oss.yml | 33 +++++++++++++++++++++++++++++++++ contracts/ref/cloud.yml | 33 +++++++++++++++++++++++++++++++++ contracts/ref/oss.yml | 33 +++++++++++++++++++++++++++++++++ scripts/reference.sh | 4 ++++ src/common/_paths.yml | 4 ++++ src/common/paths/ping.yml | 30 ++++++++++++++++++++++++++++++ 8 files changed, 203 insertions(+) create mode 100644 src/common/paths/ping.yml diff --git a/contracts/cloud.yml b/contracts/cloud.yml index bb4104a0a..c03210dd4 100644 --- a/contracts/cloud.yml +++ b/contracts/cloud.yml @@ -55,6 +55,39 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + /ping: + servers: + - url: '' + get: + operationId: PostPing + summary: Checks the status of InfluxDB instance and version of InfluxDB. + responses: + '204': + description: OK + headers: + X-Influxdb-Build: + schema: + type: string + description: The type of InfluxDB build. + X-Influxdb-Version: + schema: + type: integer + description: The version of InfluxDB. + head: + operationId: PostPing + summary: Checks the status of InfluxDB instance and version of InfluxDB. + responses: + '204': + description: OK + headers: + X-Influxdb-Build: + schema: + type: string + description: The type of InfluxDB build. + X-Influxdb-Version: + schema: + type: integer + description: The version of InfluxDB. /: get: operationId: GetRoutes diff --git a/contracts/common.yml b/contracts/common.yml index f979ee362..58135dc28 100644 --- a/contracts/common.yml +++ b/contracts/common.yml @@ -55,6 +55,39 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + /ping: + servers: + - url: '' + get: + operationId: PostPing + summary: Checks the status of InfluxDB instance and version of InfluxDB. + responses: + '204': + description: OK + headers: + X-Influxdb-Build: + schema: + type: string + description: The type of InfluxDB build. + X-Influxdb-Version: + schema: + type: integer + description: The version of InfluxDB. + head: + operationId: PostPing + summary: Checks the status of InfluxDB instance and version of InfluxDB. + responses: + '204': + description: OK + headers: + X-Influxdb-Build: + schema: + type: string + description: The type of InfluxDB build. + X-Influxdb-Version: + schema: + type: integer + description: The version of InfluxDB. /: get: operationId: GetRoutes diff --git a/contracts/oss.yml b/contracts/oss.yml index 173542d70..45bb28b08 100644 --- a/contracts/oss.yml +++ b/contracts/oss.yml @@ -55,6 +55,39 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + /ping: + servers: + - url: '' + get: + operationId: PostPing + summary: Checks the status of InfluxDB instance and version of InfluxDB. + responses: + '204': + description: OK + headers: + X-Influxdb-Build: + schema: + type: string + description: The type of InfluxDB build. + X-Influxdb-Version: + schema: + type: integer + description: The version of InfluxDB. + head: + operationId: PostPing + summary: Checks the status of InfluxDB instance and version of InfluxDB. + responses: + '204': + description: OK + headers: + X-Influxdb-Build: + schema: + type: string + description: The type of InfluxDB build. + X-Influxdb-Version: + schema: + type: integer + description: The version of InfluxDB. /: get: operationId: GetRoutes diff --git a/contracts/ref/cloud.yml b/contracts/ref/cloud.yml index 052d4d955..9c5cdeaf7 100644 --- a/contracts/ref/cloud.yml +++ b/contracts/ref/cloud.yml @@ -3756,6 +3756,39 @@ paths: summary: Retrieve usage for an organization tags: - Usage + /ping: + get: + operationId: PostPing + responses: + "204": + description: OK + headers: + X-Influxdb-Build: + description: The type of InfluxDB build. + schema: + type: string + X-Influxdb-Version: + description: The version of InfluxDB. + schema: + type: integer + summary: Checks the status of InfluxDB instance and version of InfluxDB. + head: + operationId: PostPing + responses: + "204": + description: OK + headers: + X-Influxdb-Build: + description: The type of InfluxDB build. + schema: + type: string + X-Influxdb-Version: + description: The version of InfluxDB. + schema: + type: integer + summary: Checks the status of InfluxDB instance and version of InfluxDB. + servers: + - url: "" /api/v2/poc-functions: get: operationId: GetFunctions diff --git a/contracts/ref/oss.yml b/contracts/ref/oss.yml index a0d32dd12..f0e3c06b8 100644 --- a/contracts/ref/oss.yml +++ b/contracts/ref/oss.yml @@ -3574,6 +3574,39 @@ paths: summary: Delete secrets from an organization tags: - Secrets + /ping: + get: + operationId: PostPing + responses: + "204": + description: OK + headers: + X-Influxdb-Build: + description: The type of InfluxDB build. + schema: + type: string + X-Influxdb-Version: + description: The version of InfluxDB. + schema: + type: integer + summary: Checks the status of InfluxDB instance and version of InfluxDB. + head: + operationId: PostPing + responses: + "204": + description: OK + headers: + X-Influxdb-Build: + description: The type of InfluxDB build. + schema: + type: string + X-Influxdb-Version: + description: The version of InfluxDB. + schema: + type: integer + summary: Checks the status of InfluxDB instance and version of InfluxDB. + servers: + - url: "" /api/v2/query: post: operationId: PostQuery diff --git a/scripts/reference.sh b/scripts/reference.sh index 922e4ee78..ea9f39f3d 100755 --- a/scripts/reference.sh +++ b/scripts/reference.sh @@ -23,4 +23,8 @@ swagrag \ -api-title "Complete InfluxDB OSS API" \ > ${TCONTRACTS}/ref/oss.yml +echo "Fixing /ping path" +sed -i '' -e "s|^ /api/v2/ping| /ping|" ${TCONTRACTS}/ref/cloud.yml +sed -i '' -e "s|^ /api/v2/ping| /ping|" ${TCONTRACTS}/ref/oss.yml + diff -r ${CONTRACTS}/ref ${TCONTRACTS}/ref/ diff --git a/src/common/_paths.yml b/src/common/_paths.yml index 426b280d3..b5751dd0e 100644 --- a/src/common/_paths.yml +++ b/src/common/_paths.yml @@ -2,6 +2,10 @@ $ref: "./common/paths/signin.yml" /signout: $ref: "./common/paths/signout.yml" + /ping: + servers: + - url: '' + $ref: "./common/paths/ping.yml" /: $ref: "./common/paths/0slash.yml" /documents/templates: diff --git a/src/common/paths/ping.yml b/src/common/paths/ping.yml new file mode 100644 index 000000000..8401d077e --- /dev/null +++ b/src/common/paths/ping.yml @@ -0,0 +1,30 @@ +get: + operationId: PostPing + summary: Checks the status of InfluxDB instance and version of InfluxDB. + responses: + '204': + description: OK + headers: + X-Influxdb-Build: + schema: + type: string + description: The type of InfluxDB build. + X-Influxdb-Version: + schema: + type: integer + description: The version of InfluxDB. +head: + operationId: PostPing + summary: Checks the status of InfluxDB instance and version of InfluxDB. + responses: + '204': + description: OK + headers: + X-Influxdb-Build: + schema: + type: string + description: The type of InfluxDB build. + X-Influxdb-Version: + schema: + type: integer + description: The version of InfluxDB. From bf0a8115650c69416311cbcc4ebccbf961aff525 Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Thu, 8 Jul 2021 07:53:56 +0200 Subject: [PATCH 2/2] fix: unique operation name --- contracts/cloud.yml | 4 ++-- contracts/common.yml | 4 ++-- contracts/oss.yml | 4 ++-- contracts/ref/cloud.yml | 4 ++-- contracts/ref/oss.yml | 4 ++-- src/common/paths/ping.yml | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/contracts/cloud.yml b/contracts/cloud.yml index c03210dd4..b4b17d938 100644 --- a/contracts/cloud.yml +++ b/contracts/cloud.yml @@ -59,7 +59,7 @@ paths: servers: - url: '' get: - operationId: PostPing + operationId: GetPing summary: Checks the status of InfluxDB instance and version of InfluxDB. responses: '204': @@ -74,7 +74,7 @@ paths: type: integer description: The version of InfluxDB. head: - operationId: PostPing + operationId: HeadPing summary: Checks the status of InfluxDB instance and version of InfluxDB. responses: '204': diff --git a/contracts/common.yml b/contracts/common.yml index 58135dc28..e58adc24d 100644 --- a/contracts/common.yml +++ b/contracts/common.yml @@ -59,7 +59,7 @@ paths: servers: - url: '' get: - operationId: PostPing + operationId: GetPing summary: Checks the status of InfluxDB instance and version of InfluxDB. responses: '204': @@ -74,7 +74,7 @@ paths: type: integer description: The version of InfluxDB. head: - operationId: PostPing + operationId: HeadPing summary: Checks the status of InfluxDB instance and version of InfluxDB. responses: '204': diff --git a/contracts/oss.yml b/contracts/oss.yml index 45bb28b08..91c592eb9 100644 --- a/contracts/oss.yml +++ b/contracts/oss.yml @@ -59,7 +59,7 @@ paths: servers: - url: '' get: - operationId: PostPing + operationId: GetPing summary: Checks the status of InfluxDB instance and version of InfluxDB. responses: '204': @@ -74,7 +74,7 @@ paths: type: integer description: The version of InfluxDB. head: - operationId: PostPing + operationId: HeadPing summary: Checks the status of InfluxDB instance and version of InfluxDB. responses: '204': diff --git a/contracts/ref/cloud.yml b/contracts/ref/cloud.yml index 9c5cdeaf7..f427f9f78 100644 --- a/contracts/ref/cloud.yml +++ b/contracts/ref/cloud.yml @@ -3758,7 +3758,7 @@ paths: - Usage /ping: get: - operationId: PostPing + operationId: GetPing responses: "204": description: OK @@ -3773,7 +3773,7 @@ paths: type: integer summary: Checks the status of InfluxDB instance and version of InfluxDB. head: - operationId: PostPing + operationId: HeadPing responses: "204": description: OK diff --git a/contracts/ref/oss.yml b/contracts/ref/oss.yml index f0e3c06b8..4a94ef250 100644 --- a/contracts/ref/oss.yml +++ b/contracts/ref/oss.yml @@ -3576,7 +3576,7 @@ paths: - Secrets /ping: get: - operationId: PostPing + operationId: GetPing responses: "204": description: OK @@ -3591,7 +3591,7 @@ paths: type: integer summary: Checks the status of InfluxDB instance and version of InfluxDB. head: - operationId: PostPing + operationId: HeadPing responses: "204": description: OK diff --git a/src/common/paths/ping.yml b/src/common/paths/ping.yml index 8401d077e..2dd21fd11 100644 --- a/src/common/paths/ping.yml +++ b/src/common/paths/ping.yml @@ -1,5 +1,5 @@ get: - operationId: PostPing + operationId: GetPing summary: Checks the status of InfluxDB instance and version of InfluxDB. responses: '204': @@ -14,7 +14,7 @@ get: type: integer description: The version of InfluxDB. head: - operationId: PostPing + operationId: HeadPing summary: Checks the status of InfluxDB instance and version of InfluxDB. responses: '204':