diff --git a/api-docs/.redocly.yaml b/api-docs/.redocly.yaml index de6cb425c..eea6b95a9 100644 --- a/api-docs/.redocly.yaml +++ b/api-docs/.redocly.yaml @@ -1,7 +1,5 @@ -apis: -styleguide: - plugins: - - './openapi/plugins/docs-plugin.js' - extends: - - recommended - - docs/all +plugins: + - './openapi/plugins/docs-plugin.js' +extends: + - recommended + - docs/all diff --git a/api-docs/openapi/content/cloud/info.yml b/api-docs/cloud/content/info.yml similarity index 100% rename from api-docs/openapi/content/cloud/info.yml rename to api-docs/cloud/content/info.yml diff --git a/api-docs/openapi/content/cloud/servers.yml b/api-docs/cloud/content/servers.yml similarity index 100% rename from api-docs/openapi/content/cloud/servers.yml rename to api-docs/cloud/content/servers.yml diff --git a/api-docs/openapi/content/cloud/v1compat/info.yml b/api-docs/cloud/content/v1compat/info.yml similarity index 100% rename from api-docs/openapi/content/cloud/v1compat/info.yml rename to api-docs/cloud/content/v1compat/info.yml diff --git a/api-docs/cloud/ref.yml b/api-docs/cloud/ref.yml index 10b53d836..83da9e2c3 100644 --- a/api-docs/cloud/ref.yml +++ b/api-docs/cloud/ref.yml @@ -1030,25 +1030,36 @@ components: DBRP: properties: bucketID: - description: The ID of the bucket used as the target for the translation. + description: | + A bucket ID. + Identifies the bucket used as the target for the translation. type: string database: - description: InfluxDB v1 database + description: | + A database name. + Identifies the InfluxDB v1 database. type: string default: - description: Mapping represents the default retention policy for the database specified. + description: | + If set to `true`, this DBRP mapping is the default retention policy + for the database (specified by the `database` property's value). type: boolean id: - description: The ID of the DBRP mapping. + description: | + The resource ID that InfluxDB uses to uniquely identify the database retention policy (DBRP) mapping. readOnly: true type: string links: $ref: '#/components/schemas/Links' orgID: - description: The ID of the organization. + description: | + An organization ID. + Identifies the [organization](/influxdb/cloud/reference/glossary/#organization) that owns the mapping. type: string retention_policy: - description: InfluxDB v1 retention policy + description: | + A [retention policy](/influxdb/v1.8/concepts/glossary/#retention-policy-rp) name. + Identifies the InfluxDB v1 retention policy mapping. type: string virtual: description: Indicates an autogenerated, virtual mapping based on the bucket name. Currently only available in OSS. @@ -1064,22 +1075,34 @@ components: DBRPCreate: properties: bucketID: - description: The ID of the bucket used as the target for the translation. + description: | + A bucket ID. + Identifies the bucket used as the target for the translation. type: string database: - description: InfluxDB v1 database + description: | + A database name. + Identifies the InfluxDB v1 database. type: string default: - description: Mapping represents the default retention policy for the database specified. + description: | + Set to `true` to use this DBRP mapping as the default retention policy + for the database (specified by the `database` property's value). type: boolean org: - description: The name of the organization that owns this mapping. + description: | + An organization name. + Identifies the [organization](/influxdb/cloud/reference/glossary/#organization) that owns the mapping. type: string orgID: - description: The ID of the organization. + description: | + An organization ID. + Identifies the [organization](/influxdb/cloud/reference/glossary/#organization) that owns the mapping. type: string retention_policy: - description: InfluxDB v1 retention policy + description: | + A [retention policy](/influxdb/v1.8/concepts/glossary/#retention-policy-rp) name. + Identifies the InfluxDB v1 retention policy mapping. type: string required: - bucketID @@ -1095,9 +1118,15 @@ components: DBRPUpdate: properties: default: + description: | + Set to `true` to use this DBRP mapping as the default retention policy + for the database (specified by the `database` property's value). + To remove the default mapping, set to `false`. type: boolean retention_policy: - description: InfluxDB v1 retention policy + description: | + A [retention policy](/influxdb/v1.8/concepts/glossary/#retention-policy-rp) name. + Identifies the InfluxDB v1 retention policy mapping. type: string DBRPs: properties: @@ -3326,6 +3355,12 @@ components: format: date-time readOnly: true type: string + defaultStorageType: + description: Discloses whether the organization uses TSM or IOx. + enum: + - tsm + - iox + type: string description: type: string id: @@ -3364,7 +3399,7 @@ components: type: string status: default: active - description: If inactive the organization is inactive. + description: If inactive, the organization is inactive. enum: - active - inactive @@ -4325,11 +4360,6 @@ components: id: readOnly: true type: string - labels: - description: The list of label names associated with the script. - items: - type: string - type: array language: $ref: '#/components/schemas/ScriptLanguage' name: @@ -6617,6 +6647,9 @@ components: curl --get "INFLUX_URL/api/v2/signin" --header "Authorization: Basic VVNFUk5BTUU6UEFTU1dPUkQ=" ``` + + To learn more about HTTP authentication, see + [Mozilla Developer Network (MDN) Web Docs, HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication)._ scheme: basic type: http TokenAuthentication: @@ -9751,25 +9784,39 @@ paths: - Dashboards /api/v2/dbrps: get: + description: | + Lists database retention policy (DBRP) mappings. + + #### Related guide + + - [Database and retention policy mapping](/influxdb/cloud/reference/api/influxdb-1x/dbrp/) operationId: GetDBRPs parameters: - $ref: '#/components/parameters/TraceSpan' - - description: Specifies the organization ID to filter on + - description: | + An organization ID. + Only returns DBRP mappings for the specified organization. in: query name: orgID schema: type: string - - description: Specifies the organization name to filter on + - description: | + An organization name. + Only returns DBRP mappings for the specified organization. in: query name: org schema: type: string - - description: Specifies the mapping ID to filter on + - description: | + A DBPR mapping ID. + Only returns the specified DBRP mapping. in: query name: id schema: type: string - - description: Specifies the bucket ID to filter on + - description: | + A bucket ID. + Only returns DBRP mappings that belong to the specified bucket. in: query name: bucketID schema: @@ -9779,12 +9826,16 @@ paths: name: default schema: type: boolean - - description: Specifies the database to filter on + - description: | + A database. + Only returns DBRP mappings that belong to the 1.x database. in: query name: db schema: type: string - - description: Specifies the retention policy to filter on + - description: | + A [retention policy](/influxdb/v1.8/concepts/glossary/#retention-policy-rp). + Specifies the 1.x retention policy to filter on. in: query name: rp schema: @@ -9793,15 +9844,42 @@ paths: '200': content: application/json: + examples: + successResponse: + value: + content: + - bucketID: 4d4d9d5b61dee751 + database: example_database_1 + default: true + id: 0a3cbb5dd526a000 + orgID: bea7ea952287f70d + retention_policy: autogen + - bucketID: 4d4d9d5b61dee751 + database: example_database_2 + default: false + id: 0a3cbcde20e38000 + orgID: bea7ea952287f70d + retention_policy: example_retention_policy schema: $ref: '#/components/schemas/DBRPs' - description: Success. Returns a list of database retention policy mappings. + description: Success. The response body contains a list of database retention policy mappings. '400': content: application/json: + examples: + invalidRequest: + description: | + The query parameters contain invalid values. + value: + code: invalid + message: invalid ID schema: $ref: '#/components/schemas/Error' description: Bad request. The request has one or more invalid parameters. + '401': + $ref: '#/components/responses/AuthorizationError' + '500': + $ref: '#/components/responses/InternalServerError' default: content: application/json: @@ -9812,6 +9890,17 @@ paths: tags: - DBRPs post: + description: | + Creates a database retention policy (DBRP) mapping and returns the mapping. + + Use this endpoint to add InfluxDB 1.x API compatibility to your + InfluxDB Cloud or InfluxDB OSS 2.x buckets. Your buckets must contain a + DBRP mapping in order to query and write using the InfluxDB 1.x API. + object. + + #### Related guide + + - [Database and retention policy mapping](/influxdb/cloud/reference/api/influxdb-1x/dbrp/) operationId: PostDBRP parameters: - $ref: '#/components/parameters/TraceSpan' @@ -9820,21 +9909,49 @@ paths: application/json: schema: $ref: '#/components/schemas/DBRPCreate' - description: The database retention policy mapping to add + description: | + The database retention policy mapping to add. + + Note that _`retention_policy`_ is a required parameter in the request body. + The value of _`retention_policy`_ can be any arbitrary `string` name or + value, with the default value commonly set as `autogen`. + The value of _`retention_policy`_ isn't a [retention_policy](/influxdb/cloud/reference/glossary/#retention-policy-rp) required: true responses: '201': content: application/json: + examples: + successResponse: + value: + bucketID: 4d4d9d5b61dee751 + database: example_database + default: true + id: 0a3cbb5dd526a000 + orgID: bea7ea952287f70d + retention_policy: autogen schema: $ref: '#/components/schemas/DBRP' - description: Created. Returns the created database retention policy mapping. + description: Created. The response body contains the database retention policy mapping. '400': content: application/json: + examples: + invalidRequest: + description: | + The query parameters contain invalid values. + value: + code: invalid + message: invalid ID schema: $ref: '#/components/schemas/Error' description: Bad request. The mapping in the request has one or more invalid IDs. + '401': + $ref: '#/components/responses/AuthorizationError' + '404': + $ref: '#/components/responses/ResourceNotFoundError' + '500': + $ref: '#/components/responses/InternalServerError' default: content: application/json: @@ -9844,22 +9961,51 @@ paths: summary: Add a database retention policy mapping tags: - DBRPs + x-codeSamples: + - label: 'cURL: create a database retention policy mapping' + lang: Shell + source: | + curl --request POST \ + "http://localhost:8086/api/v2/dbrp/" \ + --header 'Content-type: application/json' \ + --header "Authorization: Token INFLUXDB_TOKEN" \ + --data-binary @- << EOF + { \ + "bucketID": "INFLUXDB_BUCKET_ID", \ + "orgID": "INFLUXDB_ORG_ID", \ + "database": "database_name", \ + "default": true, \ + "retention_policy": "example_retention_policy_name" \ + } + EOF /api/v2/dbrps/{dbrpID}: delete: + description: | + Deletes the specified database retention policy (DBRP) mapping. + + #### Related guide + + - [Database and retention policy mapping](/influxdb/cloud/reference/api/influxdb-1x/dbrp/) operationId: DeleteDBRPID parameters: - $ref: '#/components/parameters/TraceSpan' - - description: Specifies the organization ID of the mapping + - description: | + An organization ID. + Specifies the organization that owns the DBRP mapping. in: query name: orgID schema: type: string - - description: Specifies the organization name of the mapping + - description: | + An organization name. + Specifies the organization that owns the DBRP mapping. in: query name: org schema: type: string - - description: The database retention policy mapping + - description: | + A DBRP mapping ID. + Only returns the specified DBRP mapping. in: path name: dbrpID required: true @@ -9867,13 +10013,26 @@ paths: type: string responses: '204': - description: Delete has been accepted + description: Success. The delete is accepted. '400': content: application/json: + examples: + invalidRequest: + description: | + The query parameters contain invalid values. + value: + code: invalid + message: invalid ID schema: $ref: '#/components/schemas/Error' - description: if any of the IDs passed is invalid + description: Bad Request. Query parameters contain invalid values. + '401': + $ref: '#/components/responses/AuthorizationError' + '404': + $ref: '#/components/responses/ResourceNotFoundError' + '500': + $ref: '#/components/responses/InternalServerError' default: content: application/json: @@ -9884,20 +10043,32 @@ paths: tags: - DBRPs get: + description: | + Retrieves the specified retention policy (DBRP) mapping. + + #### Related guide + + - [Database and retention policy mapping](/influxdb/cloud/reference/api/influxdb-1x/dbrp/) operationId: GetDBRPsID parameters: - $ref: '#/components/parameters/TraceSpan' - - description: Specifies the organization ID of the mapping + - description: | + An organization ID. + Specifies the organization that owns the DBRP mapping. in: query name: orgID schema: type: string - - description: Specifies the organization name of the mapping + - description: | + An organization name. + Specifies the organization that owns the DBRP mapping. in: query name: org schema: type: string - - description: The database retention policy mapping ID + - description: | + A DBRP mapping ID. + Specifies the DBRP mapping. in: path name: dbrpID required: true @@ -9907,15 +10078,38 @@ paths: '200': content: application/json: + examples: + successResponse: + value: + content: + bucketID: 4d4d9d5b61dee751 + database: example_database_1 + default: true + id: 0a3cbb5dd526a000 + orgID: bea7ea952287f70d + retention_policy: autogen schema: $ref: '#/components/schemas/DBRPGet' - description: The database retention policy requested + description: Success. The response body contains the DBRP mapping. '400': content: application/json: + examples: + invalidRequest: + description: | + The query parameters contain invalid values. + value: + code: invalid + message: invalid ID schema: $ref: '#/components/schemas/Error' - description: if any of the IDs passed is invalid + description: Bad Request. Query parameters contain invalid values. + '401': + $ref: '#/components/responses/AuthorizationError' + '404': + $ref: '#/components/responses/ResourceNotFoundError' + '500': + $ref: '#/components/responses/InternalServerError' default: content: application/json: @@ -9929,17 +10123,23 @@ paths: operationId: PatchDBRPID parameters: - $ref: '#/components/parameters/TraceSpan' - - description: Specifies the organization ID of the mapping + - description: | + An organization ID. + Specifies the organization that owns the DBRP mapping. in: query name: orgID schema: type: string - - description: Specifies the organization name of the mapping + - description: | + An organization name. + Specifies the organization that owns the DBRP mapping. in: query name: org schema: type: string - - description: The database retention policy mapping. + - description: | + A DBRP mapping ID. + Specifies the DBRP mapping. in: path name: dbrpID required: true @@ -9950,27 +10150,51 @@ paths: application/json: schema: $ref: '#/components/schemas/DBRPUpdate' - description: Database retention policy update to apply + description: | + Updates the database retention policy (DBRP) mapping and returns the mapping. + + Use this endpoint to modify the _retention policy_ (`retention_policy` property) of a DBRP mapping. + + #### Related guide + + - [Database and retention policy mapping](/influxdb/cloud/reference/api/influxdb-1x/dbrp/) required: true responses: '200': content: application/json: + examples: + successResponse: + value: + content: + bucketID: 4d4d9d5b61dee751 + database: example_database + default: false + id: 0a3cbb5dd526a000 + orgID: bea7ea952287f70d + retention_policy: example_retention_policy schema: $ref: '#/components/schemas/DBRPGet' description: An updated mapping '400': content: application/json: + examples: + invalidRequest: + description: | + The query parameters contain invalid values. + value: + code: invalid + message: invalid ID schema: $ref: '#/components/schemas/Error' - description: if any of the IDs passed is invalid + description: Bad Request. Query parameters contain invalid values. + '401': + $ref: '#/components/responses/AuthorizationError' '404': - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: The mapping was not found + $ref: '#/components/responses/ResourceNotFoundError' + '500': + $ref: '#/components/responses/InternalServerError' default: content: application/json: @@ -9980,6 +10204,20 @@ paths: summary: Update a database retention policy mapping tags: - DBRPs + x-codeSamples: + - label: 'cURL: Update a DBRP mapping' + lang: Shell + source: | + curl --request PATCH \ + "http://localhost:8086/api/v2/dbrp/DBRP_ID" \ + --header 'Content-type: application/json' \ + --header "Authorization: Token INFLUX_API_TOKEN" \ + --data-binary @- << EOF + { + "default": true, + "retention_policy": "example_retention_policy_name" + } + EOF /api/v2/delete: post: description: | @@ -13750,26 +13988,6 @@ paths: required: false schema: type: string - - description: | - A list of label names. - Only returns scripts that have all the specified labels. - To retrieve a script, each name you pass in `labelNames` must exactly - match the label for a script. - in: query - name: labelNames - required: false - schema: - items: - type: string - type: array - - description: | - A part of the label name. - Returns scripts that have a label that contains the specified phrase. - in: query - name: labelContains - required: false - schema: - type: string responses: '200': content: @@ -14251,116 +14469,6 @@ paths: "mybucket": "air_sensor" } }' - /api/v2/scripts/{scriptID}/labels/add: - patch: - description: | - Adds labels to a [script](/influxdb/cloud/api-guide/api-invokable-scripts/) - and returns the script. - operationId: PatchScriptsIDAddLabels - parameters: - - description: | - The script ID. - Adds labels to the specified script. - in: path - name: scriptID - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - labels: - description: A list of label names to add. - example: - - label1 - - label2 - - label3 - items: - type: string - type: array - type: object - description: The labels to add to the script. - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Script' - description: | - Success. - The response body contains the updated script. - '400': - $ref: '#/components/responses/BadRequestError' - '401': - $ref: '#/components/responses/AuthorizationError' - '404': - $ref: '#/components/responses/ServerError' - description: Script not found. - '500': - $ref: '#/components/responses/InternalServerError' - default: - $ref: '#/components/responses/ServerError' - description: Unexpected error. - summary: Add labels to a script - tags: - - Invokable Scripts - /api/v2/scripts/{scriptID}/labels/remove: - patch: - description: Removes labels from a script and returns the script. - operationId: PatchScriptsIDRemoveLabels - parameters: - - description: | - A script ID. - Removes labels from the specified script. - in: path - name: scriptID - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - labels: - description: A list of label names to remove. - example: - - label1 - - label2 - - label3 - items: - type: string - type: array - type: object - description: The labels to remove from the script. - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Script' - description: | - Success. - The response body contains the updated script. - '400': - $ref: '#/components/responses/BadRequestError' - '401': - $ref: '#/components/responses/AuthorizationError' - '404': - $ref: '#/components/responses/ServerError' - description: Script not found. - '500': - $ref: '#/components/responses/InternalServerError' - default: - $ref: '#/components/responses/ServerError' - description: Unexpected error. - summary: Remove labels from a script - tags: - - Invokable Scripts /api/v2/scripts/{scriptID}/params: get: description: | @@ -14551,7 +14659,7 @@ paths: If authentication is successful, InfluxDB creates a new session for the user and then returns the session cookie in the `Set-Cookie` response header. - User sessions exist only in memory. + InfluxDB stores user sessions in memory only. They expire within ten minutes and during restarts of the InfluxDB instance. #### User sessions with authorizations @@ -14601,6 +14709,7 @@ paths: - BasicAuthentication: [] summary: Create a user session. tags: + - Security and access endpoints - Signin x-codeSamples: - label: 'cURL: signin with --user option encoding' @@ -14610,28 +14719,108 @@ paths: --user "USERNAME:PASSWORD" /api/v2/signout: post: - description: Expires the current UI session for the user. + description: | + Expires a user session specified by a session cookie. + + Use this endpoint to expire a user session that was generated when the user + authenticated with the InfluxDB Developer Console (UI) or the `POST /api/v2/signin` endpoint. + + For example, the `POST /api/v2/signout` endpoint represents the third step + in the following three-step process + to authenticate a user, retrieve the `user` resource, and then expire the session: + + 1. Send a request with the user's [Basic authentication credentials](#section/Authentication/BasicAuthentication) + to the `POST /api/v2/signin` endpoint to create a user session and + generate a session cookie. + 2. Send a request to the `GET /api/v2/me` endpoint, passing the stored session cookie + from step 1 to retrieve user information. + 3. Send a request to the `POST /api/v2/signout` endpoint, passing the stored session + cookie to expire the session. + + _See the complete example in request samples._ + + InfluxDB stores user sessions in memory only. + If a user doesn't sign out, then the user session automatically expires within ten minutes or + during a restart of the InfluxDB instance. + + To learn more about cookies in HTTP requests, see + [Mozilla Developer Network (MDN) Web Docs, HTTP cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies). + + #### Related endpoints + + - [Signin](#tag/Signin) operationId: PostSignout parameters: - $ref: '#/components/parameters/TraceSpan' responses: '204': - description: Session successfully expired + description: Success. The session is expired. '401': content: application/json: schema: $ref: '#/components/schemas/Error' - description: Unauthorized access + description: Unauthorized. default: content: application/json: schema: $ref: '#/components/schemas/Error' - description: Unsuccessful session expiry - summary: Expire the current UI session + description: The session expiry is unsuccessful. + summary: Expire a user session tags: + - Security and access endpoints - Signout + x-codeSamples: + - label: 'cURL: sign in a user, verify the user session, and then end the session' + lang: Shell + source: | + # The following example shows how to use cURL and the InfluxDB API + # to do the following: + # 1. Sign in a user with a username and password. + # 2. Check that the user session exists for the user. + # 3. Sign out the user to expire the session. + # 4. Check that the session is no longer active. + + # 1. Send a request to `POST /api/v2/signin` to sign in the user. + # In your request, pass the following: + # + # - `--user` option with basic authentication credentials. + # - `-c` option with a file path where cURL will write cookies. + + curl --request POST \ + -c ./cookie-file.tmp \ + "$INFLUX_URL/api/v2/signin" \ + --user "${INFLUX_USER_NAME}:${INFLUX_USER_PASSWORD}" + + # 2. To check that a user session exists for the user in step 1, + # send a request to `GET /api/v2/me`. + # In your request, pass the `-b` option with the session cookie file path from step 1. + + curl --request GET \ + -b ./cookie-file.tmp \ + "$INFLUX_URL/api/v2/me" + + # InfluxDB responds with the `user` resource. + + # 3. Send a request to `POST /api/v2/signout` to expire the user session. + # In your request, pass the `-b` option with the session cookie file path from step 1. + + curl --request POST \ + -b ./cookie-file.tmp \ + "$INFLUX_URL/api/v2/signout" + + # If the user session is successfully expired, InfluxDB responds with + an HTTP `204` status code. + + # 4. To check that the user session is expired, call `GET /api/v2/me` again, + # passing the `-b` option with the cookie file path. + + curl --request GET \ + -b ./cookie-file.tmp \ + "$INFLUX_URL/api/v2/me" + + # If the user session is expired, InfluxDB responds with an HTTP `401` status code. /api/v2/stacks: get: description: | @@ -18685,7 +18874,20 @@ tags: - name: Config - name: Dashboards - name: Data I/O endpoints - - name: DBRPs + - description: | + The InfluxDB 1.x data model includes [databases](/influxdb/v1.8/concepts/glossary/#database) + and [retention policies](/influxdb/v1.8/concepts/glossary/#retention-policy-rp). + InfluxDB 2.x replaces databases and retention policies with buckets. + To support InfluxDB 1.x query and write patterns in InfluxDB 2.x, + databases and retention policies are mapped to buckets using the + database and retention policy (DBRP) mapping service. + The DBRP mapping service uses the database and retention policy + specified in 1.x compatibility API requests to route operations to a bucket. + + ### Related guides + + - [Database and retention policy mapping](/influxdb/cloud/reference/api/influxdb-1x/dbrp/) + name: DBRPs - description: | Delete data from an InfluxDB bucket. name: Delete diff --git a/api-docs/getswagger.sh b/api-docs/getswagger.sh index a531ab716..865b3fdfb 100755 --- a/api-docs/getswagger.sh +++ b/api-docs/getswagger.sh @@ -105,24 +105,24 @@ function postProcess() { specPath=$1 platform="$2" apiVersion="$3" - openapiCLI=" @redocly/cli" + currentPath=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) npx --version # 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=) + # preceding the command name, you can then access the variables + # in the NodeJS process.env global object. INFLUXDB_API_VERSION=$apiVersion \ INFLUXDB_PLATFORM=$platform \ + API_DOCS_ROOT_PATH=$currentPath \ npm_config_yes=true \ npx $openapiCLI bundle $specPath \ -o $specPath \ --config=./.redocly.yaml - - # Lint the bundle output. - npx $openapiCLI lint $specPath \ - --max-problems 2 } function updateCloud { diff --git a/api-docs/openapi/content/content.js b/api-docs/openapi/content/content.js deleted file mode 100644 index 64847b499..000000000 --- a/api-docs/openapi/content/content.js +++ /dev/null @@ -1,26 +0,0 @@ -const path = require('path'); -const { toJSON } = require('../plugins/helpers/content-helper'); - -function getVersion(filename) { - return path.join(__dirname, process.env.INFLUXDB_PLATFORM, - (process.env.INFLUXDB_API_VERSION || ''), - filename); -} - -const info = () => toJSON(getVersion('info.yml')); - -const securitySchemes = () => toJSON(getVersion('security-schemes.yml')); - -const servers = () => toJSON(path.join(__dirname, 'servers.yml')); - -const tags = () => toJSON(getVersion('tags.yml')); - -const tagGroups = () => toJSON(getVersion('tag-groups.yml')); - -module.exports = { - info, - securitySchemes, - servers, - tagGroups, - tags, -} diff --git a/api-docs/openapi/content/servers.yml b/api-docs/openapi/content/servers.yml deleted file mode 100644 index 32cf3d7c0..000000000 --- a/api-docs/openapi/content/servers.yml +++ /dev/null @@ -1 +0,0 @@ -- url: '/' diff --git a/api-docs/openapi/plugins/decorators/servers/set-servers.js b/api-docs/openapi/plugins/decorators/servers/set-servers.js index ae2c5a162..774495926 100644 --- a/api-docs/openapi/plugins/decorators/servers/set-servers.js +++ b/api-docs/openapi/plugins/decorators/servers/set-servers.js @@ -1,7 +1,5 @@ module.exports = SetServers; -const { servers } = require('../../../content/content') - /** @type {import('@redocly/openapi-cli').OasDecorator} */ /** @@ -9,8 +7,7 @@ const { servers } = require('../../../content/content') * The key instructs openapi when to invoke the key's Visitor object. * Object key "Server" is an OAS 3.0 node type. */ -function SetServers() { - const data = servers(); +function SetServers(data) { return { DefinitionRoot: { leave(root) { diff --git a/api-docs/openapi/plugins/decorators/set-info.js b/api-docs/openapi/plugins/decorators/set-info.js index eb97a548e..41974c010 100644 --- a/api-docs/openapi/plugins/decorators/set-info.js +++ b/api-docs/openapi/plugins/decorators/set-info.js @@ -1,11 +1,7 @@ module.exports = SetInfo; -const { info } = require('../../content/content') - /** @type {import('@redocly/openapi-cli').OasDecorator} */ -function SetInfo() { - const data = info(); - +function SetInfo(data) { return { Info: { leave(info, ctx) { diff --git a/api-docs/openapi/plugins/decorators/tags/set-tag-groups.js b/api-docs/openapi/plugins/decorators/tags/set-tag-groups.js index 244df0699..07477bb5c 100644 --- a/api-docs/openapi/plugins/decorators/tags/set-tag-groups.js +++ b/api-docs/openapi/plugins/decorators/tags/set-tag-groups.js @@ -1,6 +1,5 @@ module.exports = SetTagGroups; -const { tagGroups } = require('../../../content/content') const { collect, getName, sortName } = require('../../helpers/content-helper.js') /** * Returns an object that defines handler functions for: @@ -15,8 +14,7 @@ const { collect, getName, sortName } = require('../../helpers/content-helper.js' * and sets the value of `All Endpoints` to the collected tags. */ /** @type {import('@redocly/openapi-cli').OasDecorator} */ -function SetTagGroups() { - let data = tagGroups(); +function SetTagGroups(data) { if(!Array.isArray(data)) { data = []; } diff --git a/api-docs/openapi/plugins/docs-content.js b/api-docs/openapi/plugins/docs-content.js new file mode 100644 index 000000000..6cbc764e7 --- /dev/null +++ b/api-docs/openapi/plugins/docs-content.js @@ -0,0 +1,17 @@ +const path = require('path'); +const { toJSON } = require('./helpers/content-helper'); + +function getVersioned(filename) { + const apiDocsRoot=path.resolve(process.env.API_DOCS_ROOT_PATH); + const contentPath = path.join(apiDocsRoot, process.env.INFLUXDB_PLATFORM, 'content'); + + return toJSON(path.join(contentPath, (process.env.INFLUXDB_API_VERSION || ''), filename)); +} + +const info = () => getVersioned('info.yml'); +const tagGroups = () => getVersioned('tag-groups.yml'); + +module.exports = { + info, + tagGroups, +} diff --git a/api-docs/openapi/plugins/docs-plugin.js b/api-docs/openapi/plugins/docs-plugin.js index 8d2ed8275..e56aae28e 100644 --- a/api-docs/openapi/plugins/docs-plugin.js +++ b/api-docs/openapi/plugins/docs-plugin.js @@ -1,3 +1,4 @@ +const {info, 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'); @@ -22,13 +23,13 @@ const rules = { /** @type {import('@redocly/openapi-cli').CustomRulesConfig} */ const decorators = { oas3: { - 'set-servers': SetServers, + 'set-servers': () => SetServers([ { url: '/' } ]), 'delete-servers': DeleteServers, 'remove-private-paths': RemovePrivatePaths, 'strip-version-prefix': StripVersionPrefix, 'strip-trailing-slash': StripTrailingSlash, - 'set-info': SetInfo, - 'set-tag-groups': SetTagGroups, + 'set-info': () => SetInfo(info()), + 'set-tag-groups': () => SetTagGroups(tagGroups()), 'replace-docs-url-shortcode': ReplaceShortcodes().docsUrl, } }; diff --git a/api-docs/openapi/content/v2.0/info.yml b/api-docs/v2.0/content/info.yml similarity index 100% rename from api-docs/openapi/content/v2.0/info.yml rename to api-docs/v2.0/content/info.yml diff --git a/api-docs/openapi/content/v2.1/info.yml b/api-docs/v2.1/content/info.yml similarity index 100% rename from api-docs/openapi/content/v2.1/info.yml rename to api-docs/v2.1/content/info.yml diff --git a/api-docs/openapi/content/v2.1/v1compat/info.yml b/api-docs/v2.1/content/v1compat/info.yml similarity index 100% rename from api-docs/openapi/content/v2.1/v1compat/info.yml rename to api-docs/v2.1/content/v1compat/info.yml diff --git a/api-docs/openapi/content/v2.1/v1compat/tag-groups.yml b/api-docs/v2.1/content/v1compat/tag-groups.yml similarity index 100% rename from api-docs/openapi/content/v2.1/v1compat/tag-groups.yml rename to api-docs/v2.1/content/v1compat/tag-groups.yml diff --git a/api-docs/openapi/content/v2.2/info.yml b/api-docs/v2.2/content/info.yml similarity index 100% rename from api-docs/openapi/content/v2.2/info.yml rename to api-docs/v2.2/content/info.yml diff --git a/api-docs/openapi/content/v2.2/v1compat/info.yml b/api-docs/v2.2/content/v1compat/info.yml similarity index 83% rename from api-docs/openapi/content/v2.2/v1compat/info.yml rename to api-docs/v2.2/content/v1compat/info.yml index b28b4e1dd..b04b7e581 100644 --- a/api-docs/openapi/content/v2.2/v1compat/info.yml +++ b/api-docs/v2.2/content/v1compat/info.yml @@ -3,7 +3,7 @@ version: 2.2.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/v2.2/api/). + 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://raw.githubusercontent.com/influxdata/openapi/docs-release/influxdb-oss/contracts/swaggerV1Compat.yml). diff --git a/api-docs/openapi/content/v2.2/v1compat/tag-groups.yml b/api-docs/v2.2/content/v1compat/tag-groups.yml similarity index 100% rename from api-docs/openapi/content/v2.2/v1compat/tag-groups.yml rename to api-docs/v2.2/content/v1compat/tag-groups.yml diff --git a/api-docs/openapi/content/v2.3/info.yml b/api-docs/v2.3/content/info.yml similarity index 100% rename from api-docs/openapi/content/v2.3/info.yml rename to api-docs/v2.3/content/info.yml diff --git a/api-docs/openapi/content/v2.3/v1compat/info.yml b/api-docs/v2.3/content/v1compat/info.yml similarity index 82% rename from api-docs/openapi/content/v2.3/v1compat/info.yml rename to api-docs/v2.3/content/v1compat/info.yml index 17b048997..8631c9b5c 100644 --- a/api-docs/openapi/content/v2.3/v1compat/info.yml +++ b/api-docs/v2.3/content/v1compat/info.yml @@ -3,7 +3,7 @@ version: 2.3.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/v2.2/api/). + 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.3.0/contracts/swaggerV1Compat.yml). diff --git a/api-docs/v2.3/swaggerV1Compat.yml b/api-docs/v2.3/swaggerV1Compat.yml index 34926f5ea..a71beea52 100644 --- a/api-docs/v2.3/swaggerV1Compat.yml +++ b/api-docs/v2.3/swaggerV1Compat.yml @@ -9,7 +9,7 @@ info: If you want to use the latest InfluxDB /api/v2 API instead, see the - [InfluxDB v2 API documentation](/influxdb/v2.2/api/). + [InfluxDB v2 API documentation](/influxdb/latest/api/). This documentation is generated from the diff --git a/api-docs/openapi/content/v2.4/info.yml b/api-docs/v2.4/content/info.yml similarity index 100% rename from api-docs/openapi/content/v2.4/info.yml rename to api-docs/v2.4/content/info.yml diff --git a/api-docs/openapi/content/v2.4/v1compat/info.yml b/api-docs/v2.4/content/v1compat/info.yml similarity index 82% rename from api-docs/openapi/content/v2.4/v1compat/info.yml rename to api-docs/v2.4/content/v1compat/info.yml index 38d20b458..f0fea34e1 100644 --- a/api-docs/openapi/content/v2.4/v1compat/info.yml +++ b/api-docs/v2.4/content/v1compat/info.yml @@ -3,7 +3,7 @@ version: 2.4.0 v1 compatibility description: | The InfluxDB 1.x compatibility /write and /query endpoints work with InfluxDB 1.x client libraries and third-party integrations like Grafana and others. - If you want to use the latest InfluxDB /api/v2 API instead, see the [InfluxDB v2 API documentation](/influxdb/v2.4/api/). + 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.4.0/contracts/swaggerV1Compat.yml). diff --git a/api-docs/v2.4/swaggerV1Compat.yml b/api-docs/v2.4/swaggerV1Compat.yml index ea2970e92..84973172a 100644 --- a/api-docs/v2.4/swaggerV1Compat.yml +++ b/api-docs/v2.4/swaggerV1Compat.yml @@ -5,7 +5,7 @@ info: description: | The InfluxDB 1.x compatibility /write and /query endpoints work with InfluxDB 1.x client libraries and third-party integrations like Grafana and others. - If you want to use the latest InfluxDB /api/v2 API instead, see the [InfluxDB v2 API documentation](/influxdb/v2.4/api/). + 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.4.0/contracts/swaggerV1Compat.yml). diff --git a/api-docs/openapi/content/v2.5/info.yml b/api-docs/v2.5/content/info.yml similarity index 100% rename from api-docs/openapi/content/v2.5/info.yml rename to api-docs/v2.5/content/info.yml diff --git a/api-docs/openapi/content/v2.5/v1compat/info.yml b/api-docs/v2.5/content/v1compat/info.yml similarity index 82% rename from api-docs/openapi/content/v2.5/v1compat/info.yml rename to api-docs/v2.5/content/v1compat/info.yml index 6d86c5630..d474dab15 100644 --- a/api-docs/openapi/content/v2.5/v1compat/info.yml +++ b/api-docs/v2.5/content/v1compat/info.yml @@ -3,7 +3,7 @@ version: 2.5.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/v2.4/api/). + 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.4.0/contracts/swaggerV1Compat.yml). diff --git a/api-docs/v2.5/swaggerV1Compat.yml b/api-docs/v2.5/swaggerV1Compat.yml index 5e0275afe..cb78567d7 100644 --- a/api-docs/v2.5/swaggerV1Compat.yml +++ b/api-docs/v2.5/swaggerV1Compat.yml @@ -5,10 +5,10 @@ info: description: | The InfluxDB 1.x compatibility /write and /query endpoints work with InfluxDB 1.x client libraries and third-party integrations like Grafana and others. - If you want to use the latest InfluxDB /api/v2 API instead, see the [InfluxDB v2 API documentation](/influxdb/v2.4/api/). + 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.4.0/contracts/swaggerV1Compat.yml). + [InfluxDB OpenAPI specification](https://github.com/influxdata/openapi/blob/influxdb-oss-v2.5.0/contracts/swaggerV1Compat.yml). license: name: MIT url: https://opensource.org/licenses/MIT diff --git a/api-docs/v2.6/content/info.yml b/api-docs/v2.6/content/info.yml new file mode 100644 index 000000000..855c01933 --- /dev/null +++ b/api-docs/v2.6/content/info.yml @@ -0,0 +1,10 @@ +title: InfluxDB OSS API Service +version: 2.6.0 +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://github.com/influxdata/openapi/blob/influxdb-oss-v2.6.0/contracts/ref/oss.yml). +license: + name: MIT + url: 'https://opensource.org/licenses/MIT' diff --git a/api-docs/v2.6/content/v1compat/info.yml b/api-docs/v2.6/content/v1compat/info.yml new file mode 100644 index 000000000..b8418af8f --- /dev/null +++ b/api-docs/v2.6/content/v1compat/info.yml @@ -0,0 +1,12 @@ +title: InfluxDB OSS v1 compatibility API documentation +version: 2.6.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.6.0/contracts/swaggerV1Compat.yml). +license: + name: MIT + url: 'https://opensource.org/licenses/MIT' \ No newline at end of file diff --git a/api-docs/v2.6/ref.yml b/api-docs/v2.6/ref.yml index b7683bc64..8b85873d6 100644 --- a/api-docs/v2.6/ref.yml +++ b/api-docs/v2.6/ref.yml @@ -6739,7 +6739,16 @@ components: name: Authorization type: apiKey info: - title: Complete InfluxDB OSS API + title: InfluxDB OSS API Service + version: 2.6.0 + 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://github.com/influxdata/openapi/blob/influxdb-oss-v2.6.0/contracts/ref/oss.yml). + license: + name: MIT + url: https://opensource.org/licenses/MIT openapi: 3.0.0 paths: /api/v2: diff --git a/api-docs/v2.6/swaggerV1Compat.yml b/api-docs/v2.6/swaggerV1Compat.yml index 5e0275afe..741123163 100644 --- a/api-docs/v2.6/swaggerV1Compat.yml +++ b/api-docs/v2.6/swaggerV1Compat.yml @@ -1,14 +1,14 @@ openapi: 3.0.0 info: title: InfluxDB OSS v1 compatibility API documentation - version: 2.5.0 v1 compatibility + version: 2.6.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/v2.4/api/). + 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.4.0/contracts/swaggerV1Compat.yml). + [InfluxDB OpenAPI specification](https://github.com/influxdata/openapi/blob/influxdb-oss-v2.6.0/contracts/swaggerV1Compat.yml). license: name: MIT url: https://opensource.org/licenses/MIT