Fix/api securityschemes (#3488)

* fix: oss and cloud auth. Add bearer scheme for OSS.

* chore: Add an openapi CLI decorator that replaces INFLUXDB_DOCS_URL 'shortcodes' with the correct URL in specs.

* fix: API authentication descriptions and schemes in /api/v2 and V1Compat. Remove QueryString and Basic auth schemes from /api/v2 and add them to V1Compat, along with Token auth. Hook up the replace-docs-url-shortcode which is primarily for V1Compat for now due to the way that contract is managed. Add tag groups to V1Compat.

* fix: add v1compat Info description. Comment out Bearer auth in OSS until it's available in Cloud.

* fix: add replace-shortcodes decorator. Fix v1-compat tag-groups. Fix spec titles.

* fix: restore BasicAuth scheme definition for the users operations that reference them. Still need examples for these.

* fix: remove 1.x BasicAuth references where they don't belong.

* chore: sync from openapi master.

* fix: use replace-shortcodes to replace full Docs URLs in the contracts with absolute local paths to avoid roundtrips. Improve v1compat titles.

* Update api-docs/cloud/swaggerV1Compat.yml

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update api-docs/cloud/swaggerV1Compat.yml

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update api-docs/cloud/swaggerV1Compat.yml

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update api-docs/cloud/swaggerV1Compat.yml

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update api-docs/cloud/swaggerV1Compat.yml

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>
pull/3515/head
Jason Stirnaman 2021-12-21 14:34:49 -06:00 committed by GitHub
parent 02e180ef83
commit b100bbf256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 974 additions and 418 deletions

View File

@ -1,5 +1,4 @@
apiDefintions: apiDefintions:
main: ref.yaml
lint: lint:
plugins: plugins:
- './openapi/plugins/docs-plugin.js' - './openapi/plugins/docs-plugin.js'

View File

@ -728,6 +728,19 @@ components:
type: array type: array
links: links:
$ref: '#/components/schemas/Links' $ref: '#/components/schemas/Links'
ColorMapping:
additionalProperties:
type: int
description: >-
A color mapping is an object that maps time series data to a UI color
scheme to allow the UI to render graphs consistent colors across
reloads.
example:
configcat_deployments-autopromotionblocker: 0
measurement_birdmigration_europe: 0
series_id_1: 0
series_id_2: 1
type: object
ColumnDataType: ColumnDataType:
enum: enum:
- integer - integer
@ -4502,6 +4515,39 @@ components:
type: type:
type: string type: string
type: object type: object
TelegrafPluginRequest:
properties:
config:
type: string
description:
type: string
metadata:
properties:
buckets:
items:
type: string
type: array
type: object
name:
type: string
orgID:
type: string
plugins:
items:
properties:
alias:
type: string
config:
type: string
description:
type: string
name:
type: string
type:
type: string
type: object
type: array
type: object
TelegrafPlugins: TelegrafPlugins:
properties: properties:
os: os:
@ -5788,6 +5834,9 @@ components:
properties: properties:
axes: axes:
$ref: '#/components/schemas/Axes' $ref: '#/components/schemas/Axes'
colorMapping:
$ref: '#/components/schemas/ColorMapping'
description: An object that contains information about the color mapping
colors: colors:
description: Colors define color encoding of data into a visualization description: Colors define color encoding of data into a visualization
items: items:
@ -5884,9 +5933,8 @@ components:
### Basic authentication scheme ### Basic authentication scheme
Use the HTTP Basic authentication scheme with clients that support the Use the HTTP Basic authentication scheme for InfluxDB `/api/v2` API
InfluxDB 1.x convention of username and password (that don't support the operations that support it:
`Authorization: Token` scheme):
- **username**: InfluxDB Cloud username - **username**: InfluxDB Cloud username
- **password**: InfluxDB Cloud API token - **password**: InfluxDB Cloud API token
@ -5902,86 +5950,43 @@ components:
with with
- *`INFLUX_API_TOKEN`*: your [InfluxDB API - *`INFLUX_API_TOKEN`*: your [InfluxDB API
token](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#token) token](/influxdb/cloud/reference/glossary/#token)
For more information and examples, see how to [authenticate with a
username and
password](https://docs.influxdata.com/influxdb/cloud/reference/api/influxdb-1x/).
scheme: basic scheme: basic
type: http type: http
QuerystringAuthentication:
description: >
### Querystring authentication scheme
Use InfluxDB 1.x API parameters to provide credentials through the query
string.
Username and password schemes require the following credentials:
- **username**: InfluxDB Cloud username
- **password**: InfluxDB Cloud API token
#### Example
`curl --get "https://europe-west1-1.gcp.cloud2.influxdata.com/query"
--data-urlencode "u=exampleuser@influxdata.com"
--data-urlencode "p=INFLUX_API_TOKEN"`
Replace the following:
- *`exampleuser@influxdata.com`*: the email address that you signed up
with
- *`INFLUX_API_TOKEN`*: your [InfluxDB API
token](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#token)
For more information and examples, see how to [authenticate with a
username and password
scheme](https://docs.influxdata.com/influxdb/cloud/reference/api/influxdb-1x/).
in: query
name: u=&p=
type: apiKey
TokenAuthentication: TokenAuthentication:
bearerFormat: InfluxDB token string
description: > description: >
### Token authentication scheme Use the [Token
authentication](#section/Authentication/TokenAuthentication)
scheme to authenticate to the InfluxDB API.
InfluxDB API tokens ensure secure interaction between users and data. A
token belongs to an organization and identifies InfluxDB permissions In your API requests, send an `Authorization` header.
within the organization.
For the header value, provide the word `Token` followed by a space and
an InfluxDB API token.
The word `Token` is case-sensitive.
Include your API token in an `Authorization: Token INFLUX_TOKEN` HTTP
header with each request. ### Syntax
#### Example `Authorization: Token YOUR_INFLUX_TOKEN`
`curl https://us-east-1-1.aws.cloud2.influxdata.com/
--header "Authorization: Token INFLUX_API_TOKEN"`
Replace *`INFLUX_API_TOKEN`* with your [InfluxDB API
token](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#token).
For more information and examples, see the following: For more information and examples, see the following:
- [`/authorizations`](#tag/Authorizations) endpoint. - [`/authorizations`](#tag/Authorizations) endpoint.
- [Authorize API requests](https://docs.influxdata.com/influxdb/cloud/api-guide/api_intro/#authentication). - [Authorize API requests](/influxdb/cloud/api-guide/api_intro/#authentication).
- [Manage API tokens](https://docs.influxdata.com/influxdb/cloud/security/tokens). - [Manage API tokens](/influxdb/cloud/security/tokens).
- [Assign a token to a specific user](https://docs.influxdata.com/influxdb/cloud/security/tokens/create-token). in: header
scheme: token name: Authorization
type: http type: apiKey
info: info:
title: Influx Cloud API Service title: InfluxDB Cloud API Service
description: > description: >
The InfluxDB v2 API provides a programmatic interface for all interactions The InfluxDB v2 API provides a programmatic interface for all interactions
with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
@ -11213,7 +11218,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/TelegrafRequest' $ref: '#/components/schemas/TelegrafPluginRequest'
description: Telegraf configuration to create description: Telegraf configuration to create
required: true required: true
responses: responses:
@ -11317,7 +11322,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/TelegrafRequest' $ref: '#/components/schemas/TelegrafPluginRequest'
description: Telegraf configuration update to apply description: Telegraf configuration update to apply
required: true required: true
responses: responses:
@ -12364,20 +12369,16 @@ paths:
- Write - Write
security: security:
- TokenAuthentication: [] - TokenAuthentication: []
- BasicAuthentication: []
- QuerystringAuthentication: []
servers: servers:
- url: / - url: /
tags: tags:
- description: > - description: |
Use one of the following schemes to authenticate to the InfluxDB API: The InfluxDB `/api/v2` API requires authentication for all requests.
Use InfluxDB API tokens to authenticate requests to the `/api/v2` API.
- [Token authentication](#section/Authentication/TokenAuthentication)
- [Basic authentication](#section/Authentication/BasicAuthentication) For more information, see
[Token authentication](#section/Authentication/TokenAuthentication)
- [Querystring
authentication](#section/Authentication/QuerystringAuthentication)
<!-- ReDoc-Inject: <security-definitions> --> <!-- ReDoc-Inject: <security-definitions> -->
name: Authentication name: Authentication
@ -12390,9 +12391,9 @@ tags:
For more information and examples, see the following: For more information and examples, see the following:
- [Authorize API requests](https://docs.influxdata.com/influxdb/cloud/api-guide/api_intro/#authentication). - [Authorize API requests](/influxdb/cloud/api-guide/api_intro/#authentication).
- [Manage API tokens](https://docs.influxdata.com/influxdb/cloud/security/tokens). - [Manage API tokens](/influxdb/cloud/security/tokens).
- [Assign a token to a specific user](https://docs.influxdata.com/influxdb/cloud/security/tokens/create-token). - [Assign a token to a specific user](/influxdb/cloud/security/tokens/create-token).
name: Authorizations name: Authorizations
- Bucket Schemas - Bucket Schemas
- Buckets - Buckets
@ -12413,16 +12414,14 @@ tags:
Retrieve data, analyze queries, and get query suggestions. Retrieve data, analyze queries, and get query suggestions.
name: Query name: Query
- description: > - description: >
See the [**API Quick See the [**API Quick Start**](/influxdb/cloud/api-guide/api_intro/) to get
Start**](https://docs.influxdata.com/influxdb/cloud/api-guide/api_intro/) up and running authenticating with tokens, writing to buckets, and
to get up and running authenticating with tokens, writing to buckets, and
querying data. querying data.
[**InfluxDB API client [**InfluxDB API client
libraries**](https://docs.influxdata.com/influxdb/cloud/api-guide/client-libraries/) libraries**](/influxdb/cloud/api-guide/client-libraries/) are available
are available for popular languages and ready to import into your for popular languages and ready to import into your application.
application.
name: Quick start name: Quick start
x-traitTag: true x-traitTag: true
- Resources - Resources
@ -12457,8 +12456,7 @@ tags:
malformed</li><li>API token value is missing from the header</li><li>API malformed</li><li>API token value is missing from the header</li><li>API
token does not have permission. For more information about token types and token does not have permission. For more information about token types and
permissions, see [Manage API permissions, see [Manage API
tokens](https://docs.influxdata.com/influxdb/cloud/security/tokens/)</li> tokens](/influxdb/cloud/security/tokens/)</li> |
|
| `404` | Not found | Requested resource was not | `404` | Not found | Requested resource was not
found. `message` in the response body provides details about the requested found. `message` in the response body provides details about the requested

View File

@ -1,18 +1,24 @@
# this is a manually maintained file for these old routes until oats#15 is resolved openapi: 3.0.0
openapi: "3.0.0"
info: info:
title: Influx API Service (V1 compatible endpoints) title: InfluxDB Cloud v1 compatibility API documentation
version: 0.1.0 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.
If you want to use the latest InfluxDB `/api/v2` API instead,
see the [InfluxDB v2 API documentation](/influxdb/cloud/api/).
servers: servers:
- url: / - url: /
description: V1 compatible api endpoints.
paths: paths:
/write: /write:
post: # technically this functions with other methods as well post:
operationId: PostWriteV1 operationId: PostWriteV1
tags: tags:
- Write - Write
summary: Write time series data into InfluxDB in a V1 compatible format summary: Write time series data into InfluxDB in a V1-compatible format
requestBody: requestBody:
description: Line protocol body description: Line protocol body
required: true required: true
@ -21,15 +27,17 @@ paths:
schema: schema:
type: string type: string
parameters: parameters:
- $ref: "#/components/parameters/TraceSpan" - $ref: '#/components/parameters/TraceSpan'
- $ref: "#/components/parameters/AuthUserV1" - $ref: '#/components/parameters/AuthUserV1'
- $ref: "#/components/parameters/AuthPassV1" - $ref: '#/components/parameters/AuthPassV1'
- in: query - in: query
name: db name: db
schema: schema:
type: string type: string
required: true required: true
description: The bucket to write to. If none exist a bucket will be created with a default 3 day retention policy. description: >-
Bucket to write to. If none exist a bucket will be created with
a default 3 day retention policy.
- in: query - in: query
name: rp name: rp
schema: schema:
@ -42,54 +50,76 @@ paths:
description: Write precision. description: Write precision.
- in: header - in: header
name: Content-Encoding 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: schema:
type: string 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 default: identity
enum: enum:
- gzip - gzip
- identity - identity
responses: responses:
"204": '204':
description: Write data is correctly formatted and accepted for writing to the bucket. description: >-
"400": Write data is correctly formatted and accepted for writing to the
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. 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: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/LineProtocolError" $ref: '#/components/schemas/LineProtocolError'
"401": '401':
description: Token does not have sufficient permissions to write to this organization and bucket or the organization and bucket do not exist. description: >-
Token does not have sufficient permissions to write to this
organization and bucket or the organization and bucket do not exist.
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
"403": '403':
description: No token was sent and they are required. description: No token was sent and they are required.
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
"413": '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. 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: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/LineProtocolLengthError" $ref: '#/components/schemas/LineProtocolLengthError'
"429": '429':
description: Token is temporarily over quota. The Retry-After header describes when to try the write again. description: >-
Token is temporarily over quota. The Retry-After header describes
when to try the write again.
headers: headers:
Retry-After: 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: schema:
type: integer type: integer
format: int32 format: int32
"503": '503':
description: Server is temporarily unavailable to accept writes. The Retry-After header describes when to try the write again. description: >-
Server is temporarily unavailable to accept writes. The Retry-After
header describes when to try the write again.
headers: headers:
Retry-After: 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: schema:
type: integer type: integer
format: int32 format: int32
@ -98,9 +128,9 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
/query: /query:
post: # technically this functions with other methods as well post:
operationId: PostQueryV1 operationId: PostQueryV1
tags: tags:
- Query - Query
@ -108,18 +138,21 @@ paths:
requestBody: requestBody:
description: InfluxQL query to execute. description: InfluxQL query to execute.
content: content:
text/plain: # although this should be `application/vnd.influxql`, oats breaks so we define the content-type header parameter text/plain:
schema: schema:
type: string type: string
parameters: parameters:
- $ref: "#/components/parameters/TraceSpan" - $ref: '#/components/parameters/TraceSpan'
- $ref: "#/components/parameters/AuthUserV1" - $ref: '#/components/parameters/AuthUserV1'
- $ref: "#/components/parameters/AuthPassV1" - $ref: '#/components/parameters/AuthPassV1'
- in: header - in: header
name: Accept name: Accept
schema: schema:
type: string 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 default: application/json
enum: enum:
- application/json - application/json
@ -128,10 +161,15 @@ paths:
- application/x-msgpack - application/x-msgpack
- in: header - in: header
name: Accept-Encoding 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: schema:
type: string 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 default: identity
enum: enum:
- gzip - gzip
@ -142,48 +180,70 @@ paths:
type: string type: string
enum: enum:
- application/vnd.influxql - application/vnd.influxql
- in: query
name: db
schema:
type: string
required: true
description: Bucket to query.
- in: query
name: rp
schema:
type: string
description: Retention policy name.
- in: query - in: query
name: q name: q
description: Defines the influxql query to run. description: Defines the influxql query to run.
schema: schema:
type: string type: string
responses: responses:
"200": '200':
description: Query results description: Query results
headers: headers:
Content-Encoding: 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: schema:
type: string 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 default: identity
enum: enum:
- gzip - gzip
- identity - identity
Trace-Id: 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: schema:
type: string type: string
description: Specifies the request's trace ID. description: Specifies the request's trace ID.
content: content:
application/csv: application/csv:
schema: schema:
$ref: "#/components/schemas/InfluxQLCSVResponse" $ref: '#/components/schemas/InfluxQLCSVResponse'
text/csv: text/csv:
schema: schema:
$ref: "#/components/schemas/InfluxQLCSVResponse" $ref: '#/components/schemas/InfluxQLCSVResponse'
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/InfluxQLResponse" $ref: '#/components/schemas/InfluxQLResponse'
application/x-msgpack: application/x-msgpack:
schema: schema:
type: string type: string
format: binary format: binary
"429": '429':
description: Token is temporarily over quota. The Retry-After header describes when to try the read again. description: >-
Token is temporarily over quota. The Retry-After header describes
when to try the read again.
headers: headers:
Retry-After: 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: schema:
type: integer type: integer
format: int32 format: int32
@ -192,7 +252,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
components: components:
parameters: parameters:
TraceSpan: TraceSpan:
@ -200,8 +260,8 @@ components:
name: Zap-Trace-Span name: Zap-Trace-Span
description: OpenTracing span context description: OpenTracing span context
example: example:
trace_id: "1" trace_id: '1'
span_id: "1" span_id: '1'
baggage: baggage:
key: value key: value
required: false required: false
@ -260,7 +320,6 @@ components:
description: Code is the machine-readable error code. description: Code is the machine-readable error code.
readOnly: true readOnly: true
type: string type: string
# This set of enumerations must remain in sync with the constants defined in errors.go
enum: enum:
- internal error - internal error
- not found - not found
@ -277,7 +336,9 @@ components:
readOnly: true readOnly: true
description: Message is a human-readable message. description: Message is a human-readable message.
type: string type: string
required: [code, message] required:
- code
- message
LineProtocolError: LineProtocolError:
properties: properties:
code: code:
@ -297,18 +358,26 @@ components:
type: string type: string
op: op:
readOnly: true 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 type: string
err: err:
readOnly: true 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 type: string
line: line:
readOnly: true readOnly: true
description: First line within sent body containing malformed data description: First line within sent body containing malformed data
type: integer type: integer
format: int32 format: int32
required: [code, message, op, err] required:
- code
- message
- op
- err
LineProtocolLengthError: LineProtocolLengthError:
properties: properties:
code: code:
@ -326,4 +395,108 @@ components:
description: Max length in bytes for a body of line-protocol. description: Max length in bytes for a body of line-protocol.
type: integer type: integer
format: int32 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)
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.
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](/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):
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.
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: >
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)
<!-- ReDoc-Inject: <security-definitions> -->
x-traitTag: true
- Query
- Write
x-tagGroups:
- name: Overview
tags:
- Authentication
- name: Data I/O endpoints
tags:
- Write
- Query
- name: All endpoints
tags:
- Query
- Write

View File

@ -67,6 +67,11 @@ weight: 304
--templateOptions.version="$version" \ --templateOptions.version="$version" \
--templateOptions.titleVersion="$titleVersion" \ --templateOptions.titleVersion="$titleVersion" \
# Use Redoc's openapi-cli to regenerate the v1-compat spec with custom decorations.
INFLUXDB_API_VERSION=v1compat INFLUXDB_VERSION=$version npm_config_yes=true npx $openapiCLI bundle $version/swaggerV1Compat.yml \
--config=./.redocly.yaml \
-o $version/swaggerV1Compat.yml
# Use Redoc to generate the v1 compatibility API html # Use Redoc to generate the v1 compatibility API html
npm_config_yes=true npx $redocCLI bundle $version/swaggerV1Compat.yml \ npm_config_yes=true npx $redocCLI bundle $version/swaggerV1Compat.yml \
-t template.hbs \ -t template.hbs \
@ -74,6 +79,7 @@ weight: 304
--options.sortPropsAlphabetically \ --options.sortPropsAlphabetically \
--options.menuToggle \ --options.menuToggle \
--options.hideHostname \ --options.hideHostname \
--options.noAutoAuth \
--templateOptions.version="$version" \ --templateOptions.version="$version" \
--templateOptions.titleVersion="$titleVersion" \ --templateOptions.titleVersion="$titleVersion" \
--output=redoc-static-v1-compat.html \ --output=redoc-static-v1-compat.html \

View File

@ -98,7 +98,7 @@ function updateOSS {
} }
function updateV1Compat { function updateV1Compat {
echo "Updating Cloud and ${ossVersion} v1 compatibilty openapi..." echo "Updating Cloud and ${ossVersion} v1 compatibility openapi..."
curl ${verbose} ${baseUrl}/contracts/swaggerV1Compat.yml -s -o cloud/swaggerV1Compat.yml curl ${verbose} ${baseUrl}/contracts/swaggerV1Compat.yml -s -o cloud/swaggerV1Compat.yml
mkdir -p ${ossVersion} && cp cloud/swaggerV1Compat.yml $_/swaggerV1Compat.yml mkdir -p ${ossVersion} && cp cloud/swaggerV1Compat.yml $_/swaggerV1Compat.yml
} }

View File

@ -1,3 +1,3 @@
title: Influx Cloud API Service title: InfluxDB Cloud API Service
description: | description: |
The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.

View File

@ -0,0 +1 @@
title: InfluxDB Cloud v1 compatibility API documentation

View File

@ -0,0 +1,9 @@
- name: Overview
tags:
- Authentication
- name: Data I/O endpoints
tags:
- Write
- Query
- name: All endpoints
tags: []

View File

@ -2,7 +2,7 @@ const path = require('path');
const { toJSON } = require('../plugins/helpers/content-helper'); const { toJSON } = require('../plugins/helpers/content-helper');
function getVersion(filename) { function getVersion(filename) {
return path.join(__dirname, process.env.INFLUXDB_VERSION, filename); return path.join(__dirname, process.env.INFLUXDB_VERSION, (process.env.INFLUXDB_API_VERSION || ''), filename);
} }
const info = toJSON(getVersion('info.yml')); const info = toJSON(getVersion('info.yml'));

View File

@ -1,3 +1,3 @@
title: Influx OSS API Service title: InfluxDB OSS API Service
description: | description: |
The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.

View File

@ -1,3 +1,3 @@
title: Influx OSS API Service title: InfluxDB OSS API Service
description: | description: |
The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.

View File

@ -0,0 +1 @@
title: InfluxDB OSS v1 compatibility API documentation

View File

@ -0,0 +1,9 @@
- name: Overview
tags:
- Authentication
- name: Data I/O endpoints
tags:
- Write
- Query
- name: All endpoints
tags: []

View File

@ -0,0 +1,42 @@
module.exports = ReplaceShortcodes;
function replaceDocsUrl(node) {
const shortcode = /\{\{\% INFLUXDB_DOCS_URL \%\}\}/g;
let replacement = `/influxdb/${process.env.INFLUXDB_VERSION}`;
let description = node.description?.replace(shortcode, replacement);
const fullUrl = /https:\/\/docs\.influxdata\.com\/influxdb\//g;
replacement = "/influxdb/";
return description?.replace(fullUrl, replacement);
}
/** @type {import('@redocly/openapi-cli').OasDecorator} */
function docsUrl() {
return {
Info: {
leave(info, ctx) {
info.description = replaceDocsUrl(info);
}
},
PathItem: {
leave(pathItem, ctx) {
pathItem.description = replaceDocsUrl(pathItem);
}
},
Tag: {
leave(tag, ctx) {
tag.description = replaceDocsUrl(tag);
}
},
SecurityScheme: {
leave(scheme, ctx) {
scheme.description = replaceDocsUrl(scheme);
}
}
}
}
function ReplaceShortcodes() {
return {
docsUrl,
};
}

View File

@ -6,10 +6,14 @@ function SetInfo(options) {
Info: { Info: {
leave(info, ctx) { leave(info, ctx) {
if(options.data) { if(options.data) {
if(options.data.hasOwnProperty('title')) {
info.title = options.data.title; info.title = options.data.title;
}
if(options.data.hasOwnProperty('description')) {
info.description = options.data.description; info.description = options.data.description;
} }
} }
} }
} }
}
} }

View File

@ -1,6 +1,7 @@
const ReportTags = require('./rules/report-tags'); const ReportTags = require('./rules/report-tags');
const ValidateServersUrl = require('./rules/validate-servers-url'); const ValidateServersUrl = require('./rules/validate-servers-url');
const RemovePrivatePaths = require('./decorators/paths/remove-private-paths'); const RemovePrivatePaths = require('./decorators/paths/remove-private-paths');
const ReplaceShortcodes = require('./decorators/replace-shortcodes');
const SetInfo = require('./decorators/set-info'); const SetInfo = require('./decorators/set-info');
const SetServers = require('./decorators/servers/set-servers'); const SetServers = require('./decorators/servers/set-servers');
const SetSecuritySchemes = require('./decorators/security/set-security-schemes'); const SetSecuritySchemes = require('./decorators/security/set-security-schemes');
@ -24,6 +25,7 @@ const decorators = {
oas3: { oas3: {
'set-servers': () => SetServers({data: servers}), 'set-servers': () => SetServers({data: servers}),
'remove-private-paths': RemovePrivatePaths, 'remove-private-paths': RemovePrivatePaths,
'replace-docs-url-shortcode': ReplaceShortcodes().docsUrl,
'strip-version-prefix': StripVersionPrefix, 'strip-version-prefix': StripVersionPrefix,
'set-info': () => SetInfo({data: info}), 'set-info': () => SetInfo({data: info}),
'set-security': () => SetSecurity({data: security}), 'set-security': () => SetSecurity({data: security}),
@ -44,6 +46,7 @@ module.exports = {
decorators: { decorators: {
'docs/set-servers': 'error', 'docs/set-servers': 'error',
'docs/remove-private-paths': 'error', 'docs/remove-private-paths': 'error',
'docs/replace-docs-url-shortcode': 'error',
'docs/strip-version-prefix': 'error', 'docs/strip-version-prefix': 'error',
'docs/set-info': 'error', 'docs/set-info': 'error',
'docs/set-tag-groups': 'error', 'docs/set-tag-groups': 'error',

View File

@ -51,7 +51,8 @@ function toJSON(yamlPath) {
try { try {
return yaml.load(fs.readFileSync(yamlPath, 'utf8')); return yaml.load(fs.readFileSync(yamlPath, 'utf8'));
} catch (e) { } catch (e) {
console.log(e); /** No file, no harm, no foul. **/
// console.log(e);
} }
} }
@ -62,4 +63,3 @@ module.exports = {
sortName, sortName,
toJSON, toJSON,
} }

View File

@ -5847,12 +5847,11 @@ components:
- *`1.x_PASSWORD`*: your InfluxDB v1.x password - *`1.x_PASSWORD`*: your InfluxDB v1.x password
- *`INFLUX_API_TOKEN`*: your [InfluxDB API - *`INFLUX_API_TOKEN`*: your [InfluxDB API
token](https://docs.influxdata.com/influxdb/v2.0/reference/glossary/#token) token](/influxdb/v2.0/reference/glossary/#token)
For more information and examples, see how to [authenticate with a For more information and examples, see how to [authenticate with a
username and password username and password scheme](/influxdb/v2.0/reference/api/influxdb-1x/)
scheme](https://docs.influxdata.com/influxdb/v2.0/reference/api/influxdb-1x/)
scheme: basic scheme: basic
type: http type: http
QuerystringAuthentication: QuerystringAuthentication:
@ -5889,12 +5888,11 @@ components:
- *`1.x_PASSWORD`*: your InfluxDB v1.x password - *`1.x_PASSWORD`*: your InfluxDB v1.x password
- *`INFLUX_API_TOKEN`*: your [InfluxDB API - *`INFLUX_API_TOKEN`*: your [InfluxDB API
token](https://docs.influxdata.com/influxdb/v2.0/reference/glossary/#token) token](/influxdb/v2.0/reference/glossary/#token)
For more information and examples, see how to [authenticate with a For more information and examples, see how to [authenticate with a
username and username and password](/influxdb/v2.0/reference/api/influxdb-1x/)
password](https://docs.influxdata.com/influxdb/v2.0/reference/api/influxdb-1x/)
in: query in: query
name: u=&p= name: u=&p=
type: apiKey type: apiKey
@ -5921,17 +5919,17 @@ components:
--header "Authorization: Token INFLUX_API_TOKEN"` --header "Authorization: Token INFLUX_API_TOKEN"`
Replace *`INFLUX_API_TOKEN`* with your [InfluxDB API Replace *`INFLUX_API_TOKEN`* with your [InfluxDB API
token](https://docs.influxdata.com/influxdb/v2.0/reference/glossary/#token). token](/influxdb/v2.0/reference/glossary/#token).
For more information and examples, see the following: For more information and examples, see the following:
- [`/authorizations`](#tag/Authorizations) endpoint. - [`/authorizations`](#tag/Authorizations) endpoint.
- [Use tokens in API requests](https://docs.influxdata.com/influxdb/v2.0/api-guide/api_intro/#authentication). - [Use tokens in API requests](/influxdb/v2.0/api-guide/api_intro/#authentication).
- [Manage API tokens](https://docs.influxdata.com/influxdb/v2.0/security/tokens). - [Manage API tokens](/influxdb/v2.0/security/tokens).
- [Assign a token to a specific user](https://docs.influxdata.com/influxdb/v2.0/security/tokens/create-token). - [Assign a token to a specific user](/influxdb/v2.0/security/tokens/create-token).
scheme: token scheme: token
type: http type: http
info: info:
title: Influx OSS API Service title: InfluxDB OSS API Service
description: > description: >
The InfluxDB v2 API provides a programmatic interface for all interactions The InfluxDB v2 API provides a programmatic interface for all interactions
with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
@ -12969,16 +12967,14 @@ tags:
- name: Quick start - name: Quick start
x-traitTag: true x-traitTag: true
description: > description: >
See the [**API Quick See the [**API Quick Start**](/influxdb/v2.0/api-guide/api_intro/) to get
Start**](https://docs.influxdata.com/influxdb/v2.0/api-guide/api_intro/) up and running authenticating with tokens, writing to buckets, and
to get up and running authenticating with tokens, writing to buckets, and
querying data. querying data.
[**InfluxDB API client [**InfluxDB API client
libraries**](https://docs.influxdata.com/influxdb/v2.0/api-guide/client-libraries/) libraries**](/influxdb/v2.0/api-guide/client-libraries/) are available for
are available for popular languages and ready to import into your popular languages and ready to import into your application.
application.
- Ready - Ready
- Resources - Resources
- name: Response codes - name: Response codes
@ -13013,8 +13009,8 @@ tags:
following: <li>`Authorization: Token` header is missing or following: <li>`Authorization: Token` header is missing or
malformed</li><li>API token value is missing from the header</li><li>API malformed</li><li>API token value is missing from the header</li><li>API
token does not have permission. For more information about token types and token does not have permission. For more information about token types and
permissions, see [Manage API permissions, see [Manage API tokens](/influxdb/v2.0/security/tokens/)</li>
tokens](https://docs.influxdata.com/influxdb/v2.0/security/tokens/)</li> | |
| `404` | Not found | Requested resource was not | `404` | Not found | Requested resource was not
found. `message` in the response body provides details about the requested found. `message` in the response body provides details about the requested

View File

@ -1,18 +1,24 @@
# this is a manually maintained file for these old routes until oats#15 is resolved openapi: 3.0.0
openapi: "3.0.0"
info: info:
title: Influx API Service (V1 compatible endpoints) title: Influx API Service (V1 compatible endpoints)
version: 0.1.0 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.
If you want to use the latest InfluxDB `/api/v2` API instead,
see the [InfluxDB v2 API documentation](/influxdb/v2.0/api).
servers: servers:
- url: / - url: /
description: V1 compatible api endpoints.
paths: paths:
/write: /write:
post: # technically this functions with other methods as well post:
operationId: PostWriteV1 operationId: PostWriteV1
tags: tags:
- Write - Write
summary: Write time series data into InfluxDB in a V1 compatible format summary: Write time series data into InfluxDB in a V1 compatible format.
requestBody: requestBody:
description: Line protocol body description: Line protocol body
required: true required: true
@ -21,15 +27,17 @@ paths:
schema: schema:
type: string type: string
parameters: parameters:
- $ref: "#/components/parameters/TraceSpan" - $ref: '#/components/parameters/TraceSpan'
- $ref: "#/components/parameters/AuthUserV1" - $ref: '#/components/parameters/AuthUserV1'
- $ref: "#/components/parameters/AuthPassV1" - $ref: '#/components/parameters/AuthPassV1'
- in: query - in: query
name: db name: db
schema: schema:
type: string type: string
required: true required: true
description: The bucket to write to. If none exist a bucket will be created with a default 3 day retention policy. description: >-
The bucket to write to. If none exist a bucket will be created with
a default 3 day retention policy.
- in: query - in: query
name: rp name: rp
schema: schema:
@ -42,54 +50,76 @@ paths:
description: Write precision. description: Write precision.
- in: header - in: header
name: Content-Encoding 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: schema:
type: string 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 default: identity
enum: enum:
- gzip - gzip
- identity - identity
responses: responses:
"204": '204':
description: Write data is correctly formatted and accepted for writing to the bucket. description: >-
"400": Write data is correctly formatted and accepted for writing to the
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. 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: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/LineProtocolError" $ref: '#/components/schemas/LineProtocolError'
"401": '401':
description: Token does not have sufficient permissions to write to this organization and bucket or the organization and bucket do not exist. description: >-
Token does not have sufficient permissions to write to this
organization and bucket or the organization and bucket do not exist.
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
"403": '403':
description: No token was sent and they are required. description: No token was sent and they are required.
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
"413": '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. 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: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/LineProtocolLengthError" $ref: '#/components/schemas/LineProtocolLengthError'
"429": '429':
description: Token is temporarily over quota. The Retry-After header describes when to try the write again. description: >-
Token is temporarily over quota. The Retry-After header describes
when to try the write again.
headers: headers:
Retry-After: 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: schema:
type: integer type: integer
format: int32 format: int32
"503": '503':
description: Server is temporarily unavailable to accept writes. The Retry-After header describes when to try the write again. description: >-
Server is temporarily unavailable to accept writes. The Retry-After
header describes when to try the write again.
headers: headers:
Retry-After: 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: schema:
type: integer type: integer
format: int32 format: int32
@ -98,9 +128,9 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
/query: /query:
post: # technically this functions with other methods as well post:
operationId: PostQueryV1 operationId: PostQueryV1
tags: tags:
- Query - Query
@ -108,18 +138,21 @@ paths:
requestBody: requestBody:
description: InfluxQL query to execute. description: InfluxQL query to execute.
content: content:
text/plain: # although this should be `application/vnd.influxql`, oats breaks so we define the content-type header parameter text/plain:
schema: schema:
type: string type: string
parameters: parameters:
- $ref: "#/components/parameters/TraceSpan" - $ref: '#/components/parameters/TraceSpan'
- $ref: "#/components/parameters/AuthUserV1" - $ref: '#/components/parameters/AuthUserV1'
- $ref: "#/components/parameters/AuthPassV1" - $ref: '#/components/parameters/AuthPassV1'
- in: header - in: header
name: Accept name: Accept
schema: schema:
type: string 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 default: application/json
enum: enum:
- application/json - application/json
@ -128,10 +161,15 @@ paths:
- application/x-msgpack - application/x-msgpack
- in: header - in: header
name: Accept-Encoding 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: schema:
type: string 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 default: identity
enum: enum:
- gzip - gzip
@ -142,48 +180,70 @@ paths:
type: string type: string
enum: enum:
- application/vnd.influxql - application/vnd.influxql
- in: query
name: db
schema:
type: string
required: true
description: The bucket to query.
- in: query
name: rp
schema:
type: string
description: The retention policy name.
- in: query - in: query
name: q name: q
description: Defines the influxql query to run. description: Defines the influxql query to run.
schema: schema:
type: string type: string
responses: responses:
"200": '200':
description: Query results description: Query results
headers: headers:
Content-Encoding: 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: schema:
type: string 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 default: identity
enum: enum:
- gzip - gzip
- identity - identity
Trace-Id: 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: schema:
type: string type: string
description: Specifies the request's trace ID. description: Specifies the request's trace ID.
content: content:
application/csv: application/csv:
schema: schema:
$ref: "#/components/schemas/InfluxQLCSVResponse" $ref: '#/components/schemas/InfluxQLCSVResponse'
text/csv: text/csv:
schema: schema:
$ref: "#/components/schemas/InfluxQLCSVResponse" $ref: '#/components/schemas/InfluxQLCSVResponse'
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/InfluxQLResponse" $ref: '#/components/schemas/InfluxQLResponse'
application/x-msgpack: application/x-msgpack:
schema: schema:
type: string type: string
format: binary format: binary
"429": '429':
description: Token is temporarily over quota. The Retry-After header describes when to try the read again. description: >-
Token is temporarily over quota. The Retry-After header describes
when to try the read again.
headers: headers:
Retry-After: 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: schema:
type: integer type: integer
format: int32 format: int32
@ -192,7 +252,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
components: components:
parameters: parameters:
TraceSpan: TraceSpan:
@ -200,8 +260,8 @@ components:
name: Zap-Trace-Span name: Zap-Trace-Span
description: OpenTracing span context description: OpenTracing span context
example: example:
trace_id: "1" trace_id: '1'
span_id: "1" span_id: '1'
baggage: baggage:
key: value key: value
required: false required: false
@ -260,7 +320,6 @@ components:
description: Code is the machine-readable error code. description: Code is the machine-readable error code.
readOnly: true readOnly: true
type: string type: string
# This set of enumerations must remain in sync with the constants defined in errors.go
enum: enum:
- internal error - internal error
- not found - not found
@ -277,7 +336,9 @@ components:
readOnly: true readOnly: true
description: Message is a human-readable message. description: Message is a human-readable message.
type: string type: string
required: [code, message] required:
- code
- message
LineProtocolError: LineProtocolError:
properties: properties:
code: code:
@ -297,18 +358,26 @@ components:
type: string type: string
op: op:
readOnly: true 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 type: string
err: err:
readOnly: true 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 type: string
line: line:
readOnly: true readOnly: true
description: First line within sent body containing malformed data description: First line within sent body containing malformed data
type: integer type: integer
format: int32 format: int32
required: [code, message, op, err] required:
- code
- message
- op
- err
LineProtocolLengthError: LineProtocolLengthError:
properties: properties:
code: code:
@ -326,4 +395,108 @@ components:
description: Max length in bytes for a body of line-protocol. description: Max length in bytes for a body of line-protocol.
type: integer type: integer
format: int32 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)
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.
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](/influxdb/v2.1/api-guide/api_intro/#authentication).
- [Manage API tokens](/influxdb/v2.1/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):
For examples and more information, see how to [authenticate with a
username and password](/influxdb/v2.1/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.
For examples and more information, see how to [authenticate with a
username and password](/influxdb/v2.1/reference/api/influxdb-1x/).
security:
- TokenAuthentication: []
- BasicAuthentication: []
- QuerystringAuthentication: []
tags:
- name: Authentication
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)
<!-- ReDoc-Inject: <security-definitions> -->
x-traitTag: true
- Query
- Write
x-tagGroups:
- name: Overview
tags:
- Authentication
- name: Data I/O endpoints
tags:
- Write
- Query
- name: All endpoints
tags:
- Query
- Write

View File

@ -794,6 +794,19 @@ components:
type: array type: array
links: links:
$ref: '#/components/schemas/Links' $ref: '#/components/schemas/Links'
ColorMapping:
additionalProperties:
type: int
description: >-
A color mapping is an object that maps time series data to a UI color
scheme to allow the UI to render graphs consistent colors across
reloads.
example:
configcat_deployments-autopromotionblocker: 0
measurement_birdmigration_europe: 0
series_id_1: 0
series_id_2: 1
type: object
ConditionalExpression: ConditionalExpression:
description: >- description: >-
Selects one of two expressions, `Alternate` or `Consequent`, depending Selects one of two expressions, `Alternate` or `Consequent`, depending
@ -4440,6 +4453,39 @@ components:
type: type:
type: string type: string
type: object type: object
TelegrafPluginRequest:
properties:
config:
type: string
description:
type: string
metadata:
properties:
buckets:
items:
type: string
type: array
type: object
name:
type: string
orgID:
type: string
plugins:
items:
properties:
alias:
type: string
config:
type: string
description:
type: string
name:
type: string
type:
type: string
type: object
type: array
type: object
TelegrafPlugins: TelegrafPlugins:
properties: properties:
os: os:
@ -5717,6 +5763,9 @@ components:
properties: properties:
axes: axes:
$ref: '#/components/schemas/Axes' $ref: '#/components/schemas/Axes'
colorMapping:
$ref: '#/components/schemas/ColorMapping'
description: An object that contains information about the color mapping
colors: colors:
description: Colors define color encoding of data into a visualization description: Colors define color encoding of data into a visualization
items: items:
@ -5810,123 +5859,49 @@ components:
securitySchemes: securitySchemes:
BasicAuthentication: BasicAuthentication:
description: > description: >
### Basic authentication scheme Use the HTTP Basic authentication scheme for InfluxDB `/api/v2` API
operations that support it.
Use HTTP Basic Auth with clients that support the InfluxDB 1.x
convention of username and password (that don't support the
`Authorization: Token` scheme).
Username and password schemes require the following credentials: Username and password schemes require the following credentials:
- **username**: 1.x username (this is separate from the UI login username) - **username**
- **password**: 1.x password or InfluxDB API token - **password**
#### API token example
`curl --get "http://localhost:8086/query"
--user "1.x_USERNAME":"INFLUX_API_TOKEN"`
#### 1.x password example
`curl --get "http://localhost:8086/query"
--user "1.x_USERNAME":"1.x_PASSWORD"`
Replace the following:
- *`1.x_USERNAME`*: your InfluxDB v1.x username
- *`1.x_PASSWORD`*: your InfluxDB v1.x password
- *`INFLUX_API_TOKEN`*: your [InfluxDB API
token](https://docs.influxdata.com/influxdb/v2.1/reference/glossary/#token)
For more information and examples, see how to [authenticate with a
username and password
scheme](https://docs.influxdata.com/influxdb/v2.1/reference/api/influxdb-1x/)
scheme: basic scheme: basic
type: http type: http
QuerystringAuthentication:
description: >
### Querystring authentication scheme
Use InfluxDB 1.x API parameters to provide credentials through the query
string.
Username and password schemes require the following credentials:
- **username**: 1.x username (this is separate from the UI login username)
- **password**: 1.x password or InfluxDB API token
#### API token example
`curl --get "http://localhost:8086/query"
--data-urlencode "u=1.x_USERNAME"
--data-urlencode "p=INFLUX_API_TOKEN"`
#### 1.x password example
`curl --get "http://localhost:8086/query"
--data-urlencode "u=1.x_USERNAME"
--data-urlencode "p=1.x_PASSWORD"`
Replace the following:
- *`1.x_USERNAME`*: your InfluxDB v1.x username
- *`1.x_PASSWORD`*: your InfluxDB v1.x password
- *`INFLUX_API_TOKEN`*: your [InfluxDB API
token](https://docs.influxdata.com/influxdb/v2.1/reference/glossary/#token)
For more information and examples, see how to [authenticate with a
username and password
scheme](https://docs.influxdata.com/influxdb/v2.1/reference/api/influxdb-1x/)
in: query
name: u=&p=
type: apiKey
TokenAuthentication: TokenAuthentication:
bearerFormat: InfluxDB Token String
description: > description: >
### Token authentication scheme Use the [Token
authentication](#section/Authentication/TokenAuthentication)
scheme to authenticate to the InfluxDB API.
InfluxDB API tokens enable authentication and authorization of API
clients.
A token belongs to an organization and identifies InfluxDB permissions In your API requests, send an `Authorization` header.
within the organization.
For the header value, provide the word `Token` followed by a space and
an InfluxDB API token.
The word `Token` is case-sensitive.
Include your API token in an `Authorization: Token` HTTP header with
each request. ### Syntax
#### Example `Authorization: Token YOUR_INFLUX_TOKEN`
`curl http://localhost:8086/ping
--header "Authorization: Token INFLUX_API_TOKEN"`
Replace *`INFLUX_API_TOKEN`* with your [InfluxDB API
token](https://docs.influxdata.com/influxdb/v2.1/reference/glossary/#token).
For more information and examples, see the following: For more information and examples, see the following:
- [`/authorizations`](#tag/Authorizations) endpoint. - [`/authorizations`](#tag/Authorizations) endpoint.
- [Authorize API requests](https://docs.influxdata.com/influxdb/v2.1/api-guide/api_intro/#authentication). - [Authorize API requests](/influxdb/v2.1/api-guide/api_intro/#authentication).
- [Manage API tokens](https://docs.influxdata.com/influxdb/v2.1/security/tokens). - [Manage API tokens](/influxdb/v2.1/security/tokens/).
- [Assign a token to a specific user](https://docs.influxdata.com/influxdb/v2.1/security/tokens/create-token). in: header
scheme: token name: Authorization
type: http type: apiKey
info: info:
title: Influx OSS API Service title: InfluxDB OSS API Service
description: > description: >
The InfluxDB v2 API provides a programmatic interface for all interactions The InfluxDB v2 API provides a programmatic interface for all interactions
with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
@ -11812,7 +11787,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/TelegrafRequest' $ref: '#/components/schemas/TelegrafPluginRequest'
description: Telegraf configuration to create description: Telegraf configuration to create
required: true required: true
responses: responses:
@ -11916,7 +11891,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/TelegrafRequest' $ref: '#/components/schemas/TelegrafPluginRequest'
description: Telegraf configuration update to apply description: Telegraf configuration update to apply
required: true required: true
responses: responses:
@ -12974,20 +12949,16 @@ paths:
- Write - Write
security: security:
- TokenAuthentication: [] - TokenAuthentication: []
- BasicAuthentication: []
- QuerystringAuthentication: []
servers: servers:
- url: / - url: /
tags: tags:
- description: > - description: |
Use one of the following schemes to authenticate to the InfluxDB API: The InfluxDB `/api/v2` API requires authentication for all requests.
Use InfluxDB API tokens to authenticate requests to the `/api/v2` API.
- [Token authentication](#section/Authentication/TokenAuthentication)
- [Basic authentication](#section/Authentication/BasicAuthentication) For examples and more information, see
[Token authentication](#section/Authentication/TokenAuthentication)
- [Querystring
authentication](#section/Authentication/QuerystringAuthentication)
<!-- ReDoc-Inject: <security-definitions> --> <!-- ReDoc-Inject: <security-definitions> -->
name: Authentication name: Authentication
@ -13000,9 +12971,9 @@ tags:
For more information and examples, see the following: For more information and examples, see the following:
- [Authorize API requests](https://docs.influxdata.com/influxdb/v2.1/api-guide/api_intro/#authentication). - [Authorize API requests](/influxdb/v2.1/api-guide/api_intro/#authentication).
- [Manage API tokens](https://docs.influxdata.com/influxdb/v2.1/security/tokens). - [Manage API tokens](/influxdb/v2.1/security/tokens/).
- [Assign a token to a specific user](https://docs.influxdata.com/influxdb/v2.1/security/tokens/create-token). - [Assign a token to a specific user](/influxdb/v2.1/security/tokens/create-token).
name: Authorizations name: Authorizations
- Backup - Backup
- Buckets - Buckets
@ -13022,16 +12993,14 @@ tags:
Retrieve data, analyze queries, and get query suggestions. Retrieve data, analyze queries, and get query suggestions.
name: Query name: Query
- description: > - description: >
See the [**API Quick See the [**API Quick Start**](/influxdb/v2.1/api-guide/api_intro/) to get
Start**](https://docs.influxdata.com/influxdb/v2.1/api-guide/api_intro/) up and running authenticating with tokens, writing to buckets, and
to get up and running authenticating with tokens, writing to buckets, and
querying data. querying data.
[**InfluxDB API client [**InfluxDB API client
libraries**](https://docs.influxdata.com/influxdb/v2.1/api-guide/client-libraries/) libraries**](/influxdb/v2.1/api-guide/client-libraries/) are available for
are available for popular languages and ready to import into your popular languages and ready to import into your application.
application.
name: Quick start name: Quick start
x-traitTag: true x-traitTag: true
- Ready - Ready
@ -13066,8 +13035,8 @@ tags:
following: <li>`Authorization: Token` header is missing or following: <li>`Authorization: Token` header is missing or
malformed</li><li>API token value is missing from the header</li><li>API malformed</li><li>API token value is missing from the header</li><li>API
token does not have permission. For more information about token types and token does not have permission. For more information about token types and
permissions, see [Manage API permissions, see [Manage API tokens](/influxdb/v2.1/security/tokens/)</li>
tokens](https://docs.influxdata.com/influxdb/v2.1/security/tokens/)</li> | |
| `404` | Not found | Requested resource was not | `404` | Not found | Requested resource was not
found. `message` in the response body provides details about the requested found. `message` in the response body provides details about the requested

View File

@ -1,18 +1,24 @@
# this is a manually maintained file for these old routes until oats#15 is resolved openapi: 3.0.0
openapi: "3.0.0"
info: info:
title: Influx API Service (V1 compatible endpoints) title: InfluxDB OSS v1 compatibility API documentation
version: 0.1.0 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.
If you want to use the latest InfluxDB `/api/v2` API instead,
see the [InfluxDB v2 API documentation](/influxdb/v2.1/api/).
servers: servers:
- url: / - url: /
description: V1 compatible api endpoints.
paths: paths:
/write: /write:
post: # technically this functions with other methods as well post:
operationId: PostWriteV1 operationId: PostWriteV1
tags: tags:
- Write - Write
summary: Write time series data into InfluxDB in a V1 compatible format summary: Write time series data into InfluxDB in a V1-compatible format
requestBody: requestBody:
description: Line protocol body description: Line protocol body
required: true required: true
@ -21,15 +27,17 @@ paths:
schema: schema:
type: string type: string
parameters: parameters:
- $ref: "#/components/parameters/TraceSpan" - $ref: '#/components/parameters/TraceSpan'
- $ref: "#/components/parameters/AuthUserV1" - $ref: '#/components/parameters/AuthUserV1'
- $ref: "#/components/parameters/AuthPassV1" - $ref: '#/components/parameters/AuthPassV1'
- in: query - in: query
name: db name: db
schema: schema:
type: string type: string
required: true required: true
description: The bucket to write to. If none exist a bucket will be created with a default 3 day retention policy. description: >-
The bucket to write to. If none exist a bucket will be created with
a default 3 day retention policy.
- in: query - in: query
name: rp name: rp
schema: schema:
@ -42,54 +50,76 @@ paths:
description: Write precision. description: Write precision.
- in: header - in: header
name: Content-Encoding 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: schema:
type: string 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 default: identity
enum: enum:
- gzip - gzip
- identity - identity
responses: responses:
"204": '204':
description: Write data is correctly formatted and accepted for writing to the bucket. description: >-
"400": Write data is correctly formatted and accepted for writing to the
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. 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: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/LineProtocolError" $ref: '#/components/schemas/LineProtocolError'
"401": '401':
description: Token does not have sufficient permissions to write to this organization and bucket or the organization and bucket do not exist. description: >-
Token does not have sufficient permissions to write to this
organization and bucket or the organization and bucket do not exist.
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
"403": '403':
description: No token was sent and they are required. description: No token was sent and they are required.
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
"413": '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. 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: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/LineProtocolLengthError" $ref: '#/components/schemas/LineProtocolLengthError'
"429": '429':
description: Token is temporarily over quota. The Retry-After header describes when to try the write again. description: >-
Token is temporarily over quota. The Retry-After header describes
when to try the write again.
headers: headers:
Retry-After: 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: schema:
type: integer type: integer
format: int32 format: int32
"503": '503':
description: Server is temporarily unavailable to accept writes. The Retry-After header describes when to try the write again. description: >-
Server is temporarily unavailable to accept writes. The Retry-After
header describes when to try the write again.
headers: headers:
Retry-After: 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: schema:
type: integer type: integer
format: int32 format: int32
@ -98,9 +128,9 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
/query: /query:
post: # technically this functions with other methods as well post:
operationId: PostQueryV1 operationId: PostQueryV1
tags: tags:
- Query - Query
@ -108,18 +138,21 @@ paths:
requestBody: requestBody:
description: InfluxQL query to execute. description: InfluxQL query to execute.
content: content:
text/plain: # although this should be `application/vnd.influxql`, oats breaks so we define the content-type header parameter text/plain:
schema: schema:
type: string type: string
parameters: parameters:
- $ref: "#/components/parameters/TraceSpan" - $ref: '#/components/parameters/TraceSpan'
- $ref: "#/components/parameters/AuthUserV1" - $ref: '#/components/parameters/AuthUserV1'
- $ref: "#/components/parameters/AuthPassV1" - $ref: '#/components/parameters/AuthPassV1'
- in: header - in: header
name: Accept name: Accept
schema: schema:
type: string 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 default: application/json
enum: enum:
- application/json - application/json
@ -128,10 +161,15 @@ paths:
- application/x-msgpack - application/x-msgpack
- in: header - in: header
name: Accept-Encoding 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: schema:
type: string 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 default: identity
enum: enum:
- gzip - gzip
@ -142,48 +180,70 @@ paths:
type: string type: string
enum: enum:
- application/vnd.influxql - application/vnd.influxql
- in: query
name: db
schema:
type: string
required: true
description: The bucket to query.
- in: query
name: rp
schema:
type: string
description: The retention policy name.
- in: query - in: query
name: q name: q
description: Defines the influxql query to run. description: Defines the influxql query to run.
schema: schema:
type: string type: string
responses: responses:
"200": '200':
description: Query results description: Query results
headers: headers:
Content-Encoding: 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: schema:
type: string 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 default: identity
enum: enum:
- gzip - gzip
- identity - identity
Trace-Id: 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: schema:
type: string type: string
description: Specifies the request's trace ID. description: Specifies the request's trace ID.
content: content:
application/csv: application/csv:
schema: schema:
$ref: "#/components/schemas/InfluxQLCSVResponse" $ref: '#/components/schemas/InfluxQLCSVResponse'
text/csv: text/csv:
schema: schema:
$ref: "#/components/schemas/InfluxQLCSVResponse" $ref: '#/components/schemas/InfluxQLCSVResponse'
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/InfluxQLResponse" $ref: '#/components/schemas/InfluxQLResponse'
application/x-msgpack: application/x-msgpack:
schema: schema:
type: string type: string
format: binary format: binary
"429": '429':
description: Token is temporarily over quota. The Retry-After header describes when to try the read again. description: >-
Token is temporarily over quota. The Retry-After header describes
when to try the read again.
headers: headers:
Retry-After: 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: schema:
type: integer type: integer
format: int32 format: int32
@ -192,7 +252,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
components: components:
parameters: parameters:
TraceSpan: TraceSpan:
@ -200,8 +260,8 @@ components:
name: Zap-Trace-Span name: Zap-Trace-Span
description: OpenTracing span context description: OpenTracing span context
example: example:
trace_id: "1" trace_id: '1'
span_id: "1" span_id: '1'
baggage: baggage:
key: value key: value
required: false required: false
@ -260,7 +320,6 @@ components:
description: Code is the machine-readable error code. description: Code is the machine-readable error code.
readOnly: true readOnly: true
type: string type: string
# This set of enumerations must remain in sync with the constants defined in errors.go
enum: enum:
- internal error - internal error
- not found - not found
@ -277,7 +336,9 @@ components:
readOnly: true readOnly: true
description: Message is a human-readable message. description: Message is a human-readable message.
type: string type: string
required: [code, message] required:
- code
- message
LineProtocolError: LineProtocolError:
properties: properties:
code: code:
@ -297,18 +358,26 @@ components:
type: string type: string
op: op:
readOnly: true 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 type: string
err: err:
readOnly: true 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 type: string
line: line:
readOnly: true readOnly: true
description: First line within sent body containing malformed data description: First line within sent body containing malformed data
type: integer type: integer
format: int32 format: int32
required: [code, message, op, err] required:
- code
- message
- op
- err
LineProtocolLengthError: LineProtocolLengthError:
properties: properties:
code: code:
@ -326,4 +395,108 @@ components:
description: Max length in bytes for a body of line-protocol. description: Max length in bytes for a body of line-protocol.
type: integer type: integer
format: int32 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)
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.
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](/influxdb/v2.1/api-guide/api_intro/#authentication).
- [Manage API tokens](/influxdb/v2.1/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):
For examples and more information, see how to [authenticate with a
username and password](/influxdb/v2.1/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.
For examples and more information, see how to [authenticate with a
username and password](/influxdb/v2.1/reference/api/influxdb-1x/).
security:
- TokenAuthentication: []
- BasicAuthentication: []
- QuerystringAuthentication: []
tags:
- name: Authentication
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)
<!-- ReDoc-Inject: <security-definitions> -->
x-traitTag: true
- Query
- Write
x-tagGroups:
- name: Overview
tags:
- Authentication
- name: Data I/O endpoints
tags:
- Write
- Query
- name: All endpoints
tags:
- Query
- Write