Skip to content

feat: add ping endpoint #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions contracts/cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,39 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'
/ping:
servers:
- url: ''
get:
operationId: GetPing
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: HeadPing
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
Expand Down
33 changes: 33 additions & 0 deletions contracts/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,39 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'
/ping:
servers:
- url: ''
get:
operationId: GetPing
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: HeadPing
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
Expand Down
33 changes: 33 additions & 0 deletions contracts/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,39 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'
/ping:
servers:
- url: ''
get:
operationId: GetPing
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: HeadPing
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
Expand Down
33 changes: 33 additions & 0 deletions contracts/ref/cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3756,6 +3756,39 @@ paths:
summary: Retrieve usage for an organization
tags:
- Usage
/ping:
get:
operationId: GetPing
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: HeadPing
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
Expand Down
33 changes: 33 additions & 0 deletions contracts/ref/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3574,6 +3574,39 @@ paths:
summary: Delete secrets from an organization
tags:
- Secrets
/ping:
get:
operationId: GetPing
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: HeadPing
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
Expand Down
4 changes: 4 additions & 0 deletions scripts/reference.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
4 changes: 4 additions & 0 deletions src/common/_paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
30 changes: 30 additions & 0 deletions src/common/paths/ping.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
get:
operationId: GetPing
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this is actually a float, small enough nit i'll merge this

description: The version of InfluxDB.
head:
operationId: HeadPing
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.