feat(v3): Restructure API docs for v3 (#5408)

* v3 management API
Fixes #5397

- Adds an API reference doc for the  HTTP management API openapi spec (https://github.com/influxdata/granite/blob/main/openapi.yaml) (Cloud Dedicated only)
- Doesn't fetch changes for any specs except for the Management spec.
- Adds summaries and fixes descriptions in spec overrides.
- Removes versions in spec overrides.
- Adds configuration for generating API reference docs, Hugo frontmatter, setting the default API (for the [product]/api/ URL)
- Restructures `/api-docs` to better allow for multiple APIs (and customizations) per product
- Adds `[product]/api/v2/` docs URL for cloud products (currently set as the "default" API, `[product]/api`)
- Refactors `generate-api-docs` to remove specific conditions and use the new directory structure.
- Redocly update fixes some theme formatting issues

- Tested the following URLs:

   - http://localhost:1313/influxdb/v2/api/
   - http://localhost:1313/influxdb/v2/api/v1-compatibility/
   - http://localhost:1313/influxdb/cloud/api/
   - http://localhost:1313/influxdb/cloud/api/v2/
   - http://localhost:1313/influxdb/cloud-dedicated/api/
   - http://localhost:1313/influxdb/cloud-dedicated/api/v2/
   - http://localhost:1313/influxdb/cloud/api/v1-compatibility/
   - http://localhost:1313/influxdb/cloud-dedicated/api/v1-compatibility/
   - http://localhost:1313/influxdb/cloud-serverless/
   - http://localhost:1313/influxdb/cloud-serverless/api/v2/
   - http://localhost:1313/influxdb/cloud-serverless/api/v1-compatibility/
   - http://localhost:1313/influxdb/clustered/api/
   - http://localhost:1313/influxdb/clustered/api/v2/
   - http://localhost:1313/influxdb/clustered/api/v1-compatibility/

* fix(v3): Remove Management API from menu

* Update api-docs/cloud-dedicated/v2/content/info.yml

* show management api in nav, update nav names

---------

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>
Co-authored-by: Scott Anderson <scott@influxdata.com>
pull/5416/head
Jason Stirnaman 2024-04-09 18:02:12 -05:00 committed by GitHub
parent 35ba19d3cb
commit ac4b1c53c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
53 changed files with 26143 additions and 22689 deletions

2
.gitignore vendored
View File

@ -6,7 +6,7 @@ node_modules
*.log
/resources
.hugo_build.lock
/content/influxdb/*/api/*.html
/content/influxdb/*/api/**/*.html
/api-docs/redoc-static.html*
.vscode/*
.idea

View File

@ -0,0 +1,15 @@
plugins:
- '../openapi/plugins/docs-plugin.js'
extends:
- recommended
- docs/all
x-influxdata-product-name: InfluxDB v3 Cloud Dedicated
apis:
management@0:
root: management/openapi.yml
v2@2:
root: v2/ref.yml
x-influxdata-default: true
v1-compatibility@2:
root: v1-compatibility/swaggerV1Compat.yml

View File

@ -1,7 +0,0 @@
title: InfluxDB Cloud Dedicated API Service
description: |
The InfluxDB HTTP API provides a programmatic interface for interacting with InfluxDB.
version: InfluxDB v3.0
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'

View File

@ -0,0 +1,11 @@
title: InfluxDB Cloud Dedicated Management API
summary: |
The Management API for InfluxDB Cloud Dedicated provides a programmatic interface for managing an InfluxDB Cloud Dedicated instance.
description: |
The InfluxDB v3 Management API lets you manage an InfluxDB Cloud Dedicated instance and integrate functions such as creating and managing databases, permissions, and tokens into your workflow or application.
This documentation is generated from the
InfluxDB OpenAPI specification.
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'

View File

@ -0,0 +1,8 @@
- url: 'https://{baseurl}/api/v0'
description: InfluxDB Cloud Dedicated Management API URL
variables:
baseurl:
enum:
- 'console.influxdata.com'
default: 'console.influxdata.com'
description: InfluxDB Cloud Dedicated Console URL

View File

@ -0,0 +1,6 @@
- name: Using the Management API
tags:
- Authentication
- Examples
- name: All endpoints
tags: []

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
title: InfluxDB v1 HTTP API for InfluxDB Cloud Dedicated
summary: The InfluxDB v1 HTTP API provides v1 compatibility for writing and querying data in an InfluxDB v3 Cloud Dedicated database.
description: |
The InfluxDB 1.x `/write` and `/query` endpoints work with InfluxDB 1.x client libraries and third-party integrations like Grafana and others.
This documentation is generated from the
[InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/swaggerV1Compat.yml).
#### Related
[InfluxDB `/api/v2` API for InfluxDB Cloud Dedicated](/influxdb/cloud-dedicated/api/v2/)
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'

View File

@ -0,0 +1,434 @@
openapi: 3.0.0
info:
title: InfluxDB v1 HTTP API for InfluxDB Cloud Dedicated
version: ''
description: |
The InfluxDB 1.x `/write` and `/query` endpoints work with InfluxDB 1.x client libraries and third-party integrations like Grafana and others.
This documentation is generated from the
[InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/swaggerV1Compat.yml).
#### Related
[InfluxDB `/api/v2` API for InfluxDB Cloud Dedicated](/influxdb/cloud-dedicated/api/v2/)
license:
name: MIT
url: https://opensource.org/licenses/MIT
summary: The InfluxDB v1 HTTP API provides v1 compatibility for writing and querying data in an InfluxDB v3 Cloud Dedicated database.
servers:
- url: /
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
- name: Query
- name: Write
paths:
/write:
post:
operationId: PostWriteV1
tags:
- Write
summary: Write time series data into InfluxDB in a V1-compatible format
requestBody:
description: Line protocol body
required: true
content:
text/plain:
schema:
type: string
parameters:
- $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.
- in: query
name: rp
schema:
type: string
description: Retention policy name.
- in: query
name: precision
schema:
type: string
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.
schema:
type: string
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.
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.
content:
application/json:
schema:
$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.
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.
headers:
Retry-After:
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.
headers:
Retry-After:
description: A non-negative decimal integer indicating the seconds to delay after the response is received.
schema:
type: integer
format: int32
default:
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/query:
post:
operationId: PostQueryV1
tags:
- Query
summary: Query InfluxDB in a V1 compatible format
requestBody:
description: InfluxQL query to execute.
content:
text/plain:
schema:
type: string
parameters:
- $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.
default: application/json
enum:
- application/json
- application/csv
- text/csv
- 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.
schema:
type: string
description: Specifies that the query response in the body should be encoded with gzip or not encoded with identity.
default: identity
enum:
- gzip
- identity
- in: header
name: Content-Type
schema:
type: string
enum:
- 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
name: q
description: Defines the influxql query to run.
schema:
type: string
responses:
'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
schema:
type: string
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.
schema:
type: string
description: Specifies the request's trace ID.
content:
application/csv:
schema:
$ref: '#/components/schemas/InfluxQLCSVResponse'
text/csv:
schema:
$ref: '#/components/schemas/InfluxQLCSVResponse'
application/json:
schema:
$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.
headers:
Retry-After:
description: A non-negative decimal integer indicating the seconds to delay after the response is received.
schema:
type: integer
format: int32
default:
description: Error processing query
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
parameters:
TraceSpan:
in: header
name: Zap-Trace-Span
description: OpenTracing span context
example:
trace_id: '1'
span_id: '1'
baggage:
key: value
required: false
schema:
type: string
AuthUserV1:
in: query
name: u
required: false
schema:
type: string
description: Username.
AuthPassV1:
in: query
name: p
required: false
schema:
type: string
description: User token.
schemas:
InfluxQLResponse:
properties:
results:
type: array
oneOf:
- required:
- statement_id
- error
- required:
- statement_id
- series
items:
type: object
properties:
statement_id:
type: integer
error:
type: string
series:
type: array
items:
type: object
properties:
name:
type: string
tags:
type: object
additionalProperties:
type: string
partial:
type: boolean
columns:
type: array
items:
type: string
values:
type: array
items:
type: array
items: {}
InfluxQLCSVResponse:
type: string
example: |
name,tags,time,test_field,test_tag test_measurement,,1603740794286107366,1,tag_value test_measurement,,1603740870053205649,2,tag_value test_measurement,,1603741221085428881,3,tag_value
Error:
properties:
code:
description: Code is the machine-readable error code.
readOnly: true
type: string
enum:
- internal error
- not found
- conflict
- invalid
- unprocessable entity
- empty value
- unavailable
- forbidden
- too many requests
- unauthorized
- method not allowed
message:
readOnly: true
description: Message is a human-readable message.
type: string
required:
- code
- message
LineProtocolError:
properties:
code:
description: Code is the machine-readable error code.
readOnly: true
type: string
enum:
- internal error
- not found
- conflict
- invalid
- empty value
- unavailable
message:
readOnly: true
description: Message is a human-readable message.
type: string
op:
readOnly: true
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.
type: string
line:
readOnly: true
description: First line within sent body containing malformed data
type: integer
format: int32
required:
- code
- message
- op
- err
LineProtocolLengthError:
properties:
code:
description: Code is the machine-readable error code.
readOnly: true
type: string
enum:
- invalid
message:
readOnly: true
description: Message is a human-readable message.
type: string
maxLength:
readOnly: true
description: Max length in bytes for a body of line-protocol.
type: integer
format: int32
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/).

View File

@ -0,0 +1,11 @@
title: InfluxDB v2 HTTP API for InfluxDB Cloud Dedicated
summary: The InfluxDB v2 HTTP API for InfluxDB Cloud Dedicated provides a v2-compatible programmatic interface for writing data stored in an InfluxDB Cloud Dedicated database.
description: |
The InfluxDB v2 HTTP API lets you use `/api/v2` endpoints for managing retention policy mappings and writing data stored in an InfluxDB v3 instance.
This documentation is generated from the
[InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/ref/cloud.yml).
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'

View File

@ -0,0 +1,13 @@
plugins:
- '../openapi/plugins/docs-plugin.js'
extends:
- recommended
- docs/all
x-influxdata-product-name: InfluxDB v3 Serverless
apis:
v2@2:
root: v2/ref.yml
x-influxdata-default: true
v1-compatibility@2:
root: v1-compatibility/swaggerV1Compat.yml

View File

@ -1,7 +0,0 @@
title: InfluxDB Cloud Serverless API Service
description: |
The InfluxDB HTTP API provides a programmatic interface for interacting with InfluxDB.
version: InfluxDB v3.0
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'

View File

@ -0,0 +1,14 @@
title: InfluxDB v1 HTTP API for InfluxDB Cloud Serverless
summary: The InfluxDB v1 HTTP API provides v1 compatibility for writing and querying data in an InfluxDB v3 Cloud Serverless bucket.
description: |
The InfluxDB 1.x `/write` and `/query` endpoints work with InfluxDB 1.x client libraries and third-party integrations like Grafana and others.
This documentation is generated from the
[InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/swaggerV1Compat.yml).
#### Related
[InfluxDB `/api/v2` API for InfluxDB Cloud Serverless](/influxdb/cloud-serverless/api/v2/)
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'

View File

@ -0,0 +1,434 @@
openapi: 3.0.0
info:
title: InfluxDB v1 HTTP API for InfluxDB Cloud Serverless
version: ''
description: |
The InfluxDB 1.x `/write` and `/query` endpoints work with InfluxDB 1.x client libraries and third-party integrations like Grafana and others.
This documentation is generated from the
[InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/swaggerV1Compat.yml).
#### Related
[InfluxDB `/api/v2` API for InfluxDB Cloud Serverless](/influxdb/cloud-serverless/api/v2/)
license:
name: MIT
url: https://opensource.org/licenses/MIT
summary: The InfluxDB v1 HTTP API provides v1 compatibility for writing and querying data in an InfluxDB v3 Cloud Serverless bucket.
servers:
- url: /
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
- name: Query
- name: Write
paths:
/write:
post:
operationId: PostWriteV1
tags:
- Write
summary: Write time series data into InfluxDB in a V1-compatible format
requestBody:
description: Line protocol body
required: true
content:
text/plain:
schema:
type: string
parameters:
- $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.
- in: query
name: rp
schema:
type: string
description: Retention policy name.
- in: query
name: precision
schema:
type: string
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.
schema:
type: string
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.
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.
content:
application/json:
schema:
$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.
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.
headers:
Retry-After:
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.
headers:
Retry-After:
description: A non-negative decimal integer indicating the seconds to delay after the response is received.
schema:
type: integer
format: int32
default:
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/query:
post:
operationId: PostQueryV1
tags:
- Query
summary: Query InfluxDB in a V1 compatible format
requestBody:
description: InfluxQL query to execute.
content:
text/plain:
schema:
type: string
parameters:
- $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.
default: application/json
enum:
- application/json
- application/csv
- text/csv
- 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.
schema:
type: string
description: Specifies that the query response in the body should be encoded with gzip or not encoded with identity.
default: identity
enum:
- gzip
- identity
- in: header
name: Content-Type
schema:
type: string
enum:
- 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
name: q
description: Defines the influxql query to run.
schema:
type: string
responses:
'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
schema:
type: string
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.
schema:
type: string
description: Specifies the request's trace ID.
content:
application/csv:
schema:
$ref: '#/components/schemas/InfluxQLCSVResponse'
text/csv:
schema:
$ref: '#/components/schemas/InfluxQLCSVResponse'
application/json:
schema:
$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.
headers:
Retry-After:
description: A non-negative decimal integer indicating the seconds to delay after the response is received.
schema:
type: integer
format: int32
default:
description: Error processing query
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
parameters:
TraceSpan:
in: header
name: Zap-Trace-Span
description: OpenTracing span context
example:
trace_id: '1'
span_id: '1'
baggage:
key: value
required: false
schema:
type: string
AuthUserV1:
in: query
name: u
required: false
schema:
type: string
description: Username.
AuthPassV1:
in: query
name: p
required: false
schema:
type: string
description: User token.
schemas:
InfluxQLResponse:
properties:
results:
type: array
oneOf:
- required:
- statement_id
- error
- required:
- statement_id
- series
items:
type: object
properties:
statement_id:
type: integer
error:
type: string
series:
type: array
items:
type: object
properties:
name:
type: string
tags:
type: object
additionalProperties:
type: string
partial:
type: boolean
columns:
type: array
items:
type: string
values:
type: array
items:
type: array
items: {}
InfluxQLCSVResponse:
type: string
example: |
name,tags,time,test_field,test_tag test_measurement,,1603740794286107366,1,tag_value test_measurement,,1603740870053205649,2,tag_value test_measurement,,1603741221085428881,3,tag_value
Error:
properties:
code:
description: Code is the machine-readable error code.
readOnly: true
type: string
enum:
- internal error
- not found
- conflict
- invalid
- unprocessable entity
- empty value
- unavailable
- forbidden
- too many requests
- unauthorized
- method not allowed
message:
readOnly: true
description: Message is a human-readable message.
type: string
required:
- code
- message
LineProtocolError:
properties:
code:
description: Code is the machine-readable error code.
readOnly: true
type: string
enum:
- internal error
- not found
- conflict
- invalid
- empty value
- unavailable
message:
readOnly: true
description: Message is a human-readable message.
type: string
op:
readOnly: true
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.
type: string
line:
readOnly: true
description: First line within sent body containing malformed data
type: integer
format: int32
required:
- code
- message
- op
- err
LineProtocolLengthError:
properties:
code:
description: Code is the machine-readable error code.
readOnly: true
type: string
enum:
- invalid
message:
readOnly: true
description: Message is a human-readable message.
type: string
maxLength:
readOnly: true
description: Max length in bytes for a body of line-protocol.
type: integer
format: int32
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/).

View File

@ -0,0 +1,11 @@
title: InfluxDB Cloud Serverless API Service
summary: |
The InfluxDB v2 HTTP API for InfluxDB Cloud Serverless provides a programmatic interface for writing data stored in an InfluxDB Cloud Serverless bucket.
description: |
The InfluxDB v2 HTTP API lets you use `/api/v2` endpoints for managing retention policy mappings and writing data stored in an InfluxDB v3 instance.
This documentation is generated from the
[InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/ref/cloud.yml).
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'

View File

@ -0,0 +1,13 @@
plugins:
- '../openapi/plugins/docs-plugin.js'
extends:
- recommended
- docs/all
x-influxdata-product-name: InfluxDB v2 Cloud
apis:
v2@2:
root: v2/ref.yml
x-influxdata-default: true
v1-compatibility@2:
root: v1-compatibility/swaggerV1Compat.yml

View File

@ -1,11 +0,0 @@
title: InfluxDB Cloud API Service
description: |
The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB.
Access the InfluxDB API using the `/api/v2/` endpoint.
This documentation is generated from the
[InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/ref/cloud.yml).
version: Cloud 2.x
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'

View File

@ -0,0 +1,10 @@
title: InfluxDB v1 HTTP API for InfluxDB Cloud
summary: The InfluxDB v1 compatibility API provides a programmatic interface for interactions with InfluxDB Cloud using InfluxDB v1-compatible endpoints.
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.
This documentation is generated from the
[InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/swaggerV1Compat.yml).
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'

View File

@ -1,19 +1,38 @@
openapi: 3.0.0
info:
title: InfluxDB Cloud v1 compatibility API documentation
version: 0.1.0
title: InfluxDB v1 HTTP API for InfluxDB Cloud
version: ''
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/).
This documentation is generated from the
[InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/swaggerV1Compat.yml).
license:
name: MIT
url: https://opensource.org/licenses/MIT
summary: The InfluxDB v1 compatibility API provides a programmatic interface for interactions with InfluxDB Cloud using InfluxDB v1-compatible endpoints.
servers:
- url: /
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
- name: Query
- name: Write
paths:
/write:
post:
@ -409,23 +428,3 @@ components:
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
- name: Query
- name: Write

View File

@ -0,0 +1,11 @@
title: InfluxDB Cloud API Service
summary: The InfluxDB v2 HTTP API provides a programmatic interface for all interactions with InfluxDB v2.
description: |
The InfluxDB v2 HTTP API provides a programmatic interface for all interactions with InfluxDB v2. Access the InfluxDB API using `/api/v2/` and InfluxDB v1-compatible endpoints.
This documentation is generated from the
[InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/ref/cloud.yml).
version: 2.x
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
plugins:
- '../openapi/plugins/docs-plugin.js'
extends:
- recommended
- docs/all
x-influxdata-product-name: InfluxDB v3 Clustered
apis:
v2@2:
root: v2/ref.yml
x-influxdata-default: true
v1-compatibility@2:
root: v1-compatibility/swaggerV1Compat.yml

View File

@ -1,7 +0,0 @@
title: InfluxDB Clustered API Service
description: |
The InfluxDB HTTP API provides a programmatic interface for interacting with InfluxDB.
version: InfluxDB v3.0
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'

View File

@ -0,0 +1,14 @@
title: InfluxDB v1 HTTP API for InfluxDB Clustered
summary: The InfluxDB v1 HTTP API provides v1 compatibility for writing and querying data in an InfluxDB v3 Clustered database.
description: |
The InfluxDB 1.x `/write` and `/query` endpoints work with InfluxDB 1.x client libraries and third-party integrations like Grafana and others.
This documentation is generated from the
[InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/swaggerV1Compat.yml).
#### Related
[InfluxDB `/api/v2` API for InfluxDB Clustered](/influxdb/clustered/api/v2/)
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'

View File

@ -1,19 +1,42 @@
openapi: 3.0.0
info:
title: InfluxDB OSS v1 compatibility API documentation
version: 2.6.0 v1 compatibility
title: InfluxDB v1 HTTP API for InfluxDB Clustered
version: ''
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/latest/api/).
The InfluxDB 1.x `/write` and `/query` endpoints work with InfluxDB 1.x client libraries and third-party integrations like Grafana and others.
This documentation is generated from the
[InfluxDB OpenAPI specification](https://github.com/influxdata/openapi/blob/influxdb-oss-v2.7.0/contracts/swaggerV1Compat.yml).
[InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/swaggerV1Compat.yml).
#### Related
[InfluxDB `/api/v2` API for InfluxDB Clustered](/influxdb/clustered/api/v2/)
license:
name: MIT
url: https://opensource.org/licenses/MIT
summary: The InfluxDB v1 HTTP API provides v1 compatibility for writing and querying data in an InfluxDB v3 Clustered database.
servers:
- url: /
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
- name: Query
- name: Write
paths:
/write:
post:
@ -409,23 +432,3 @@ components:
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
- name: Query
- name: Write

View File

@ -0,0 +1,10 @@
title: InfluxDB Clustered API Service
summary: The InfluxDB v2 HTTP API for InfluxDB Clustered provides a v2-compatible programmatic interface for writing data stored in an InfluxDB Clustered database.
description: |
The InfluxDB v2 HTTP API lets you use `/api/v2` endpoints for managing retention policy mappings and writing data stored in an InfluxDB v3 instance.
This documentation is generated from the
[InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/ref/cloud.yml).
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'

File diff suppressed because it is too large Load Diff

View File

@ -2,53 +2,6 @@
set -e
function buildHugoTemplate {
version=$1
apiVersion=$2
outFilename=$3
V_LEN_INIT=$(wc -c $version$outFilename.tmp | awk '{print $1}')
cat "redoc-static${outFilename}.html" >> $version$outFilename.tmp
V_LEN=$(wc -c $version$outFilename.tmp | awk '{print $1}')
if ! [[ $V_LEN -gt $V_LEN_INIT ]]
then
echo "Error: bundle was not appended to $version$outFilename.tmp"
exit $?
fi
rm -f "redoc-static${outFilename}.html"
mkdir -p ../content/influxdb/$version/api
mv $version$outFilename.tmp ../content/influxdb/$version/api/$outFilename.html
}
function generateHtml {
filePath=$1
outFilename=$2
titleVersion=$3
titleSubmodule=$4
echo "Bundling $filePath"
npx --version
# Use npx to install and run the specified version of redoc-cli.
# npm_config_yes=true npx overrides the prompt
# and (vs. npx --yes) is compatible with npm@6 and npm@7.
npm_config_yes=true npx redoc-cli@0.12.3 bundle $filePath \
-t template.hbs \
--title="InfluxDB $titleVersion$titleSubmodule API documentation" \
--options.sortPropsAlphabetically \
--options.menuToggle \
--options.hideDownloadButton \
--options.hideHostname \
--options.noAutoAuth \
--templateOptions.version="$version" \
--templateOptions.titleVersion="$titleVersion" \
--templateOptions.titleSubmodule="$titleSubmodule" \
--output="redoc-static$outFilename.html"
}
function showHelp {
echo "Usage: generate.sh <options>"
echo "Commands:"
@ -82,119 +35,179 @@ while getopts "hc" opt; do
esac
done
# Get list of versions from directory names
versions="$(ls -d -- */ | grep -v 'node_modules' | grep -v 'openapi')"
function generateHtml {
specPath="$1"
product="$2"
productName="$3"
api="$4"
configPath="$5"
isDefault=$6
for version in $versions
do
# Trim the trailing slash off the directory name
version="${version%/}"
# Use the product name to define the menu for the Hugo template
menu="influxdb_$(echo $product | sed 's/\./_/g;s/-/_/g;')"
# Extract the API name--for example, "management" from "management@v2".
apiName=$(echo $api | sed 's/@.*//g;')
# Convert it to title case--for example, "Management".
apiTitle=$(echo $apiName \
| awk '{print toupper(substr($1,1,1)) tolower(substr($1,2))}')
# Extract the API version--for example, "v0" from "management@v0".
version=$(echo $api | sed 's/.*@//g;')
# Use the title and summary defined in the product API's info.yml file.
title=$(yq '.title' $product/$apiName/content/info.yml)
description=$(yq '.summary' $product/$apiName/content/info.yml)
# Define the file name for the Redoc HTML output.
specbundle=redoc-static_index.html
# Define the temporary file for the Hugo template and Redoc HTML.
tmpfile="${product}-${api}_index.tmp"
# Define the menu key
if [[ $version == "cloud-serverless" ]] || [[ $version == "cloud-dedicated" ]] || [[ $version == "clustered" ]]; then
menu="influxdb_$(echo $version | sed 's/\./_/g;s/-/_/g;')"
else
menu="influxdb_$(echo $version | sed 's/\./_/g;')"
fi
echo "Bundling $specPath"
# Define the title text based on the version
if [[ $version == "cloud" ]]; then
titleVersion="Cloud"
elif [[ $version == "cloud-serverless" ]]; then
titleVersion="Cloud Serverless"
elif [[ $version == "cloud-dedicated" ]]; then
titleVersion="Cloud Dedicated"
elif [[ $version == "clustered" ]]; then
titleVersion="Clustered"
else
titleVersion="$version"
fi
# Use npx to install and run the specified version of redoc-cli.
# npm_config_yes=true npx overrides the prompt
# and (vs. npx --yes) is compatible with npm@6 and npm@7.
npx --version && \
npm_config_yes=true npx redoc-cli@0.12.3 bundle $specPath \
--config $configPath \
-t template.hbs \
--title=$title \
--options.sortPropsAlphabetically \
--options.menuToggle \
--options.hideDownloadButton \
--options.hideHostname \
--options.noAutoAuth \
--output=$specbundle \
--templateOptions.description=$description \
--templateOptions.product="$product" \
--templateOptions.productName="$productName"
# Define frontmatter version
if [[ $version == "cloud-serverless" ]] || [[ $version == "cloud-dedicated" ]] || [[ $version == "clustered" ]]; then
frontmatterVersion="v3"
else
frontmatterVersion="v2"
fi
# Generate the frontmatter
v2frontmatter="---
title: InfluxDB $titleVersion API documentation
description: >
The InfluxDB API provides a programmatic interface for interactions with InfluxDB $titleVersion.
if [[ $version == "v1" ]]; then
frontmatter="---
title: $title
description: $description
layout: api
menu:
$menu:
parent: InfluxDB v2 API
name: v2 API docs
weight: 102
---
"
v1compatfrontmatter="---
title: InfluxDB $titleVersion v1 compatibility API documentation
description: >
The InfluxDB v1 compatibility API provides a programmatic interface for interactions with InfluxDB $titleVersion using InfluxDB v1 compatibility endpoints.
layout: api
menu:
$menu:
parent: v1 compatibility
name: View v1 compatibility API docs
parent: $version compatibility
name: View $version compatibility API
weight: 304
---
"
v3frontmatter="---
title: InfluxDB $titleVersion API documentation
description: >
The InfluxDB API provides a programmatic interface for interactions with InfluxDB $titleVersion.
elif [[ $version == "0" ]]; then
echo $productName $apiName
frontmatter="---
title: $title
description: $description
layout: api
weight: 102
menu:
$menu:
parent: InfluxDB HTTP API
name: Management API
---
"
elif [[ $isDefault == true ]]; then
frontmatter="---
title: $title
description: $description
layout: api
menu:
$menu:
parent: InfluxDB HTTP API
name: $apiTitle API
weight: 102
aliases:
- /influxdb/$product/api/
---
"
else
frontmatter="---
title: $title
description: $description
layout: api
menu:
$menu:
parent: InfluxDB HTTP API
name: $apiTitle API
weight: 102
---
"
# If the v2 spec file differs from master, regenerate the HTML.
filePath="${version}/ref.yml"
update=0
if [[ $generate_changed == 0 ]]; then
fileChanged=$(git diff --name-status master -- ${filePath})
if [[ -z "$fileChanged" ]]; then
update=1
fi
fi
if [[ $update -eq 0 ]]; then
outFilename="_index"
titleSubmodule=""
generateHtml $filePath $outFilename $titleVersion $titleSubmodule
# Create the Hugo template file with the frontmatter and Redoc HTML
echo "$frontmatter" >> $tmpfile
V_LEN_INIT=$(wc -c $tmpfile | awk '{print $1}')
cat $specbundle >> $tmpfile
V_LEN=$(wc -c $tmpfile | awk '{print $1}')
# Create temp file with frontmatter and Redoc html
if [[ $frontmatterVersion == "v3" ]]; then
echo "$v3frontmatter" >> $version$outFilename.tmp
else
echo "$v2frontmatter" >> $version$outFilename.tmp
fi
buildHugoTemplate $version v2 $outFilename
if ! [[ $V_LEN -gt $V_LEN_INIT ]]
then
echo "Error: bundle was not appended to $tmpfile"
exit $?
fi
# If the v1 compatibility spec file differs from master, regenerate the HTML.
filePath="${version}/swaggerV1Compat.yml"
update=0
rm -f $specbundle
# Create the directory and move the file.
if [ ! -z "$apiName" ]; then
mkdir -p ../content/influxdb/$product/api/$apiName
mv $tmpfile ../content/influxdb/$product/api/$apiName/_index.html
else
mkdir -p ../content/influxdb/$product/api
mv $tmpfile ../content/influxdb/$product/api/_index.html
fi
}
if [ -e "$filePath" ]; then
function build {
# Get the list of products from directory names
products="$(ls -d -- */ | grep -v 'node_modules' | grep -v 'openapi')"
for product in $products; do
#Trim the trailing slash off the directory name
product="${product%/}"
# Get the product API configuration file.
configPath="$product/.config.yml"
if [ ! -f $configPath ]; then
configPath=".config.yml"
fi
echo "Checking product config $configPath"
# Get the product name from the configuration.
productName=$(yq e '.x-influxdata-product-name' $configPath)
if [[ -z "$productName" ]]; then
productName=InfluxDB
fi
# Get an array of product API names (keys) from the configuration file
apis=$(yq e '.apis | keys | .[]' $configPath)
# Read each element of the apis array
while IFS= read -r api; do
# Get the spec file path from the configuration.
specRootPath=$(yq e ".apis | .$api | .root" $configPath)
# Check that the YAML spec file exists.
specPath="$product/$specRootPath"
echo "Checking for spec $specPath"
if [ -d "$specPath" ] || [ ! -f "$specPath" ]; then
echo "OpenAPI spec $specPath doesn't exist."
fi
# Get default status from the configuration.
isDefault=false
defaultStatus=$(yq e ".apis | .$api | .x-influxdata-default" $configPath)
if [[ $defaultStatus == "true" ]]; then
isDefault=true
fi
# If the spec file differs from master, regenerate the HTML.
update=0
if [[ $generate_changed == 0 ]]; then
fileChanged=$(git diff --name-status master -- ${filePath})
if [[ -z "$fileChanged" ]]; then
update=1
diff=$(git diff --name-status master -- ${specPath})
if [[ -z "$diff" ]]; then
update=1
fi
fi
if [[ $update -eq 0 ]]; then
outFilename="v1-compatibility"
titleSubmodule="v1 compatibility"
generateHtml $filePath $outFilename $titleVersion $titleSubmodule
# Create temp file with frontmatter and Redoc html
echo "$v1compatfrontmatter" >> $version$outFilename.tmp
buildHugoTemplate $version v1 $outFilename
echo "Regenerating $product $api"
generateHtml "$specPath" "$product" "$productName" "$api" "$configPath" $isDefault
fi
fi
done <<< "$apis"
done
}
build

View File

@ -1,9 +1,9 @@
#!/bin/bash -e
# This script provides a simple way grab the latest fully resolved openapi (OAS, OpenAPI Specification) contract files
# from the influxdata/openapi repo.
# Use this script to retrieve the following InfluxData API specifications:
# - the latest, fully resolved openapi (OAS, OpenAPI Specification) contract files from the influxdata/openapi repo
#
# Specify a platform to retrieve (cloud-serverless, cloud-dedicated, clustered, cloud, oss, v1compat, all).
# Specify a product to retrieve (cloud-serverless, cloud-dedicated, clustered, cloud, v2, v1-compatibility, all).
# Optionally specify:
# - an OSS version as the second argument or using the -o flag.
# The version specifies where to write the updated openapi.
@ -15,16 +15,16 @@
# For local development, pass your openapi directory using the file:/// protocol.
# To use the existing ref.yml and prevent fetching any openapi files, use the -B flag.
# Syntax:
# sh ./getswagger.sh <platform>
# sh ./getswagger.sh <platform> -b <baseUrl>
# sh ./getswagger.sh -c <platform> -o <version> -b <baseUrl>
# sh ./getswagger.sh -c <platform> -o <version> -B
# sh ./getswagger.sh <product>
# sh ./getswagger.sh <product> -b <baseUrl>
# sh ./getswagger.sh -c <product> -o <version> -b <baseUrl>
# sh ./getswagger.sh -c <product> -o <version> -B
#
# Examples:
# sh ./getswagger.sh cloud-serverless
# sh ./getswagger.sh clustered -B
# sh ./getswagger.sh cloud
# sh ./getswagger.sh -c oss -o v2.0 -b file:///Users/johnsmith/github/openapi
# sh ./getswagger.sh -c v2 -o v2.0 -b file:///Users/johnsmith/github/openapi
versionDirs=($(ls -d */))
latestOSS=${versionDirs[${#versionDirs[@]}-1]}
@ -36,12 +36,12 @@ baseUrl="https://raw.githubusercontent.com/influxdata/openapi/master"
baseUrlOSS="https://raw.githubusercontent.com/influxdata/openapi/docs-release/influxdb-oss"
ossVersion=${latestOSS%/}
verbose=""
platform=""
product=""
function showHelp {
echo "Usage: ./getswagger.sh <platform>"
echo "Usage: ./getswagger.sh <product>"
echo " With optional arguments:"
echo " ./getswagger.sh <platform> -b <baseUrl> -V"
echo " ./getswagger.sh <product> -b <baseUrl> -V"
echo " ./getswagger.sh cloud"
echo " ./getswagger.sh cloud-dedicated"
echo " ./getswagger.sh cloud-serverless"
@ -62,8 +62,8 @@ function showHelp {
subcommand=$1
case "$subcommand" in
cloud-dedicated|cloud-serverless|clustered|cloud|oss|v1compat|all)
platform=$1
cloud-dedicated-v2|cloud-dedicated-management|cloud-serverless-v2|clustered-v2|cloud-v2|v2|v1-compat|all)
product=$1
shift
while getopts ":o:b:BhV" opt; do
@ -103,7 +103,7 @@ case "$subcommand" in
esac
function showArgs {
echo "platform: $platform";
echo "product: $product";
echo "baseUrl: $baseUrl";
echo "ossVersion: $ossVersion";
}
@ -112,98 +112,120 @@ function postProcess() {
# Use npx to install and run the specified version of openapi-cli.
# npm_config_yes=true npx overrides the prompt
# and (vs. npx --yes) is compatible with npm@6 and npm@7.
specPath=$1
platform="$2"
apiVersion="$3"
specPath="$1"
configPath="$2"
api="$3"
openapiCLI=" @redocly/cli"
currentPath=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
npx --version
# TODO: Move some of this into the plugin:
# Use Redoc's openapi-cli to regenerate the spec with custom decorations.
# If you want to lint the source contract (before bundling),
# pass `--lint` to the `bundle` command.
# If you set environment variables (for example, INFLUXDB_PLATFORM=)
# If you set environment variables (for example, INFLUXDB_PRODUCT=)
# preceding the command name, you can then access the variables
# in the NodeJS process.env global object.
INFLUXDB_API_VERSION=$apiVersion \
INFLUXDB_PLATFORM=$platform \
# INFLUXDB_API_VERSION=$apiVersion \
npx --version
INFLUXDB_PRODUCT=$(dirname "$configPath") \
INFLUXDB_API_NAME=$(echo "$api" | sed 's/@.*//g;') \
API_DOCS_ROOT_PATH=$currentPath \
npm_config_yes=true \
npx $openapiCLI bundle $specPath \
-o $specPath \
--config=./.redocly.yaml
--config=$configPath
}
function updateCloud {
outFile="cloud/ref.yml"
function updateCloudV2 {
outFile="cloud/v2/ref.yml"
if [[ -z "$baseUrl" ]];
then
echo "Using existing $outFile"
else
curl $UPDATE_OPTIONS ${baseUrl}/contracts/ref/cloud.yml -o $outFile
fi
postProcess $outFile cloud
postProcess $outFile 'cloud/.config.yml' v2@2
}
function updateCloudDedicated {
outFile="cloud-dedicated/ref.yml"
function updateCloudDedicatedManagement {
outFile="cloud-dedicated/management/openapi.yml"
if [[ -z "$baseUrl" ]];
then
echo "Using existing $outFile"
else
curl $UPDATE_OPTIONS https://raw.githubusercontent.com/influxdata/granite/3117fb47d5e56afaadcebc226ff4b25785d95b5a/openapi.yaml -o $outFile
fi
postProcess $outFile 'cloud-dedicated/.config.yml' management@0
}
function updateCloudDedicatedV2 {
outFile="cloud-dedicated/v2/ref.yml"
if [[ -z "$baseUrl" ]];
then
echo "Using existing $outFile"
else
curl $UPDATE_OPTIONS ${baseUrl}/contracts/ref/cloud.yml -o $outFile
fi
postProcess $outFile cloud-dedicated
postProcess $outFile 'cloud-dedicated/.config.yml' v2@2
}
function updateClustered {
outFile="clustered/ref.yml"
function updateClusteredV2 {
outFile="clustered/v2/ref.yml"
if [[ -z "$baseUrl" ]];
then
echo "Using existing $outFile"
else
curl $UPDATE_OPTIONS ${baseUrl}/contracts/ref/cloud.yml -o $outFile
fi
postProcess $outFile clustered
postProcess $outFile 'clustered/.config.yml' v2@2
}
function updateCloudServerless {
outFile="cloud-serverless/ref.yml"
function updateCloudServerlessV2 {
outFile="cloud-serverless/v2/ref.yml"
if [[ -z "$baseUrl" ]];
then
echo "Using existing $outFile"
else
curl $UPDATE_OPTIONS ${baseUrl}/contracts/ref/cloud.yml -o $outFile
fi
postProcess $outFile cloud-serverless
postProcess $outFile 'cloud-serverless/.config.yml' v2@2
}
function updateOSS {
mkdir -p ${ossVersion}
outFile="$ossVersion/ref.yml"
function updateOSSV2 {
outFile="v2/ref.yml"
if [[ -z "$baseUrlOSS" ]];
then
echo "Using existing $outFile"
else
curl $UPDATE_OPTIONS ${baseUrlOSS}/contracts/ref/oss.yml -o $outFile
fi
postProcess $outFile $ossVersion
postProcess $outFile 'v2/.config.yml' '@2'
}
function updateV1Compat {
outFile="cloud/swaggerV1Compat.yml"
outFile="cloud/v1-compatibility/swaggerV1Compat.yml"
if [[ -z "$baseUrl" ]];
then
echo "Using existing $outFile"
else
curl $UPDATE_OPTIONS ${baseUrl}/contracts/swaggerV1Compat.yml -o $outFile
fi
postProcess $outFile cloud v1compat
postProcess $outFile 'cloud/.config.yml' 'v1-compatibility'
outFile="$ossVersion/swaggerV1Compat.yml"
mkdir -p ${ossVersion} && cp cloud/swaggerV1Compat.yml $outFile
postProcess $outFile $ossVersion v1compat
outFile="v2/v1-compatibility/swaggerV1Compat.yml"
cp cloud/v1-compatibility/swaggerV1Compat.yml $outFile
postProcess $outFile 'v2/.config.yml' 'v1-compatibility'
outFile="cloud-dedicated/v1-compatibility/swaggerV1Compat.yml"
postProcess $outFile 'cloud-dedicated/.config.yml' 'v1-compatibility'
outFile="cloud-serverless/v1-compatibility/swaggerV1Compat.yml"
postProcess $outFile 'cloud-serverless/.config.yml' 'v1-compatibility'
outFile="clustered/v1-compatibility/swaggerV1Compat.yml"
postProcess $outFile 'clustered/.config.yml' 'v1-compatibility'
}
UPDATE_OPTIONS="--fail"
@ -215,33 +237,37 @@ then
echo ""
fi
if [ "$platform" = "cloud" ];
if [ "$product" = "cloud-v2" ];
then
updateCloud
elif [ "$platform" = "cloud-dedicated" ];
updateCloudV2
elif [ "$product" = "cloud-dedicated-v2" ];
then
updateCloudDedicated
elif [ "$platform" = "cloud-serverless" ];
updateCloudDedicatedV2
elif [ "$product" = "cloud-dedicated-management" ];
then
updateCloudServerless
elif [ "$platform" = "clustered" ];
updateCloudDedicatedManagement
elif [ "$product" = "cloud-serverless-v2" ];
then
updateClustered
elif [ "$platform" = "oss" ];
updateCloudServerlessV2
elif [ "$product" = "clustered-v2" ];
then
updateOSS
elif [ "$platform" = "v1compat" ];
updateClusteredV2
elif [ "$product" = "v2" ];
then
updateOSSV2
elif [ "$product" = "v1-compat" ];
then
updateV1Compat
elif [ "$platform" = "all" ];
elif [ "$product" = "all" ];
then
updateCloud
updateCloudDedicated
updateCloudServerless
updateClustered
updateOSS
updateCloudV2
updateCloudDedicatedV2
updateCloudDedicatedManagement
updateCloudServerlessV2
updateClusteredV2
updateOSSV2
updateV1Compat
else
echo "Provide a platform argument: cloud, cloud-serverless, cloud-dedicated, clustered, oss, v1compat, or all."
echo "Provide a product argument: cloud-v2, cloud-serverless-v2, cloud-dedicated-v2, clustered-v2, v2, v1-compat, or all."
showHelp
fi

View File

@ -6,12 +6,12 @@ function replaceDocsUrl(field) {
* [^]* matches line breaks. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#using_regular_expression_on_multiple_lines
*/
const shortcode = /\{\{%([^]|\s)*?INFLUXDB_DOCS_URL([^]|\s)*?%\}\}/g
let replacement = `/influxdb/${process.env.INFLUXDB_PLATFORM}`;
let replacement = `/influxdb/${process.env.INFLUXDB_PRODUCT}`;
field = field.replaceAll(shortcode, replacement)
.replaceAll('https://docs.influxdata.com/influxdb/', '/influxdb/');
if(process.env.INFLUXDB_PLATFORM === 'cloud-iox') {
if(process.env.INFLUXDB_PRODUCT === 'cloud-iox') {
field = field.replaceAll('/influxdb/cloud/', `${replacement}/`);
}
return field;

View File

@ -8,6 +8,9 @@ module.exports = SetServers;
* Object key "Server" is an OAS 3.0 node type.
*/
function SetServers(data) {
if (!data) {
data = [ { url: '/' } ];
}
return {
DefinitionRoot: {
leave(root) {

View File

@ -11,6 +11,11 @@ function SetInfo(data) {
}
if(data.hasOwnProperty('version')) {
info.version = data.version;
} else {
info['version'] = '';
}
if(data.hasOwnProperty('summary')) {
info.summary = data.summary;
}
if(data.hasOwnProperty('description')) {
info.description = data.description;

View File

@ -3,15 +3,22 @@ const { toJSON } = require('./helpers/content-helper');
function getVersioned(filename) {
const apiDocsRoot=path.resolve(process.env.API_DOCS_ROOT_PATH || process.cwd());
const contentPath = path.join(apiDocsRoot, process.env.INFLUXDB_PLATFORM, 'content');
return toJSON(path.join(contentPath, (process.env.INFLUXDB_API_VERSION || ''), filename));
let contentPath = path.join(apiDocsRoot, process.env.INFLUXDB_PRODUCT, process.env.INFLUXDB_API_NAME, 'content');
content = toJSON(path.join(contentPath, filename));
if (content) {
return content;
} else {
// If the content is not found in the product/api folder, try the product folder
return toJSON(path.join(apiDocsRoot, process.env.INFLUXDB_PRODUCT, 'content', filename));
}
}
const info = () => getVersioned('info.yml');
const servers = () => getVersioned('servers.yml');
const tagGroups = () => getVersioned('tag-groups.yml');
module.exports = {
info,
servers,
tagGroups,
}

View File

@ -1,4 +1,4 @@
const {info, tagGroups} = require('./docs-content');
const {info, servers, tagGroups} = require('./docs-content');
const ReportTags = require('./rules/report-tags');
const ValidateServersUrl = require('./rules/validate-servers-url');
const RemovePrivatePaths = require('./decorators/paths/remove-private-paths');
@ -23,7 +23,7 @@ const rules = {
/** @type {import('@redocly/openapi-cli').CustomRulesConfig} */
const decorators = {
oas3: {
'set-servers': () => SetServers([ { url: '/' } ]),
'set-servers': () => SetServers(servers()),
'delete-servers': DeleteServers,
'remove-private-paths': RemovePrivatePaths,
'strip-version-prefix': StripVersionPrefix,

View File

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

View File

@ -12,7 +12,7 @@
<meta charset="utf8" />
<title>{{title}}</title>
<meta name="description" content="The InfluxDB API provides a programmatic interface for interactions with InfluxDB {{templateOptions.version}}.">
<meta name="description" content="{{templateOptions.description}}.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="/img/favicon.png" type="image/png" sizes="32x32">
@ -39,7 +39,7 @@
<div class="spinner"></div>
</div>
<div id="influx-header">
<a class="back" href="/influxdb/{{templateOptions.version}}/">InfluxDB <span class="version">{{templateOptions.titleVersion}} {{templateOptions.titleSubmodule}}</span> Docs</a>
<a class="back" href="/influxdb/{{templateOptions.product}}/"><span class="version">{{templateOptions.productName}}</span> Docs</a>
<a class="btn" href="https://github.com/influxdata/influxdb/issues/new/choose/" target="_blank">Submit API issue</a>
</div>
{{{redocHTML}}}

13
api-docs/v2/.config.yml Normal file
View File

@ -0,0 +1,13 @@
plugins:
- '../openapi/plugins/docs-plugin.js'
extends:
- recommended
- docs/all
x-influxdata-product-name: InfluxDB v2 OSS
apis:
'@2':
root: ref.yml
x-influxdata-default: true
v1-compatibility@2:
root: v1-compatibility/swaggerV1Compat.yml

View File

@ -1,10 +1,11 @@
title: InfluxDB OSS API Service
version: 2.7.0
summary: The InfluxDB v2 HTTP API provides a programmatic interface for all interactions with an InfluxDB v2 instance.
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 HTTP API provides a programmatic interface for all interactions with an InfluxDB v2 instance. Access the InfluxDB API using `/api/v2/` and InfluxDB v1-compatible endpoints.
This documentation is generated from the
[InfluxDB OpenAPI specification](https://github.com/influxdata/openapi/blob/influxdb-oss-v2.7.0/contracts/ref/oss.yml).
version: 2.x
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'

View File

@ -1,12 +0,0 @@
title: InfluxDB OSS v1 compatibility API documentation
version: 2.7.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](/influxdb/latest/api/).
This documentation is generated from the
[InfluxDB OpenAPI specification](https://github.com/influxdata/openapi/blob/influxdb-oss-v2.7.0/contracts/swaggerV1Compat.yml).
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
title: InfluxDB Cloud v1 compatibility API documentation
title: InfluxDB v1 HTTP API for InfluxDB v2 OSS
summary: The InfluxDB v1 compatibility API provides a programmatic interface for interactions with InfluxDB v2 using InfluxDB v1-compatible endpoints.
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/).
This documentation is generated from the
[InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/swaggerV1Compat.yml).
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'
url: 'https://opensource.org/licenses/MIT'

View File

@ -0,0 +1,446 @@
openapi: 3.0.0
info:
title: InfluxDB v1 HTTP API for InfluxDB v2 OSS
version: ''
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.
This documentation is generated from the
[InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/swaggerV1Compat.yml).
license:
name: MIT
url: https://opensource.org/licenses/MIT
summary: The InfluxDB v1 compatibility API provides a programmatic interface for interactions with InfluxDB v2 using InfluxDB v1-compatible endpoints.
servers:
- url: /
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
- name: Query
- name: Write
paths:
/write:
post:
operationId: PostWriteV1
tags:
- Write
summary: Write time series data into InfluxDB in a V1-compatible format
requestBody:
description: Line protocol body
required: true
content:
text/plain:
schema:
type: string
parameters:
- $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.
- in: query
name: rp
schema:
type: string
description: Retention policy name.
- in: query
name: precision
schema:
type: string
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.
schema:
type: string
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.
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.
content:
application/json:
schema:
$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.
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.
headers:
Retry-After:
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.
headers:
Retry-After:
description: A non-negative decimal integer indicating the seconds to delay after the response is received.
schema:
type: integer
format: int32
default:
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/query:
post:
operationId: PostQueryV1
tags:
- Query
summary: Query InfluxDB in a V1 compatible format
requestBody:
description: InfluxQL query to execute.
content:
text/plain:
schema:
type: string
parameters:
- $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.
default: application/json
enum:
- application/json
- application/csv
- text/csv
- 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.
schema:
type: string
description: Specifies that the query response in the body should be encoded with gzip or not encoded with identity.
default: identity
enum:
- gzip
- identity
- in: header
name: Content-Type
schema:
type: string
enum:
- 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
name: q
description: Defines the influxql query to run.
schema:
type: string
responses:
'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
schema:
type: string
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.
schema:
type: string
description: Specifies the request's trace ID.
content:
application/csv:
schema:
$ref: '#/components/schemas/InfluxQLCSVResponse'
text/csv:
schema:
$ref: '#/components/schemas/InfluxQLCSVResponse'
application/json:
schema:
$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.
headers:
Retry-After:
description: A non-negative decimal integer indicating the seconds to delay after the response is received.
schema:
type: integer
format: int32
default:
description: Error processing query
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
parameters:
TraceSpan:
in: header
name: Zap-Trace-Span
description: OpenTracing span context
example:
trace_id: '1'
span_id: '1'
baggage:
key: value
required: false
schema:
type: string
AuthUserV1:
in: query
name: u
required: false
schema:
type: string
description: Username.
AuthPassV1:
in: query
name: p
required: false
schema:
type: string
description: User token.
schemas:
InfluxQLResponse:
properties:
results:
type: array
oneOf:
- required:
- statement_id
- error
- required:
- statement_id
- series
items:
type: object
properties:
statement_id:
type: integer
error:
type: string
series:
type: array
items:
type: object
properties:
name:
type: string
tags:
type: object
additionalProperties:
type: string
partial:
type: boolean
columns:
type: array
items:
type: string
values:
type: array
items:
type: array
items: {}
InfluxQLCSVResponse:
type: string
example: |
name,tags,time,test_field,test_tag test_measurement,,1603740794286107366,1,tag_value test_measurement,,1603740870053205649,2,tag_value test_measurement,,1603741221085428881,3,tag_value
Error:
properties:
code:
description: Code is the machine-readable error code.
readOnly: true
type: string
enum:
- internal error
- not found
- conflict
- invalid
- unprocessable entity
- empty value
- unavailable
- forbidden
- too many requests
- unauthorized
- method not allowed
message:
readOnly: true
description: Message is a human-readable message.
type: string
required:
- code
- message
LineProtocolError:
properties:
code:
description: Code is the machine-readable error code.
readOnly: true
type: string
enum:
- internal error
- not found
- conflict
- invalid
- empty value
- unavailable
message:
readOnly: true
description: Message is a human-readable message.
type: string
op:
readOnly: true
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.
type: string
line:
readOnly: true
description: First line within sent body containing malformed data
type: integer
format: int32
required:
- code
- message
- op
- err
LineProtocolLengthError:
properties:
code:
description: Code is the machine-readable error code.
readOnly: true
type: string
enum:
- invalid
message:
readOnly: true
description: Message is a human-readable message.
type: string
maxLength:
readOnly: true
description: Max length in bytes for a body of line-protocol.
type: integer
format: int32
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/).
x-tagGroups:
- name: Using the InfluxDB HTTP API
tags:
- Quick start
- Authentication
- Supported operations
- Headers
- Pagination
- Response codes
- Data I/O endpoints
- Security and access endpoints
- System information endpoints
- name: All endpoints
tags:
- Query
- Write