chore(api): update to latest openapi: (#4624)
- authorizations docs - update Authorizations tag to Authorizations (API tokens) - update link in influxdb/content/v2.5 to match - replace /latest/ with /v2.4/ in latest.pull/4626/head
parent
223acc897f
commit
fff1693ed3
|
|
@ -377,7 +377,7 @@ components:
|
|||
type: string
|
||||
status:
|
||||
default: active
|
||||
description: Status of the token. If `inactive`, requests using the token will be rejected.
|
||||
description: Status of the token. If `inactive`, InfluxDB rejects requests that use the token.
|
||||
enum:
|
||||
- active
|
||||
- inactive
|
||||
|
|
@ -2345,21 +2345,21 @@ components:
|
|||
- $ref: '#/components/schemas/AuthorizationUpdateRequest'
|
||||
- properties:
|
||||
orgID:
|
||||
description: The ID of the organization that the authorization is scoped to.
|
||||
description: The organization ID. Identifies the organization that the authorization is scoped to.
|
||||
type: string
|
||||
permissions:
|
||||
description: |
|
||||
A list of permissions that provide `read` and `write` access to organization resources.
|
||||
The list of permissions that provide `read` and `write` access to organization resources.
|
||||
An authorization must contain at least one permission.
|
||||
items:
|
||||
$ref: '#/components/schemas/Permission'
|
||||
minItems: 1
|
||||
type: array
|
||||
token:
|
||||
description: A name that you provide for the authorization.
|
||||
description: The name that you provide for the authorization.
|
||||
type: string
|
||||
userID:
|
||||
description: The ID of the user that the authorization is scoped to.
|
||||
description: The user ID. Identifies the user that the authorization is scoped to.
|
||||
type: string
|
||||
type: object
|
||||
required:
|
||||
|
|
@ -3437,6 +3437,24 @@ components:
|
|||
- type
|
||||
- messageTemplate
|
||||
type: object
|
||||
Params:
|
||||
properties:
|
||||
params:
|
||||
additionalProperties:
|
||||
enum:
|
||||
- any
|
||||
- bool
|
||||
- duration
|
||||
- float
|
||||
- int
|
||||
- string
|
||||
- time
|
||||
- uint
|
||||
type: string
|
||||
description: |
|
||||
The `params` keys and value type defined in the script.
|
||||
type: object
|
||||
type: object
|
||||
ParenExpression:
|
||||
description: Represents an expression wrapped in parenthesis
|
||||
properties:
|
||||
|
|
@ -3946,7 +3964,7 @@ components:
|
|||
#### InfluxDB OSS
|
||||
|
||||
- Default value depends on the
|
||||
[bucket retention period](/influxdb/cloud/v2.3/reference/internals/shards/#shard-group-duration).
|
||||
[bucket retention period](/influxdb/cloud/reference/internals/shards/#shard-group-duration).
|
||||
format: int64
|
||||
type: integer
|
||||
type:
|
||||
|
|
@ -4377,11 +4395,10 @@ components:
|
|||
ScriptUpdateRequest:
|
||||
properties:
|
||||
description:
|
||||
type: string
|
||||
name:
|
||||
description: A description of the script.
|
||||
type: string
|
||||
script:
|
||||
description: script is script to be executed
|
||||
description: The script to execute.
|
||||
type: string
|
||||
type: object
|
||||
Scripts:
|
||||
|
|
@ -6633,7 +6650,7 @@ components:
|
|||
|
||||
### Related endpoints
|
||||
|
||||
- [`/authorizations` endpoints](#tag/Authorizations)
|
||||
- [`/authorizations` endpoints](#tag/Authorizations-(API-tokens))
|
||||
|
||||
### Related guides
|
||||
|
||||
|
|
@ -6689,7 +6706,7 @@ paths:
|
|||
Lists authorizations.
|
||||
|
||||
To limit which authorizations are returned, pass query parameters in your request.
|
||||
If no query parameters are passed, InfluxDB returns all authorizations for the organization.
|
||||
If no query parameters are passed, InfluxDB returns all authorizations.
|
||||
|
||||
#### InfluxDB Cloud
|
||||
|
||||
|
|
@ -6699,7 +6716,11 @@ paths:
|
|||
|
||||
#### Required permissions
|
||||
|
||||
To retrieve an authorization, the request must use an API token that has the
|
||||
following permissions:
|
||||
|
||||
- `read-authorizations`
|
||||
- `read-user` for the user that the authorization is scoped to
|
||||
|
||||
#### Related guides
|
||||
|
||||
|
|
@ -6709,39 +6730,45 @@ paths:
|
|||
- $ref: '#/components/parameters/TraceSpan'
|
||||
- description: |
|
||||
A user ID.
|
||||
Only returns authorizations scoped to the specified
|
||||
[user](/influxdb/cloud/reference/glossary/#user).
|
||||
Only returns authorizations scoped to the specified [user](/influxdb/cloud/reference/glossary/#user).
|
||||
in: query
|
||||
name: userID
|
||||
schema:
|
||||
type: string
|
||||
- description: |
|
||||
A user name.
|
||||
Only returns authorizations scoped to the specified
|
||||
[user](/influxdb/cloud/reference/glossary/#user).
|
||||
Only returns authorizations scoped to the specified [user](/influxdb/cloud/reference/glossary/#user).
|
||||
in: query
|
||||
name: user
|
||||
schema:
|
||||
type: string
|
||||
- description: |
|
||||
An organization ID.
|
||||
Only returns authorizations that belong to the specified
|
||||
[organization](/influxdb/cloud/reference/glossary/#organization).
|
||||
- description: An organization ID. Only returns authorizations that belong to the specified [organization](/influxdb/cloud/reference/glossary/#organization).
|
||||
in: query
|
||||
name: orgID
|
||||
schema:
|
||||
type: string
|
||||
- description: |
|
||||
An organization name.
|
||||
Only returns authorizations that belong to the specified
|
||||
[organization](/influxdb/cloud/reference/glossary/#organization).
|
||||
Only returns authorizations that belong to the specified [organization](/influxdb/cloud/reference/glossary/#organization).
|
||||
in: query
|
||||
name: org
|
||||
schema:
|
||||
type: string
|
||||
- description: |
|
||||
An API [token](/influxdb/cloud/reference/glossary/#token) value.
|
||||
Returns the authorization for the specified token.
|
||||
Specifies an authorization by its `token` property value
|
||||
and returns the authorization.
|
||||
|
||||
#### InfluxDB OSS
|
||||
|
||||
- Doesn't support this parameter. InfluxDB OSS ignores the `token=` parameter,
|
||||
applies other parameters, and then returns the result.
|
||||
|
||||
#### Limitations
|
||||
|
||||
- The parameter is non-repeatable. If you specify more than one,
|
||||
only the first one is used. If a resource with the specified
|
||||
property value doesn't exist, then the response body contains an empty list.
|
||||
in: query
|
||||
name: token
|
||||
schema:
|
||||
|
|
@ -6752,7 +6779,19 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Authorizations'
|
||||
description: Success. The response body contains a list of authorizations.
|
||||
description: |
|
||||
Success. The response body contains a list of authorizations.
|
||||
|
||||
If the response body is missing authorizations that you expect, check that the API
|
||||
token used in the request has `read-user` permission for the users (`userID` property value)
|
||||
in those authorizations.
|
||||
|
||||
#### InfluxDB OSS
|
||||
|
||||
- **Warning**: The response body contains authorizations with their
|
||||
[API token](/influxdb/cloud/reference/glossary/#token) values in clear text.
|
||||
- If the request uses an _[operator token](/influxdb/latest/security/tokens/#operator-token)_,
|
||||
InfluxDB OSS returns authorizations for all organizations in the instance.
|
||||
'400':
|
||||
$ref: '#/components/responses/GeneralServerError'
|
||||
description: Invalid request
|
||||
|
|
@ -6765,7 +6804,8 @@ paths:
|
|||
description: Unexpected error
|
||||
summary: List authorizations
|
||||
tags:
|
||||
- Authorizations
|
||||
- Authorizations (API tokens)
|
||||
- Security and access endpoints
|
||||
post:
|
||||
description: |
|
||||
Creates an authorization and returns the authorization with the
|
||||
|
|
@ -6773,20 +6813,24 @@ paths:
|
|||
|
||||
Use this endpoint to create an authorization, which generates an API token
|
||||
with permissions to `read` or `write` to a specific resource or `type` of resource.
|
||||
|
||||
#### Limitations
|
||||
The API token is the authorization's `token` property value.
|
||||
|
||||
To follow best practices for secure API token generation and retrieval,
|
||||
InfluxDB Cloud enforces access restrictions on API tokens.
|
||||
InfluxDB enforces access restrictions on API tokens.
|
||||
|
||||
- InfluxDB only allows access to the API token value immediately after the authorization is created.
|
||||
- You can't update an authorization's permissions.
|
||||
- A token stops working when the user who created the authorization is deleted.
|
||||
- InfluxDB allows access to the API token value immediately after the authorization is created.
|
||||
- You can’t change access (read/write) permissions for an API token after it’s created.
|
||||
- Tokens stop working when the user who created the token is deleted.
|
||||
|
||||
We recommend the following for managing your tokens:
|
||||
|
||||
- Create a generic user to create and manage tokens for writing data.
|
||||
- Store your tokens in a secure password vault for future access.
|
||||
- Create a generic user to create and manage tokens for writing data.
|
||||
- Store your tokens in a secure password vault for future access.
|
||||
|
||||
#### Required permissions
|
||||
|
||||
- `write-authorizations`
|
||||
- `write-user` for the user that the authorization is scoped to
|
||||
|
||||
#### Related guides
|
||||
|
||||
|
|
@ -6815,7 +6859,8 @@ paths:
|
|||
schema:
|
||||
$ref: '#/components/schemas/Authorization'
|
||||
description: |
|
||||
Success. The authorization is created. The response body contains the authorization.
|
||||
Success. The authorization is created. The response body contains the
|
||||
authorization.
|
||||
'400':
|
||||
$ref: '#/components/responses/GeneralServerError'
|
||||
description: Invalid request
|
||||
|
|
@ -6828,13 +6873,21 @@ paths:
|
|||
description: Unexpected error
|
||||
summary: Create an authorization
|
||||
tags:
|
||||
- Authorizations
|
||||
- Authorizations (API tokens)
|
||||
- Security and access endpoints
|
||||
/api/v2/authorizations/{authID}:
|
||||
delete:
|
||||
description: |
|
||||
Deletes an authorization.
|
||||
|
||||
Use the endpoint to delete an API token.
|
||||
|
||||
If you want to disable an API token instead of delete it,
|
||||
[update the authorization's status to `inactive`](#operation/PatchAuthorizationsID).
|
||||
operationId: DeleteAuthorizationsID
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/TraceSpan'
|
||||
- description: The identifier of the authorization to delete.
|
||||
- description: An authorization ID. Specifies the authorization to delete.
|
||||
in: path
|
||||
name: authID
|
||||
required: true
|
||||
|
|
@ -6842,18 +6895,70 @@ paths:
|
|||
type: string
|
||||
responses:
|
||||
'204':
|
||||
description: Authorization deleted
|
||||
description: Success. The authorization is deleted.
|
||||
'400':
|
||||
content:
|
||||
application/json:
|
||||
examples:
|
||||
notFound:
|
||||
summary: |
|
||||
The specified resource ID is invalid.
|
||||
value:
|
||||
code: invalid
|
||||
message: id must have a length of 16 bytes
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
description: |
|
||||
Bad request.
|
||||
'401':
|
||||
$ref: '#/components/responses/AuthorizationError'
|
||||
'404':
|
||||
content:
|
||||
application/json:
|
||||
examples:
|
||||
notFound:
|
||||
summary: |
|
||||
The requested authorization doesn't exist.
|
||||
value:
|
||||
code: not found
|
||||
message: authorization not found
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
description: |
|
||||
Not found.
|
||||
'500':
|
||||
$ref: '#/components/responses/InternalServerError'
|
||||
default:
|
||||
$ref: '#/components/responses/GeneralServerError'
|
||||
description: Unexpected error
|
||||
summary: Delete an authorization
|
||||
tags:
|
||||
- Authorizations
|
||||
- Authorizations (API tokens)
|
||||
- Security and access endpoints
|
||||
get:
|
||||
description: |
|
||||
Retrieves an authorization.
|
||||
|
||||
Use this endpoint to retrieve information about an API token, including
|
||||
the token's permissions and the user that the token is scoped to.
|
||||
|
||||
#### InfluxDB OSS
|
||||
|
||||
- InfluxDB OSS returns
|
||||
[API token](/influxdb/cloud/reference/glossary/#token) values in authorizations.
|
||||
- If the request uses an _[operator token](/influxdb/latest/security/tokens/#operator-token)_,
|
||||
InfluxDB OSS returns authorizations for all organizations in the instance.
|
||||
|
||||
#### Related guides
|
||||
|
||||
- [View tokens](/influxdb/cloud/security/tokens/view-tokens/)
|
||||
externalDocs:
|
||||
description: View tokens
|
||||
url: https://docs.influxdata.com/influxdb/cloud/security/tokens/view-tokens/
|
||||
operationId: GetAuthorizationsID
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/TraceSpan'
|
||||
- description: The identifier of the authorization to get.
|
||||
- description: An authorization ID. Specifies the authorization to retrieve.
|
||||
in: path
|
||||
name: authID
|
||||
required: true
|
||||
|
|
@ -6865,19 +6970,56 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Authorization'
|
||||
description: Authorization details
|
||||
description: Success. The response body contains the authorization.
|
||||
'400':
|
||||
content:
|
||||
application/json:
|
||||
examples:
|
||||
notFound:
|
||||
summary: |
|
||||
The specified resource ID is invalid.
|
||||
value:
|
||||
code: invalid
|
||||
message: id must have a length of 16 bytes
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
description: |
|
||||
Bad request.
|
||||
'401':
|
||||
$ref: '#/components/responses/AuthorizationError'
|
||||
'404':
|
||||
content:
|
||||
application/json:
|
||||
examples:
|
||||
notFound:
|
||||
summary: |
|
||||
The requested authorization doesn't exist.
|
||||
value:
|
||||
code: not found
|
||||
message: authorization not found
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
description: |
|
||||
Not found.
|
||||
'500':
|
||||
$ref: '#/components/responses/InternalServerError'
|
||||
default:
|
||||
$ref: '#/components/responses/GeneralServerError'
|
||||
description: Unexpected error
|
||||
summary: Retrieve an authorization
|
||||
tags:
|
||||
- Authorizations
|
||||
- Authorizations (API tokens)
|
||||
- Security and access endpoints
|
||||
patch:
|
||||
description: Update an authorization's status to `active` or `inactive`.
|
||||
description: |
|
||||
Updates an authorization.
|
||||
|
||||
Use this endpoint to set an API token's status to be _active_ or _inactive_.
|
||||
InfluxDB rejects requests that use inactive API tokens.
|
||||
operationId: PatchAuthorizationsID
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/TraceSpan'
|
||||
- description: The identifier of the authorization to update.
|
||||
- description: An authorization ID. Specifies the authorization to update.
|
||||
in: path
|
||||
name: authID
|
||||
required: true
|
||||
|
|
@ -6888,7 +7030,7 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/AuthorizationUpdateRequest'
|
||||
description: The updated Authorization object.
|
||||
description: In the request body, provide the authorization properties to update.
|
||||
required: true
|
||||
responses:
|
||||
'200':
|
||||
|
|
@ -6896,13 +7038,14 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Authorization'
|
||||
description: The updated authorization.
|
||||
description: Success. The response body contains the updated authorization.
|
||||
default:
|
||||
$ref: '#/components/responses/GeneralServerError'
|
||||
description: Unexpected error
|
||||
summary: Update authorization status
|
||||
summary: Update an API token to be active or inactive
|
||||
tags:
|
||||
- Authorizations
|
||||
- Authorizations (API tokens)
|
||||
- Security and access endpoints
|
||||
/api/v2/buckets:
|
||||
get:
|
||||
description: |
|
||||
|
|
@ -7905,7 +8048,7 @@ paths:
|
|||
#### InfluxDB Cloud
|
||||
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Limitations
|
||||
|
||||
|
|
@ -7921,7 +8064,7 @@ paths:
|
|||
|
||||
#### Related endpoints
|
||||
|
||||
- [Authorizations](#tag/Authorizations)
|
||||
- [Authorizations](#tag/Authorizations-(API-tokens))
|
||||
|
||||
#### Related guides
|
||||
|
||||
|
|
@ -7986,7 +8129,7 @@ paths:
|
|||
#### InfluxDB Cloud
|
||||
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Limitations
|
||||
|
||||
|
|
@ -8001,7 +8144,7 @@ paths:
|
|||
|
||||
#### Related endpoints
|
||||
|
||||
- [Authorizations](#tag/Authorizations)
|
||||
- [Authorizations](#tag/Authorizations-(API-tokens))
|
||||
|
||||
#### Related guides
|
||||
|
||||
|
|
@ -8087,7 +8230,7 @@ paths:
|
|||
#### InfluxDB Cloud
|
||||
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Limitations
|
||||
|
||||
|
|
@ -8103,7 +8246,7 @@ paths:
|
|||
|
||||
#### Related endpoints
|
||||
|
||||
- [Authorizations](#tag/Authorizations)
|
||||
- [Authorizations](#tag/Authorizations-(API-tokens))
|
||||
|
||||
#### Related guides
|
||||
|
||||
|
|
@ -8277,6 +8420,7 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/MeasurementSchemaCreateRequest'
|
||||
required: true
|
||||
responses:
|
||||
'201':
|
||||
content:
|
||||
|
|
@ -8472,6 +8616,7 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/MeasurementSchemaUpdateRequest'
|
||||
required: true
|
||||
responses:
|
||||
'200':
|
||||
content:
|
||||
|
|
@ -10030,7 +10175,7 @@ paths:
|
|||
|
||||
1. Use [token authentication](#section/Authentication/TokenAuthentication) or a [user session](#tag/Signin) with this endpoint to retrieve
|
||||
feature flags and their values.
|
||||
2. Follow the instructions to [enable, disable, or override values for feature flags](/influxdb/cloud/influxdb/v2.4/reference/config-options/#feature-flags).
|
||||
2. Follow the instructions to [enable, disable, or override values for feature flags](/influxdb/cloud/reference/config-options/#feature-flags).
|
||||
3. **Optional**: To confirm that your change is applied, do one of the following:
|
||||
|
||||
- Send a request to this endpoint to retrieve the current feature flag values.
|
||||
|
|
@ -10039,7 +10184,7 @@ paths:
|
|||
|
||||
#### Related guides
|
||||
|
||||
- [InfluxDB configuration options](/influxdb/cloud/influxdb/v2.4/reference/config-options/)
|
||||
- [InfluxDB configuration options](/influxdb/cloud/reference/config-options/)
|
||||
operationId: GetFlags
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/TraceSpan'
|
||||
|
|
@ -11335,7 +11480,7 @@ paths:
|
|||
#### InfluxDB Cloud
|
||||
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Limitations
|
||||
|
||||
|
|
@ -11433,7 +11578,7 @@ paths:
|
|||
|
||||
#### InfluxDB Cloud
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Limitations
|
||||
|
||||
|
|
@ -11532,7 +11677,7 @@ paths:
|
|||
#### InfluxDB Cloud
|
||||
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Limitations
|
||||
|
||||
|
|
@ -11593,7 +11738,7 @@ paths:
|
|||
#### InfluxDB Cloud
|
||||
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Required permissions
|
||||
|
||||
|
|
@ -11655,7 +11800,7 @@ paths:
|
|||
#### InfluxDB Cloud
|
||||
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Required permissions
|
||||
|
||||
|
|
@ -11665,7 +11810,7 @@ paths:
|
|||
|
||||
#### Related endpoints
|
||||
|
||||
- [Authorizations](#tag/Authorizations)
|
||||
- [Authorizations](#tag/Authorizations-(API-tokens))
|
||||
operationId: PostOrgsIDOwners
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/TraceSpan'
|
||||
|
|
@ -11739,7 +11884,7 @@ paths:
|
|||
|
||||
#### InfluxDB Cloud
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Limitations
|
||||
|
||||
|
|
@ -11754,7 +11899,7 @@ paths:
|
|||
remove an owner from.
|
||||
|
||||
#### Related endpoints
|
||||
- [Authorizations](#tag/Authorizations)
|
||||
- [Authorizations](#tag/Authorizations-(API-tokens))
|
||||
operationId: DeleteOrgsIDOwnersID
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/TraceSpan'
|
||||
|
|
@ -13775,7 +13920,18 @@ paths:
|
|||
}'
|
||||
/api/v2/scripts/{scriptID}:
|
||||
delete:
|
||||
description: Deletes a [script](/influxdb/cloud/api-guide/api-invokable-scripts/) and all associated records.
|
||||
description: |
|
||||
Deletes a [script](/influxdb/cloud/api-guide/api-invokable-scripts/) and all associated records.
|
||||
|
||||
#### Limitations
|
||||
|
||||
- You can delete only one script per request.
|
||||
- If the script ID you provide doesn't exist for the organization, InfluxDB
|
||||
responds with an HTTP `204` status code.
|
||||
|
||||
#### Related Guides
|
||||
|
||||
- [Invoke custom scripts](/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
operationId: DeleteScriptsID
|
||||
parameters:
|
||||
- description: |
|
||||
|
|
@ -13788,7 +13944,9 @@ paths:
|
|||
type: string
|
||||
responses:
|
||||
'204':
|
||||
description: Success. The script is deleted.
|
||||
description: |
|
||||
Success.
|
||||
The script is queued for deletion.
|
||||
'401':
|
||||
$ref: '#/components/responses/AuthorizationError'
|
||||
'500':
|
||||
|
|
@ -13799,9 +13957,21 @@ paths:
|
|||
summary: Delete a script
|
||||
tags:
|
||||
- Invokable Scripts
|
||||
x-codeSamples:
|
||||
- label: cURL
|
||||
lang: Shell
|
||||
source: |
|
||||
curl -X 'DELETE' \
|
||||
"https://cloud2.influxdata.com/api/v2/scripts/SCRIPT_ID" \
|
||||
--header "Authorization: Token INFLUX_TOKEN" \
|
||||
--header 'Accept: application/json'
|
||||
get:
|
||||
description: |
|
||||
Retrieves a [script](/influxdb/cloud/api-guide/api-invokable-scripts/).
|
||||
|
||||
#### Related Guides
|
||||
|
||||
- [Invoke custom scripts](/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
operationId: GetScriptsID
|
||||
parameters:
|
||||
- description: |
|
||||
|
|
@ -13816,25 +13986,62 @@ paths:
|
|||
'200':
|
||||
content:
|
||||
application/json:
|
||||
examples:
|
||||
successResponse:
|
||||
value:
|
||||
createdAt: '2022-07-17T23:49:45.731237Z'
|
||||
description: getLastPoint finds the last point in a bucket
|
||||
id: 09afa3b220fe4000
|
||||
language: flux
|
||||
name: getLastPoint
|
||||
orgID: bea7ea952287f70d
|
||||
script: 'from(bucket: my-bucket) |> range(start: -7d) |> limit(n:1)'
|
||||
updatedAt: '2022-07-17T23:49:45.731237Z'
|
||||
schema:
|
||||
$ref: '#/components/schemas/Script'
|
||||
description: Success. The response body contains the script.
|
||||
'401':
|
||||
$ref: '#/components/responses/AuthorizationError'
|
||||
'404':
|
||||
content:
|
||||
application/json:
|
||||
examples:
|
||||
notFound:
|
||||
summary: |
|
||||
The requested script was not found.
|
||||
value:
|
||||
code: not found
|
||||
message: script "09afa3b220fe400" not found
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
description: |
|
||||
Not found.
|
||||
'500':
|
||||
$ref: '#/components/responses/InternalServerError'
|
||||
default:
|
||||
$ref: '#/components/responses/ServerError'
|
||||
description: Unexpected error.
|
||||
description: Internal server error.
|
||||
summary: Retrieve a script
|
||||
tags:
|
||||
- Data I/O endpoints
|
||||
- Invokable Scripts
|
||||
patch:
|
||||
description: |
|
||||
Updates a [script](/influxdb/cloud/api-guide/api-invokable-scripts/) and returns the script.
|
||||
Updates an invokable script.
|
||||
|
||||
Use this endpoint to update the properties (`name`, `description`, and `script`) of an invokable script.
|
||||
Use this endpoint to modify values for script properties (`description` and `script`).
|
||||
|
||||
To update a script, pass an object that contains the updated key-value pairs.
|
||||
|
||||
#### Limitations
|
||||
|
||||
- If you send an empty request body, the script will neither update nor
|
||||
store an empty script, but InfluxDB will respond with an HTTP `200` status
|
||||
code.
|
||||
|
||||
#### Related Guides
|
||||
|
||||
- [Invoke custom scripts](/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
operationId: PatchScriptsID
|
||||
parameters:
|
||||
- description: |
|
||||
|
|
@ -13850,27 +14057,64 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ScriptUpdateRequest'
|
||||
description: The script update to apply.
|
||||
description: |
|
||||
An object that contains the updated script properties to apply.
|
||||
required: true
|
||||
responses:
|
||||
'200':
|
||||
content:
|
||||
application/json:
|
||||
examples:
|
||||
successResponse:
|
||||
value:
|
||||
createdAt: '2022-07-17T23:49:45.731237Z'
|
||||
description: get last point from new bucket
|
||||
id: 09afa3b220fe4000
|
||||
language: flux
|
||||
name: getLastPoint
|
||||
orgID: bea7ea952287f70d
|
||||
script: 'from(bucket: newBucket) |> range(start: -7d) |> limit(n:1)'
|
||||
updatedAt: '2022-07-19T22:27:23.185436Z'
|
||||
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':
|
||||
content:
|
||||
application/json:
|
||||
examples:
|
||||
notFound:
|
||||
summary: |
|
||||
The requested script wasn't found.
|
||||
value:
|
||||
code: not found
|
||||
message: script "09afa3b220fe400" not found
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
description: |
|
||||
Not found.
|
||||
'500':
|
||||
$ref: '#/components/responses/InternalServerError'
|
||||
default:
|
||||
$ref: '#/components/responses/ServerError'
|
||||
description: Unexpected error
|
||||
description: Internal server error
|
||||
summary: Update a script
|
||||
tags:
|
||||
- Invokable Scripts
|
||||
x-codeSamples:
|
||||
- label: cURL
|
||||
lang: Shell
|
||||
source: |
|
||||
curl -X 'PATCH' \
|
||||
"https://cloud2.influxdata.com/api/v2/scripts/SCRIPT_ID" \
|
||||
--header "Authorization: Token INFLUX_TOKEN" \
|
||||
--header "Accept: application/json"
|
||||
--header "Content-Type: application/json"
|
||||
--data '{
|
||||
"description": "get last point from new bucket",
|
||||
"script": "from(bucket: updatedBucket) |> range(start: -7d) |> limit(n:1)", "language": "flux"
|
||||
}'
|
||||
/api/v2/scripts/{scriptID}/invoke:
|
||||
post:
|
||||
description: |
|
||||
|
|
@ -14117,6 +14361,116 @@ paths:
|
|||
summary: Remove labels from a script
|
||||
tags:
|
||||
- Invokable Scripts
|
||||
/api/v2/scripts/{scriptID}/params:
|
||||
get:
|
||||
description: |
|
||||
Analyzes a script and determines required parameters.
|
||||
Find all `params` keys referenced in a script and return a list
|
||||
of keys. If it is possible to determine the type of the value
|
||||
from the context then the type is also returned -- for example:
|
||||
|
||||
The following sample script contains a _`mybucket`_ parameter :
|
||||
|
||||
```json
|
||||
"script": "from(bucket: params.mybucket)
|
||||
|> range(start: -7d)
|
||||
|> limit(n:1)"
|
||||
```
|
||||
|
||||
Requesting the parameters using `GET /api/v2/scripts/SCRIPT_ID/params`
|
||||
returns the following:
|
||||
|
||||
```json
|
||||
{
|
||||
"params": {
|
||||
"mybucket": "string"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The type name returned for a parameter will be one of:
|
||||
|
||||
- `any`
|
||||
- `bool`
|
||||
- `duration`
|
||||
- `float`
|
||||
- `int`
|
||||
- `string`
|
||||
- `time`
|
||||
- `uint`
|
||||
|
||||
The type name `any` is used when the type of a parameter cannot
|
||||
be determined from the context, or the type is determined to
|
||||
be a structured type such as an array or record.
|
||||
|
||||
#### Related guides
|
||||
|
||||
- [Invoke custom scripts](/influxdb/cloud/api-guide/api-invokable-scripts/)
|
||||
operationId: GetScriptsIDParams
|
||||
parameters:
|
||||
- description: |
|
||||
A script ID.
|
||||
The script to analyze for params.
|
||||
in: path
|
||||
name: scriptID
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
content:
|
||||
application/json:
|
||||
examples:
|
||||
successResponse:
|
||||
value:
|
||||
params:
|
||||
mybucket: string
|
||||
schema:
|
||||
$ref: '#/components/schemas/Params'
|
||||
description: |
|
||||
Success.
|
||||
The response body contains the parameters found, along with their types.
|
||||
'401':
|
||||
$ref: '#/components/responses/AuthorizationError'
|
||||
'404':
|
||||
content:
|
||||
application/json:
|
||||
examples:
|
||||
scriptNotFound:
|
||||
description: InfluxDB can't find the requested script.
|
||||
summary: |
|
||||
Script not found
|
||||
value:
|
||||
code: not found
|
||||
message: script "09afa3b220fe400" not found
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
description: |
|
||||
Not found.
|
||||
headers:
|
||||
X-Platform-Error-Code:
|
||||
description: |
|
||||
The reason for the error.
|
||||
schema:
|
||||
example: not found
|
||||
type: string
|
||||
'500':
|
||||
$ref: '#/components/responses/InternalServerError'
|
||||
default:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
description: Unexpected error.
|
||||
summary: Find script parameters.
|
||||
tags:
|
||||
- Invokable Scripts
|
||||
x-codeSamples:
|
||||
- label: cURL
|
||||
lang: Shell
|
||||
source: |
|
||||
curl --request GET "https://cloud2.influxdata.com/api/v2/scripts/SCRIPT_ID/params" \
|
||||
--header "Authorization: Token INFLUX_TOKEN"
|
||||
/api/v2/setup:
|
||||
get:
|
||||
description: Check if setup is allowed. Returns `true` if no default user, organization, or bucket have been created.
|
||||
|
|
@ -15260,7 +15614,7 @@ paths:
|
|||
deprecated: true
|
||||
description: |
|
||||
**Deprecated**: Tasks don't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
Lists all users that have the `member` role for the specified [task](/influxdb/cloud/reference/glossary/#task).
|
||||
operationId: GetTasksIDMembers
|
||||
|
|
@ -15298,7 +15652,7 @@ paths:
|
|||
deprecated: true
|
||||
description: |
|
||||
**Deprecated**: Tasks don't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
Adds a specified user to members of the specified [task](/influxdb/cloud/reference/glossary/#task) and then returns
|
||||
the member.
|
||||
|
|
@ -15345,7 +15699,7 @@ paths:
|
|||
deprecated: true
|
||||
description: |
|
||||
**Deprecated**: Tasks don't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
Removes a member from a [task](/influxdb/cloud/reference/glossary/#task).
|
||||
operationId: DeleteTasksIDMembersID
|
||||
|
|
@ -15380,7 +15734,7 @@ paths:
|
|||
deprecated: true
|
||||
description: |
|
||||
**Deprecated**: Tasks don't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
Lists all users that have the `owner` role for the specified task.
|
||||
operationId: GetTasksIDOwners
|
||||
|
|
@ -15432,7 +15786,7 @@ paths:
|
|||
deprecated: true
|
||||
description: |
|
||||
**Deprecated**: Tasks don't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
Adds a specified user to owners of the specified task and then returns the
|
||||
owner.
|
||||
|
|
@ -15509,7 +15863,7 @@ paths:
|
|||
deprecated: true
|
||||
description: |
|
||||
**Deprecated**: Tasks don't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
Removes an owner from a [task](/influxdb/cloud/reference/glossary/#task).
|
||||
operationId: DeleteTasksIDOwnersID
|
||||
|
|
@ -18274,24 +18628,12 @@ tags:
|
|||
permissions for organization resources and provides an API token for authentication.
|
||||
An authorization belongs to an organization and only contains permissions for that organization.
|
||||
|
||||
In InfluxDB Cloud, an authorization with `read-authorizations` permission
|
||||
can be used to view other authorizations.
|
||||
|
||||
#### Limitations
|
||||
|
||||
To follow best practices for secure API token generation and retrieval,
|
||||
InfluxDB enforces access restrictions on API tokens.
|
||||
|
||||
- InfluxDB allows access to the API token value immediately after the authorization is created.
|
||||
- You can’t change access (read/write) permissions for an API token after it’s created.
|
||||
- Tokens stop working when the user who created the token is deleted.
|
||||
|
||||
We recommend the following for managing your tokens:
|
||||
|
||||
- Create a generic user to create and manage tokens for writing data.
|
||||
- Store your tokens in a secure password vault for future access.
|
||||
|
||||
#### User sessions with authorizations
|
||||
### User sessions with authorizations
|
||||
|
||||
Optionally, when creating an authorization, you can scope it to a specific user.
|
||||
If the user signs in with username and password, creating a _user session_,
|
||||
|
|
@ -18309,7 +18651,7 @@ tags:
|
|||
- [Authorize API requests](/influxdb/cloud/api-guide/api_intro/#authentication)
|
||||
- [Manage API tokens](/influxdb/cloud/security/tokens/)
|
||||
- [Assign a token to a specific user](/influxdb/cloud/security/tokens/create-token/)
|
||||
name: Authorizations
|
||||
name: Authorizations (API tokens)
|
||||
- name: Bucket Schemas
|
||||
- description: |
|
||||
Store your data in InfluxDB [buckets](/influxdb/cloud/reference/glossary/#bucket).
|
||||
|
|
@ -18378,7 +18720,7 @@ tags:
|
|||
Use the `/api/v2/scripts` endpoints to create and manage scripts.
|
||||
See related guides to learn how to define parameters and execute scripts.
|
||||
|
||||
#### Related guides
|
||||
### Related guides
|
||||
|
||||
- [Invoke custom scripts](/influxdb/cloud/api-guide/api-invokable-scripts/) from API requests.
|
||||
- [Create a task that references a script](/influxdb/cloud/process-data/manage-tasks/create-task/#create-a-task-that-references-a-script)
|
||||
|
|
@ -18407,7 +18749,7 @@ tags:
|
|||
| `offset` | integer | The number of records to skip (before `limit`, after other parameters are applied). |
|
||||
| `after` | string (resource ID) | Only returns resources created after the specified resource. |
|
||||
|
||||
#### Limitations
|
||||
### Limitations
|
||||
|
||||
- For specific endpoint parameters and examples, see the endpoint definition.
|
||||
- If you specify an `offset` parameter value greater than the total number of records,
|
||||
|
|
@ -18492,7 +18834,7 @@ tags:
|
|||
|
||||
<span id="tasks-schemaref-task" />
|
||||
|
||||
#### Properties
|
||||
### Properties
|
||||
|
||||
A `task` object contains information about an InfluxDB task resource.
|
||||
|
||||
|
|
@ -18500,7 +18842,7 @@ tags:
|
|||
|
||||
<SchemaDefinition schemaRef="#/components/schemas/Task" />
|
||||
|
||||
#### Related guides
|
||||
### Related guides
|
||||
|
||||
- [Get started with tasks](/influxdb/cloud/process-data/get-started/)
|
||||
- [Common data processing tasks](/influxdb/cloud/process-data/common-tasks/)
|
||||
|
|
@ -18525,7 +18867,7 @@ tags:
|
|||
|
||||
Use the `/api/v2/stacks` endpoints to manage installed template resources.
|
||||
|
||||
#### Related guides
|
||||
### Related guides
|
||||
|
||||
- [InfluxDB stacks](/influxdb/cloud/influxdb-templates/stacks/)
|
||||
- [InfluxDB templates](/influxdb/cloud/influxdb-templates/)
|
||||
|
|
@ -18541,14 +18883,14 @@ tags:
|
|||
`GET /api/v2/users` and `GET /api/v2/users/USER_ID` API endpoints to
|
||||
view specific members.
|
||||
|
||||
#### User sessions with authorizations
|
||||
### User sessions with authorizations
|
||||
|
||||
Optionally, you can scope an authorization (and its API token) to a user.
|
||||
If a user signs in with username and password, creating a _user session_,
|
||||
the session carries the permissions granted by all the user's authorizations.
|
||||
To create a user session, use the [`POST /api/v2/signin` endpoint](#operation/PostSignin).
|
||||
|
||||
#### Related guides
|
||||
### Related guides
|
||||
|
||||
- [Manage users](/influxdb/cloud/organizations/users/)
|
||||
name: Users
|
||||
|
|
@ -18573,7 +18915,7 @@ x-tagGroups:
|
|||
- System information endpoints
|
||||
- name: All endpoints
|
||||
tags:
|
||||
- Authorizations
|
||||
- Authorizations (API tokens)
|
||||
- Bucket Schemas
|
||||
- Buckets
|
||||
- Cells
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -363,7 +363,7 @@ components:
|
|||
type: string
|
||||
status:
|
||||
default: active
|
||||
description: Status of the token. If `inactive`, requests using the token will be rejected.
|
||||
description: Status of the token. If `inactive`, InfluxDB rejects requests that use the token.
|
||||
enum:
|
||||
- active
|
||||
- inactive
|
||||
|
|
@ -2365,21 +2365,21 @@ components:
|
|||
- $ref: '#/components/schemas/AuthorizationUpdateRequest'
|
||||
- properties:
|
||||
orgID:
|
||||
description: The ID of the organization that the authorization is scoped to.
|
||||
description: The organization ID. Identifies the organization that the authorization is scoped to.
|
||||
type: string
|
||||
permissions:
|
||||
description: |
|
||||
A list of permissions that provide `read` and `write` access to organization resources.
|
||||
The list of permissions that provide `read` and `write` access to organization resources.
|
||||
An authorization must contain at least one permission.
|
||||
items:
|
||||
$ref: '#/components/schemas/Permission'
|
||||
minItems: 1
|
||||
type: array
|
||||
token:
|
||||
description: A name that you provide for the authorization.
|
||||
description: The name that you provide for the authorization.
|
||||
type: string
|
||||
userID:
|
||||
description: The ID of the user that the authorization is scoped to.
|
||||
description: The user ID. Identifies the user that the authorization is scoped to.
|
||||
type: string
|
||||
type: object
|
||||
required:
|
||||
|
|
@ -3939,7 +3939,7 @@ components:
|
|||
#### InfluxDB OSS
|
||||
|
||||
- Default value depends on the
|
||||
[bucket retention period](/influxdb/latest/v2.3/reference/internals/shards/#shard-group-duration).
|
||||
[bucket retention period](/influxdb/latest/reference/internals/shards/#shard-group-duration).
|
||||
format: int64
|
||||
type: integer
|
||||
type:
|
||||
|
|
@ -6697,7 +6697,7 @@ components:
|
|||
|
||||
### Related endpoints
|
||||
|
||||
- [`/authorizations` endpoints](#tag/Authorizations)
|
||||
- [`/authorizations` endpoints](#tag/Authorizations-(API-tokens))
|
||||
|
||||
### Related guides
|
||||
|
||||
|
|
@ -6754,16 +6754,19 @@ paths:
|
|||
To limit which authorizations are returned, pass query parameters in your request.
|
||||
If no query parameters are passed, InfluxDB returns all authorizations.
|
||||
|
||||
#### InfluxDB OSS
|
||||
#### InfluxDB Cloud
|
||||
|
||||
- InfluxDB OSS returns
|
||||
[API token](/influxdb/latest/reference/glossary/#token) values in authorizations.
|
||||
- If the request uses an _[operator token](/influxdb/latest/security/tokens/#operator-token)_,
|
||||
InfluxDB OSS returns authorizations for all organizations in the instance.
|
||||
- InfluxDB Cloud doesn't expose [API token](/influxdb/latest/reference/glossary/#token)
|
||||
values in `GET /api/v2/authorizations` responses;
|
||||
returns `token: redacted` for all authorizations.
|
||||
|
||||
#### Required permissions
|
||||
|
||||
- An _[operator token](/influxdb/latest/security/tokens/#operator-token)_.
|
||||
To retrieve an authorization, the request must use an API token that has the
|
||||
following permissions:
|
||||
|
||||
- `read-authorizations`
|
||||
- `read-user` for the user that the authorization is scoped to
|
||||
|
||||
#### Related guides
|
||||
|
||||
|
|
@ -6797,13 +6800,44 @@ paths:
|
|||
name: org
|
||||
schema:
|
||||
type: string
|
||||
- description: |
|
||||
An API [token](/influxdb/latest/reference/glossary/#token) value.
|
||||
Specifies an authorization by its `token` property value
|
||||
and returns the authorization.
|
||||
|
||||
#### InfluxDB OSS
|
||||
|
||||
- Doesn't support this parameter. InfluxDB OSS ignores the `token=` parameter,
|
||||
applies other parameters, and then returns the result.
|
||||
|
||||
#### Limitations
|
||||
|
||||
- The parameter is non-repeatable. If you specify more than one,
|
||||
only the first one is used. If a resource with the specified
|
||||
property value doesn't exist, then the response body contains an empty list.
|
||||
in: query
|
||||
name: token
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Authorizations'
|
||||
description: Success. The response body contains a list of authorizations.
|
||||
description: |
|
||||
Success. The response body contains a list of authorizations.
|
||||
|
||||
If the response body is missing authorizations that you expect, check that the API
|
||||
token used in the request has `read-user` permission for the users (`userID` property value)
|
||||
in those authorizations.
|
||||
|
||||
#### InfluxDB OSS
|
||||
|
||||
- **Warning**: The response body contains authorizations with their
|
||||
[API token](/influxdb/latest/reference/glossary/#token) values in clear text.
|
||||
- If the request uses an _[operator token](/influxdb/latest/security/tokens/#operator-token)_,
|
||||
InfluxDB OSS returns authorizations for all organizations in the instance.
|
||||
'400':
|
||||
$ref: '#/components/responses/GeneralServerError'
|
||||
description: Invalid request
|
||||
|
|
@ -6816,7 +6850,7 @@ paths:
|
|||
description: Unexpected error
|
||||
summary: List authorizations
|
||||
tags:
|
||||
- Authorizations
|
||||
- Authorizations (API tokens)
|
||||
- Security and access endpoints
|
||||
post:
|
||||
description: |
|
||||
|
|
@ -6825,21 +6859,24 @@ paths:
|
|||
|
||||
Use this endpoint to create an authorization, which generates an API token
|
||||
with permissions to `read` or `write` to a specific resource or `type` of resource.
|
||||
The response contains the new authorization with the generated API token.
|
||||
|
||||
#### Limitations
|
||||
The API token is the authorization's `token` property value.
|
||||
|
||||
To follow best practices for secure API token generation and retrieval,
|
||||
InfluxDB enforces access restrictions on API tokens.
|
||||
|
||||
- In InfluxDB OSS, API tokens are visible to the user who created the authorization and to any
|
||||
user with an _[operator token](/influxdb/latest/security/tokens/#operator-token)_.
|
||||
- You can't update an authorization's permissions.
|
||||
- Even if an API token has `read-authorizations` permission, the
|
||||
token can't be used to view its authorization details.
|
||||
- A token stops working when the user who created the authorization is deleted.
|
||||
- InfluxDB allows access to the API token value immediately after the authorization is created.
|
||||
- You can’t change access (read/write) permissions for an API token after it’s created.
|
||||
- Tokens stop working when the user who created the token is deleted.
|
||||
|
||||
We recommend creating a generic user to create and manage tokens for writing data.
|
||||
We recommend the following for managing your tokens:
|
||||
|
||||
- Create a generic user to create and manage tokens for writing data.
|
||||
- Store your tokens in a secure password vault for future access.
|
||||
|
||||
#### Required permissions
|
||||
|
||||
- `write-authorizations`
|
||||
- `write-user` for the user that the authorization is scoped to
|
||||
|
||||
#### Related guides
|
||||
|
||||
|
|
@ -6868,7 +6905,8 @@ paths:
|
|||
schema:
|
||||
$ref: '#/components/schemas/Authorization'
|
||||
description: |
|
||||
Success. The authorization is created. The response body contains the authorization.
|
||||
Success. The authorization is created. The response body contains the
|
||||
authorization.
|
||||
'400':
|
||||
$ref: '#/components/responses/GeneralServerError'
|
||||
description: Invalid request
|
||||
|
|
@ -6881,13 +6919,21 @@ paths:
|
|||
description: Unexpected error
|
||||
summary: Create an authorization
|
||||
tags:
|
||||
- Authorizations
|
||||
- Authorizations (API tokens)
|
||||
- Security and access endpoints
|
||||
/api/v2/authorizations/{authID}:
|
||||
delete:
|
||||
description: |
|
||||
Deletes an authorization.
|
||||
|
||||
Use the endpoint to delete an API token.
|
||||
|
||||
If you want to disable an API token instead of delete it,
|
||||
[update the authorization's status to `inactive`](#operation/PatchAuthorizationsID).
|
||||
operationId: DeleteAuthorizationsID
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/TraceSpan'
|
||||
- description: The ID of the authorization to delete.
|
||||
- description: An authorization ID. Specifies the authorization to delete.
|
||||
in: path
|
||||
name: authID
|
||||
required: true
|
||||
|
|
@ -6895,18 +6941,70 @@ paths:
|
|||
type: string
|
||||
responses:
|
||||
'204':
|
||||
description: Authorization deleted
|
||||
description: Success. The authorization is deleted.
|
||||
'400':
|
||||
content:
|
||||
application/json:
|
||||
examples:
|
||||
notFound:
|
||||
summary: |
|
||||
The specified resource ID is invalid.
|
||||
value:
|
||||
code: invalid
|
||||
message: id must have a length of 16 bytes
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
description: |
|
||||
Bad request.
|
||||
'401':
|
||||
$ref: '#/components/responses/AuthorizationError'
|
||||
'404':
|
||||
content:
|
||||
application/json:
|
||||
examples:
|
||||
notFound:
|
||||
summary: |
|
||||
The requested authorization doesn't exist.
|
||||
value:
|
||||
code: not found
|
||||
message: authorization not found
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
description: |
|
||||
Not found.
|
||||
'500':
|
||||
$ref: '#/components/responses/InternalServerError'
|
||||
default:
|
||||
$ref: '#/components/responses/GeneralServerError'
|
||||
description: Unexpected error
|
||||
summary: Delete an authorization
|
||||
tags:
|
||||
- Authorizations
|
||||
- Authorizations (API tokens)
|
||||
- Security and access endpoints
|
||||
get:
|
||||
description: |
|
||||
Retrieves an authorization.
|
||||
|
||||
Use this endpoint to retrieve information about an API token, including
|
||||
the token's permissions and the user that the token is scoped to.
|
||||
|
||||
#### InfluxDB OSS
|
||||
|
||||
- InfluxDB OSS returns
|
||||
[API token](/influxdb/latest/reference/glossary/#token) values in authorizations.
|
||||
- If the request uses an _[operator token](/influxdb/latest/security/tokens/#operator-token)_,
|
||||
InfluxDB OSS returns authorizations for all organizations in the instance.
|
||||
|
||||
#### Related guides
|
||||
|
||||
- [View tokens](/influxdb/latest/security/tokens/view-tokens/)
|
||||
externalDocs:
|
||||
description: View tokens
|
||||
url: https://docs.influxdata.com/influxdb/latest/security/tokens/view-tokens/
|
||||
operationId: GetAuthorizationsID
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/TraceSpan'
|
||||
- description: The ID of the authorization to get.
|
||||
- description: An authorization ID. Specifies the authorization to retrieve.
|
||||
in: path
|
||||
name: authID
|
||||
required: true
|
||||
|
|
@ -6918,19 +7016,56 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Authorization'
|
||||
description: Authorization details
|
||||
description: Success. The response body contains the authorization.
|
||||
'400':
|
||||
content:
|
||||
application/json:
|
||||
examples:
|
||||
notFound:
|
||||
summary: |
|
||||
The specified resource ID is invalid.
|
||||
value:
|
||||
code: invalid
|
||||
message: id must have a length of 16 bytes
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
description: |
|
||||
Bad request.
|
||||
'401':
|
||||
$ref: '#/components/responses/AuthorizationError'
|
||||
'404':
|
||||
content:
|
||||
application/json:
|
||||
examples:
|
||||
notFound:
|
||||
summary: |
|
||||
The requested authorization doesn't exist.
|
||||
value:
|
||||
code: not found
|
||||
message: authorization not found
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
description: |
|
||||
Not found.
|
||||
'500':
|
||||
$ref: '#/components/responses/InternalServerError'
|
||||
default:
|
||||
$ref: '#/components/responses/GeneralServerError'
|
||||
description: Unexpected error
|
||||
summary: Retrieve an authorization
|
||||
tags:
|
||||
- Authorizations
|
||||
- Authorizations (API tokens)
|
||||
- Security and access endpoints
|
||||
patch:
|
||||
description: |
|
||||
Updates an authorization.
|
||||
|
||||
Use this endpoint to set an API token's status to be _active_ or _inactive_.
|
||||
InfluxDB rejects requests that use inactive API tokens.
|
||||
operationId: PatchAuthorizationsID
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/TraceSpan'
|
||||
- description: The ID of the authorization to update.
|
||||
- description: An authorization ID. Specifies the authorization to update.
|
||||
in: path
|
||||
name: authID
|
||||
required: true
|
||||
|
|
@ -6941,7 +7076,7 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/AuthorizationUpdateRequest'
|
||||
description: Authorization to update
|
||||
description: In the request body, provide the authorization properties to update.
|
||||
required: true
|
||||
responses:
|
||||
'200':
|
||||
|
|
@ -6949,13 +7084,14 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Authorization'
|
||||
description: The active or inactive authorization
|
||||
description: Success. The response body contains the updated authorization.
|
||||
default:
|
||||
$ref: '#/components/responses/GeneralServerError'
|
||||
description: Unexpected error
|
||||
summary: Update an authorization to be active or inactive
|
||||
summary: Update an API token to be active or inactive
|
||||
tags:
|
||||
- Authorizations
|
||||
- Authorizations (API tokens)
|
||||
- Security and access endpoints
|
||||
/api/v2/backup/kv:
|
||||
get:
|
||||
deprecated: true
|
||||
|
|
@ -8084,7 +8220,7 @@ paths:
|
|||
#### InfluxDB Cloud
|
||||
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Limitations
|
||||
|
||||
|
|
@ -8100,7 +8236,7 @@ paths:
|
|||
|
||||
#### Related endpoints
|
||||
|
||||
- [Authorizations](#tag/Authorizations)
|
||||
- [Authorizations](#tag/Authorizations-(API-tokens))
|
||||
|
||||
#### Related guides
|
||||
|
||||
|
|
@ -8165,7 +8301,7 @@ paths:
|
|||
#### InfluxDB Cloud
|
||||
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Limitations
|
||||
|
||||
|
|
@ -8180,7 +8316,7 @@ paths:
|
|||
|
||||
#### Related endpoints
|
||||
|
||||
- [Authorizations](#tag/Authorizations)
|
||||
- [Authorizations](#tag/Authorizations-(API-tokens))
|
||||
|
||||
#### Related guides
|
||||
|
||||
|
|
@ -8266,7 +8402,7 @@ paths:
|
|||
#### InfluxDB Cloud
|
||||
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Limitations
|
||||
|
||||
|
|
@ -8282,7 +8418,7 @@ paths:
|
|||
|
||||
#### Related endpoints
|
||||
|
||||
- [Authorizations](#tag/Authorizations)
|
||||
- [Authorizations](#tag/Authorizations-(API-tokens))
|
||||
|
||||
#### Related guides
|
||||
|
||||
|
|
@ -10571,7 +10707,7 @@ paths:
|
|||
|
||||
1. Use [token authentication](#section/Authentication/TokenAuthentication) or a [user session](#tag/Signin) with this endpoint to retrieve
|
||||
feature flags and their values.
|
||||
2. Follow the instructions to [enable, disable, or override values for feature flags](/influxdb/latest/influxdb/v2.4/reference/config-options/#feature-flags).
|
||||
2. Follow the instructions to [enable, disable, or override values for feature flags](/influxdb/latest/reference/config-options/#feature-flags).
|
||||
3. **Optional**: To confirm that your change is applied, do one of the following:
|
||||
|
||||
- Send a request to this endpoint to retrieve the current feature flag values.
|
||||
|
|
@ -10580,7 +10716,7 @@ paths:
|
|||
|
||||
#### Related guides
|
||||
|
||||
- [InfluxDB configuration options](/influxdb/latest/influxdb/v2.4/reference/config-options/)
|
||||
- [InfluxDB configuration options](/influxdb/latest/reference/config-options/)
|
||||
operationId: GetFlags
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/TraceSpan'
|
||||
|
|
@ -11930,7 +12066,7 @@ paths:
|
|||
#### InfluxDB Cloud
|
||||
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Limitations
|
||||
|
||||
|
|
@ -12028,7 +12164,7 @@ paths:
|
|||
|
||||
#### InfluxDB Cloud
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Limitations
|
||||
|
||||
|
|
@ -12127,7 +12263,7 @@ paths:
|
|||
#### InfluxDB Cloud
|
||||
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Limitations
|
||||
|
||||
|
|
@ -12188,7 +12324,7 @@ paths:
|
|||
#### InfluxDB Cloud
|
||||
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Required permissions
|
||||
|
||||
|
|
@ -12250,7 +12386,7 @@ paths:
|
|||
#### InfluxDB Cloud
|
||||
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Required permissions
|
||||
|
||||
|
|
@ -12260,7 +12396,7 @@ paths:
|
|||
|
||||
#### Related endpoints
|
||||
|
||||
- [Authorizations](#tag/Authorizations)
|
||||
- [Authorizations](#tag/Authorizations-(API-tokens))
|
||||
operationId: PostOrgsIDOwners
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/TraceSpan'
|
||||
|
|
@ -12334,7 +12470,7 @@ paths:
|
|||
|
||||
#### InfluxDB Cloud
|
||||
- Doesn't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
#### Limitations
|
||||
|
||||
|
|
@ -12349,7 +12485,7 @@ paths:
|
|||
remove an owner from.
|
||||
|
||||
#### Related endpoints
|
||||
- [Authorizations](#tag/Authorizations)
|
||||
- [Authorizations](#tag/Authorizations-(API-tokens))
|
||||
operationId: DeleteOrgsIDOwnersID
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/TraceSpan'
|
||||
|
|
@ -15782,7 +15918,6 @@ paths:
|
|||
Only returns [tasks](/influxdb/latest/reference/glossary/#task) owned by the specified [organization](/influxdb/latest/reference/glossary/#organization).
|
||||
in: query
|
||||
name: orgID
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- description: |
|
||||
|
|
@ -16313,7 +16448,7 @@ paths:
|
|||
deprecated: true
|
||||
description: |
|
||||
**Deprecated**: Tasks don't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
Lists all users that have the `member` role for the specified [task](/influxdb/latest/reference/glossary/#task).
|
||||
operationId: GetTasksIDMembers
|
||||
|
|
@ -16351,7 +16486,7 @@ paths:
|
|||
deprecated: true
|
||||
description: |
|
||||
**Deprecated**: Tasks don't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
Adds a specified user to members of the specified [task](/influxdb/latest/reference/glossary/#task) and then returns
|
||||
the member.
|
||||
|
|
@ -16398,7 +16533,7 @@ paths:
|
|||
deprecated: true
|
||||
description: |
|
||||
**Deprecated**: Tasks don't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
Removes a member from a [task](/influxdb/latest/reference/glossary/#task).
|
||||
operationId: DeleteTasksIDMembersID
|
||||
|
|
@ -16433,7 +16568,7 @@ paths:
|
|||
deprecated: true
|
||||
description: |
|
||||
**Deprecated**: Tasks don't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
Lists all users that have the `owner` role for the specified task.
|
||||
operationId: GetTasksIDOwners
|
||||
|
|
@ -16485,7 +16620,7 @@ paths:
|
|||
deprecated: true
|
||||
description: |
|
||||
**Deprecated**: Tasks don't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
Adds a specified user to owners of the specified task and then returns the
|
||||
owner.
|
||||
|
|
@ -16562,7 +16697,7 @@ paths:
|
|||
deprecated: true
|
||||
description: |
|
||||
**Deprecated**: Tasks don't use `owner` and `member` roles.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
|
||||
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
|
||||
|
||||
Removes an owner from a [task](/influxdb/latest/reference/glossary/#task).
|
||||
operationId: DeleteTasksIDOwnersID
|
||||
|
|
@ -19361,23 +19496,9 @@ tags:
|
|||
permissions for organization resources and provides an API token for authentication.
|
||||
An authorization belongs to an organization and only contains permissions for that organization.
|
||||
|
||||
#### Limitations
|
||||
|
||||
To follow best practices for secure API token generation and retrieval,
|
||||
InfluxDB enforces access restrictions on API tokens.
|
||||
|
||||
- InfluxDB allows access to the API token value immediately after the authorization is created.
|
||||
- You can’t change access (read/write) permissions for an API token after it’s created.
|
||||
- Tokens stop working when the user who created the token is deleted.
|
||||
|
||||
API tokens are visible to the user who created the authorization and to any
|
||||
user with an _[operator token](/influxdb/latest/security/tokens/#operator-token)_.
|
||||
In InfluxDB OSS, even if an API token has `read-authorizations` permission, the
|
||||
token can't be used to view its authorization details.
|
||||
|
||||
We recommend creating a generic user to create and manage tokens for writing data.
|
||||
|
||||
#### User sessions with authorizations
|
||||
### User sessions with authorizations
|
||||
|
||||
Optionally, when creating an authorization, you can scope it to a specific user.
|
||||
If a user signs in with username and password, creating a _user session_,
|
||||
|
|
@ -19395,7 +19516,7 @@ tags:
|
|||
- [Authorize API requests](/influxdb/latest/api-guide/api_intro/#authentication)
|
||||
- [Manage API tokens](/influxdb/latest/security/tokens/)
|
||||
- [Assign a token to a specific user](/influxdb/latest/security/tokens/create-token/)
|
||||
name: Authorizations
|
||||
name: Authorizations (API tokens)
|
||||
- name: Backup
|
||||
- description: |
|
||||
Store your data in InfluxDB [buckets](/influxdb/latest/reference/glossary/#bucket).
|
||||
|
|
@ -19487,7 +19608,7 @@ tags:
|
|||
| `offset` | integer | The number of records to skip (before `limit`, after other parameters are applied). |
|
||||
| `after` | string (resource ID) | Only returns resources created after the specified resource. |
|
||||
|
||||
#### Limitations
|
||||
### Limitations
|
||||
|
||||
- For specific endpoint parameters and examples, see the endpoint definition.
|
||||
- If you specify an `offset` parameter value greater than the total number of records,
|
||||
|
|
@ -19577,7 +19698,7 @@ tags:
|
|||
|
||||
<span id="tasks-schemaref-task" />
|
||||
|
||||
#### Properties
|
||||
### Properties
|
||||
|
||||
A `task` object contains information about an InfluxDB task resource.
|
||||
|
||||
|
|
@ -19585,7 +19706,7 @@ tags:
|
|||
|
||||
<SchemaDefinition schemaRef="#/components/schemas/Task" />
|
||||
|
||||
#### Related guides
|
||||
### Related guides
|
||||
|
||||
- [Get started with tasks](/influxdb/latest/process-data/get-started/)
|
||||
- [Common data processing tasks](/influxdb/latest/process-data/common-tasks/)
|
||||
|
|
@ -19611,7 +19732,7 @@ tags:
|
|||
|
||||
Use the `/api/v2/stacks` endpoints to manage installed template resources.
|
||||
|
||||
#### Related guides
|
||||
### Related guides
|
||||
|
||||
- [InfluxDB stacks](/influxdb/latest/influxdb-templates/stacks/)
|
||||
- [InfluxDB templates](/influxdb/latest/influxdb-templates/)
|
||||
|
|
@ -19622,14 +19743,14 @@ tags:
|
|||
To grant a user permission to access data, add them as a member of an
|
||||
organization and provide them with an API token.
|
||||
|
||||
#### User sessions with authorizations
|
||||
### User sessions with authorizations
|
||||
|
||||
Optionally, you can scope an authorization (and its API token) to a user.
|
||||
If a user signs in with username and password, creating a _user session_,
|
||||
the session carries the permissions granted by all the user's authorizations.
|
||||
To create a user session, use the [`POST /api/v2/signin` endpoint](#operation/PostSignin).
|
||||
|
||||
#### Related guides
|
||||
### Related guides
|
||||
|
||||
- [Manage users](/influxdb/latest/influxdb/latest/users/)
|
||||
- [Create a token scoped to a user](/influxdb/latest/latest/security/tokens/create-token/#create-a-token-scoped-to-a-user)
|
||||
|
|
@ -19656,7 +19777,7 @@ x-tagGroups:
|
|||
- System information endpoints
|
||||
- name: All endpoints
|
||||
tags:
|
||||
- Authorizations
|
||||
- Authorizations (API tokens)
|
||||
- Backup
|
||||
- Buckets
|
||||
- Cells
|
||||
|
|
|
|||
|
|
@ -107,4 +107,4 @@ To filter authorizations by organization when using an operator token, include a
|
|||
|
||||
{{% /oss-only %}}
|
||||
|
||||
See the [`/authorizations` endpoint documentation](/influxdb/v2.5/api/#tag/Authorizations) for more information about available parameters.
|
||||
See the [`/authorizations` endpoint documentation](/influxdb/v2.5/api/#tag/Authorizations-(API-tokens)) for more information about available parameters.
|
||||
|
|
|
|||
Loading…
Reference in New Issue