Chore/update api docs (#4411)
* feat: add MIT license to api content * chore: whitespace * chore(api): update to openapi Cloud and OSS to master HEAD. Co-authored-by: Sunbrye Ly <sunbryely@Sunbryes-MacBook-Pro.local>pull/4353/head^2
parent
2fc84884c3
commit
31f18dd373
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,19 +1,23 @@
|
|||
# this is a manually maintained file for these old routes until oats#15 is resolved
|
||||
openapi: "3.0.0"
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
title: InfluxDB API Service (V1 compatible endpoints)
|
||||
version: 0.1.0
|
||||
description: |
|
||||
The InfluxDB 1.x compatibility `/write` and `/query` endpoints work with
|
||||
InfluxDB 1.x client libraries and third-party integrations like Grafana
|
||||
and others.
|
||||
title: InfluxDB OSS v1 compatibility API documentation
|
||||
version: 2.4.0 v1 compatibility
|
||||
description: >
|
||||
The InfluxDB 1.x compatibility /write and /query endpoints work with
|
||||
InfluxDB 1.x client libraries and third-party integrations like Grafana and
|
||||
others.
|
||||
|
||||
|
||||
If you want to use the latest InfluxDB `/api/v2` API instead,
|
||||
see the [InfluxDB v2 API documentation](https://docs.influxdata.com/influxdb/cloud/api/).
|
||||
If you want to use the latest InfluxDB /api/v2 API instead, see the
|
||||
[InfluxDB v2 API documentation](/influxdb/v2.4/api/).
|
||||
|
||||
|
||||
This documentation is generated from the
|
||||
|
||||
[InfluxDB OpenAPI
|
||||
specification](https://github.com/influxdata/openapi/blob/influxdb-oss-v2.4.0/contracts/swaggerV1Compat.yml).
|
||||
servers:
|
||||
- url: /
|
||||
description: V1-compatible API endpoints.
|
||||
paths:
|
||||
/write:
|
||||
post:
|
||||
|
|
@ -29,15 +33,17 @@ paths:
|
|||
schema:
|
||||
type: string
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/TraceSpan"
|
||||
- $ref: "#/components/parameters/AuthUserV1"
|
||||
- $ref: "#/components/parameters/AuthPassV1"
|
||||
- $ref: '#/components/parameters/TraceSpan'
|
||||
- $ref: '#/components/parameters/AuthUserV1'
|
||||
- $ref: '#/components/parameters/AuthPassV1'
|
||||
- in: query
|
||||
name: db
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
description: Bucket to write to. If none exists, InfluxDB creates a bucket with a default 3-day retention policy.
|
||||
description: >-
|
||||
Bucket to write to. If none exists, InfluxDB creates a bucket with a
|
||||
default 3-day retention policy.
|
||||
- in: query
|
||||
name: rp
|
||||
schema:
|
||||
|
|
@ -50,54 +56,76 @@ paths:
|
|||
description: Write precision.
|
||||
- in: header
|
||||
name: Content-Encoding
|
||||
description: When present, its value indicates to the database that compression is applied to the line protocol body.
|
||||
description: >-
|
||||
When present, its value indicates to the database that compression
|
||||
is applied to the line protocol body.
|
||||
schema:
|
||||
type: string
|
||||
description: Specifies that the line protocol in the body is encoded with gzip or not encoded with identity.
|
||||
description: >-
|
||||
Specifies that the line protocol in the body is encoded with gzip
|
||||
or not encoded with identity.
|
||||
default: identity
|
||||
enum:
|
||||
- gzip
|
||||
- identity
|
||||
responses:
|
||||
"204":
|
||||
description: Write data is correctly formatted and accepted for writing to the bucket.
|
||||
"400":
|
||||
description: Line protocol poorly formed and no points were written. Response can be used to determine the first malformed line in the body line-protocol. All data in body was rejected and not written.
|
||||
'204':
|
||||
description: >-
|
||||
Write data is correctly formatted and accepted for writing to the
|
||||
bucket.
|
||||
'400':
|
||||
description: >-
|
||||
Line protocol poorly formed and no points were written. Response
|
||||
can be used to determine the first malformed line in the body
|
||||
line-protocol. All data in body was rejected and not written.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/LineProtocolError"
|
||||
"401":
|
||||
description: Token does not have sufficient permissions to write to this organization and bucket or the organization and bucket do not exist.
|
||||
$ref: '#/components/schemas/LineProtocolError'
|
||||
'401':
|
||||
description: >-
|
||||
Token does not have sufficient permissions to write to this
|
||||
organization and bucket or the organization and bucket do not exist.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
"403":
|
||||
$ref: '#/components/schemas/Error'
|
||||
'403':
|
||||
description: No token was sent and they are required.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
"413":
|
||||
description: Write has been rejected because the payload is too large. Error message returns max size supported. All data in body was rejected and not written.
|
||||
$ref: '#/components/schemas/Error'
|
||||
'413':
|
||||
description: >-
|
||||
Write has been rejected because the payload is too large. Error
|
||||
message returns max size supported. All data in body was rejected
|
||||
and not written.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/LineProtocolLengthError"
|
||||
"429":
|
||||
description: Token is temporarily over quota. The Retry-After header describes when to try the write again.
|
||||
$ref: '#/components/schemas/LineProtocolLengthError'
|
||||
'429':
|
||||
description: >-
|
||||
Token is temporarily over quota. The Retry-After header describes
|
||||
when to try the write again.
|
||||
headers:
|
||||
Retry-After:
|
||||
description: A non-negative decimal integer indicating the seconds to delay after the response is received.
|
||||
description: >-
|
||||
A non-negative decimal integer indicating the seconds to delay
|
||||
after the response is received.
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
"503":
|
||||
description: Server is temporarily unavailable to accept writes. The Retry-After header describes when to try the write again.
|
||||
'503':
|
||||
description: >-
|
||||
Server is temporarily unavailable to accept writes. The Retry-After
|
||||
header describes when to try the write again.
|
||||
headers:
|
||||
Retry-After:
|
||||
description: A non-negative decimal integer indicating the seconds to delay after the response is received.
|
||||
description: >-
|
||||
A non-negative decimal integer indicating the seconds to delay
|
||||
after the response is received.
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
|
|
@ -106,9 +134,9 @@ paths:
|
|||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
$ref: '#/components/schemas/Error'
|
||||
/query:
|
||||
post: # technically this functions with other methods as well
|
||||
post:
|
||||
operationId: PostQueryV1
|
||||
tags:
|
||||
- Query
|
||||
|
|
@ -116,18 +144,21 @@ paths:
|
|||
requestBody:
|
||||
description: InfluxQL query to execute.
|
||||
content:
|
||||
text/plain: # although this should be `application/vnd.influxql`, oats breaks so we define the content-type header parameter
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/TraceSpan"
|
||||
- $ref: "#/components/parameters/AuthUserV1"
|
||||
- $ref: "#/components/parameters/AuthPassV1"
|
||||
- $ref: '#/components/parameters/TraceSpan'
|
||||
- $ref: '#/components/parameters/AuthUserV1'
|
||||
- $ref: '#/components/parameters/AuthPassV1'
|
||||
- in: header
|
||||
name: Accept
|
||||
schema:
|
||||
type: string
|
||||
description: Specifies how query results should be encoded in the response. **Note:** With `application/csv`, query results include epoch timestamps instead of RFC3339 timestamps.
|
||||
description: >-
|
||||
Specifies how query results should be encoded in the response.
|
||||
**Note:** With `application/csv`, query results include epoch
|
||||
timestamps instead of RFC3339 timestamps.
|
||||
default: application/json
|
||||
enum:
|
||||
- application/json
|
||||
|
|
@ -136,10 +167,15 @@ paths:
|
|||
- application/x-msgpack
|
||||
- in: header
|
||||
name: Accept-Encoding
|
||||
description: The Accept-Encoding request HTTP header advertises which content encoding, usually a compression algorithm, the client is able to understand.
|
||||
description: >-
|
||||
The Accept-Encoding request HTTP header advertises which content
|
||||
encoding, usually a compression algorithm, the client is able to
|
||||
understand.
|
||||
schema:
|
||||
type: string
|
||||
description: Specifies that the query response in the body should be encoded with gzip or not encoded with identity.
|
||||
description: >-
|
||||
Specifies that the query response in the body should be encoded
|
||||
with gzip or not encoded with identity.
|
||||
default: identity
|
||||
enum:
|
||||
- gzip
|
||||
|
|
@ -167,42 +203,53 @@ paths:
|
|||
schema:
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
'200':
|
||||
description: Query results
|
||||
headers:
|
||||
Content-Encoding:
|
||||
description: The Content-Encoding entity header is used to compress the media-type. When present, its value indicates which encodings were applied to the entity-body
|
||||
description: >-
|
||||
The Content-Encoding entity header is used to compress the
|
||||
media-type. When present, its value indicates which encodings
|
||||
were applied to the entity-body
|
||||
schema:
|
||||
type: string
|
||||
description: Specifies that the response in the body is encoded with gzip or not encoded with identity.
|
||||
description: >-
|
||||
Specifies that the response in the body is encoded with gzip
|
||||
or not encoded with identity.
|
||||
default: identity
|
||||
enum:
|
||||
- gzip
|
||||
- identity
|
||||
Trace-Id:
|
||||
description: The Trace-Id header reports the request's trace ID, if one was generated.
|
||||
description: >-
|
||||
The Trace-Id header reports the request's trace ID, if one was
|
||||
generated.
|
||||
schema:
|
||||
type: string
|
||||
description: Specifies the request's trace ID.
|
||||
content:
|
||||
application/csv:
|
||||
schema:
|
||||
$ref: "#/components/schemas/InfluxQLCSVResponse"
|
||||
$ref: '#/components/schemas/InfluxQLCSVResponse'
|
||||
text/csv:
|
||||
schema:
|
||||
$ref: "#/components/schemas/InfluxQLCSVResponse"
|
||||
$ref: '#/components/schemas/InfluxQLCSVResponse'
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/InfluxQLResponse"
|
||||
$ref: '#/components/schemas/InfluxQLResponse'
|
||||
application/x-msgpack:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
"429":
|
||||
description: Token is temporarily over quota. The Retry-After header describes when to try the read again.
|
||||
'429':
|
||||
description: >-
|
||||
Token is temporarily over quota. The Retry-After header describes
|
||||
when to try the read again.
|
||||
headers:
|
||||
Retry-After:
|
||||
description: A non-negative decimal integer indicating the seconds to delay after the response is received.
|
||||
description: >-
|
||||
A non-negative decimal integer indicating the seconds to delay
|
||||
after the response is received.
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
|
|
@ -211,7 +258,7 @@ paths:
|
|||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
$ref: '#/components/schemas/Error'
|
||||
components:
|
||||
parameters:
|
||||
TraceSpan:
|
||||
|
|
@ -219,8 +266,8 @@ components:
|
|||
name: Zap-Trace-Span
|
||||
description: OpenTracing span context
|
||||
example:
|
||||
trace_id: "1"
|
||||
span_id: "1"
|
||||
trace_id: '1'
|
||||
span_id: '1'
|
||||
baggage:
|
||||
key: value
|
||||
required: false
|
||||
|
|
@ -246,8 +293,12 @@ components:
|
|||
results:
|
||||
type: array
|
||||
oneOf:
|
||||
- required: [statement_id, error]
|
||||
- required: [statement_id, series]
|
||||
- required:
|
||||
- statement_id
|
||||
- error
|
||||
- required:
|
||||
- statement_id
|
||||
- series
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
|
|
@ -290,7 +341,6 @@ components:
|
|||
description: Code is the machine-readable error code.
|
||||
readOnly: true
|
||||
type: string
|
||||
# This set of enumerations must remain in sync with the constants defined in errors.go
|
||||
enum:
|
||||
- internal error
|
||||
- not found
|
||||
|
|
@ -307,7 +357,9 @@ components:
|
|||
readOnly: true
|
||||
description: Message is a human-readable message.
|
||||
type: string
|
||||
required: [code, message]
|
||||
required:
|
||||
- code
|
||||
- message
|
||||
LineProtocolError:
|
||||
properties:
|
||||
code:
|
||||
|
|
@ -327,18 +379,26 @@ components:
|
|||
type: string
|
||||
op:
|
||||
readOnly: true
|
||||
description: Op describes the logical code operation during error. Useful for debugging.
|
||||
description: >-
|
||||
Op describes the logical code operation during error. Useful for
|
||||
debugging.
|
||||
type: string
|
||||
err:
|
||||
readOnly: true
|
||||
description: Err is a stack of errors that occurred during processing of the request. Useful for debugging.
|
||||
description: >-
|
||||
Err is a stack of errors that occurred during processing of the
|
||||
request. Useful for debugging.
|
||||
type: string
|
||||
line:
|
||||
readOnly: true
|
||||
description: First line within sent body containing malformed data
|
||||
type: integer
|
||||
format: int32
|
||||
required: [code, message, op, err]
|
||||
required:
|
||||
- code
|
||||
- message
|
||||
- op
|
||||
- err
|
||||
LineProtocolLengthError:
|
||||
properties:
|
||||
code:
|
||||
|
|
@ -356,65 +416,97 @@ components:
|
|||
description: Max length in bytes for a body of line-protocol.
|
||||
type: integer
|
||||
format: int32
|
||||
required: [code, message, maxLength]
|
||||
required:
|
||||
- code
|
||||
- message
|
||||
- maxLength
|
||||
securitySchemes:
|
||||
TokenAuthentication:
|
||||
type: apiKey
|
||||
name: Authorization
|
||||
in: header
|
||||
description: |
|
||||
Use the [Token authentication](#section/Authentication/TokenAuthentication)
|
||||
description: >
|
||||
Use the [Token
|
||||
authentication](#section/Authentication/TokenAuthentication)
|
||||
|
||||
scheme to authenticate to the InfluxDB API.
|
||||
|
||||
|
||||
|
||||
In your API requests, send an `Authorization` header.
|
||||
For the header value, provide the word `Token` followed by a space and an InfluxDB API token.
|
||||
|
||||
For the header value, provide the word `Token` followed by a space and
|
||||
an InfluxDB API token.
|
||||
|
||||
The word `Token` is case-sensitive.
|
||||
|
||||
|
||||
|
||||
### Syntax
|
||||
|
||||
|
||||
`Authorization: Token YOUR_INFLUX_TOKEN`
|
||||
|
||||
|
||||
|
||||
For examples and more information, see the following:
|
||||
- [`/authorizations`](#tag/Authorizations) endpoint.
|
||||
- [Authorize API requests](https://docs.influxdata.com/influxdb/cloud/api-guide/api_intro/#authentication).
|
||||
- [Manage API tokens](https://docs.influxdata.com/influxdb/cloud/security/tokens/).
|
||||
- [Authorize API requests](/influxdb/cloud/api-guide/api_intro/#authentication).
|
||||
- [Manage API tokens](/influxdb/cloud/security/tokens/).
|
||||
BasicAuthentication:
|
||||
type: http
|
||||
scheme: basic
|
||||
description: |
|
||||
Use the HTTP [Basic authentication](#section/Authentication/BasicAuthentication)
|
||||
scheme with clients that support the InfluxDB 1.x convention of username and password (that don't support the `Authorization: Token` scheme):
|
||||
description: >
|
||||
Use the HTTP [Basic
|
||||
authentication](#section/Authentication/BasicAuthentication)
|
||||
|
||||
scheme with clients that support the InfluxDB 1.x convention of username
|
||||
and password (that don't support the `Authorization: Token` scheme):
|
||||
|
||||
|
||||
For examples and more information, see how to [authenticate with a username and password](https://docs.influxdata.com/influxdb/cloud/reference/api/influxdb-1x/).
|
||||
|
||||
For examples and more information, see how to [authenticate with a
|
||||
username and password](/influxdb/cloud/reference/api/influxdb-1x/).
|
||||
QuerystringAuthentication:
|
||||
type: apiKey
|
||||
in: query
|
||||
name: u=&p=
|
||||
description: |
|
||||
Use the [Querystring authentication](#section/Authentication/QuerystringAuthentication)
|
||||
scheme with InfluxDB 1.x API parameters to provide credentials through the query string.
|
||||
type: apiKey
|
||||
in: query
|
||||
name: u=&p=
|
||||
description: >
|
||||
Use the [Querystring
|
||||
authentication](#section/Authentication/QuerystringAuthentication)
|
||||
|
||||
scheme with InfluxDB 1.x API parameters to provide credentials through
|
||||
the query string.
|
||||
|
||||
|
||||
For examples and more information, see how to [authenticate with a username and password](https://docs.influxdata.com/influxdb/cloud/reference/api/influxdb-1x/).
|
||||
|
||||
For examples and more information, see how to [authenticate with a
|
||||
username and password](/influxdb/cloud/reference/api/influxdb-1x/).
|
||||
security:
|
||||
- TokenAuthentication: []
|
||||
- BasicAuthentication: []
|
||||
- QuerystringAuthentication: []
|
||||
tags:
|
||||
- name: Authentication
|
||||
description: |
|
||||
description: >
|
||||
The InfluxDB 1.x API requires authentication for all requests.
|
||||
|
||||
InfluxDB Cloud uses InfluxDB API tokens to authenticate requests.
|
||||
|
||||
|
||||
|
||||
For more information, see the following:
|
||||
|
||||
- [Token authentication](#section/Authentication/TokenAuthentication)
|
||||
|
||||
- [Basic authentication](#section/Authentication/BasicAuthentication)
|
||||
- [Querystring authentication](#section/Authentication/QuerystringAuthentication)
|
||||
|
||||
- [Querystring
|
||||
authentication](#section/Authentication/QuerystringAuthentication)
|
||||
|
||||
|
||||
<!-- ReDoc-Inject: <security-definitions> -->
|
||||
x-traitTag: true
|
||||
x-traitTag: true
|
||||
- name: Query
|
||||
- name: Write
|
||||
x-tagGroups: []
|
||||
|
|
|
|||
Loading…
Reference in New Issue