fix for reverted 4788 build the http api reference for iox relevant endpoints (#4803)
* feature(cloud-iox): add cloud-iox API reference content. * feature(api): revise tagging, add cloud-iox API: - Closes #4788. - Generates cloud-iox/api. - Changes handling of tags and x-tagGroups. - Configures custom All Endpoints list for cloud-iox. - Simplifies the nav with other grouping tags. Any custom x-tagGroups configured in [platform]/content/tag-groups.yml take precedence over those already defined in the spec. If you assign a list of tags to 'All endpoints' x-tagGroup, the decorator will use that list and remove Operations not tagged with those tags. If you assign an empty array([]) to the 'All endpoints' x-tagGroup, the decorator will list all resource-like tags. TODO: document in CONTRIBUTING. TODO: unset x-tagGroups from openapi. * Apply suggestions from code review Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * fix(api): unintended deletion of API operations --------- Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>pull/4804/head
parent
63b524bf0b
commit
8129c5b4c5
|
@ -92,24 +92,22 @@
|
||||||
git checkout -b release/api-oss origin/master
|
git checkout -b release/api-oss origin/master
|
||||||
```
|
```
|
||||||
|
|
||||||
7. In `./api-docs`, create a directory for the new OSS version number--for example:
|
7. In `./api-docs`, copy the previous version or create a directory for the new OSS version number--for example:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# In your terminal, go to the `docs-v2/api-docs` directory:
|
# In your terminal, go to the `docs-v2/api-docs` directory:
|
||||||
cd ./api-docs
|
cd ./api-docs
|
||||||
|
|
||||||
# Create the directory:
|
|
||||||
mkdir v2.3
|
|
||||||
```
|
```
|
||||||
|
|
||||||
8. Copy custom content from the previous version--for example:
|
If the old version directory contains custom content files (for example, v2.2/content), you'll likely want to copy
|
||||||
|
those for the new version.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# In your terminal, copy the `docs-v2/api-docs/openapi/content/v2.2` directory to a new directory:
|
# Copy the old version directory to a directory for the new version:
|
||||||
cp -r ./openapi/content/v2.2 ./openapi/content/v2.3
|
cp -r v2.2 v2.3
|
||||||
|
```
|
||||||
# TODO: We can probably automate this step now since we pass the version number.
|
|
||||||
```
|
8. In your editor, update custom content files in NEW_VERSION/content.
|
||||||
|
|
||||||
9. Enter the following commands into your terminal to fetch and process the contracts:
|
9. Enter the following commands into your terminal to fetch and process the contracts:
|
||||||
|
|
||||||
|
@ -267,27 +265,42 @@ When you run `getswagger.sh`, it executes `@redocly/openapi-cli` and the plugins
|
||||||
[`./openapi/plugins/decorators`](./openapi/plugins/decorators) to apply custom
|
[`./openapi/plugins/decorators`](./openapi/plugins/decorators) to apply custom
|
||||||
processing to OpenAPI specs.
|
processing to OpenAPI specs.
|
||||||
|
|
||||||
`.yml` files in [`./openapi/content`](./openapi/content) set content for sections (nodes) in the contract.
|
`.yml` files in [`./PLATFORM/content`](./openapi/content) define custom content for OpenAPI nodes published in the reference docs.
|
||||||
To update the content for those nodes, you only need to update the YAML files.
|
To update the content for those nodes, you only need to update the YAML files.
|
||||||
To add new YAML files for other nodes in the contracts,
|
For example, to customize the Info section for the Cloud API reference, edit `./cloud/content/info.yml`.
|
||||||
configure the new content YAML file in [`./openapi/content/content.js`](./openapi/content/content.js).
|
|
||||||
The content structure and Markdown must be valid OAS.
|
|
||||||
|
|
||||||
Then, you'll need to write or update a decorator module for the node and configure the decorator in the plugin,
|
To add new YAML files for other nodes in the contracts, follow these steps:
|
||||||
e.g. [`./openapi/plugins/docs-plugin.js`](`./openapi/plugins/docs-plugin.js).
|
|
||||||
See the [complete list of OAS v3.0 nodes](https://github.com/Redocly/openapi-cli/blob/master/packages/core/src/types/oas3.ts#L529).
|
|
||||||
|
|
||||||
`@redocly/openapi-cli` requires that modules use CommonJS `require` syntax for imports.
|
1. Create your new content file with valid OAS content structure and Markdown.
|
||||||
|
2. Configure the new content YAML file in [`./openapi/content/content.js`](./openapi/content/content.js).
|
||||||
|
3. Write or update a decorator module for the node and configure the decorator in
|
||||||
|
[`./openapi/plugins/docs-plugin.js`](`./openapi/plugins/docs-plugin.js).
|
||||||
|
See the [complete list of OAS v3.0 nodes](https://github.com/Redocly/openapi-cli/blob/master/packages/core/src/types/oas3.ts#L529).
|
||||||
|
|
||||||
|
`@redocly/cli` requires that modules use CommonJS `require` syntax for imports.
|
||||||
|
|
||||||
|
`@redocly/cli` also provides some [built-in decorators](https://redocly.com/docs/cli/decorators/)
|
||||||
|
that you can configure in `.redocly` without having to write JavaScript.
|
||||||
### How to add tag content or describe a group of paths
|
### How to add tag content or describe a group of paths
|
||||||
|
|
||||||
In API reference docs, we use OpenAPI `tags` elements for navigation and the
|
In API reference docs, we use OpenAPI `tags` elements for navigation,
|
||||||
`x-traitTag` vendor extension to define custom content.
|
the `x-traitTag` vendor extension for providing custom content, and the `x-tagGroups` vendor extension
|
||||||
|
for grouping tags in navigation.
|
||||||
|
|
||||||
| Example | OpenAPI field | |
|
| Example | OpenAPI field | |
|
||||||
|:-------------------------------------------------------------------------------------------------------|-------------------------------------------------------|--------------------------------------------|
|
|:-------------------------------------------------------------------------------------------------------|-------------------------------------------------------|--------------------------------------------|
|
||||||
| [Add supplementary documentation](https://docs.influxdata.com/influxdb/cloud/api/#tag/Quick-start) | `tags: [ { name: 'Quick start', x-traitTag: true } ]` | [Source](https://github.com/influxdata/openapi/master/src/cloud/tags.yml) |
|
| [Add supplementary documentation](https://docs.influxdata.com/influxdb/cloud/api/#tag/Quick-start) | `tags: [ { name: 'Quick start', x-traitTag: true } ]` | [Source](https://github.com/influxdata/openapi/master/src/cloud/tags.yml) |
|
||||||
| [Group and describe related paths](https://docs.influxdata.com/influxdb/cloud/api/#tag/Authorizations) | `tags: [ { name: 'Buckets', description: '...' } ]` | [Source](https://github.com/influxdata/openapi/master/src/cloud/tags-groups.yml)) |
|
| Group tags in navigation | `x-tagGroups: [ { name: 'All endpoints', tags: [...], ...} ]` | [Source](https://github.com/influxdata/docs-v2/blob/da6c2e467de7212fc2197dfe0b87f0f0296688ee/api-docs/cloud-iox/content/tag-groups.yml)) |
|
||||||
|
|
||||||
|
#### Add and update x-tagGroups
|
||||||
|
|
||||||
|
Custom `x-tagGroups` configured in
|
||||||
|
`PLATFORM/content/tag-groups.yml` override `x-tagGroups` defined in `influxdata/openapi`.
|
||||||
|
If you assign a list of tags to the `All endpoints` tag group,
|
||||||
|
the decorator applies your list and removes Operations that don't contain
|
||||||
|
those tags.
|
||||||
|
If you assign an empty array(`[]`) to the `All endpoints` x-tagGroup in `PLATFORM/content/tag-groups.yml`,
|
||||||
|
the decorator replaces the empty array with the list of tags from all Operations in the spec.
|
||||||
|
|
||||||
## How to test your spec or API reference changes
|
## How to test your spec or API reference changes
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
title: InfluxDB Cloud (IOx) API Service
|
||||||
|
description: |
|
||||||
|
The InfluxDB HTTP 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'
|
|
@ -0,0 +1,8 @@
|
||||||
|
- url: https://{baseurl}
|
||||||
|
description: InfluxDB Cloud (IOx) API URL
|
||||||
|
variables:
|
||||||
|
baseurl:
|
||||||
|
enum:
|
||||||
|
- 'us-east-1-1.aws.cloud2.influxdata.com'
|
||||||
|
default: 'us-east-1-1.aws.cloud2.influxdata.com'
|
||||||
|
description: InfluxDB Cloud (IOx) URL
|
|
@ -0,0 +1,33 @@
|
||||||
|
- 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:
|
||||||
|
- Authorizations (API tokens)
|
||||||
|
- Bucket Schemas
|
||||||
|
- Buckets
|
||||||
|
- Delete
|
||||||
|
- DBRPs
|
||||||
|
- Invokable Scripts
|
||||||
|
- Legacy Query
|
||||||
|
- Legacy Write
|
||||||
|
- Limits
|
||||||
|
- Organizations
|
||||||
|
- Query
|
||||||
|
- Resources
|
||||||
|
- Routes
|
||||||
|
- Secrets
|
||||||
|
- Tasks
|
||||||
|
- Telegrafs
|
||||||
|
- Templates
|
||||||
|
- Usage
|
||||||
|
- Variables
|
||||||
|
- Write
|
|
@ -0,0 +1,11 @@
|
||||||
|
title: InfluxDB Cloud IOx v1 compatibility API documentation
|
||||||
|
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'
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,432 @@
|
||||||
|
openapi: 3.0.0
|
||||||
|
info:
|
||||||
|
title: InfluxDB Cloud v1 compatibility API documentation
|
||||||
|
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/).
|
||||||
|
|
||||||
|
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
|
||||||
|
servers:
|
||||||
|
- url: /
|
||||||
|
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/).
|
||||||
|
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
|
||||||
|
x-tagGroups: []
|
|
@ -0,0 +1,13 @@
|
||||||
|
- 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: []
|
File diff suppressed because it is too large
Load Diff
|
@ -429,4 +429,3 @@ tags:
|
||||||
x-traitTag: true
|
x-traitTag: true
|
||||||
- name: Query
|
- name: Query
|
||||||
- name: Write
|
- name: Write
|
||||||
x-tagGroups: []
|
|
||||||
|
|
|
@ -91,6 +91,8 @@ do
|
||||||
menu="influxdb_$(echo $version | sed 's/\./_/g;s/v//g;')_ref"
|
menu="influxdb_$(echo $version | sed 's/\./_/g;s/v//g;')_ref"
|
||||||
if [[ $version == "cloud" ]]; then
|
if [[ $version == "cloud" ]]; then
|
||||||
titleVersion="Cloud"
|
titleVersion="Cloud"
|
||||||
|
elif [[ $version == "cloud-iox" ]]; then
|
||||||
|
titleVersion="Cloud (IOx)"
|
||||||
else
|
else
|
||||||
titleVersion="$version"
|
titleVersion="$version"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# This script provides a simple way grab the latest fully resolved openapi (OAS, OpenAPI Specification) contract files
|
# This script provides a simple way grab the latest fully resolved openapi (OAS, OpenAPI Specification) contract files
|
||||||
# from the influxdata/openapi repo.
|
# from the influxdata/openapi repo.
|
||||||
#
|
#
|
||||||
# Specify a platform to retrieve (cloud, oss, v1compat, all).
|
# Specify a platform to retrieve (cloud-iox, cloud, oss, v1compat, all).
|
||||||
# Optionally specify:
|
# Optionally specify:
|
||||||
# - an OSS version as the second argument or using the -o flag.
|
# - an OSS version as the second argument or using the -o flag.
|
||||||
# The version specifies where to write the updated openapi.
|
# The version specifies where to write the updated openapi.
|
||||||
|
@ -20,6 +20,7 @@
|
||||||
# sh ./getswagger.sh -c <platform> -o <version> -b <baseUrl>
|
# sh ./getswagger.sh -c <platform> -o <version> -b <baseUrl>
|
||||||
#
|
#
|
||||||
# Examples:
|
# Examples:
|
||||||
|
# sh ./getswagger.sh cloud-iox
|
||||||
# sh ./getswagger.sh cloud
|
# sh ./getswagger.sh cloud
|
||||||
# sh ./getswagger.sh -c oss -o v2.0 -b file:///Users/johnsmith/github/openapi
|
# sh ./getswagger.sh -c oss -o v2.0 -b file:///Users/johnsmith/github/openapi
|
||||||
|
|
||||||
|
@ -56,7 +57,7 @@ function showHelp {
|
||||||
subcommand=$1
|
subcommand=$1
|
||||||
|
|
||||||
case "$subcommand" in
|
case "$subcommand" in
|
||||||
cloud|oss|v1compat|all)
|
cloud-iox|cloud|oss|v1compat|all)
|
||||||
platform=$1
|
platform=$1
|
||||||
shift
|
shift
|
||||||
|
|
||||||
|
@ -131,6 +132,12 @@ function updateCloud {
|
||||||
postProcess $outFile cloud
|
postProcess $outFile cloud
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateCloudIOx {
|
||||||
|
outFile="cloud-iox/ref.yml"
|
||||||
|
curl $UPDATE_OPTIONS ${baseUrl}/contracts/ref/cloud.yml -o $outFile
|
||||||
|
postProcess $outFile cloud-iox
|
||||||
|
}
|
||||||
|
|
||||||
function updateOSS {
|
function updateOSS {
|
||||||
mkdir -p ${ossVersion}
|
mkdir -p ${ossVersion}
|
||||||
outFile="$ossVersion/ref.yml"
|
outFile="$ossVersion/ref.yml"
|
||||||
|
@ -160,6 +167,9 @@ fi
|
||||||
if [ "$platform" = "cloud" ];
|
if [ "$platform" = "cloud" ];
|
||||||
then
|
then
|
||||||
updateCloud
|
updateCloud
|
||||||
|
elif [ "$platform" = "cloud-iox" ];
|
||||||
|
then
|
||||||
|
updateCloudIOx
|
||||||
elif [ "$platform" = "oss" ];
|
elif [ "$platform" = "oss" ];
|
||||||
then
|
then
|
||||||
updateOSS
|
updateOSS
|
||||||
|
@ -169,9 +179,10 @@ then
|
||||||
elif [ "$platform" = "all" ];
|
elif [ "$platform" = "all" ];
|
||||||
then
|
then
|
||||||
updateCloud
|
updateCloud
|
||||||
|
updateCloudIOx
|
||||||
updateOSS
|
updateOSS
|
||||||
updateV1Compat
|
updateV1Compat
|
||||||
else
|
else
|
||||||
echo "Provide a platform argument: cloud, oss, v1compat, or all."
|
echo "Provide a platform argument: cloud, cloud-iox, oss, v1compat, or all."
|
||||||
showHelp
|
showHelp
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module.exports = SetTagGroups;
|
module.exports = SetTagGroups;
|
||||||
|
|
||||||
const { collect, getName, sortName } = require('../../helpers/content-helper.js')
|
const { collect, getName, sortName, isPresent } = require('../../helpers/content-helper.js')
|
||||||
/**
|
/**
|
||||||
* Returns an object that defines handler functions for:
|
* Returns an object that defines handler functions for:
|
||||||
* - Operation nodes
|
* - Operation nodes
|
||||||
|
@ -19,17 +19,56 @@ function SetTagGroups(data) {
|
||||||
data = [];
|
data = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ALL_ENDPOINTS = 'All endpoints';
|
||||||
|
/** Tag names used for ad-hoc grouping of Operations and not specific to a resource or path.
|
||||||
|
* For example, these might be useful for UI navigation and filtering, but shouldn't appear
|
||||||
|
* in a list of resource tags.
|
||||||
|
*/
|
||||||
|
const nonResourceTags = [
|
||||||
|
'Data I/O endpoints',
|
||||||
|
'Security and access endpoints',
|
||||||
|
'System information endpoints'
|
||||||
|
];
|
||||||
|
|
||||||
|
const allEndpointsGroup = data.filter(customGroup => customGroup.name === ALL_ENDPOINTS).pop();
|
||||||
|
|
||||||
|
function addAllEndpointTags(tagGroups) {
|
||||||
|
tagGroups.map(grp => {
|
||||||
|
if(grp.name === ALL_ENDPOINTS && !grp.tags.length) {
|
||||||
|
grp.tags = endpointTags;
|
||||||
|
}
|
||||||
|
return grp;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
let tags = [];
|
let tags = [];
|
||||||
/** Collect tags for each operation and convert string tags to object tags. **/
|
/** Collect tags for each operation and convert string tags to object tags. **/
|
||||||
return {
|
return {
|
||||||
DefinitionRoot: {
|
DefinitionRoot: {
|
||||||
Operation: {
|
Operation: {
|
||||||
leave(op) {
|
leave(op, ctx) {
|
||||||
let opTags = op.tags?.map(
|
let opTags = op.tags?.map(
|
||||||
function(t) {
|
function(t) {
|
||||||
return typeof t === 'string' ? { name: t } : t;
|
return typeof t === 'string' ? { name: t } : t;
|
||||||
}
|
}
|
||||||
) || [];
|
) || [];
|
||||||
|
|
||||||
|
const { parent, key } = ctx;
|
||||||
|
if(allEndpointsGroup?.tags.length) {
|
||||||
|
opTags.forEach(
|
||||||
|
function(t) {
|
||||||
|
if(!isPresent(allEndpointsGroup.tags, t) && !isPresent(nonResourceTags, t)) {
|
||||||
|
/** If a custom allEndpointsGroup is defined and the current Operation
|
||||||
|
* contains a tag not specified in allEndpointsGroup,
|
||||||
|
* then delete the Operation from the doc so that it doesn't appear in other tags.
|
||||||
|
*/
|
||||||
|
delete parent[key];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
tags = collect(tags, opTags);
|
tags = collect(tags, opTags);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -40,34 +79,15 @@ function SetTagGroups(data) {
|
||||||
|
|
||||||
endpointTags = root.tags
|
endpointTags = root.tags
|
||||||
.filter(t => !t['x-traitTag'])
|
.filter(t => !t['x-traitTag'])
|
||||||
|
.filter(t => !isPresent(nonResourceTags, t))
|
||||||
.map(t => getName(t));
|
.map(t => getName(t));
|
||||||
|
|
||||||
if(Array.isArray(root['x-tagGroups'])) {
|
/** In Redoc, if x-tagGroups is present, a tag (and its paths)
|
||||||
root['x-tagGroups'].concat(data);
|
* must be assigned to an x-tagGroup in order to display. */
|
||||||
} else {
|
if(data.length) {
|
||||||
|
addAllEndpointTags(data);
|
||||||
root['x-tagGroups'] = data;
|
root['x-tagGroups'] = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
let nonEndpointTags = []
|
|
||||||
root['x-tagGroups'].map(
|
|
||||||
function(grp) {
|
|
||||||
if(grp.name !== 'All endpoints') {
|
|
||||||
nonEndpointTags = nonEndpointTags.concat(grp.tags);
|
|
||||||
}
|
|
||||||
if(!['All endpoints', 'Overview'].includes(grp.name)) {
|
|
||||||
grp.name = ""
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
root['x-tagGroups'].map(
|
|
||||||
function(grp) {
|
|
||||||
if(grp.name === 'All endpoints') {
|
|
||||||
grp.tags = endpointTags
|
|
||||||
.filter(t => !nonEndpointTags.includes(t));
|
|
||||||
}
|
|
||||||
return grp;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ const decorators = {
|
||||||
'strip-trailing-slash': StripTrailingSlash,
|
'strip-trailing-slash': StripTrailingSlash,
|
||||||
'set-info': () => SetInfo(info()),
|
'set-info': () => SetInfo(info()),
|
||||||
'set-tag-groups': () => SetTagGroups(tagGroups()),
|
'set-tag-groups': () => SetTagGroups(tagGroups()),
|
||||||
'replace-docs-url-shortcode': ReplaceShortcodes().docsUrl,
|
'replace-docs-url-shortcode': ReplaceShortcodes().docsUrl
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ module.exports = {
|
||||||
'docs/strip-trailing-slash': 'error',
|
'docs/strip-trailing-slash': 'error',
|
||||||
'docs/set-info': 'error',
|
'docs/set-info': 'error',
|
||||||
'docs/set-tag-groups': 'error',
|
'docs/set-tag-groups': 'error',
|
||||||
'docs/replace-docs-url-shortcode': 'error',
|
'docs/replace-docs-url-shortcode': 'error'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
- 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: []
|
|
@ -20092,17 +20092,14 @@ tags:
|
||||||
Write time series data to [buckets](/influxdb/latest/reference/glossary/#bucket).
|
Write time series data to [buckets](/influxdb/latest/reference/glossary/#bucket).
|
||||||
name: Write
|
name: Write
|
||||||
x-tagGroups:
|
x-tagGroups:
|
||||||
- name: Overview
|
- name: Using the InfluxDB HTTP API
|
||||||
tags:
|
tags:
|
||||||
- Quick start
|
- Quick start
|
||||||
- Authentication
|
- Authentication
|
||||||
- Supported operations
|
- Supported operations
|
||||||
- Headers
|
- Headers
|
||||||
- Common parameters
|
|
||||||
- Pagination
|
- Pagination
|
||||||
- Response codes
|
- Response codes
|
||||||
- name: ''
|
|
||||||
tags:
|
|
||||||
- Data I/O endpoints
|
- Data I/O endpoints
|
||||||
- Security and access endpoints
|
- Security and access endpoints
|
||||||
- System information endpoints
|
- System information endpoints
|
||||||
|
|
|
@ -429,4 +429,3 @@ tags:
|
||||||
x-traitTag: true
|
x-traitTag: true
|
||||||
- name: Query
|
- name: Query
|
||||||
- name: Write
|
- name: Write
|
||||||
x-tagGroups: []
|
|
||||||
|
|
Loading…
Reference in New Issue