docs-v2/api-docs/v2.6/ref.yml

7273 lines
216 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

components:
examples:
AuthorizationPostRequest:
description: Creates an authorization.
summary: An authorization for a resource type
value:
description: iot_users read buckets
orgID: INFLUX_ORG_ID
permissions:
- action: read
resource:
type: buckets
AuthorizationWithResourcePostRequest:
description: Creates an authorization for access to a specific resource.
summary: An authorization for a resource
value:
description: iot_users read buckets
orgID: INFLUX_ORG_ID
permissions:
- action: read
resource:
id: INFLUX_BUCKET_ID
type: buckets
AuthorizationWithUserPostRequest:
description: Creates an authorization scoped to a specific user.
summary: An authorization scoped to a user
value:
description: iot_user write to bucket
orgID: INFLUX_ORG_ID
permissions:
- action: write
resource:
id: INFLUX_BUCKET_ID
type: buckets
userID: INFLUX_USER_ID
TaskWithFluxRequest:
description: Sets the `flux` property with Flux task options and a query.
summary: A task with Flux
value:
description: This task contains Flux that configures the task schedule and downsamples CPU data every hour.
flux: "option task = {name: \"CPU Total 1 Hour New\", every: 1h}from(bucket: \"telegraf\")|> range(start: -1h)|> filter(fn: (r) => (r._measurement == \"cpu\"))|> filter(fn: (r) =>\n\t\t(r._field == \"usage_system\"))|> filter(fn: (r) => (r.cpu == \"cpu-total\"))|> aggregateWindow(every: 1h, fn: max)|> to(bucket: \"cpu_usage_user_total_1h\", org: \"INFLUX_ORG\")"
status: active
parameters:
After:
description: |
A resource ID to seek from.
Returns records created after the specified record;
results don't include the specified record.
Use `after` instead of the `offset` parameter.
For more information about pagination parameters, see [Pagination](/influxdb/latest/api/#tag/Pagination).
in: query
name: after
required: false
schema:
type: string
Descending:
in: query
name: descending
required: false
schema:
default: false
type: boolean
Limit:
description: |
Limits the number of records returned. Default is `20`.
in: query
name: limit
required: false
schema:
default: 20
maximum: 100
minimum: 1
type: integer
Offset:
description: |
The offset for pagination.
The number of records to skip.
For more information about pagination parameters, see [Pagination](/influxdb/latest/api/#tag/Pagination).
in: query
name: offset
required: false
schema:
minimum: 0
type: integer
SortBy:
in: query
name: sortBy
required: false
schema:
type: string
TraceSpan:
description: OpenTracing span context
example:
baggage:
key: value
span_id: '1'
trace_id: '1'
in: header
name: Zap-Trace-Span
required: false
schema:
type: string
responses:
AuthorizationError:
content:
application/json:
examples:
tokenNotAuthorized:
summary: Token is not authorized to access a resource
value:
code: unauthorized
message: unauthorized access
schema:
properties:
code:
description: |
The HTTP status code description. Default is `unauthorized`.
enum:
- unauthorized
readOnly: true
type: string
message:
description: A human-readable message that may contain detail about the error.
readOnly: true
type: string
description: |
Unauthorized. The error may indicate one of the following:
* The `Authorization: Token` header is missing or malformed.
* The API token value is missing from the header.
* The token doesn't have sufficient permissions to write to this organization and bucket.
BadRequestError:
content:
application/json:
examples:
orgProvidedNotFound:
summary: The org or orgID passed doesn't own the token passed in the header
value:
code: invalid
message: 'failed to decode request body: organization not found'
schema:
$ref: '#/components/schemas/Error'
description: |
Bad request.
The response body contains detail about the error.
#### InfluxDB OSS
- Returns this error if an incorrect value is passed in the `org` parameter or `orgID` parameter.
GeneralServerError:
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: Non 2XX error response from server.
InternalServerError:
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: |
Internal server error.
The server encountered an unexpected situation.
ResourceNotFoundError:
content:
application/json:
examples:
bucket-not-found:
summary: Bucket name not found
value:
code: not found
message: bucket "air_sensor" not found
org-not-found:
summary: Organization name not found
value:
code: not found
message: organization name "my-org" not found
orgID-not-found:
summary: Organization ID not found
value:
code: not found
message: organization not found
schema:
$ref: '#/components/schemas/Error'
description: |
Not found.
A requested resource was not found.
The response body contains the requested resource type and the name value
(if you passed it)--for example:
- `"organization name \"my-org\" not found"`
- `"organization not found"`: indicates you passed an ID that did not match
an organization.
ServerError:
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: Non 2XX error response from server.
schemas:
ASTResponse:
description: Contains the AST for the supplied Flux query
properties:
ast:
$ref: '#/components/schemas/Package'
type: object
AddResourceMemberRequestBody:
properties:
id:
description: |
The ID of the user to add to the resource.
type: string
name:
description: |
The name of the user to add to the resource.
type: string
required:
- id
type: object
AnalyzeQueryResponse:
properties:
errors:
items:
properties:
character:
type: integer
column:
type: integer
line:
type: integer
message:
type: string
type: object
type: array
type: object
ArrayExpression:
description: Used to create and directly specify the elements of an array object
properties:
elements:
description: Elements of the array
items:
$ref: '#/components/schemas/Expression'
type: array
type:
$ref: '#/components/schemas/NodeType'
type: object
Authorization:
allOf:
- $ref: '#/components/schemas/AuthorizationUpdateRequest'
- properties:
createdAt:
format: date-time
readOnly: true
type: string
id:
description: The authorization ID.
readOnly: true
type: string
links:
example:
self: /api/v2/authorizations/1
user: /api/v2/users/12
properties:
self:
$ref: '#/components/schemas/Link'
readOnly: true
user:
$ref: '#/components/schemas/Link'
readOnly: true
readOnly: true
type: object
org:
description: |
The organization name.
Specifies the [organization](/influxdb/v2.6/reference/glossary/#organization)
that the token is scoped to.
readOnly: true
type: string
orgID:
description: |
The organization ID.
Specifies the [organization](/influxdb/v2.6/reference/glossary/#organization) that the authorization is scoped to.
type: string
permissions:
description: |
The list of permissions.
An authorization must have at least one permission.
items:
$ref: '#/components/schemas/Permission'
minItems: 1
type: array
token:
description: |
The API token.
The token value is unique to the authorization.
[API tokens](/influxdb/v2.6/reference/glossary/#token) are
used to authenticate and authorize InfluxDB API requests and `influx`
CLI commands--after receiving the request, InfluxDB checks that the
token is valid and that the `permissions` allow the requested action(s).
readOnly: true
type: string
updatedAt:
format: date-time
readOnly: true
type: string
user:
description: |
The user name.
Specifies the [user](/influxdb/v2.6/reference/glossary/#user) that owns the authorization.
If the authorization is _scoped_ to a user, the user;
otherwise, the creator of the authorization.
readOnly: true
type: string
userID:
description: The user ID. Specifies the [user](/influxdb/v2.6/reference/glossary/#user) that owns the authorization. If _scoped_, the user that the authorization is scoped to; otherwise, the creator of the authorization.
readOnly: true
type: string
type: object
required:
- orgID
- permissions
AuthorizationPostRequest:
allOf:
- $ref: '#/components/schemas/AuthorizationUpdateRequest'
- properties:
orgID:
description: |
An organization ID.
Specifies the organization that owns the authorization.
type: string
permissions:
description: |
A list of permissions for an authorization.
In the list, provide at least one `permission` object.
In a `permission`, the `resource.type` property grants access to all
resources of the specified type.
To grant access to only a specific resource, specify the
`resource.id` property.
items:
$ref: '#/components/schemas/Permission'
minItems: 1
type: array
userID:
description: |
A user ID.
Specifies the user that the authorization is scoped to.
When a user authenticates with username and password,
InfluxDB generates a _user session_ with all the permissions
specified by all the user's authorizations.
type: string
type: object
required:
- orgID
- permissions
AuthorizationUpdateRequest:
properties:
description:
description: A description of the token.
type: string
status:
default: active
description: Status of the token. If `inactive`, InfluxDB rejects requests that use the token.
enum:
- active
- inactive
type: string
Authorizations:
properties:
authorizations:
items:
$ref: '#/components/schemas/Authorization'
type: array
links:
$ref: '#/components/schemas/Links'
readOnly: true
type: object
Axes:
description: The viewport for a View's visualizations
properties:
x:
$ref: '#/components/schemas/Axis'
'y':
$ref: '#/components/schemas/Axis'
required:
- x
- 'y'
type: object
Axis:
description: Axis used in a visualization.
properties:
base:
description: Radix for formatting axis values.
enum:
- ''
- '2'
- '10'
type: string
bounds:
description: The extents of the axis in the form [lower, upper]. Clients determine whether bounds are inclusive or exclusive of their limits.
items:
type: string
maxItems: 2
minItems: 0
type: array
label:
description: Description of the axis.
type: string
prefix:
description: Label prefix for formatting axis values.
type: string
scale:
$ref: '#/components/schemas/AxisScale'
suffix:
description: Label suffix for formatting axis values.
type: string
type: object
AxisScale:
description: 'Scale is the axis formatting scale. Supported: "log", "linear"'
enum:
- log
- linear
type: string
BadStatement:
description: A placeholder for statements for which no correct statement nodes can be created
properties:
text:
description: Raw source text
type: string
type:
$ref: '#/components/schemas/NodeType'
type: object
BandViewProperties:
properties:
adaptiveZoomHide:
type: boolean
axes:
$ref: '#/components/schemas/Axes'
colors:
description: Colors define color encoding of data into a visualization
items:
$ref: '#/components/schemas/DashboardColor'
type: array
generateXAxisTicks:
items:
type: string
type: array
generateYAxisTicks:
items:
type: string
type: array
geom:
$ref: '#/components/schemas/XYGeom'
hoverDimension:
enum:
- auto
- x
- 'y'
- xy
type: string
legendColorizeRows:
type: boolean
legendHide:
type: boolean
legendOpacity:
format: float
type: number
legendOrientationThreshold:
type: integer
lowerColumn:
type: string
mainColumn:
type: string
note:
type: string
queries:
items:
$ref: '#/components/schemas/DashboardQuery'
type: array
shape:
enum:
- chronograf-v2
type: string
showNoteWhenEmpty:
description: If true, will display note when empty
type: boolean
staticLegend:
$ref: '#/components/schemas/StaticLegend'
timeFormat:
type: string
type:
enum:
- band
type: string
upperColumn:
type: string
xColumn:
type: string
xTickStart:
format: float
type: number
xTickStep:
format: float
type: number
xTotalTicks:
type: integer
yColumn:
type: string
yTickStart:
format: float
type: number
yTickStep:
format: float
type: number
yTotalTicks:
type: integer
required:
- type
- geom
- queries
- shape
- axes
- colors
- note
- showNoteWhenEmpty
type: object
BinaryExpression:
description: uses binary operators to act on two operands in an expression
properties:
left:
$ref: '#/components/schemas/Expression'
operator:
type: string
right:
$ref: '#/components/schemas/Expression'
type:
$ref: '#/components/schemas/NodeType'
type: object
Block:
description: A set of statements
properties:
body:
description: Block body
items:
$ref: '#/components/schemas/Statement'
type: array
type:
$ref: '#/components/schemas/NodeType'
type: object
BooleanLiteral:
description: Represents boolean values
properties:
type:
$ref: '#/components/schemas/NodeType'
value:
type: boolean
type: object
Bucket:
properties:
createdAt:
format: date-time
readOnly: true
type: string
description:
type: string
id:
readOnly: true
type: string
labels:
$ref: '#/components/schemas/Labels'
links:
example:
labels: /api/v2/buckets/1/labels
members: /api/v2/buckets/1/members
org: /api/v2/orgs/2
owners: /api/v2/buckets/1/owners
self: /api/v2/buckets/1
write: /api/v2/write?org=2&bucket=1
properties:
labels:
$ref: '#/components/schemas/Link'
description: The URL to retrieve labels for this bucket.
members:
$ref: '#/components/schemas/Link'
description: The URL to retrieve members that can read this bucket.
org:
$ref: '#/components/schemas/Link'
description: The URL to retrieve parent organization for this bucket.
owners:
$ref: '#/components/schemas/Link'
description: The URL to retrieve owners that can read and write to this bucket.
self:
$ref: '#/components/schemas/Link'
description: The URL for this bucket.
write:
$ref: '#/components/schemas/Link'
description: The URL to write line protocol to this bucket.
readOnly: true
type: object
name:
type: string
orgID:
type: string
retentionRules:
$ref: '#/components/schemas/RetentionRules'
rp:
type: string
schemaType:
$ref: '#/components/schemas/SchemaType'
default: implicit
type:
default: user
enum:
- user
- system
readOnly: true
type: string
updatedAt:
format: date-time
readOnly: true
type: string
required:
- name
- retentionRules
BucketMetadataManifest:
properties:
bucketID:
type: string
bucketName:
type: string
defaultRetentionPolicy:
type: string
description:
type: string
organizationID:
type: string
organizationName:
type: string
retentionPolicies:
$ref: '#/components/schemas/RetentionPolicyManifests'
required:
- organizationID
- organizationName
- bucketID
- bucketName
- defaultRetentionPolicy
- retentionPolicies
type: object
BucketMetadataManifests:
items:
$ref: '#/components/schemas/BucketMetadataManifest'
type: array
BucketShardMapping:
properties:
newId:
format: int64
type: integer
oldId:
format: int64
type: integer
required:
- oldId
- newId
type: object
BucketShardMappings:
items:
$ref: '#/components/schemas/BucketShardMapping'
type: array
Buckets:
properties:
buckets:
items:
$ref: '#/components/schemas/Bucket'
type: array
links:
$ref: '#/components/schemas/Links'
readOnly: true
type: object
BuilderAggregateFunctionType:
enum:
- filter
- group
type: string
BuilderConfig:
properties:
aggregateWindow:
properties:
fillValues:
type: boolean
period:
type: string
type: object
buckets:
items:
type: string
type: array
functions:
items:
$ref: '#/components/schemas/BuilderFunctionsType'
type: array
tags:
items:
$ref: '#/components/schemas/BuilderTagsType'
type: array
type: object
BuilderFunctionsType:
properties:
name:
type: string
type: object
BuilderTagsType:
properties:
aggregateFunctionType:
$ref: '#/components/schemas/BuilderAggregateFunctionType'
key:
type: string
values:
items:
type: string
type: array
type: object
BuiltinStatement:
description: Declares a builtin identifier and its type
properties:
id:
$ref: '#/components/schemas/Identifier'
type:
$ref: '#/components/schemas/NodeType'
type: object
CallExpression:
description: Represents a function call
properties:
arguments:
description: Function arguments
items:
$ref: '#/components/schemas/Expression'
type: array
callee:
$ref: '#/components/schemas/Expression'
type:
$ref: '#/components/schemas/NodeType'
type: object
Cell:
properties:
h:
format: int32
type: integer
id:
type: string
links:
properties:
self:
type: string
view:
type: string
type: object
viewID:
description: The reference to a view from the views API.
type: string
w:
format: int32
type: integer
x:
format: int32
type: integer
'y':
format: int32
type: integer
type: object
CellUpdate:
properties:
h:
format: int32
type: integer
w:
format: int32
type: integer
x:
format: int32
type: integer
'y':
format: int32
type: integer
type: object
CellWithViewProperties:
allOf:
- $ref: '#/components/schemas/Cell'
- properties:
name:
type: string
properties:
$ref: '#/components/schemas/ViewProperties'
type: object
type: object
Cells:
items:
$ref: '#/components/schemas/Cell'
type: array
CellsWithViewProperties:
items:
$ref: '#/components/schemas/CellWithViewProperties'
type: array
Check:
allOf:
- $ref: '#/components/schemas/CheckDiscriminator'
CheckBase:
properties:
createdAt:
format: date-time
readOnly: true
type: string
description:
description: An optional description of the check.
type: string
id:
readOnly: true
type: string
labels:
$ref: '#/components/schemas/Labels'
lastRunError:
readOnly: true
type: string
lastRunStatus:
enum:
- failed
- success
- canceled
readOnly: true
type: string
latestCompleted:
description: A timestamp ([RFC3339 date/time format](/influxdb/latest/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run.
format: date-time
readOnly: true
type: string
links:
example:
labels: /api/v2/checks/1/labels
members: /api/v2/checks/1/members
owners: /api/v2/checks/1/owners
query: /api/v2/checks/1/query
self: /api/v2/checks/1
properties:
labels:
$ref: '#/components/schemas/Link'
description: The URL to retrieve labels for this check.
members:
$ref: '#/components/schemas/Link'
description: The URL to retrieve members for this check.
owners:
$ref: '#/components/schemas/Link'
description: The URL to retrieve owners for this check.
query:
$ref: '#/components/schemas/Link'
description: The URL to retrieve the Flux script for this check.
self:
$ref: '#/components/schemas/Link'
description: The URL for this check.
readOnly: true
type: object
name:
type: string
orgID:
description: The ID of the organization that owns this check.
type: string
ownerID:
description: The ID of creator used to create this check.
readOnly: true
type: string
query:
$ref: '#/components/schemas/DashboardQuery'
status:
$ref: '#/components/schemas/TaskStatusType'
taskID:
description: The ID of the task associated with this check.
type: string
updatedAt:
format: date-time
readOnly: true
type: string
required:
- name
- orgID
- query
CheckDiscriminator:
discriminator:
mapping:
custom: '#/components/schemas/CustomCheck'
deadman: '#/components/schemas/DeadmanCheck'
threshold: '#/components/schemas/ThresholdCheck'
propertyName: type
oneOf:
- $ref: '#/components/schemas/DeadmanCheck'
- $ref: '#/components/schemas/ThresholdCheck'
- $ref: '#/components/schemas/CustomCheck'
CheckPatch:
properties:
description:
type: string
name:
type: string
status:
enum:
- active
- inactive
type: string
type: object
CheckStatusLevel:
description: The state to record if check matches a criteria.
enum:
- UNKNOWN
- OK
- INFO
- CRIT
- WARN
type: string
CheckViewProperties:
properties:
adaptiveZoomHide:
type: boolean
check:
$ref: '#/components/schemas/Check'
checkID:
type: string
colors:
description: Colors define color encoding of data into a visualization
items:
$ref: '#/components/schemas/DashboardColor'
type: array
legendColorizeRows:
type: boolean
legendHide:
type: boolean
legendOpacity:
format: float
type: number
legendOrientationThreshold:
type: integer
queries:
items:
$ref: '#/components/schemas/DashboardQuery'
type: array
shape:
enum:
- chronograf-v2
type: string
type:
enum:
- check
type: string
required:
- type
- shape
- checkID
- queries
- colors
type: object
Checks:
properties:
checks:
items:
$ref: '#/components/schemas/Check'
type: array
links:
$ref: '#/components/schemas/Links'
ColorMapping:
additionalProperties:
type: string
description: A color mapping is an object that maps time series data to a UI color scheme to allow the UI to render graphs consistent colors across reloads.
example:
configcat_deployments-autopromotionblocker: '#663cd0'
measurement_birdmigration_europe: '#663cd0'
series_id_1: '#edf529'
series_id_2: '#edf529'
type: object
ConditionalExpression:
description: Selects one of two expressions, `Alternate` or `Consequent`, depending on a third boolean expression, `Test`
properties:
alternate:
$ref: '#/components/schemas/Expression'
consequent:
$ref: '#/components/schemas/Expression'
test:
$ref: '#/components/schemas/Expression'
type:
$ref: '#/components/schemas/NodeType'
type: object
Config:
properties:
config:
type: object
type: object
ConstantVariableProperties:
properties:
type:
enum:
- constant
type: string
values:
items:
type: string
type: array
CreateCell:
properties:
h:
format: int32
type: integer
name:
type: string
usingView:
description: Makes a copy of the provided view.
type: string
w:
format: int32
type: integer
x:
format: int32
type: integer
'y':
format: int32
type: integer
type: object
CreateDashboardRequest:
properties:
description:
description: The user-facing description of the dashboard.
type: string
name:
description: The user-facing name of the dashboard.
type: string
orgID:
description: The ID of the organization that owns the dashboard.
type: string
required:
- orgID
- name
CustomCheck:
allOf:
- $ref: '#/components/schemas/CheckBase'
- properties:
type:
enum:
- custom
type: string
required:
- type
type: object
DBRP:
properties:
bucketID:
description: |
A bucket ID.
Identifies the bucket used as the target for the translation.
type: string
database:
description: |
A database name.
Identifies the InfluxDB v1 database.
type: string
default:
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 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: |
An organization ID.
Identifies the [organization](/influxdb/latest/reference/glossary/#organization) that owns the mapping.
type: string
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.
type: boolean
required:
- id
- orgID
- bucketID
- database
- retention_policy
- default
type: object
DBRPCreate:
properties:
bucketID:
description: |
A bucket ID.
Identifies the bucket used as the target for the translation.
type: string
database:
description: |
A database name.
Identifies the InfluxDB v1 database.
type: string
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).
type: boolean
org:
description: |
An organization name.
Identifies the [organization](/influxdb/latest/reference/glossary/#organization) that owns the mapping.
type: string
orgID:
description: |
An organization ID.
Identifies the [organization](/influxdb/latest/reference/glossary/#organization) that owns the mapping.
type: string
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
- database
- retention_policy
type: object
DBRPGet:
properties:
content:
$ref: '#/components/schemas/DBRP'
required: true
type: object
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: |
A [retention policy](/influxdb/v1.8/concepts/glossary/#retention-policy-rp) name.
Identifies the InfluxDB v1 retention policy mapping.
type: string
DBRPs:
properties:
content:
items:
$ref: '#/components/schemas/DBRP'
type: array
Dashboard:
allOf:
- $ref: '#/components/schemas/CreateDashboardRequest'
- properties:
cells:
$ref: '#/components/schemas/Cells'
id:
readOnly: true
type: string
labels:
$ref: '#/components/schemas/Labels'
links:
example:
cells: /api/v2/dashboards/1/cells
labels: /api/v2/dashboards/1/labels
members: /api/v2/dashboards/1/members
org: /api/v2/labels/1
owners: /api/v2/dashboards/1/owners
self: /api/v2/dashboards/1
properties:
cells:
$ref: '#/components/schemas/Link'
labels:
$ref: '#/components/schemas/Link'
members:
$ref: '#/components/schemas/Link'
org:
$ref: '#/components/schemas/Link'
owners:
$ref: '#/components/schemas/Link'
self:
$ref: '#/components/schemas/Link'
type: object
meta:
properties:
createdAt:
format: date-time
type: string
updatedAt:
format: date-time
type: string
type: object
type: object
type: object
DashboardColor:
description: Defines an encoding of data value into color space.
properties:
hex:
description: The hex number of the color
maxLength: 7
minLength: 7
type: string
id:
description: The unique ID of the view color.
type: string
name:
description: The user-facing name of the hex color.
type: string
type:
description: Type is how the color is used.
enum:
- min
- max
- threshold
- scale
- text
- background
type: string
value:
description: The data value mapped to this color.
format: float
type: number
required:
- id
- type
- hex
- name
- value
type: object
DashboardQuery:
properties:
builderConfig:
$ref: '#/components/schemas/BuilderConfig'
editMode:
$ref: '#/components/schemas/QueryEditMode'
name:
type: string
text:
description: The text of the Flux query.
type: string
type: object
DashboardWithViewProperties:
allOf:
- $ref: '#/components/schemas/CreateDashboardRequest'
- properties:
cells:
$ref: '#/components/schemas/CellsWithViewProperties'
id:
readOnly: true
type: string
labels:
$ref: '#/components/schemas/Labels'
links:
example:
cells: /api/v2/dashboards/1/cells
labels: /api/v2/dashboards/1/labels
members: /api/v2/dashboards/1/members
org: /api/v2/labels/1
owners: /api/v2/dashboards/1/owners
self: /api/v2/dashboards/1
properties:
cells:
$ref: '#/components/schemas/Link'
labels:
$ref: '#/components/schemas/Link'
members:
$ref: '#/components/schemas/Link'
org:
$ref: '#/components/schemas/Link'
owners:
$ref: '#/components/schemas/Link'
self:
$ref: '#/components/schemas/Link'
type: object
meta:
properties:
createdAt:
format: date-time
type: string
updatedAt:
format: date-time
type: string
type: object
type: object
type: object
Dashboards:
properties:
dashboards:
items:
$ref: '#/components/schemas/Dashboard'
type: array
links:
$ref: '#/components/schemas/Links'
type: object
DateTimeLiteral:
description: Represents an instant in time with nanosecond precision in [RFC3339Nano date/time format](/influxdb/latest/reference/glossary/#rfc3339nano-timestamp).
properties:
type:
$ref: '#/components/schemas/NodeType'
value:
format: date-time
type: string
type: object
DeadmanCheck:
allOf:
- $ref: '#/components/schemas/CheckBase'
- properties:
every:
description: Check repetition interval.
type: string
level:
$ref: '#/components/schemas/CheckStatusLevel'
offset:
description: Duration to delay after the schedule, before executing check.
type: string
reportZero:
description: If only zero values reported since time, trigger an alert
type: boolean
staleTime:
description: String duration for time that a series is considered stale and should not trigger deadman.
type: string
statusMessageTemplate:
description: The template used to generate and write a status message.
type: string
tags:
description: List of tags to write to each status.
items:
properties:
key:
type: string
value:
type: string
type: object
type: array
timeSince:
description: String duration before deadman triggers.
type: string
type:
enum:
- deadman
type: string
required:
- type
type: object
DecimalPlaces:
description: Indicates whether decimal places should be enforced, and how many digits it should show.
properties:
digits:
description: The number of digits after decimal to display
format: int32
type: integer
isEnforced:
description: Indicates whether decimal point setting should be enforced
type: boolean
type: object
DeletePredicateRequest:
description: The delete predicate request.
properties:
predicate:
description: |
An expression in [delete predicate syntax](/influxdb/latest/reference/syntax/delete-predicate/).
example: tag1="value1" and (tag2="value2" and tag3!="value3")
type: string
start:
description: |
A timestamp ([RFC3339 date/time format](/influxdb/latest/reference/glossary/#rfc3339-timestamp)).
The earliest time to delete from.
format: date-time
type: string
stop:
description: |
A timestamp ([RFC3339 date/time format](/influxdb/latest/reference/glossary/#rfc3339-timestamp)).
The latest time to delete from.
format: date-time
type: string
required:
- start
- stop
type: object
Dialect:
description: |
Options for tabular data output.
Default output is [annotated CSV](/influxdb/latest/reference/syntax/annotated-csv/#csv-response-format) with headers.
For more information about tabular data **dialect**,
see [W3 metadata vocabulary for tabular data](https://www.w3.org/TR/2015/REC-tabular-metadata-20151217/#dialect-descriptions).
properties:
annotations:
description: |
Annotation rows to include in the results.
An _annotation_ is metadata associated with an object (column) in the data model.
#### Related guides
- See [Annotated CSV annotations](/influxdb/latest/reference/syntax/annotated-csv/#annotations) for examples and more information.
For more information about **annotations** in tabular data,
see [W3 metadata vocabulary for tabular data](https://www.w3.org/TR/2015/REC-tabular-data-model-20151217/#columns).
items:
enum:
- group
- datatype
- default
type: string
type: array
uniqueItems: true
commentPrefix:
default: '#'
description: The character prefixed to comment strings. Default is a number sign (`#`).
maxLength: 1
minLength: 0
type: string
dateTimeFormat:
default: RFC3339
description: |
The format for timestamps in results.
Default is [`RFC3339` date/time format](/influxdb/latest/reference/glossary/#rfc3339-timestamp).
To include nanoseconds in timestamps, use `RFC3339Nano`.
#### Example formatted date/time values
| Format | Value |
|:------------|:----------------------------|
| `RFC3339` | `"2006-01-02T15:04:05Z07:00"` |
| `RFC3339Nano` | `"2006-01-02T15:04:05.999999999Z07:00"` |
enum:
- RFC3339
- RFC3339Nano
type: string
delimiter:
default: ','
description: The separator used between cells. Default is a comma (`,`).
maxLength: 1
minLength: 1
type: string
header:
default: true
description: If true, the results contain a header row.
type: boolean
type: object
DictExpression:
description: Used to create and directly specify the elements of a dictionary
properties:
elements:
description: Elements of the dictionary
items:
$ref: '#/components/schemas/DictItem'
type: array
type:
$ref: '#/components/schemas/NodeType'
type: object
DictItem:
description: A key-value pair in a dictionary.
properties:
key:
$ref: '#/components/schemas/Expression'
type:
$ref: '#/components/schemas/NodeType'
val:
$ref: '#/components/schemas/Expression'
type: object
Duration:
description: A pair consisting of length of time and the unit of time measured. It is the atomic unit from which all duration literals are composed.
properties:
magnitude:
type: integer
type:
$ref: '#/components/schemas/NodeType'
unit:
type: string
type: object
DurationLiteral:
description: Represents the elapsed time between two instants as an int64 nanosecond count with syntax of golang's time.Duration
properties:
type:
$ref: '#/components/schemas/NodeType'
values:
description: Duration values
items:
$ref: '#/components/schemas/Duration'
type: array
type: object
Error:
properties:
code:
$ref: '#/components/schemas/ErrorCode'
description: code is the machine-readable error code.
enum:
- internal error
- not found
- conflict
- invalid
- unprocessable entity
- empty value
- unavailable
- forbidden
- too many requests
- unauthorized
- method not allowed
- request too large
- unsupported media type
readOnly: true
type: string
err:
description: Stack of errors that occurred during processing of the request. Useful for debugging.
readOnly: true
type: string
message:
description: Human-readable message.
readOnly: true
type: string
op:
description: Describes the logical code operation when the error occurred. Useful for debugging.
readOnly: true
type: string
required:
- code
ErrorCode:
description: code is the machine-readable error code.
enum:
- internal error
- not found
- conflict
- invalid
- unprocessable entity
- empty value
- unavailable
- forbidden
- too many requests
- unauthorized
- method not allowed
- request too large
- unsupported media type
readOnly: true
type: string
Expression:
oneOf:
- $ref: '#/components/schemas/ArrayExpression'
- $ref: '#/components/schemas/DictExpression'
- $ref: '#/components/schemas/FunctionExpression'
- $ref: '#/components/schemas/BinaryExpression'
- $ref: '#/components/schemas/CallExpression'
- $ref: '#/components/schemas/ConditionalExpression'
- $ref: '#/components/schemas/LogicalExpression'
- $ref: '#/components/schemas/MemberExpression'
- $ref: '#/components/schemas/IndexExpression'
- $ref: '#/components/schemas/ObjectExpression'
- $ref: '#/components/schemas/ParenExpression'
- $ref: '#/components/schemas/PipeExpression'
- $ref: '#/components/schemas/UnaryExpression'
- $ref: '#/components/schemas/BooleanLiteral'
- $ref: '#/components/schemas/DateTimeLiteral'
- $ref: '#/components/schemas/DurationLiteral'
- $ref: '#/components/schemas/FloatLiteral'
- $ref: '#/components/schemas/IntegerLiteral'
- $ref: '#/components/schemas/PipeLiteral'
- $ref: '#/components/schemas/RegexpLiteral'
- $ref: '#/components/schemas/StringLiteral'
- $ref: '#/components/schemas/UnsignedIntegerLiteral'
- $ref: '#/components/schemas/Identifier'
ExpressionStatement:
description: May consist of an expression that doesn't return a value and is executed solely for its side-effects
properties:
expression:
$ref: '#/components/schemas/Expression'
type:
$ref: '#/components/schemas/NodeType'
type: object
Field:
properties:
alias:
description: Alias overrides the field name in the returned response. Applies only if type is `func`
type: string
args:
description: Args are the arguments to the function
items:
$ref: '#/components/schemas/Field'
type: array
type:
description: '`type` describes the field type. `func` is a function. `field` is a field reference.'
enum:
- func
- field
- integer
- number
- regex
- wildcard
type: string
value:
description: value is the value of the field. Meaning of the value is implied by the `type` key
type: string
type: object
File:
description: Represents a source from a single file
properties:
body:
description: List of Flux statements
items:
$ref: '#/components/schemas/Statement'
type: array
imports:
description: A list of package imports
items:
$ref: '#/components/schemas/ImportDeclaration'
type: array
name:
description: The name of the file.
type: string
package:
$ref: '#/components/schemas/PackageClause'
type:
$ref: '#/components/schemas/NodeType'
type: object
Flags:
additionalProperties: true
type: object
FloatLiteral:
description: Represents floating point numbers according to the double representations defined by the IEEE-754-1985
properties:
type:
$ref: '#/components/schemas/NodeType'
value:
type: number
type: object
FluxResponse:
description: Rendered flux that backs the check or notification.
properties:
flux:
type: string
FluxSuggestion:
properties:
name:
type: string
params:
additionalProperties:
type: string
type: object
type: object
FluxSuggestions:
properties:
funcs:
items:
$ref: '#/components/schemas/FluxSuggestion'
type: array
type: object
FunctionExpression:
description: Function expression
properties:
body:
$ref: '#/components/schemas/Node'
params:
description: Function parameters
items:
$ref: '#/components/schemas/Property'
type: array
type:
$ref: '#/components/schemas/NodeType'
type: object
GaugeViewProperties:
properties:
colors:
description: Colors define color encoding of data into a visualization
items:
$ref: '#/components/schemas/DashboardColor'
type: array
decimalPlaces:
$ref: '#/components/schemas/DecimalPlaces'
note:
type: string
prefix:
type: string
queries:
items:
$ref: '#/components/schemas/DashboardQuery'
type: array
shape:
enum:
- chronograf-v2
type: string
showNoteWhenEmpty:
description: If true, will display note when empty
type: boolean
suffix:
type: string
tickPrefix:
type: string
tickSuffix:
type: string
type:
enum:
- gauge
type: string
required:
- type
- queries
- colors
- shape
- note
- showNoteWhenEmpty
- prefix
- tickPrefix
- suffix
- tickSuffix
- decimalPlaces
type: object
GeoCircleViewLayer:
allOf:
- $ref: '#/components/schemas/GeoViewLayerProperties'
- properties:
colorDimension:
$ref: '#/components/schemas/Axis'
colorField:
description: Circle color field
type: string
colors:
description: Colors define color encoding of data into a visualization
items:
$ref: '#/components/schemas/DashboardColor'
type: array
interpolateColors:
description: Interpolate circle color based on displayed value
type: boolean
radius:
description: Maximum radius size in pixels
type: integer
radiusDimension:
$ref: '#/components/schemas/Axis'
radiusField:
description: Radius field
type: string
required:
- radiusField
- radiusDimension
- colorField
- colorDimension
- colors
type: object
GeoHeatMapViewLayer:
allOf:
- $ref: '#/components/schemas/GeoViewLayerProperties'
- properties:
blur:
description: Blur for heatmap points
type: integer
colors:
description: Colors define color encoding of data into a visualization
items:
$ref: '#/components/schemas/DashboardColor'
type: array
intensityDimension:
$ref: '#/components/schemas/Axis'
intensityField:
description: Intensity field
type: string
radius:
description: Radius size in pixels
type: integer
required:
- intensityField
- intensityDimension
- radius
- blur
- colors
type: object
GeoPointMapViewLayer:
allOf:
- $ref: '#/components/schemas/GeoViewLayerProperties'
- properties:
colorDimension:
$ref: '#/components/schemas/Axis'
colorField:
description: Marker color field
type: string
colors:
description: Colors define color encoding of data into a visualization
items:
$ref: '#/components/schemas/DashboardColor'
type: array
isClustered:
description: Cluster close markers together
type: boolean
tooltipColumns:
description: An array for which columns to display in tooltip
items:
type: string
type: array
required:
- colorField
- colorDimension
- colors
type: object
GeoTrackMapViewLayer:
allOf:
- $ref: '#/components/schemas/GeoViewLayerProperties'
- required:
- trackWidth
- speed
- randomColors
- trackPointVisualization
type: object
properties:
colors:
description: Colors define color encoding of data into a visualization
items:
$ref: '#/components/schemas/DashboardColor'
type: array
randomColors:
description: Assign different colors to different tracks
type: boolean
speed:
description: Speed of the track animation
type: integer
trackWidth:
description: Width of the track
type: integer
GeoViewLayer:
oneOf:
- $ref: '#/components/schemas/GeoCircleViewLayer'
- $ref: '#/components/schemas/GeoHeatMapViewLayer'
- $ref: '#/components/schemas/GeoPointMapViewLayer'
- $ref: '#/components/schemas/GeoTrackMapViewLayer'
type: object
GeoViewLayerProperties:
properties:
type:
enum:
- heatmap
- circleMap
- pointMap
- trackMap
type: string
required:
- type
type: object
GeoViewProperties:
properties:
allowPanAndZoom:
default: true
description: If true, map zoom and pan controls are enabled on the dashboard view
type: boolean
center:
description: Coordinates of the center of the map
properties:
lat:
description: Latitude of the center of the map
format: double
type: number
lon:
description: Longitude of the center of the map
format: double
type: number
required:
- lat
- lon
type: object
colors:
description: Colors define color encoding of data into a visualization
items:
$ref: '#/components/schemas/DashboardColor'
type: array
detectCoordinateFields:
default: true
description: If true, search results get automatically regroupped so that lon,lat and value are treated as columns
type: boolean
latLonColumns:
$ref: '#/components/schemas/LatLonColumns'
layers:
description: List of individual layers shown in the map
items:
$ref: '#/components/schemas/GeoViewLayer'
type: array
mapStyle:
description: Define map type - regular, satellite etc.
type: string
note:
type: string
queries:
items:
$ref: '#/components/schemas/DashboardQuery'
type: array
s2Column:
description: String to define the column
type: string
shape:
enum:
- chronograf-v2
type: string
showNoteWhenEmpty:
description: If true, will display note when empty
type: boolean
type:
enum:
- geo
type: string
useS2CellID:
description: If true, S2 column is used to calculate lat/lon
type: boolean
zoom:
description: Zoom level used for initial display of the map
format: double
maximum: 28
minimum: 1
type: number
required:
- type
- shape
- queries
- note
- showNoteWhenEmpty
- center
- zoom
- allowPanAndZoom
- detectCoordinateFields
- layers
type: object
GreaterThreshold:
allOf:
- $ref: '#/components/schemas/ThresholdBase'
- properties:
type:
enum:
- greater
type: string
value:
format: float
type: number
required:
- type
- value
type: object
HTTPNotificationEndpoint:
allOf:
- $ref: '#/components/schemas/NotificationEndpointBase'
- properties:
authMethod:
enum:
- none
- basic
- bearer
type: string
contentTemplate:
type: string
headers:
additionalProperties:
type: string
description: Customized headers.
type: object
method:
enum:
- POST
- GET
- PUT
type: string
password:
type: string
token:
type: string
url:
type: string
username:
type: string
required:
- url
- authMethod
- method
type: object
type: object
HTTPNotificationRule:
allOf:
- $ref: '#/components/schemas/NotificationRuleBase'
- $ref: '#/components/schemas/HTTPNotificationRuleBase'
HTTPNotificationRuleBase:
properties:
type:
enum:
- http
type: string
url:
type: string
required:
- type
type: object
HealthCheck:
properties:
checks:
items:
$ref: '#/components/schemas/HealthCheck'
type: array
commit:
type: string
message:
type: string
name:
type: string
status:
enum:
- pass
- fail
type: string
version:
type: string
required:
- name
- status
type: object
HeatmapViewProperties:
properties:
adaptiveZoomHide:
type: boolean
binSize:
type: number
colors:
description: Colors define color encoding of data into a visualization
items:
type: string
type: array
generateXAxisTicks:
items:
type: string
type: array
generateYAxisTicks:
items:
type: string
type: array
legendColorizeRows:
type: boolean
legendHide:
type: boolean
legendOpacity:
format: float
type: number
legendOrientationThreshold:
type: integer
note:
type: string
queries:
items:
$ref: '#/components/schemas/DashboardQuery'
type: array
shape:
enum:
- chronograf-v2
type: string
showNoteWhenEmpty:
description: If true, will display note when empty
type: boolean
timeFormat:
type: string
type:
enum:
- heatmap
type: string
xAxisLabel:
type: string
xColumn:
type: string
xDomain:
items:
type: number
maxItems: 2
type: array
xPrefix:
type: string
xSuffix:
type: string
xTickStart:
format: float
type: number
xTickStep:
format: float
type: number
xTotalTicks:
type: integer
yAxisLabel:
type: string
yColumn:
type: string
yDomain:
items:
type: number
maxItems: 2
type: array
yPrefix:
type: string
ySuffix:
type: string
yTickStart:
format: float
type: number
yTickStep:
format: float
type: number
yTotalTicks:
type: integer
required:
- type
- queries
- colors
- shape
- note
- showNoteWhenEmpty
- xColumn
- yColumn
- xDomain
- yDomain
- xAxisLabel
- yAxisLabel
- xPrefix
- yPrefix
- xSuffix
- ySuffix
- binSize
type: object
HistogramViewProperties:
properties:
binCount:
type: integer
colors:
description: Colors define color encoding of data into a visualization
items:
$ref: '#/components/schemas/DashboardColor'
type: array
fillColumns:
items:
type: string
type: array
legendColorizeRows:
type: boolean
legendHide:
type: boolean
legendOpacity:
format: float
type: number
legendOrientationThreshold:
type: integer
note:
type: string
position:
enum:
- overlaid
- stacked
type: string
queries:
items:
$ref: '#/components/schemas/DashboardQuery'
type: array
shape:
enum:
- chronograf-v2
type: string
showNoteWhenEmpty:
description: If true, will display note when empty
type: boolean
type:
enum:
- histogram
type: string
xAxisLabel:
type: string
xColumn:
type: string
xDomain:
items:
format: float
type: number
type: array
required:
- type
- queries
- colors
- shape
- note
- showNoteWhenEmpty
- xColumn
- fillColumns
- xDomain
- xAxisLabel
- position
- binCount
type: object
Identifier:
description: A valid Flux identifier
properties:
name:
type: string
type:
$ref: '#/components/schemas/NodeType'
type: object
ImportDeclaration:
description: Declares a package import
properties:
as:
$ref: '#/components/schemas/Identifier'
path:
$ref: '#/components/schemas/StringLiteral'
type:
$ref: '#/components/schemas/NodeType'
type: object
IndexExpression:
description: Represents indexing into an array
properties:
array:
$ref: '#/components/schemas/Expression'
index:
$ref: '#/components/schemas/Expression'
type:
$ref: '#/components/schemas/NodeType'
type: object
InfluxqlCsvResponse:
description: CSV Response to InfluxQL Query
example: |
name,tags,time,test_field,test_tag test_measurement,,1603740794286107366,1,tag_value test_measurement,,1603740870053205649,2,tag_value test_measurement,,1603741221085428881,3,tag_value
type: string
InfluxqlJsonResponse:
description: JSON Response to InfluxQL Query
properties:
results:
items:
properties:
error:
type: string
series:
items:
properties:
columns:
items:
type: string
type: array
name:
type: string
partial:
type: boolean
tags:
additionalProperties:
type: string
type: object
values:
items:
items: {}
type: array
type: array
type: object
type: array
statement_id:
type: integer
type: object
type: array
type: object
IntegerLiteral:
description: Represents integer numbers
properties:
type:
$ref: '#/components/schemas/NodeType'
value:
type: string
type: object
IsOnboarding:
properties:
allowed:
description: |
If `true`, the InfluxDB instance hasn't had initial setup;
`false` otherwise.
type: boolean
type: object
Label:
properties:
id:
readOnly: true
type: string
name:
type: string
orgID:
readOnly: true
type: string
properties:
additionalProperties:
type: string
description: |
Key-value pairs associated with this label.
To remove a property, send an update with an empty value (`""`) for the key.
example:
color: ffb3b3
description: this is a description
type: object
type: object
LabelCreateRequest:
properties:
name:
type: string
orgID:
type: string
properties:
additionalProperties:
type: string
description: |
Key-value pairs associated with this label.
To remove a property, send an update with an empty value (`""`) for the key.
example:
color: ffb3b3
description: this is a description
type: object
required:
- orgID
- name
type: object
LabelMapping:
description: A _label mapping_ contains a `label` ID to attach to a resource.
properties:
labelID:
description: |
A label ID.
Specifies the label to attach.
type: string
required:
- labelID
type: object
LabelResponse:
properties:
label:
$ref: '#/components/schemas/Label'
links:
$ref: '#/components/schemas/Links'
type: object
LabelUpdate:
properties:
name:
type: string
properties:
additionalProperties:
description: |
Key-value pairs associated with this label.
To remove a property, send an update with an empty value (`""`) for the key.
type: string
example:
color: ffb3b3
description: this is a description
type: object
type: object
Labels:
items:
$ref: '#/components/schemas/Label'
type: array
LabelsResponse:
properties:
labels:
$ref: '#/components/schemas/Labels'
links:
$ref: '#/components/schemas/Links'
type: object
LanguageRequest:
description: Flux query to be analyzed.
properties:
query:
description: |
The Flux query script to be analyzed.
type: string
required:
- query
type: object
LatLonColumn:
description: Object type for key and column definitions
properties:
column:
description: Column to look up Lat/Lon
type: string
key:
description: Key to determine whether the column is tag/field
type: string
required:
- key
- column
type: object
LatLonColumns:
description: Object type to define lat/lon columns
properties:
lat:
$ref: '#/components/schemas/LatLonColumn'
lon:
$ref: '#/components/schemas/LatLonColumn'
required:
- lat
- lon
type: object
LegacyAuthorizationPostRequest:
allOf:
- $ref: '#/components/schemas/AuthorizationUpdateRequest'
- properties:
orgID:
description: The organization ID. Identifies the organization that the authorization is scoped to.
type: string
permissions:
description: |
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: The name that you provide for the authorization.
type: string
userID:
description: The user ID. Identifies the user that the authorization is scoped to.
type: string
type: object
required:
- orgID
- permissions
LesserThreshold:
allOf:
- $ref: '#/components/schemas/ThresholdBase'
- properties:
type:
enum:
- lesser
type: string
value:
format: float
type: number
required:
- type
- value
type: object
LinePlusSingleStatProperties:
properties:
adaptiveZoomHide:
type: boolean
axes:
$ref: '#/components/schemas/Axes'
colors:
description: Colors define color encoding of data into a visualization
items:
$ref: '#/components/schemas/DashboardColor'
type: array
decimalPlaces:
$ref: '#/components/schemas/DecimalPlaces'
generateXAxisTicks:
items:
type: string
type: array
generateYAxisTicks:
items:
type: string
type: array
hoverDimension:
enum:
- auto
- x
- 'y'
- xy
type: string
legendColorizeRows:
type: boolean
legendHide:
type: boolean
legendOpacity:
format: float
type: number
legendOrientationThreshold:
type: integer
note:
type: string
position:
enum:
- overlaid
- stacked
type: string
prefix:
type: string
queries:
items:
$ref: '#/components/schemas/DashboardQuery'
type: array
shadeBelow:
type: boolean
shape:
enum:
- chronograf-v2
type: string
showNoteWhenEmpty:
description: If true, will display note when empty
type: boolean
staticLegend:
$ref: '#/components/schemas/StaticLegend'
suffix:
type: string
timeFormat:
type: string
type:
enum:
- line-plus-single-stat
type: string
xColumn:
type: string
xTickStart:
format: float
type: number
xTickStep:
format: float
type: number
xTotalTicks:
type: integer
yColumn:
type: string
yTickStart:
format: float
type: number
yTickStep:
format: float
type: number
yTotalTicks:
type: integer
required:
- type
- queries
- shape
- axes
- colors
- note
- showNoteWhenEmpty
- prefix
- suffix
- decimalPlaces
- position
type: object
LineProtocolError:
properties:
code:
description: Code is the machine-readable error code.
enum:
- internal error
- not found
- conflict
- invalid
- empty value
- unavailable
readOnly: true
type: string
err:
description: Stack of errors that occurred during processing of the request. Useful for debugging.
readOnly: true
type: string
line:
description: First line in the request body that contains malformed data.
format: int32
readOnly: true
type: integer
message:
description: Human-readable message.
readOnly: true
type: string
op:
description: Describes the logical code operation when the error occurred. Useful for debugging.
readOnly: true
type: string
required:
- code
LineProtocolLengthError:
properties:
code:
description: Code is the machine-readable error code.
enum:
- invalid
readOnly: true
type: string
message:
description: Human-readable message.
readOnly: true
type: string
required:
- code
- message
Link:
description: URI of resource.
format: uri
readOnly: true
type: string
Links:
description: |
URI pointers for additional paged results.
properties:
next:
$ref: '#/components/schemas/Link'
prev:
$ref: '#/components/schemas/Link'
self:
$ref: '#/components/schemas/Link'
required:
- self
type: object
LogEvent:
properties:
message:
description: A description of the event that occurred.
example: Halt and catch fire
readOnly: true
type: string
runID:
description: The ID of the task run that generated the event.
readOnly: true
type: string
time:
description: The time ([RFC3339Nano date/time format](/influxdb/latest/reference/glossary/#rfc3339nano-timestamp)) that the event occurred.
example: 2006-01-02T15:04:05.999999999Z07:00
format: date-time
readOnly: true
type: string
type: object
LogicalExpression:
description: Represents the rule conditions that collectively evaluate to either true or false
properties:
left:
$ref: '#/components/schemas/Expression'
operator:
type: string
right:
$ref: '#/components/schemas/Expression'
type:
$ref: '#/components/schemas/NodeType'
type: object
Logs:
properties:
events:
items:
$ref: '#/components/schemas/LogEvent'
readOnly: true
type: array
type: object
MapVariableProperties:
properties:
type:
enum:
- map
type: string
values:
additionalProperties:
type: string
type: object
MarkdownViewProperties:
properties:
note:
type: string
shape:
enum:
- chronograf-v2
type: string
type:
enum:
- markdown
type: string
required:
- type
- shape
- note
type: object
MemberAssignment:
description: Object property assignment
properties:
init:
$ref: '#/components/schemas/Expression'
member:
$ref: '#/components/schemas/MemberExpression'
type:
$ref: '#/components/schemas/NodeType'
type: object
MemberExpression:
description: Represents accessing a property of an object
properties:
object:
$ref: '#/components/schemas/Expression'
property:
$ref: '#/components/schemas/PropertyKey'
type:
$ref: '#/components/schemas/NodeType'
type: object
MetadataBackup:
properties:
buckets:
$ref: '#/components/schemas/BucketMetadataManifests'
kv:
format: binary
type: string
sql:
format: binary
type: string
required:
- kv
- sql
- buckets
type: object
MosaicViewProperties:
properties:
colors:
description: Colors define color encoding of data into a visualization
items:
type: string
type: array
fillColumns:
items:
type: string
type: array
generateXAxisTicks:
items:
type: string
type: array
hoverDimension:
enum:
- auto
- x
- 'y'
- xy
type: string
legendColorizeRows:
type: boolean
legendHide:
type: boolean
legendOpacity:
format: float
type: number
legendOrientationThreshold:
type: integer
note:
type: string
queries:
items:
$ref: '#/components/schemas/DashboardQuery'
type: array
shape:
enum:
- chronograf-v2
type: string
showNoteWhenEmpty:
description: If true, will display note when empty
type: boolean
timeFormat:
type: string
type:
enum:
- mosaic
type: string
xAxisLabel:
type: string
xColumn:
type: string
xDomain:
items:
type: number
maxItems: 2
type: array
xPrefix:
type: string
xSuffix:
type: string
xTickStart:
format: float
type: number
xTickStep:
format: float
type: number
xTotalTicks:
type: integer
yAxisLabel:
type: string
yDomain:
items:
type: number
maxItems: 2
type: array
yLabelColumnSeparator:
type: string
yLabelColumns:
items:
type: string
type: array
yPrefix:
type: string
ySeriesColumns:
items:
type: string
type: array
ySuffix:
type: string
required:
- type
- queries
- colors
- shape
- note
- showNoteWhenEmpty
- xColumn
- ySeriesColumns
- fillColumns
- xDomain
- yDomain
- xAxisLabel
- yAxisLabel
- xPrefix
- yPrefix
- xSuffix
- ySuffix
type: object
Node:
oneOf:
- $ref: '#/components/schemas/Expression'
- $ref: '#/components/schemas/Block'
NodeType:
description: Type of AST node
type: string
NotificationEndpoint:
allOf:
- $ref: '#/components/schemas/NotificationEndpointDiscriminator'
NotificationEndpointBase:
properties:
createdAt:
format: date-time
readOnly: true
type: string
description:
description: An optional description of the notification endpoint.
type: string
id:
type: string
labels:
$ref: '#/components/schemas/Labels'
links:
example:
labels: /api/v2/notificationEndpoints/1/labels
members: /api/v2/notificationEndpoints/1/members
owners: /api/v2/notificationEndpoints/1/owners
self: /api/v2/notificationEndpoints/1
properties:
labels:
$ref: '#/components/schemas/Link'
description: The URL to retrieve labels for this endpoint.
members:
$ref: '#/components/schemas/Link'
description: The URL to retrieve members for this endpoint.
owners:
$ref: '#/components/schemas/Link'
description: The URL to retrieve owners for this endpoint.
self:
$ref: '#/components/schemas/Link'
description: The URL for this endpoint.
readOnly: true
type: object
name:
type: string
orgID:
type: string
status:
default: active
description: The status of the endpoint.
enum:
- active
- inactive
type: string
type:
$ref: '#/components/schemas/NotificationEndpointType'
updatedAt:
format: date-time
readOnly: true
type: string
userID:
type: string
required:
- type
- name
type: object
NotificationEndpointDiscriminator:
discriminator:
mapping:
http: '#/components/schemas/HTTPNotificationEndpoint'
pagerduty: '#/components/schemas/PagerDutyNotificationEndpoint'
slack: '#/components/schemas/SlackNotificationEndpoint'
telegram: '#/components/schemas/TelegramNotificationEndpoint'
propertyName: type
oneOf:
- $ref: '#/components/schemas/SlackNotificationEndpoint'
- $ref: '#/components/schemas/PagerDutyNotificationEndpoint'
- $ref: '#/components/schemas/HTTPNotificationEndpoint'
- $ref: '#/components/schemas/TelegramNotificationEndpoint'
NotificationEndpointType:
enum:
- slack
- pagerduty
- http
- telegram
type: string
NotificationEndpointUpdate:
properties:
description:
type: string
name:
type: string
status:
enum:
- active
- inactive
type: string
type: object
NotificationEndpoints:
properties:
links:
$ref: '#/components/schemas/Links'
notificationEndpoints:
items:
$ref: '#/components/schemas/NotificationEndpoint'
type: array
NotificationRule:
allOf:
- $ref: '#/components/schemas/NotificationRuleDiscriminator'
NotificationRuleBase:
properties:
createdAt:
format: date-time
readOnly: true
type: string
description:
description: An optional description of the notification rule.
type: string
endpointID:
type: string
every:
description: The notification repetition interval.
type: string
id:
readOnly: true
type: string
labels:
$ref: '#/components/schemas/Labels'
lastRunError:
readOnly: true
type: string
lastRunStatus:
enum:
- failed
- success
- canceled
readOnly: true
type: string
latestCompleted:
description: A timestamp ([RFC3339 date/time format](/influxdb/latest/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run.
format: date-time
readOnly: true
type: string
limit:
description: Don't notify me more than <limit> times every <limitEvery> seconds. If set, limitEvery cannot be empty.
type: integer
limitEvery:
description: Don't notify me more than <limit> times every <limitEvery> seconds. If set, limit cannot be empty.
type: integer
links:
example:
labels: /api/v2/notificationRules/1/labels
members: /api/v2/notificationRules/1/members
owners: /api/v2/notificationRules/1/owners
query: /api/v2/notificationRules/1/query
self: /api/v2/notificationRules/1
properties:
labels:
$ref: '#/components/schemas/Link'
description: The URL to retrieve labels for this notification rule.
members:
$ref: '#/components/schemas/Link'
description: The URL to retrieve members for this notification rule.
owners:
$ref: '#/components/schemas/Link'
description: The URL to retrieve owners for this notification rule.
query:
$ref: '#/components/schemas/Link'
description: The URL to retrieve the Flux script for this notification rule.
self:
$ref: '#/components/schemas/Link'
description: The URL for this endpoint.
readOnly: true
type: object
name:
description: Human-readable name describing the notification rule.
type: string
offset:
description: Duration to delay after the schedule, before executing check.
type: string
orgID:
description: The ID of the organization that owns this notification rule.
type: string
ownerID:
description: The ID of creator used to create this notification rule.
readOnly: true
type: string
runbookLink:
type: string
sleepUntil:
type: string
status:
$ref: '#/components/schemas/TaskStatusType'
statusRules:
description: List of status rules the notification rule attempts to match.
items:
$ref: '#/components/schemas/StatusRule'
minItems: 1
type: array
tagRules:
description: List of tag rules the notification rule attempts to match.
items:
$ref: '#/components/schemas/TagRule'
type: array
taskID:
description: The ID of the task associated with this notification rule.
type: string
updatedAt:
format: date-time
readOnly: true
type: string
required:
- orgID
- status
- name
- statusRules
- endpointID
type: object
NotificationRuleDiscriminator:
discriminator:
mapping:
http: '#/components/schemas/HTTPNotificationRule'
pagerduty: '#/components/schemas/PagerDutyNotificationRule'
slack: '#/components/schemas/SlackNotificationRule'
smtp: '#/components/schemas/SMTPNotificationRule'
telegram: '#/components/schemas/TelegramNotificationRule'
propertyName: type
oneOf:
- $ref: '#/components/schemas/SlackNotificationRule'
- $ref: '#/components/schemas/SMTPNotificationRule'
- $ref: '#/components/schemas/PagerDutyNotificationRule'
- $ref: '#/components/schemas/HTTPNotificationRule'
- $ref: '#/components/schemas/TelegramNotificationRule'
NotificationRuleUpdate:
properties:
description:
type: string
name:
type: string
status:
enum:
- active
- inactive
type: string
type: object
NotificationRules:
properties:
links:
$ref: '#/components/schemas/Links'
notificationRules:
items:
$ref: '#/components/schemas/NotificationRule'
type: array
ObjectExpression:
description: Allows the declaration of an anonymous object within a declaration
properties:
properties:
description: Object properties
items:
$ref: '#/components/schemas/Property'
type: array
type:
$ref: '#/components/schemas/NodeType'
type: object
OnboardingRequest:
properties:
bucket:
type: string
org:
type: string
password:
type: string
retentionPeriodHrs:
deprecated: true
description: |
Retention period *in nanoseconds* for the new bucket. This key's name has been misleading since OSS 2.0 GA, please transition to use `retentionPeriodSeconds`
type: integer
retentionPeriodSeconds:
format: int64
type: integer
token:
description: |
Authentication token to set on the initial user. If not specified, the server will generate a token.
type: string
username:
type: string
required:
- username
- org
- bucket
type: object
OnboardingResponse:
properties:
auth:
$ref: '#/components/schemas/Authorization'
bucket:
$ref: '#/components/schemas/Bucket'
org:
$ref: '#/components/schemas/Organization'
user:
$ref: '#/components/schemas/UserResponse'
type: object
OptionStatement:
description: A single variable declaration
properties:
assignment:
oneOf:
- $ref: '#/components/schemas/VariableAssignment'
- $ref: '#/components/schemas/MemberAssignment'
type:
$ref: '#/components/schemas/NodeType'
type: object
Organization:
properties:
createdAt:
format: date-time
readOnly: true
type: string
description:
type: string
id:
readOnly: true
type: string
links:
example:
buckets: /api/v2/buckets?org=myorg
dashboards: /api/v2/dashboards?org=myorg
labels: /api/v2/orgs/1/labels
members: /api/v2/orgs/1/members
owners: /api/v2/orgs/1/owners
secrets: /api/v2/orgs/1/secrets
self: /api/v2/orgs/1
tasks: /api/v2/tasks?org=myorg
properties:
buckets:
$ref: '#/components/schemas/Link'
dashboards:
$ref: '#/components/schemas/Link'
labels:
$ref: '#/components/schemas/Link'
members:
$ref: '#/components/schemas/Link'
owners:
$ref: '#/components/schemas/Link'
secrets:
$ref: '#/components/schemas/Link'
self:
$ref: '#/components/schemas/Link'
tasks:
$ref: '#/components/schemas/Link'
readOnly: true
type: object
name:
type: string
status:
default: active
description: If inactive the organization is inactive.
enum:
- active
- inactive
type: string
updatedAt:
format: date-time
readOnly: true
type: string
required:
- name
Organizations:
properties:
links:
$ref: '#/components/schemas/Links'
orgs:
items:
$ref: '#/components/schemas/Organization'
type: array
type: object
Package:
description: Represents a complete package source tree.
properties:
files:
description: Package files
items:
$ref: '#/components/schemas/File'
type: array
package:
description: Package name
type: string
path:
description: Package import path
type: string
type:
$ref: '#/components/schemas/NodeType'
type: object
PackageClause:
description: Defines a package identifier
properties:
name:
$ref: '#/components/schemas/Identifier'
type:
$ref: '#/components/schemas/NodeType'
type: object
PagerDutyNotificationEndpoint:
allOf:
- $ref: '#/components/schemas/NotificationEndpointBase'
- properties:
clientURL:
type: string
routingKey:
type: string
required:
- routingKey
type: object
type: object
PagerDutyNotificationRule:
allOf:
- $ref: '#/components/schemas/NotificationRuleBase'
- $ref: '#/components/schemas/PagerDutyNotificationRuleBase'
PagerDutyNotificationRuleBase:
properties:
messageTemplate:
type: string
type:
enum:
- pagerduty
type: string
required:
- type
- messageTemplate
type: object
ParenExpression:
description: Represents an expression wrapped in parenthesis
properties:
expression:
$ref: '#/components/schemas/Expression'
type:
$ref: '#/components/schemas/NodeType'
type: object
PasswordResetBody:
properties:
password:
type: string
required:
- password
PatchBucketRequest:
description: |
An object that contains updated bucket properties to apply.
properties:
description:
description: |
A description of the bucket.
type: string
name:
description: |
The name of the bucket.
type: string
retentionRules:
$ref: '#/components/schemas/PatchRetentionRules'
type: object
PatchOrganizationRequest:
description: |
An object that contains updated organization properties to apply.
properties:
description:
description: |
The description of the organization.
type: string
name:
description: |
The name of the organization.
type: string
type: object
PatchRetentionRule:
properties:
everySeconds:
default: 2592000
description: |
The number of seconds to keep data.
Default duration is `2592000` (30 days).
`0` represents infinite retention.
example: 86400
format: int64
minimum: 0
type: integer
shardGroupDurationSeconds:
description: |
The [shard group duration](/influxdb/latest/reference/glossary/#shard).
The number of seconds that each shard group covers.
#### InfluxDB Cloud
- Doesn't use `shardGroupDurationsSeconds`.
#### InfluxDB OSS
- Default value depends on the [bucket retention period](/influxdb/latest/reference/internals/shards/#shard-group-duration).
#### Related guides
- InfluxDB [shards and shard groups](/influxdb/latest/reference/internals/shards/)
format: int64
type: integer
type:
default: expire
enum:
- expire
type: string
required:
- everySeconds
type: object
PatchRetentionRules:
description: Updates to rules to expire or retain data. No rules means no updates.
items:
$ref: '#/components/schemas/PatchRetentionRule'
type: array
Permission:
properties:
action:
enum:
- read
- write
type: string
resource:
$ref: '#/components/schemas/Resource'
properties:
id:
description: |
A resource ID.
Identifies a specific resource.
type: string
name:
description: |
The name of the resource.
_Note: not all resource types have a `name` property_.
type: string
org:
description: |
An organization name.
The organization that owns the resource.
type: string
orgID:
description: |
An organization ID.
Identifies the organization that owns the resource.
type: string
type:
description: |
A resource type.
Identifies the API resource's type (or _kind_).
enum:
- authorizations
- buckets
- dashboards
- orgs
- tasks
- telegrafs
- users
- variables
- secrets
- labels
- views
- documents
- notificationRules
- notificationEndpoints
- checks
- dbrp
- annotations
- sources
- scrapers
- notebooks
- remotes
- replications
- instance
- flows
- functions
- subscriptions
type: string
required:
- type
type: object
required:
- action
- resource
PipeExpression:
description: Call expression with pipe argument
properties:
argument:
$ref: '#/components/schemas/Expression'
call:
$ref: '#/components/schemas/CallExpression'
type:
$ref: '#/components/schemas/NodeType'
type: object
PipeLiteral:
description: Represents a specialized literal value, indicating the left hand value of a pipe expression
properties:
type:
$ref: '#/components/schemas/NodeType'
type: object
PostBucketRequest:
properties:
description:
description: |
A description of the bucket.
type: string
name:
description: |
The bucket name.
type: string
orgID:
description: |
The organization ID.
Specifies the organization that owns the bucket.
type: string
retentionRules:
$ref: '#/components/schemas/RetentionRules'
rp:
default: '0'
description: |
The retention policy for the bucket.
For InfluxDB 1.x, specifies the duration of time that each data point
in the retention policy persists.
If you need compatibility with InfluxDB 1.x, specify a value for the `rp` property;
otherwise, see the `retentionRules` property.
[Retention policy](/influxdb/v1.8/concepts/glossary/#retention-policy-rp)
is an InfluxDB 1.x concept.
The InfluxDB 2.x and Cloud equivalent is
[retention period](/influxdb/latest/reference/glossary/#retention-period).
The InfluxDB `/api/v2` API uses `RetentionRules` to configure the retention period.
type: string
schemaType:
$ref: '#/components/schemas/SchemaType'
default: implicit
description: |
The schema Type. Default is `implicit`.
#### InfluxDB Cloud
- Use `explicit` to enforce column names, tags, fields, and data types for
your data.
#### InfluxDB OSS
- Doesn't support `explicit` bucket schemas.
required:
- orgID
- name
PostCheck:
allOf:
- $ref: '#/components/schemas/CheckDiscriminator'
PostNotificationEndpoint:
allOf:
- $ref: '#/components/schemas/NotificationEndpointDiscriminator'
PostNotificationRule:
allOf:
- $ref: '#/components/schemas/NotificationRuleDiscriminator'
PostOrganizationRequest:
properties:
description:
description: |
The description of the organization.
type: string
name:
description: |
The name of the organization.
type: string
required:
- name
type: object
Property:
description: The value associated with a key
properties:
key:
$ref: '#/components/schemas/PropertyKey'
type:
$ref: '#/components/schemas/NodeType'
value:
$ref: '#/components/schemas/Expression'
type: object
PropertyKey:
oneOf:
- $ref: '#/components/schemas/Identifier'
- $ref: '#/components/schemas/StringLiteral'
Query:
description: Query InfluxDB with the Flux language
properties:
dialect:
$ref: '#/components/schemas/Dialect'
extern:
$ref: '#/components/schemas/File'
now:
description: |
Specifies the time that should be reported as `now` in the query.
Default is the server `now` time.
format: date-time
type: string
params:
additionalProperties: true
description: |
Key-value pairs passed as parameters during query execution.
To use parameters in your query, pass a _`query`_ with `params` references (in dot notation)--for example:
```json
query: "from(bucket: params.mybucket)\
|> range(start: params.rangeStart) |> limit(n:1)"
```
and pass _`params`_ with the key-value pairs--for example:
```json
params: {
"mybucket": "environment",
"rangeStart": "-30d"
}
```
During query execution, InfluxDB passes _`params`_ to your script and substitutes the values.
#### Limitations
- If you use _`params`_, you can't use _`extern`_.
type: object
query:
description: The query script to execute.
type: string
type:
description: The type of query. Must be "flux".
enum:
- flux
type: string
required:
- query
type: object
QueryEditMode:
enum:
- builder
- advanced
type: string
QueryVariableProperties:
properties:
type:
enum:
- query
type: string
values:
properties:
language:
type: string
query:
type: string
type: object
RangeThreshold:
allOf:
- $ref: '#/components/schemas/ThresholdBase'
- properties:
max:
format: float
type: number
min:
format: float
type: number
type:
enum:
- range
type: string
within:
type: boolean
required:
- type
- min
- max
- within
type: object
Ready:
properties:
started:
example: '2019-03-13T10:09:33.891196-04:00'
format: date-time
type: string
status:
enum:
- ready
type: string
up:
example: 14m45.911966424s
type: string
type: object
RegexpLiteral:
description: Expressions begin and end with `/` and are regular expressions with syntax accepted by RE2
properties:
type:
$ref: '#/components/schemas/NodeType'
value:
type: string
type: object
RemoteConnection:
properties:
allowInsecureTLS:
default: false
type: boolean
description:
type: string
id:
type: string
name:
type: string
orgID:
type: string
remoteOrgID:
type: string
remoteURL:
format: uri
type: string
required:
- id
- name
- orgID
- remoteURL
- allowInsecureTLS
type: object
RemoteConnectionCreationRequest:
properties:
allowInsecureTLS:
default: false
type: boolean
description:
type: string
name:
type: string
orgID:
type: string
remoteAPIToken:
type: string
remoteOrgID:
type: string
remoteURL:
format: uri
type: string
required:
- name
- orgID
- remoteURL
- remoteAPIToken
- allowInsecureTLS
type: object
RemoteConnectionUpdateRequest:
properties:
allowInsecureTLS:
default: false
type: boolean
description:
type: string
name:
type: string
remoteAPIToken:
type: string
remoteOrgID:
type: string
remoteURL:
format: uri
type: string
type: object
RemoteConnections:
properties:
remotes:
items:
$ref: '#/components/schemas/RemoteConnection'
type: array
type: object
RenamableField:
description: Describes a field that can be renamed and made visible or invisible.
properties:
displayName:
description: The name that a field is renamed to by the user.
type: string
internalName:
description: The calculated name of a field.
readOnly: true
type: string
visible:
description: Indicates whether this field should be visible on the table.
type: boolean
type: object
Replication:
properties:
currentQueueSizeBytes:
format: int64
type: integer
description:
type: string
dropNonRetryableData:
type: boolean
id:
type: string
latestErrorMessage:
type: string
latestResponseCode:
type: integer
localBucketID:
type: string
maxQueueSizeBytes:
format: int64
type: integer
name:
type: string
orgID:
type: string
remoteBucketID:
type: string
remoteBucketName:
type: string
remoteID:
type: string
required:
- id
- name
- remoteID
- orgID
- localBucketID
- maxQueueSizeBytes
- currentQueueSizeBytes
type: object
ReplicationCreationRequest:
properties:
description:
type: string
dropNonRetryableData:
default: false
type: boolean
localBucketID:
type: string
maxAgeSeconds:
default: 604800
format: int64
minimum: 0
type: integer
maxQueueSizeBytes:
default: 67108860
format: int64
minimum: 33554430
type: integer
name:
type: string
orgID:
type: string
remoteBucketID:
type: string
remoteBucketName:
type: string
remoteID:
type: string
required:
- name
- orgID
- remoteID
- localBucketID
- maxQueueSizeBytes
- maxAgeSeconds
type: object
ReplicationUpdateRequest:
properties:
description:
type: string
dropNonRetryableData:
type: boolean
maxAgeSeconds:
format: int64
minimum: 0
type: integer
maxQueueSizeBytes:
format: int64
minimum: 33554430
type: integer
name:
type: string
remoteBucketID:
type: string
remoteBucketName:
type: string
remoteID:
type: string
type: object
Replications:
properties:
replications:
items:
$ref: '#/components/schemas/Replication'
type: array
type: object
Resource:
properties:
id:
description: |
A resource ID.
Identifies a specific resource.
type: string
name:
description: |
The name of the resource.
_Note: not all resource types have a `name` property_.
type: string
org:
description: |
An organization name.
The organization that owns the resource.
type: string
orgID:
description: |
An organization ID.
Identifies the organization that owns the resource.
type: string
type:
description: |
A resource type.
Identifies the API resource's type (or _kind_).
enum:
- authorizations
- buckets
- dashboards
- orgs
- tasks
- telegrafs
- users
- variables
- secrets
- labels
- views
- documents
- notificationRules
- notificationEndpoints
- checks
- dbrp
- annotations
- sources
- scrapers
- notebooks
- remotes
- replications
- instance
- flows
- functions
- subscriptions
type: string
required:
- type
type: object
ResourceMember:
allOf:
- $ref: '#/components/schemas/UserResponse'
- properties:
role:
default: member
enum:
- member
type: string
type: object
ResourceMembers:
properties:
links:
properties:
self:
format: uri
type: string
type: object
users:
items:
$ref: '#/components/schemas/ResourceMember'
type: array
type: object
ResourceOwner:
allOf:
- $ref: '#/components/schemas/UserResponse'
- properties:
role:
default: owner
enum:
- owner
type: string
type: object
ResourceOwners:
properties:
links:
properties:
self:
format: uri
type: string
type: object
users:
items:
$ref: '#/components/schemas/ResourceOwner'
type: array
type: object
RestoredBucketMappings:
properties:
id:
description: New ID of the restored bucket
type: string
name:
type: string
shardMappings:
$ref: '#/components/schemas/BucketShardMappings'
required:
- id
- name
- shardMappings
type: object
RetentionPolicyManifest:
properties:
duration:
format: int64
type: integer
name:
type: string
replicaN:
type: integer
shardGroupDuration:
format: int64
type: integer
shardGroups:
$ref: '#/components/schemas/ShardGroupManifests'
subscriptions:
$ref: '#/components/schemas/SubscriptionManifests'
required:
- name
- replicaN
- duration
- shardGroupDuration
- shardGroups
- subscriptions
type: object
RetentionPolicyManifests:
items:
$ref: '#/components/schemas/RetentionPolicyManifest'
type: array
RetentionRule:
properties:
everySeconds:
default: 2592000
description: |
The duration in seconds for how long data will be kept in the database.
The default duration is 2592000 (30 days).
0 represents infinite retention.
example: 86400
format: int64
minimum: 0
type: integer
shardGroupDurationSeconds:
description: |
The shard group duration.
The duration or interval (in seconds) that each shard group covers.
#### InfluxDB Cloud
- Does not use `shardGroupDurationsSeconds`.
#### InfluxDB OSS
- Default value depends on the
[bucket retention period](/influxdb/latest/reference/internals/shards/#shard-group-duration).
format: int64
type: integer
type:
default: expire
enum:
- expire
type: string
required:
- everySeconds
type: object
RetentionRules:
description: |
Retention rules to expire or retain data.
The InfluxDB `/api/v2` API uses `RetentionRules` to configure the [retention period](/influxdb/latest/reference/glossary/#retention-period).
#### InfluxDB Cloud
- `retentionRules` is required.
#### InfluxDB OSS
- `retentionRules` isn't required.
items:
$ref: '#/components/schemas/RetentionRule'
type: array
ReturnStatement:
description: Defines an expression to return
properties:
argument:
$ref: '#/components/schemas/Expression'
type:
$ref: '#/components/schemas/NodeType'
type: object
Routes:
properties:
authorizations:
format: uri
type: string
buckets:
format: uri
type: string
dashboards:
format: uri
type: string
external:
properties:
statusFeed:
format: uri
type: string
type: object
flags:
format: uri
type: string
me:
format: uri
type: string
orgs:
format: uri
type: string
query:
properties:
analyze:
format: uri
type: string
ast:
format: uri
type: string
self:
format: uri
type: string
suggestions:
format: uri
type: string
type: object
setup:
format: uri
type: string
signin:
format: uri
type: string
signout:
format: uri
type: string
sources:
format: uri
type: string
system:
properties:
debug:
format: uri
type: string
health:
format: uri
type: string
metrics:
format: uri
type: string
type: object
tasks:
format: uri
type: string
telegrafs:
format: uri
type: string
users:
format: uri
type: string
variables:
format: uri
type: string
write:
format: uri
type: string
RuleStatusLevel:
description: The state to record if check matches a criteria.
enum:
- UNKNOWN
- OK
- INFO
- CRIT
- WARN
- ANY
type: string
Run:
properties:
finishedAt:
description: The time ([RFC3339Nano date/time format](https://go.dev/src/time/format.go)) the run finished executing.
example: 2006-01-02T15:04:05.999999999Z07:00
format: date-time
readOnly: true
type: string
flux:
description: Flux used for the task
readOnly: true
type: string
id:
readOnly: true
type: string
links:
example:
retry: /api/v2/tasks/1/runs/1/retry
self: /api/v2/tasks/1/runs/1
task: /api/v2/tasks/1
properties:
retry:
format: uri
type: string
self:
format: uri
type: string
task:
format: uri
type: string
readOnly: true
type: object
log:
description: An array of logs associated with the run.
items:
$ref: '#/components/schemas/LogEvent'
readOnly: true
type: array
requestedAt:
description: The time ([RFC3339Nano date/time format](/influxdb/latest/reference/glossary/#rfc3339nano-timestamp)) the run was manually requested.
example: 2006-01-02T15:04:05.999999999Z07:00
format: date-time
readOnly: true
type: string
scheduledFor:
description: The time [RFC3339 date/time format](/influxdb/latest/reference/glossary/#rfc3339-timestamp) used for the run's `now` option.
format: date-time
type: string
startedAt:
description: The time ([RFC3339Nano date/time format](https://go.dev/src/time/format.go)) the run started executing.
example: 2006-01-02T15:04:05.999999999Z07:00
format: date-time
readOnly: true
type: string
status:
enum:
- scheduled
- started
- failed
- success
- canceled
readOnly: true
type: string
taskID:
readOnly: true
type: string
RunManually:
properties:
scheduledFor:
description: |
The time [RFC3339 date/time format](/influxdb/latest/reference/glossary/#rfc3339-timestamp)
used for the run's `now` option.
Default is the server _now_ time.
format: date-time
nullable: true
type: string
Runs:
properties:
links:
$ref: '#/components/schemas/Links'
runs:
items:
$ref: '#/components/schemas/Run'
type: array
type: object
SMTPNotificationRule:
allOf:
- $ref: '#/components/schemas/NotificationRuleBase'
- $ref: '#/components/schemas/SMTPNotificationRuleBase'
SMTPNotificationRuleBase:
properties:
bodyTemplate:
type: string
subjectTemplate:
type: string
to:
type: string
type:
enum:
- smtp
type: string
required:
- type
- subjectTemplate
- to
type: object
ScatterViewProperties:
properties:
adaptiveZoomHide:
type: boolean
colors:
description: Colors define color encoding of data into a visualization
items:
type: string
type: array
fillColumns:
items:
type: string
type: array
generateXAxisTicks:
items:
type: string
type: array
generateYAxisTicks:
items:
type: string
type: array
legendColorizeRows:
type: boolean
legendHide:
type: boolean
legendOpacity:
format: float
type: number
legendOrientationThreshold:
type: integer
note:
type: string
queries:
items:
$ref: '#/components/schemas/DashboardQuery'
type: array
shape:
enum:
- chronograf-v2
type: string
showNoteWhenEmpty:
description: If true, will display note when empty
type: boolean
symbolColumns:
items:
type: string
type: array
timeFormat:
type: string
type:
enum:
- scatter
type: string
xAxisLabel:
type: string
xColumn:
type: string
xDomain:
items:
type: number
maxItems: 2
type: array
xPrefix:
type: string
xSuffix:
type: string
xTickStart:
format: float
type: number
xTickStep:
format: float
type: number
xTotalTicks:
type: integer
yAxisLabel:
type: string
yColumn:
type: string
yDomain:
items:
type: number
maxItems: 2
type: array
yPrefix:
type: string
ySuffix:
type: string
yTickStart:
format: float
type: number
yTickStep:
format: float
type: number
yTotalTicks:
type: integer
required:
- type
- queries
- colors
- shape
- note
- showNoteWhenEmpty
- xColumn
- yColumn
- fillColumns
- symbolColumns
- xDomain
- yDomain
- xAxisLabel
- yAxisLabel
- xPrefix
- yPrefix
- xSuffix
- ySuffix
type: object
SchemaType:
enum:
- implicit
- explicit
type: string
ScraperTargetRequest:
properties:
allowInsecure:
default: false
description: Skip TLS verification on endpoint.
type: boolean
bucketID:
description: The ID of the bucket to write to.
type: string
name:
description: The name of the scraper target.
type: string
orgID:
description: The organization ID.
type: string
type:
description: The type of the metrics to be parsed.
enum:
- prometheus
type: string
url:
description: The URL of the metrics endpoint.
example: http://localhost:9090/metrics
type: string
type: object
ScraperTargetResponse:
allOf:
- $ref: '#/components/schemas/ScraperTargetRequest'
- properties:
bucket:
description: The bucket name.
type: string
id:
readOnly: true
type: string
links:
example:
bucket: /api/v2/buckets/1
members: /api/v2/scrapers/1/members
organization: /api/v2/orgs/1
owners: /api/v2/scrapers/1/owners
self: /api/v2/scrapers/1
properties:
bucket:
$ref: '#/components/schemas/Link'
members:
$ref: '#/components/schemas/Link'
organization:
$ref: '#/components/schemas/Link'
owners:
$ref: '#/components/schemas/Link'
self:
$ref: '#/components/schemas/Link'
readOnly: true
type: object
org:
description: The name of the organization.
type: string
type: object
type: object
ScraperTargetResponses:
properties:
configurations:
items:
$ref: '#/components/schemas/ScraperTargetResponse'
type: array
type: object
SecretKeys:
properties:
secrets:
items:
type: string
type: array
type: object
SecretKeysResponse:
allOf:
- $ref: '#/components/schemas/SecretKeys'
- properties:
links:
properties:
org:
type: string
self:
type: string
readOnly: true
type: object
type: object
Secrets:
additionalProperties:
type: string
example:
apikey: abc123xyz
ShardGroupManifest:
properties:
deletedAt:
format: date-time
type: string
endTime:
format: date-time
type: string
id:
format: int64
type: integer
shards:
$ref: '#/components/schemas/ShardManifests'
startTime:
format: date-time
type: string
truncatedAt:
format: date-time
type: string
required:
- id
- startTime
- endTime
- shards
type: object
ShardGroupManifests:
items:
$ref: '#/components/schemas/ShardGroupManifest'
type: array
ShardManifest:
properties:
id:
format: int64
type: integer
shardOwners:
$ref: '#/components/schemas/ShardOwners'
required:
- id
- shardOwners
type: object
ShardManifests:
items:
$ref: '#/components/schemas/ShardManifest'
type: array
ShardOwner:
properties:
nodeID:
description: The ID of the node that owns the shard.
format: int64
type: integer
required:
- nodeID
type: object
ShardOwners:
items:
$ref: '#/components/schemas/ShardOwner'
type: array
SimpleTableViewProperties:
properties:
note:
type: string
queries:
items:
$ref: '#/components/schemas/DashboardQuery'
type: array
shape:
enum:
- chronograf-v2
type: string
showAll:
type: boolean
showNoteWhenEmpty:
description: If true, will display note when empty
type: boolean
type:
enum:
- simple-table
type: string
required:
- type
- showAll
- queries
- shape
- note
- showNoteWhenEmpty
type: object
SingleStatViewProperties:
properties:
colors:
description: Colors define color encoding of data into a visualization
items:
$ref: '#/components/schemas/DashboardColor'
type: array
decimalPlaces:
$ref: '#/components/schemas/DecimalPlaces'
note:
type: string
prefix:
type: string
queries:
items:
$ref: '#/components/schemas/DashboardQuery'
type: array
shape:
enum:
- chronograf-v2
type: string
showNoteWhenEmpty:
description: If true, will display note when empty
type: boolean
staticLegend:
$ref: '#/components/schemas/StaticLegend'
suffix:
type: string
tickPrefix:
type: string
tickSuffix:
type: string
type:
enum:
- single-stat
type: string
required:
- type
- queries
- colors
- shape
- note
- showNoteWhenEmpty
- prefix
- tickPrefix
- suffix
- tickSuffix
- decimalPlaces
type: object
SlackNotificationEndpoint:
allOf:
- $ref: '#/components/schemas/NotificationEndpointBase'
- properties:
token:
description: Specifies the API token string. Specify either `URL` or `Token`.
type: string
url:
description: Specifies the URL of the Slack endpoint. Specify either `URL` or `Token`.
type: string
type: object
type: object
SlackNotificationRule:
allOf:
- $ref: '#/components/schemas/NotificationRuleBase'
- $ref: '#/components/schemas/SlackNotificationRuleBase'
SlackNotificationRuleBase:
properties:
channel:
type: string
messageTemplate:
type: string
type:
enum:
- slack
type: string
required:
- type
- messageTemplate
type: object
Source:
properties:
default:
type: boolean
defaultRP:
type: string
id:
type: string
insecureSkipVerify:
type: boolean
languages:
items:
enum:
- flux
- influxql
type: string
readOnly: true
type: array
links:
properties:
buckets:
type: string
health:
type: string
query:
type: string
self:
type: string
type: object
metaUrl:
format: uri
type: string
name:
type: string
orgID:
type: string
password:
type: string
sharedSecret:
type: string
telegraf:
type: string
token:
type: string
type:
enum:
- v1
- v2
- self
type: string
url:
format: uri
type: string
username:
type: string
type: object
Sources:
properties:
links:
properties:
self:
format: uri
type: string
type: object
sources:
items:
$ref: '#/components/schemas/Source'
type: array
type: object
Stack:
properties:
createdAt:
format: date-time
readOnly: true
type: string
events:
items:
properties:
description:
type: string
eventType:
type: string
name:
type: string
resources:
items:
properties:
apiVersion:
type: string
associations:
items:
properties:
kind:
$ref: '#/components/schemas/TemplateKind'
metaName:
type: string
type: object
type: array
kind:
$ref: '#/components/schemas/TemplateKind'
links:
properties:
self:
type: string
type: object
resourceID:
type: string
templateMetaName:
type: string
type: object
type: array
sources:
items:
type: string
type: array
updatedAt:
format: date-time
readOnly: true
type: string
urls:
items:
type: string
type: array
type: object
type: array
id:
type: string
orgID:
type: string
type: object
Statement:
oneOf:
- $ref: '#/components/schemas/BadStatement'
- $ref: '#/components/schemas/VariableAssignment'
- $ref: '#/components/schemas/MemberAssignment'
- $ref: '#/components/schemas/ExpressionStatement'
- $ref: '#/components/schemas/ReturnStatement'
- $ref: '#/components/schemas/OptionStatement'
- $ref: '#/components/schemas/BuiltinStatement'
- $ref: '#/components/schemas/TestStatement'
StaticLegend:
description: StaticLegend represents the options specific to the static legend
properties:
colorizeRows:
type: boolean
heightRatio:
format: float
type: number
opacity:
format: float
type: number
orientationThreshold:
type: integer
show:
type: boolean
valueAxis:
type: string
widthRatio:
format: float
type: number
type: object
StatusRule:
properties:
count:
type: integer
currentLevel:
$ref: '#/components/schemas/RuleStatusLevel'
period:
type: string
previousLevel:
$ref: '#/components/schemas/RuleStatusLevel'
type: object
StringLiteral:
description: Expressions begin and end with double quote marks
properties:
type:
$ref: '#/components/schemas/NodeType'
value:
type: string
type: object
SubscriptionManifest:
properties:
destinations:
items:
type: string
type: array
mode:
type: string
name:
type: string
required:
- name
- mode
- destinations
type: object
SubscriptionManifests:
items:
$ref: '#/components/schemas/SubscriptionManifest'
type: array
TableViewProperties:
properties:
colors:
description: Colors define color encoding of data into a visualization
items:
$ref: '#/components/schemas/DashboardColor'
type: array
decimalPlaces:
$ref: '#/components/schemas/DecimalPlaces'
fieldOptions:
description: fieldOptions represent the fields retrieved by the query with customization options
items:
$ref: '#/components/schemas/RenamableField'
type: array
note:
type: string
queries:
items:
$ref: '#/components/schemas/DashboardQuery'
type: array
shape:
enum:
- chronograf-v2
type: string
showNoteWhenEmpty:
description: If true, will display note when empty
type: boolean
tableOptions:
properties:
fixFirstColumn:
description: fixFirstColumn indicates whether the first column of the table should be locked
type: boolean
sortBy:
$ref: '#/components/schemas/RenamableField'
verticalTimeAxis:
description: verticalTimeAxis describes the orientation of the table by indicating whether the time axis will be displayed vertically
type: boolean
wrapping:
description: Wrapping describes the text wrapping style to be used in table views
enum:
- truncate
- wrap
- single-line
type: string
type: object
timeFormat:
description: timeFormat describes the display format for time values according to moment.js date formatting
type: string
type:
enum:
- table
type: string
required:
- type
- queries
- colors
- shape
- note
- showNoteWhenEmpty
- tableOptions
- fieldOptions
- timeFormat
- decimalPlaces
type: object
TagRule:
properties:
key:
type: string
operator:
enum:
- equal
- notequal
- equalregex
- notequalregex
type: string
value:
type: string
type: object
Task:
properties:
authorizationID:
description: |
An authorization ID.
Identifies the authorization used when the task communicates with the query engine.
To find an authorization ID, use the
[`GET /api/v2/authorizations` endpoint](#operation/GetAuthorizations) to
list authorizations.
type: string
createdAt:
format: date-time
readOnly: true
type: string
cron:
$ref: '#/components/schemas/TaskCron'
description:
$ref: '#/components/schemas/TaskDescription'
every:
$ref: '#/components/schemas/TaskEvery'
flux:
$ref: '#/components/schemas/TaskFlux'
id:
description: |
The resource ID that InfluxDB uses to uniquely identify the task.
readOnly: true
type: string
labels:
$ref: '#/components/schemas/Labels'
lastRunError:
readOnly: true
type: string
lastRunStatus:
enum:
- failed
- success
- canceled
readOnly: true
type: string
latestCompleted:
description: A timestamp ([RFC3339 date/time format](/influxdb/latest/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run.
format: date-time
readOnly: true
type: string
links:
example:
labels: /api/v2/tasks/1/labels
logs: /api/v2/tasks/1/logs
members: /api/v2/tasks/1/members
owners: /api/v2/tasks/1/owners
runs: /api/v2/tasks/1/runs
self: /api/v2/tasks/1
properties:
labels:
$ref: '#/components/schemas/Link'
logs:
$ref: '#/components/schemas/Link'
members:
$ref: '#/components/schemas/Link'
owners:
$ref: '#/components/schemas/Link'
runs:
$ref: '#/components/schemas/Link'
self:
$ref: '#/components/schemas/Link'
readOnly: true
type: object
name:
$ref: '#/components/schemas/TaskName'
offset:
$ref: '#/components/schemas/TaskOffset'
org:
$ref: '#/components/schemas/TaskOrg'
orgID:
$ref: '#/components/schemas/TaskOrgID'
ownerID:
description: |
A user ID.
Identifies the [user](/influxdb/latest/reference/glossary/#user) that owns the task.
To find a user ID, use the
[`GET /api/v2/users` endpoint](#operation/GetUsers) to
list users.
type: string
status:
$ref: '#/components/schemas/TaskStatusType'
updatedAt:
format: date-time
readOnly: true
type: string
required:
- id
- name
- orgID
- flux
type: object
TaskCreateRequest:
properties:
description:
$ref: '#/components/schemas/TaskDescription'
flux:
$ref: '#/components/schemas/TaskFlux'
name:
$ref: '#/components/schemas/TaskName'
org:
$ref: '#/components/schemas/TaskOrg'
orgID:
$ref: '#/components/schemas/TaskOrgID'
status:
$ref: '#/components/schemas/TaskStatusType'
required:
- flux
type: object
TaskCron:
description: A [Cron expression](https://en.wikipedia.org/wiki/Cron#Overview) that defines the schedule on which the task runs. InfluxDB uses the system time when evaluating Cron expressions.
format: cron
type: string
TaskDescription:
description: A description of the task.
type: string
TaskEvery:
description: The interval ([duration literal](/influxdb/latest/reference/glossary/#rfc3339-timestamp)) at which the task runs. `every` also determines when the task first runs, depending on the specified time.
format: duration
type: string
TaskFlux:
description: |
Flux with [task configuration options](/influxdb/latest/process-data/task-options/)
and the script for the task to run.
#### Related guides
- [Task configuration options](/influxdb/latest/process-data/task-options/)
format: Flux
type: string
TaskName:
description: The name of the task.
type: string
TaskOffset:
description: A [duration](https://docs.influxdata.com/flux/v0.x/spec/lexical-elements/#duration-literals) to delay execution of the task after the scheduled time has elapsed. `0` removes the offset.
format: duration
type: string
TaskOrg:
description: |
An organization name.
Identifies the [organization](/influxdb/latest/reference/glossary/#organization) that owns the task.
type: string
TaskOrgID:
description: |
An organization ID.
Identifies the [organization](/influxdb/latest/reference/glossary/#organization) that owns the task.
type: string
TaskStatusType:
description: |
`inactive` cancels scheduled runs and prevents manual runs of the task.
enum:
- active
- inactive
type: string
TaskUpdateRequest:
properties:
cron:
$ref: '#/components/schemas/TaskCron'
description:
$ref: '#/components/schemas/TaskDescription'
every:
$ref: '#/components/schemas/TaskEvery'
flux:
$ref: '#/components/schemas/TaskFlux'
name:
$ref: '#/components/schemas/TaskName'
offset:
$ref: '#/components/schemas/TaskOffset'
status:
$ref: '#/components/schemas/TaskStatusType'
type: object
Tasks:
properties:
links:
$ref: '#/components/schemas/Links'
readOnly: true
tasks:
items:
$ref: '#/components/schemas/Task'
type: array
type: object
Telegraf:
allOf:
- $ref: '#/components/schemas/TelegrafRequest'
- properties:
id:
readOnly: true
type: string
labels:
$ref: '#/components/schemas/Labels'
readOnly: true
links:
example:
lables: /api/v2/telegrafs/1/labels
members: /api/v2/telegrafs/1/members
owners: /api/v2/telegrafs/1/owners
self: /api/v2/telegrafs/1
properties:
labels:
$ref: '#/components/schemas/Link'
members:
$ref: '#/components/schemas/Link'
owners:
$ref: '#/components/schemas/Link'
self:
$ref: '#/components/schemas/Link'
readOnly: true
type: object
type: object
type: object
TelegrafPlugin:
properties:
config:
type: string
description:
type: string
name:
type: string
type:
type: string
type: object
TelegrafPluginRequest:
properties:
config:
type: string
description:
type: string
metadata:
properties:
buckets:
items:
type: string
type: array
type: object
name:
type: string
orgID:
type: string
plugins:
items:
properties:
alias:
type: string
config:
type: string
description:
type: string
name:
type: string
type:
type: string
type: object
type: array
type: object
TelegrafPlugins:
properties:
os:
type: string
plugins:
items:
$ref: '#/components/schemas/TelegrafPlugin'
type: array
version:
type: string
type: object
TelegrafRequest:
properties:
config:
type: string
description:
type: string
metadata:
properties:
buckets:
items:
type: string
type: array
type: object
name:
type: string
orgID:
type: string
type: object
Telegrafs:
properties:
configurations:
items:
$ref: '#/components/schemas/Telegraf'
type: array
type: object
TelegramNotificationEndpoint:
allOf:
- $ref: '#/components/schemas/NotificationEndpointBase'
- properties:
channel:
description: The ID of the telegram channel; a chat_id in https://core.telegram.org/bots/api#sendmessage .
type: string
token:
description: Specifies the Telegram bot token. See https://core.telegram.org/bots#creating-a-new-bot .
type: string
required:
- token
- channel
type: object
type: object
TelegramNotificationRule:
allOf:
- $ref: '#/components/schemas/NotificationRuleBase'
- $ref: '#/components/schemas/TelegramNotificationRuleBase'
TelegramNotificationRuleBase:
properties:
disableWebPagePreview:
description: Disables preview of web links in the sent messages when "true". Defaults to "false".
type: boolean
messageTemplate:
description: The message template as a flux interpolated string.
type: string
parseMode:
description: Parse mode of the message text per https://core.telegram.org/bots/api#formatting-options. Defaults to "MarkdownV2".
enum:
- MarkdownV2
- HTML
- Markdown
type: string
type:
description: The discriminator between other types of notification rules is "telegram".
enum:
- telegram
type: string
required:
- type
- messageTemplate
- channel
type: object
Template:
items:
description: |
A template entry.
Defines an InfluxDB resource in a template.
properties:
apiVersion:
example: influxdata.com/v2alpha1
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
metadata:
description: |
Metadata properties used for the resource when the template is applied.
properties:
name:
type: string
type: object
spec:
description: |
Configuration properties used for the resource when the template is applied.
Key-value pairs map to the specification for the resource.
The following code samples show `spec` configurations for template resources:
- A bucket:
```json
{ "spec": {
"name": "iot_center",
"retentionRules": [{
"everySeconds": 2.592e+06,
"type": "expire"
}]
}
}
```
- A variable:
```json
{ "spec": {
"language": "flux",
"name": "Node_Service",
"query": "import \"influxdata/influxdb/v1\"\r\nv1.tagValues(bucket: \"iot_center\",
tag: \"service\")",
"type": "query"
}
}
```
type: object
type: object
type: array
TemplateApply:
properties:
actions:
description: |
A list of `action` objects.
Actions let you customize how InfluxDB applies templates in the request.
You can use the following actions to prevent creating or updating resources:
- A `skipKind` action skips template resources of a specified `kind`.
- A `skipResource` action skips template resources with a specified `metadata.name`
and `kind`.
items:
oneOf:
- properties:
action:
enum:
- skipKind
type: string
properties:
properties:
kind:
$ref: '#/components/schemas/TemplateKind'
required:
- kind
type: object
type: object
- properties:
action:
enum:
- skipResource
type: string
properties:
properties:
kind:
$ref: '#/components/schemas/TemplateKind'
resourceTemplateName:
type: string
required:
- kind
- resourceTemplateName
type: object
type: object
type: array
dryRun:
description: |
Only applies a dry run of the templates passed in the request.
- Validates the template and generates a resource diff and summary.
- Doesn't install templates or make changes to the InfluxDB instance.
type: boolean
envRefs:
additionalProperties:
oneOf:
- type: string
- type: integer
- type: number
- type: boolean
description: |
An object with key-value pairs that map to **environment references** in templates.
Environment references in templates are `envRef` objects with an `envRef.key`
property.
To substitute a custom environment reference value when applying templates,
pass `envRefs` with the `envRef.key` and the value.
When you apply a template, InfluxDB replaces `envRef` objects in the template
with the values that you provide in the `envRefs` parameter.
For more examples, see how to [define environment references](/influxdb/latest/influxdb-templates/use/#define-environment-references).
The following template fields may use environment references:
- `metadata.name`
- `spec.endpointName`
- `spec.associations.name`
For more information about including environment references in template fields, see how to
[include user-definable resource names](/influxdb/latest/influxdb-templates/create/#include-user-definable-resource-names).
type: object
orgID:
description: |
Organization ID.
InfluxDB applies templates to this organization.
The organization owns all resources created by the template.
To find your organization, see how to
[view organizations](/influxdb/latest/organizations/view-orgs/).
type: string
remotes:
description: |
A list of URLs for template files.
To apply a template manifest file located at a URL, pass `remotes`
with an array that contains the URL.
items:
properties:
contentType:
type: string
url:
type: string
required:
- url
type: object
type: array
secrets:
additionalProperties:
type: string
description: |
An object with key-value pairs that map to **secrets** in queries.
Queries may reference secrets stored in InfluxDB--for example,
the following Flux script retrieves `POSTGRES_USERNAME` and `POSTGRES_PASSWORD`
secrets and then uses them to connect to a PostgreSQL database:
```js
import "sql"
import "influxdata/influxdb/secrets"
username = secrets.get(key: "POSTGRES_USERNAME")
password = secrets.get(key: "POSTGRES_PASSWORD")
sql.from(
driverName: "postgres",
dataSourceName: "postgresql://${username}:${password}@localhost:5432",
query: "SELECT * FROM example_table",
)
```
To define secret values in your `/api/v2/templates/apply` request,
pass the `secrets` parameter with key-value pairs--for example:
```json
{
...
"secrets": {
"POSTGRES_USERNAME": "pguser",
"POSTGRES_PASSWORD": "foo"
}
...
}
```
InfluxDB stores the key-value pairs as secrets that you can access with `secrets.get()`.
Once stored, you can't view secret values in InfluxDB.
#### Related guides
- [How to pass secrets when installing a template](/influxdb/latest/influxdb-templates/use/#pass-secrets-when-installing-a-template)
type: object
stackID:
description: |
ID of the stack to update.
To apply templates to an existing stack in the organization, use the `stackID` parameter.
If you apply templates without providing a stack ID,
InfluxDB initializes a new stack with all new resources.
To find a stack ID, use the InfluxDB [`/api/v2/stacks` API endpoint](#operation/ListStacks) to list stacks.
#### Related guides
- [Stacks](/influxdb/latest/influxdb-templates/stacks/)
- [View stacks](/influxdb/latest/influxdb-templates/stacks/view/)
type: string
template:
description: |
A template object to apply.
A template object has a `contents` property
with an array of InfluxDB resource configurations.
Pass `template` to apply only one template object.
If you use `template`, you can't use the `templates` parameter.
If you want to apply multiple template objects, use `templates` instead.
properties:
contentType:
type: string
contents:
$ref: '#/components/schemas/Template'
sources:
items:
type: string
type: array
type: object
templates:
description: |
A list of template objects to apply.
A template object has a `contents` property
with an array of InfluxDB resource configurations.
Use the `templates` parameter to apply multiple template objects.
If you use `templates`, you can't use the `template` parameter.
items:
properties:
contentType:
type: string
contents:
$ref: '#/components/schemas/Template'
sources:
items:
type: string
type: array
type: object
type: array
type: object
TemplateChart:
properties:
height:
type: integer
properties:
$ref: '#/components/schemas/ViewProperties'
width:
type: integer
xPos:
type: integer
yPos:
type: integer
type: object
TemplateEnvReferences:
items:
properties:
defaultValue:
description: Default value that will be provided for the reference when no value is provided
nullable: true
oneOf:
- type: string
- type: integer
- type: number
- type: boolean
envRefKey:
description: Key identified as environment reference and is the key identified in the template
type: string
resourceField:
description: Field the environment reference corresponds too
type: string
value:
description: Value provided to fulfill reference
nullable: true
oneOf:
- type: string
- type: integer
- type: number
- type: boolean
required:
- resourceField
- envRefKey
type: object
type: array
TemplateExportByID:
properties:
orgIDs:
items:
properties:
orgID:
type: string
resourceFilters:
properties:
byLabel:
items:
type: string
type: array
byResourceKind:
items:
$ref: '#/components/schemas/TemplateKind'
type: array
type: object
type: object
type: array
resources:
items:
properties:
id:
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
name:
description: if defined with id, name is used for resource exported by id. if defined independently, resources strictly matching name are exported
type: string
required:
- id
- kind
type: object
type: array
stackID:
type: string
type: object
TemplateExportByName:
properties:
orgIDs:
items:
properties:
orgID:
type: string
resourceFilters:
properties:
byLabel:
items:
type: string
type: array
byResourceKind:
items:
$ref: '#/components/schemas/TemplateKind'
type: array
type: object
type: object
type: array
resources:
items:
properties:
kind:
$ref: '#/components/schemas/TemplateKind'
name:
type: string
required:
- name
- kind
type: object
type: array
stackID:
type: string
type: object
TemplateKind:
enum:
- Bucket
- Check
- CheckDeadman
- CheckThreshold
- Dashboard
- Label
- NotificationEndpoint
- NotificationEndpointHTTP
- NotificationEndpointPagerDuty
- NotificationEndpointSlack
- NotificationRule
- Task
- Telegraf
- Variable
type: string
TemplateSummary:
properties:
diff:
properties:
buckets:
items:
properties:
id:
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
new:
properties:
description:
type: string
name:
type: string
retentionRules:
$ref: '#/components/schemas/RetentionRules'
type: object
old:
properties:
description:
type: string
name:
type: string
retentionRules:
$ref: '#/components/schemas/RetentionRules'
type: object
stateStatus:
type: string
templateMetaName:
type: string
type: object
type: array
checks:
items:
properties:
id:
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
new:
$ref: '#/components/schemas/CheckDiscriminator'
old:
$ref: '#/components/schemas/CheckDiscriminator'
stateStatus:
type: string
templateMetaName:
type: string
type: object
type: array
dashboards:
items:
properties:
id:
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
new:
properties:
charts:
items:
$ref: '#/components/schemas/TemplateChart'
type: array
description:
type: string
name:
type: string
type: object
old:
properties:
charts:
items:
$ref: '#/components/schemas/TemplateChart'
type: array
description:
type: string
name:
type: string
type: object
stateStatus:
type: string
templateMetaName:
type: string
type: object
type: array
labelMappings:
items:
properties:
labelID:
type: string
labelName:
type: string
labelTemplateMetaName:
type: string
resourceID:
type: string
resourceName:
type: string
resourceTemplateMetaName:
type: string
resourceType:
type: string
status:
type: string
type: object
type: array
labels:
items:
properties:
id:
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
new:
properties:
color:
type: string
description:
type: string
name:
type: string
type: object
old:
properties:
color:
type: string
description:
type: string
name:
type: string
type: object
stateStatus:
type: string
templateMetaName:
type: string
type: object
type: array
notificationEndpoints:
items:
properties:
id:
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
new:
$ref: '#/components/schemas/NotificationEndpointDiscriminator'
old:
$ref: '#/components/schemas/NotificationEndpointDiscriminator'
stateStatus:
type: string
templateMetaName:
type: string
type: object
type: array
notificationRules:
items:
properties:
id:
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
new:
properties:
description:
type: string
endpointID:
type: string
endpointName:
type: string
endpointType:
type: string
every:
type: string
messageTemplate:
type: string
name:
type: string
offset:
type: string
status:
type: string
statusRules:
items:
properties:
currentLevel:
type: string
previousLevel:
type: string
type: object
type: array
tagRules:
items:
properties:
key:
type: string
operator:
type: string
value:
type: string
type: object
type: array
type: object
old:
properties:
description:
type: string
endpointID:
type: string
endpointName:
type: string
endpointType:
type: string
every:
type: string
messageTemplate:
type: string
name:
type: string
offset:
type: string
status:
type: string
statusRules:
items:
properties:
currentLevel:
type: string
previousLevel:
type: string
type: object
type: array
tagRules:
items:
properties:
key:
type: string
operator:
type: string
value:
type: string
type: object
type: array
type: object
stateStatus:
type: string
templateMetaName:
type: string
type: object
type: array
tasks:
items:
properties:
id:
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
new:
properties:
cron:
type: string
description:
type: string
every:
type: string
name:
type: string
offset:
type: string
query:
type: string
status:
type: string
type: object
old:
properties:
cron:
type: string
description:
type: string
every:
type: string
name:
type: string
offset:
type: string
query:
type: string
status:
type: string
type: object
stateStatus:
type: string
templateMetaName:
type: string
type: object
type: array
telegrafConfigs:
items:
properties:
id:
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
new:
$ref: '#/components/schemas/TelegrafRequest'
old:
$ref: '#/components/schemas/TelegrafRequest'
stateStatus:
type: string
templateMetaName:
type: string
type: object
type: array
variables:
items:
properties:
id:
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
new:
properties:
args:
$ref: '#/components/schemas/VariableProperties'
description:
type: string
name:
type: string
type: object
old:
properties:
args:
$ref: '#/components/schemas/VariableProperties'
description:
type: string
name:
type: string
type: object
stateStatus:
type: string
templateMetaName:
type: string
type: object
type: array
type: object
errors:
items:
properties:
fields:
items:
type: string
type: array
indexes:
items:
type: integer
type: array
kind:
$ref: '#/components/schemas/TemplateKind'
reason:
type: string
type: object
type: array
sources:
items:
type: string
type: array
stackID:
type: string
summary:
properties:
buckets:
items:
properties:
description:
type: string
envReferences:
$ref: '#/components/schemas/TemplateEnvReferences'
id:
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
labelAssociations:
items:
$ref: '#/components/schemas/TemplateSummaryLabel'
type: array
name:
type: string
orgID:
type: string
retentionPeriod:
type: integer
templateMetaName:
type: string
type: object
type: array
checks:
items:
allOf:
- $ref: '#/components/schemas/CheckDiscriminator'
- properties:
envReferences:
$ref: '#/components/schemas/TemplateEnvReferences'
kind:
$ref: '#/components/schemas/TemplateKind'
labelAssociations:
items:
$ref: '#/components/schemas/TemplateSummaryLabel'
type: array
templateMetaName:
type: string
type: object
type: array
dashboards:
items:
properties:
charts:
items:
$ref: '#/components/schemas/TemplateChart'
type: array
description:
type: string
envReferences:
$ref: '#/components/schemas/TemplateEnvReferences'
id:
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
labelAssociations:
items:
$ref: '#/components/schemas/TemplateSummaryLabel'
type: array
name:
type: string
orgID:
type: string
templateMetaName:
type: string
type: object
type: array
labelMappings:
items:
properties:
labelID:
type: string
labelName:
type: string
labelTemplateMetaName:
type: string
resourceID:
type: string
resourceName:
type: string
resourceTemplateMetaName:
type: string
resourceType:
type: string
status:
type: string
type: object
type: array
labels:
items:
$ref: '#/components/schemas/TemplateSummaryLabel'
type: array
missingEnvRefs:
items:
type: string
type: array
missingSecrets:
items:
type: string
type: array
notificationEndpoints:
items:
allOf:
- $ref: '#/components/schemas/NotificationEndpointDiscriminator'
- properties:
envReferences:
$ref: '#/components/schemas/TemplateEnvReferences'
kind:
$ref: '#/components/schemas/TemplateKind'
labelAssociations:
items:
$ref: '#/components/schemas/TemplateSummaryLabel'
type: array
templateMetaName:
type: string
type: object
type: array
notificationRules:
items:
properties:
description:
type: string
endpointID:
type: string
endpointTemplateMetaName:
type: string
endpointType:
type: string
envReferences:
$ref: '#/components/schemas/TemplateEnvReferences'
every:
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
labelAssociations:
items:
$ref: '#/components/schemas/TemplateSummaryLabel'
type: array
messageTemplate:
type: string
name:
type: string
offset:
type: string
status:
type: string
statusRules:
items:
properties:
currentLevel:
type: string
previousLevel:
type: string
type: object
type: array
tagRules:
items:
properties:
key:
type: string
operator:
type: string
value:
type: string
type: object
type: array
templateMetaName:
type: string
type: object
type: array
tasks:
items:
properties:
cron:
type: string
description:
type: string
envReferences:
$ref: '#/components/schemas/TemplateEnvReferences'
every:
type: string
id:
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
name:
type: string
offset:
type: string
query:
type: string
status:
type: string
templateMetaName:
type: string
type: object
type: array
telegrafConfigs:
items:
allOf:
- $ref: '#/components/schemas/TelegrafRequest'
- properties:
envReferences:
$ref: '#/components/schemas/TemplateEnvReferences'
kind:
$ref: '#/components/schemas/TemplateKind'
labelAssociations:
items:
$ref: '#/components/schemas/TemplateSummaryLabel'
type: array
templateMetaName:
type: string
type: object
type: array
variables:
items:
properties:
arguments:
$ref: '#/components/schemas/VariableProperties'
description:
type: string
envReferences:
$ref: '#/components/schemas/TemplateEnvReferences'
id:
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
labelAssociations:
items:
$ref: '#/components/schemas/TemplateSummaryLabel'
type: array
name:
type: string
orgID:
type: string
templateMetaName:
type: string
type: object
type: array
type: object
type: object
TemplateSummaryLabel:
properties:
envReferences:
$ref: '#/components/schemas/TemplateEnvReferences'
id:
type: string
kind:
$ref: '#/components/schemas/TemplateKind'
name:
type: string
orgID:
type: string
properties:
properties:
color:
type: string
description:
type: string
type: object
templateMetaName:
type: string
type: object
TestStatement:
description: Declares a Flux test case
properties:
assignment:
$ref: '#/components/schemas/VariableAssignment'
type:
$ref: '#/components/schemas/NodeType'
type: object
Threshold:
discriminator:
mapping:
greater: '#/components/schemas/GreaterThreshold'
lesser: '#/components/schemas/LesserThreshold'
range: '#/components/schemas/RangeThreshold'
propertyName: type
oneOf:
- $ref: '#/components/schemas/GreaterThreshold'
- $ref: '#/components/schemas/LesserThreshold'
- $ref: '#/components/schemas/RangeThreshold'
ThresholdBase:
properties:
allValues:
description: If true, only alert if all values meet threshold.
type: boolean
level:
$ref: '#/components/schemas/CheckStatusLevel'
ThresholdCheck:
allOf:
- $ref: '#/components/schemas/CheckBase'
- properties:
every:
description: Check repetition interval.
type: string
offset:
description: Duration to delay after the schedule, before executing check.
type: string
statusMessageTemplate:
description: The template used to generate and write a status message.
type: string
tags:
description: List of tags to write to each status.
items:
properties:
key:
type: string
value:
type: string
type: object
type: array
thresholds:
items:
$ref: '#/components/schemas/Threshold'
type: array
type:
enum:
- threshold
type: string
required:
- type
type: object
Token:
properties:
token:
type: string
type: object
UnaryExpression:
description: Uses operators to act on a single operand in an expression
properties:
argument:
$ref: '#/components/schemas/Expression'
operator:
type: string
type:
$ref: '#/components/schemas/NodeType'
type: object
UnsignedIntegerLiteral:
description: Represents integer numbers
properties:
type:
$ref: '#/components/schemas/NodeType'
value:
type: string
type: object
User:
properties:
id:
description: The user ID.
readOnly: true
type: string
name:
description: The user name.
type: string
status:
default: active
description: |
If `inactive`, the user is inactive.
Default is `active`.
enum:
- active
- inactive
type: string
required:
- name
UserResponse:
properties:
id:
description: |
The user ID.
readOnly: true
type: string
links:
example:
self: /api/v2/users/1
properties:
self:
format: uri
type: string
readOnly: true
type: object
name:
description: |
The user name.
type: string
status:
default: active
description: |
The status of a user.
An inactive user can't read or write resources.
enum:
- active
- inactive
type: string
required:
- name
Users:
properties:
links:
properties:
self:
format: uri
type: string
type: object
users:
items:
$ref: '#/components/schemas/UserResponse'
type: array
type: object
Variable:
properties:
arguments:
$ref: '#/components/schemas/VariableProperties'
createdAt:
format: date-time
type: string
description:
type: string
id:
readOnly: true
type: string
labels:
$ref: '#/components/schemas/Labels'
links:
properties:
labels:
format: uri
type: string
org:
format: uri
type: string
self:
format: uri
type: string
readOnly: true
type: object
name:
type: string
orgID:
type: string
selected:
items:
type: string
type: array
updatedAt:
format: date-time
type: string
required:
- name
- orgID
- arguments
type: object
VariableAssignment:
description: Represents the declaration of a variable
properties:
id:
$ref: '#/components/schemas/Identifier'
init:
$ref: '#/components/schemas/Expression'
type:
$ref: '#/components/schemas/NodeType'
type: object
VariableProperties:
oneOf:
- $ref: '#/components/schemas/QueryVariableProperties'
- $ref: '#/components/schemas/ConstantVariableProperties'
- $ref: '#/components/schemas/MapVariableProperties'
type: object
Variables:
example:
variables:
- arguments:
type: constant
values:
- howdy
- hello
- hi
- yo
- oy
id: '1221432'
name: ':ok:'
selected:
- hello
- arguments:
type: map
values:
a: fdjaklfdjkldsfjlkjdsa
b: dfaksjfkljekfajekdljfas
c: fdjksajfdkfeawfeea
id: '1221432'
name: ':ok:'
selected:
- c
- arguments:
language: flux
query: 'from(bucket: "foo") |> showMeasurements()'
type: query
id: '1221432'
name: ':ok:'
selected:
- host
properties:
variables:
items:
$ref: '#/components/schemas/Variable'
type: array
type: object
View:
properties:
id:
readOnly: true
type: string
links:
properties:
self:
type: string
readOnly: true
type: object
name:
type: string
properties:
$ref: '#/components/schemas/ViewProperties'
required:
- name
- properties
ViewProperties:
oneOf:
- $ref: '#/components/schemas/LinePlusSingleStatProperties'
- $ref: '#/components/schemas/XYViewProperties'
- $ref: '#/components/schemas/SingleStatViewProperties'
- $ref: '#/components/schemas/HistogramViewProperties'
- $ref: '#/components/schemas/GaugeViewProperties'
- $ref: '#/components/schemas/TableViewProperties'
- $ref: '#/components/schemas/SimpleTableViewProperties'
- $ref: '#/components/schemas/MarkdownViewProperties'
- $ref: '#/components/schemas/CheckViewProperties'
- $ref: '#/components/schemas/ScatterViewProperties'
- $ref: '#/components/schemas/HeatmapViewProperties'
- $ref: '#/components/schemas/MosaicViewProperties'
- $ref: '#/components/schemas/BandViewProperties'
- $ref: '#/components/schemas/GeoViewProperties'
Views:
properties:
links:
properties:
self:
type: string
type: object
views:
items:
$ref: '#/components/schemas/View'
type: array
type: object
WritePrecision:
enum:
- ms
- s
- us
- ns
type: string
XYGeom:
enum:
- line
- step
- stacked
- bar
- monotoneX
- stepBefore
- stepAfter
type: string
XYViewProperties:
properties:
adaptiveZoomHide:
type: boolean
axes:
$ref: '#/components/schemas/Axes'
colorMapping:
$ref: '#/components/schemas/ColorMapping'
description: An object that contains information about the color mapping
colors:
description: Colors define color encoding of data into a visualization
items:
$ref: '#/components/schemas/DashboardColor'
type: array
generateXAxisTicks:
items:
type: string
type: array
generateYAxisTicks:
items:
type: string
type: array
geom:
$ref: '#/components/schemas/XYGeom'
hoverDimension:
enum:
- auto
- x
- 'y'
- xy
type: string
legendColorizeRows:
type: boolean
legendHide:
type: boolean
legendOpacity:
format: float
type: number
legendOrientationThreshold:
type: integer
note:
type: string
position:
enum:
- overlaid
- stacked
type: string
queries:
items:
$ref: '#/components/schemas/DashboardQuery'
type: array
shadeBelow:
type: boolean
shape:
enum:
- chronograf-v2
type: string
showNoteWhenEmpty:
description: If true, will display note when empty
type: boolean
staticLegend:
$ref: '#/components/schemas/StaticLegend'
timeFormat:
type: string
type:
enum:
- xy
type: string
xColumn:
type: string
xTickStart:
format: float
type: number
xTickStep:
format: float
type: number
xTotalTicks:
type: integer
yColumn:
type: string
yTickStart:
format: float
type: number
yTickStep:
format: float
type: number
yTotalTicks:
type: integer
required:
- type
- geom
- queries
- shape
- axes
- colors
- note
- showNoteWhenEmpty
- position
type: object
securitySchemes:
BasicAuthentication:
description: |
### Basic authentication scheme
Use the HTTP Basic authentication scheme for InfluxDB `/api/v2` API operations that support it:
### Syntax
`Authorization: Basic BASE64_ENCODED_CREDENTIALS`
To construct the `BASE64_ENCODED_CREDENTIALS`, combine the username and
the password with a colon (`USERNAME:PASSWORD`), and then encode the
resulting string in [base64](https://developer.mozilla.org/en-US/docs/Glossary/Base64).
Many HTTP clients encode the credentials for you before sending the
request.
_**Warning**: Base64-encoding can easily be reversed to obtain the original
username and password. It is used to keep the data intact and does not provide
security. You should always use HTTPS when authenticating or sending a request with
sensitive information._
### Examples
In the examples, replace the following:
- **`USERNAME`**: InfluxDB username
- **`PASSWORD`**: InfluxDB [API token](/influxdb/latest/reference/glossary/#token)
- **`INFLUX_URL`**: your InfluxDB URL
#### Encode credentials with cURL
The following example shows how to use cURL to send an API request that uses Basic authentication.
With the `--user` option, cURL encodes the credentials and passes them
in the `Authorization: Basic` header.
```sh
curl --get "INFLUX_URL/api/v2/signin"
--user "USERNAME":"PASSWORD"
```
#### Encode credentials with Flux
The Flux [`http.basicAuth()` function](https://docs.influxdata.com/flux/v0.x/stdlib/http/basicauth/) returns a Base64-encoded
basic authentication header using a specified username and password combination.
#### Encode credentials with JavaScript
The following example shows how to use the JavaScript `btoa()` function
to create a Base64-encoded string:
```js
btoa('USERNAME:PASSWORD')
```
The output is the following:
```js
'VVNFUk5BTUU6UEFTU1dPUkQ='
```
Once you have the Base64-encoded credentials, you can pass them in the
`Authorization` header--for example:
```sh
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:
description: |
Use the [Token authentication](#section/Authentication/TokenAuthentication)
scheme to authenticate to the InfluxDB API.
In your API requests, send an `Authorization` header.
For the header value, provide the word `Token` followed by a space and an InfluxDB API token.
The word `Token` is case-sensitive.
### Syntax
`Authorization: Token INFLUX_API_TOKEN`
### Example
#### Use Token authentication with cURL
The following example shows how to use cURL to send an API request that uses Token authentication:
```sh
curl --request GET "INFLUX_URL/api/v2/buckets" \
--header "Authorization: Token INFLUX_API_TOKEN"
```
Replace the following:
- *`INFLUX_URL`*: your InfluxDB URL
- *`INFLUX_API_TOKEN`*: your [InfluxDB API token](/influxdb/latest/reference/glossary/#token)
### Related endpoints
- [`/authorizations` endpoints](#tag/Authorizations-(API-tokens))
### Related guides
- [Authorize API requests](/influxdb/latest/api-guide/api_intro/#authentication)
- [Manage API tokens](/influxdb/latest/security/tokens/)
in: header
name: Authorization
type: apiKey
info:
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: {}
/api/v2/authorizations: {}
/api/v2/authorizations/{authID}: {}
/api/v2/backup/kv: {}
/api/v2/backup/metadata: {}
/api/v2/backup/shards/{shardID}: {}
/api/v2/buckets: {}
/api/v2/buckets/{bucketID}: {}
/api/v2/buckets/{bucketID}/labels: {}
/api/v2/buckets/{bucketID}/labels/{labelID}: {}
/api/v2/buckets/{bucketID}/members: {}
/api/v2/buckets/{bucketID}/members/{userID}: {}
/api/v2/buckets/{bucketID}/owners: {}
/api/v2/buckets/{bucketID}/owners/{userID}: {}
/api/v2/checks: {}
/api/v2/checks/{checkID}: {}
/api/v2/checks/{checkID}/labels: {}
/api/v2/checks/{checkID}/labels/{labelID}: {}
/api/v2/checks/{checkID}/query: {}
/api/v2/config: {}
/api/v2/dashboards: {}
/api/v2/dashboards/{dashboardID}: {}
/api/v2/dashboards/{dashboardID}/cells: {}
/api/v2/dashboards/{dashboardID}/cells/{cellID}: {}
/api/v2/dashboards/{dashboardID}/cells/{cellID}/view: {}
/api/v2/dashboards/{dashboardID}/labels: {}
/api/v2/dashboards/{dashboardID}/labels/{labelID}: {}
/api/v2/dashboards/{dashboardID}/members: {}
/api/v2/dashboards/{dashboardID}/members/{userID}: {}
/api/v2/dashboards/{dashboardID}/owners: {}
/api/v2/dashboards/{dashboardID}/owners/{userID}: {}
/api/v2/dbrps: {}
/api/v2/dbrps/{dbrpID}: {}
/debug/pprof/all: {}
/debug/pprof/allocs: {}
/debug/pprof/block: {}
/debug/pprof/cmdline: {}
/debug/pprof/goroutine: {}
/debug/pprof/heap: {}
/debug/pprof/mutex: {}
/debug/pprof/profile: {}
/debug/pprof/threadcreate: {}
/debug/pprof/trace: {}
/api/v2/delete: {}
/api/v2/flags: {}
/health: {}
/api/v2/labels: {}
/api/v2/labels/{labelID}: {}
/api/v2/maps/mapToken:
get:
operationId: getMapboxToken
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Token'
description: Temporary token for Mapbox.
'401':
$ref: '#/components/responses/ServerError'
'500':
$ref: '#/components/responses/ServerError'
default:
$ref: '#/components/responses/ServerError'
summary: Get a mapbox token
/api/v2/me: {}
/api/v2/me/password: {}
/metrics: {}
/api/v2/notificationEndpoints: {}
/api/v2/notificationEndpoints/{endpointID}: {}
/api/v2/notificationEndpoints/{endpointID}/labels: {}
/api/v2/notificationEndpoints/{endpointID}/labels/{labelID}: {}
/api/v2/notificationRules: {}
/api/v2/notificationRules/{ruleID}: {}
/api/v2/notificationRules/{ruleID}/labels: {}
/api/v2/notificationRules/{ruleID}/labels/{labelID}: {}
/api/v2/notificationRules/{ruleID}/query: {}
/api/v2/orgs: {}
/api/v2/orgs/{orgID}: {}
/api/v2/orgs/{orgID}/members: {}
/api/v2/orgs/{orgID}/members/{userID}: {}
/api/v2/orgs/{orgID}/owners: {}
/api/v2/orgs/{orgID}/owners/{userID}: {}
/api/v2/orgs/{orgID}/secrets: {}
/api/v2/orgs/{orgID}/secrets/{secretID}: {}
/api/v2/orgs/{orgID}/secrets/delete: {}
/ping: {}
/api/v2/query: {}
/api/v2/query/analyze: {}
/api/v2/query/ast: {}
/api/v2/query/suggestions: {}
/api/v2/query/suggestions/{name}: {}
/ready: {}
/api/v2/remotes: {}
/api/v2/remotes/{remoteID}: {}
/api/v2/replications: {}
/api/v2/replications/{replicationID}: {}
/api/v2/replications/{replicationID}/validate: {}
/api/v2/resources: {}
/api/v2/restore/bucket/{bucketID}: {}
/api/v2/restore/bucketMetadata: {}
/api/v2/restore/kv: {}
/api/v2/restore/shards/{shardID}: {}
/api/v2/restore/sql: {}
/api/v2/scrapers: {}
/api/v2/scrapers/{scraperTargetID}: {}
/api/v2/scrapers/{scraperTargetID}/labels: {}
/api/v2/scrapers/{scraperTargetID}/labels/{labelID}: {}
/api/v2/scrapers/{scraperTargetID}/members: {}
/api/v2/scrapers/{scraperTargetID}/members/{userID}: {}
/api/v2/scrapers/{scraperTargetID}/owners: {}
/api/v2/scrapers/{scraperTargetID}/owners/{userID}: {}
/api/v2/setup: {}
/api/v2/signin: {}
/api/v2/signout: {}
/api/v2/sources: {}
/api/v2/sources/{sourceID}: {}
/api/v2/sources/{sourceID}/buckets: {}
/api/v2/sources/{sourceID}/health: {}
/api/v2/stacks: {}
/api/v2/stacks/{stack_id}: {}
/api/v2/stacks/{stack_id}/uninstall: {}
/api/v2/tasks: {}
/api/v2/tasks/{taskID}: {}
/api/v2/tasks/{taskID}/labels: {}
/api/v2/tasks/{taskID}/labels/{labelID}: {}
/api/v2/tasks/{taskID}/logs: {}
/api/v2/tasks/{taskID}/members: {}
/api/v2/tasks/{taskID}/members/{userID}: {}
/api/v2/tasks/{taskID}/owners: {}
/api/v2/tasks/{taskID}/owners/{userID}: {}
/api/v2/tasks/{taskID}/runs: {}
/api/v2/tasks/{taskID}/runs/{runID}: {}
/api/v2/tasks/{taskID}/runs/{runID}/logs: {}
/api/v2/tasks/{taskID}/runs/{runID}/retry: {}
/api/v2/telegraf/plugins: {}
/api/v2/telegrafs: {}
/api/v2/telegrafs/{telegrafID}: {}
/api/v2/telegrafs/{telegrafID}/labels: {}
/api/v2/telegrafs/{telegrafID}/labels/{labelID}: {}
/api/v2/telegrafs/{telegrafID}/members: {}
/api/v2/telegrafs/{telegrafID}/members/{userID}: {}
/api/v2/telegrafs/{telegrafID}/owners: {}
/api/v2/telegrafs/{telegrafID}/owners/{userID}: {}
/api/v2/templates/apply: {}
/api/v2/templates/export: {}
/api/v2/users: {}
/api/v2/users/{userID}: {}
/api/v2/users/{userID}/password: {}
/api/v2/variables: {}
/api/v2/variables/{variableID}: {}
/api/v2/variables/{variableID}/labels: {}
/api/v2/variables/{variableID}/labels/{labelID}: {}
/api/v2/write: {}
/legacy/authorizations:
servers:
- url: /private
/legacy/authorizations/{authID}:
servers:
- url: /private
/legacy/authorizations/{authID}/password:
servers:
- url: /private
/query: {}
/write: {}
security:
- TokenAuthentication: []
servers:
- url: /
tags:
- description: |
Use one of the following schemes to authenticate to the InfluxDB API:
- [Token authentication](#section/Authentication/TokenAuthentication)
- [Basic authentication](#section/Authentication/BasicAuthentication)
- [Querystring authentication](#section/Authentication/QuerystringAuthentication)
<!-- ReDoc-Inject: <security-definitions> -->
name: Authentication
x-traitTag: true
- description: |
Create and manage authorizations (API tokens).
An _authorization_ contains a list of `read` and `write`
permissions for organization resources and provides an API token for authentication.
An authorization belongs to an organization and only contains permissions for that organization.
We recommend creating a generic user to create and manage tokens for writing data.
### 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_,
the session carries the permissions granted by all the user's authorizations.
For more information, see [how to assign a token to a specific user](/influxdb/latest/security/tokens/create-token/).
To create a user session, use the [`POST /api/v2/signin` endpoint](#operation/PostSignin).
### Related endpoints
- [Signin](#tag/Signin)
- [Signout](#tag/Signout)
### Related guides
- [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 (API tokens)
- name: Backup
- description: |
Store your data in InfluxDB [buckets](/influxdb/latest/reference/glossary/#bucket).
A bucket is a named location where time series data is stored. All buckets
have a [retention period](/influxdb/latest/reference/glossary/#retention-period),
a duration of time that each data point persists. InfluxDB drops all
points with timestamps older than the buckets retention period.
A bucket belongs to an organization.
### Related guides
- [Manage buckets](/influxdb/latest/organizations/buckets/)
name: Buckets
- name: Cells
- name: Checks
- description: |
To specify resources, some InfluxDB API endpoints require parameters or
properties in the request--for example,
writing to a `bucket` resource in an `org` (_organization_ resource).
### Common parameters
| Query parameter | Value type | Description |
|:------------------------ |:--------------------- |:-------------------------------------------|
| `bucket` | string | The bucket name or ID ([find your bucket](/influxdb/latest/organizations/buckets/view-buckets/). |
| `bucketID` | string | The bucket ID ([find your bucket](/influxdb/latest/organizations/buckets/view-buckets/). |
| `org` | string | The organization name or ID ([find your organization](/influxdb/latest/organizations/view-orgs/). |
| `orgID` | 16-byte string | The organization ID ([find your organization](/influxdb/latest/organizations/view-orgs/). |
name: Common parameters
x-traitTag: true
- name: Config
- name: Dashboards
- name: Data I/O endpoints
- 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/latest/reference/api/influxdb-1x/dbrp/)
name: DBRPs
- description: |
Generate profiling and trace reports.
Use routes under `/debug/pprof` to analyze the Go runtime of InfluxDB.
These endpoints generate [Go runtime profiles](https://pkg.go.dev/runtime/pprof)
and **trace** reports.
**Profiles** are collections of stack traces that show call sequences
leading to instances of a particular event, such as allocation.
For more information about **pprof profile** and **trace** reports,
see the following resources:
- [Google pprof tool](https://github.com/google/pprof)
- [Golang diagnostics](https://go.dev/doc/diagnostics)
name: Debug
- description: |
Delete data from an InfluxDB bucket.
name: Delete
- description: |
InfluxDB `/api/v2` API endpoints use standard HTTP request and response headers.
The following table shows common headers used by many InfluxDB API endpoints.
Some endpoints may use other headers that perform functions more specific to those endpoints--for example,
the `POST /api/v2/write` endpoint accepts the `Content-Encoding` header to indicate the compression applied to line protocol in the request body.
| Header | Value type | Description |
|:------------------------ |:--------------------- |:-------------------------------------------|
| `Accept` | string | The content type that the client can understand. |
| `Authorization` | string | The authorization scheme and credential. |
| `Content-Length` | integer | The size of the entity-body, in bytes, sent to the database. |
| `Content-Type` | string | The format of the data in the request body. |
name: Headers
x-traitTag: true
- name: Health
- name: Labels
- name: Legacy Authorizations
- name: Legacy Query
- name: Legacy Write
- name: Metrics
- name: NotificationEndpoints
- name: NotificationRules
- description: |
Create and manage your [organizations](/influxdb/latest/reference/glossary/#organization).
An organization is a workspace for a group of users. Organizations can be
used to separate different environments, projects, teams or users within
InfluxDB.
Use the `/api/v2/orgs` endpoints to create, view, and manage organizations.
name: Organizations
- description: |
Some InfluxDB API [list operations](#tag/SupportedOperations) may support the following query parameters for paginating results:
| Query parameter | Value type | Description |
|:------------------------ |:--------------------- |:-------------------------------------------|
| `limit` | integer | The maximum number of records to return (after other parameters are applied). |
| `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
- For specific endpoint parameters and examples, see the endpoint definition.
- If you specify an `offset` parameter value greater than the total number of records,
then InfluxDB returns an empty list in the response
(given `offset` skips the specified number of records).
The following example passes `offset=50` to skip the first 50 results,
but the user only has 10 buckets:
```sh
curl --request GET "INFLUX_URL/api/v2/buckets?limit=1&offset=50" \
--header "Authorization: Token INFLUX_API_TOKEN"
```
The response contains the following:
```json
{
"links": {
"prev": "/api/v2/buckets?descending=false\u0026limit=1\u0026offset=49\u0026orgID=ORG_ID",
"self": "/api/v2/buckets?descending=false\u0026limit=1\u0026offset=50\u0026orgID=ORG_ID"
},
"buckets": []
}
```
name: Pagination
x-traitTag: true
- name: Ping
- description: |
Retrieve data, analyze queries, and get query suggestions.
name: Query
- description: |
See the [**API Quick Start**](/influxdb/latest/api-guide/api_intro/)
to get up and running authenticating with tokens, writing to buckets, and querying data.
[**InfluxDB API client libraries**](/influxdb/latest/api-guide/client-libraries/)
are available for popular languages and ready to import into your application.
name: Quick start
x-traitTag: true
- name: Ready
- name: RemoteConnections
- name: Replications
- name: Resources
- description: |
InfluxDB `/api/v2` API endpoints use standard HTTP status codes for success and failure responses.
The response body may include additional details.
For details about a specific operation's response,
see **Responses** and **Response Samples** for that operation.
API operations may return the following HTTP status codes:
| &nbsp;Code&nbsp; | Status | Description |
|:-----------:|:------------------------ |:--------------------- |
| `200` | Success | |
| `204` | No content | For a `POST` request, `204` indicates that InfluxDB accepted the request and request data is valid. Asynchronous operations, such as `write`, might not have completed yet. |
| `400` | Bad request | May indicate one of the following: <ul><li>Line protocol is malformed. The response body contains the first malformed line in the data and indicates what was expected. For partial writes, the number of points written and the number of points rejected are also included. For more information, check the `rejected_points` measurement in your `_monitoring` bucket.</li><li>`Authorization` header is missing or malformed or the API token doesn't have permission for the operation.</li></ul> |
| `401` | Unauthorized | May indicate one of the following: <ul><li>`Authorization: Token` header is missing or malformed</li><li>API token value is missing from the header</li><li>API token doesn't have permission. For more information about token types and permissions, see [Manage API tokens](/influxdb/latest/security/tokens/)</li></ul> |
| `404` | Not found | Requested resource was not found. `message` in the response body provides details about the requested resource. |
| `413` | Request entity too large | Request payload exceeds the size limit. |
| `422` | Unprocessable entity | Request data is invalid. `code` and `message` in the response body provide details about the problem. |
| `429` | Too many requests | API token is temporarily over the request quota. The `Retry-After` header describes when to try the request again. |
| `500` | Internal server error | |
| `503` | Service unavailable | Server is temporarily unavailable to process the request. The `Retry-After` header describes when to try the request again. |
name: Response codes
x-traitTag: true
- name: Restore
- name: Routes
- name: Rules
- name: Scraper Targets
- name: Secrets
- name: Security and access endpoints
- name: Setup
- name: Signin
- name: Signout
- name: Sources
- description: "The following table shows the most common operations that the InfluxDB `/api/v2` API supports.\nSome resources may support other operations that perform functions more specific to those resources.\nFor example, you can use the `PATCH /api/v2/scripts` endpoint to update properties of a script\nresource.\n\n| Operation | |\n|:----------|:-----------------------------------------------------------------------|\n| Write | Writes (`POST`) data to a bucket. |\n| Run | Executes (`POST`) a query or script and returns the result. |\n| List |\tRetrieves (`GET`) a list of zero or more resources. |\n| Create |\tCreates (`POST`) a new resource and returns the resource. |\n| Update |\tModifies (`PUT`) an existing resource to reflect data in your request. |\n| Delete |\tRemoves (`DELETE`) a specific resource. |\n"
name: Supported operations
x-traitTag: true
- name: System information endpoints
- description: |
Process and analyze your data with [tasks](/influxdb/latest/reference/glossary/#task)
in the InfluxDB task engine.
Use the `/api/v2/tasks` endpoints to schedule and manage tasks, retry task runs, and retrieve run logs.
To configure a task, provide the script and the schedule to run the task.
For examples, see how to create a task with the [`POST /api/v2/tasks` endpoint](#operation/PostTasks).
<span id="tasks-schemaref-task" />
### Properties
A `task` object contains information about an InfluxDB task resource.
The following table defines the properties that appear in a `task` object:
<SchemaDefinition schemaRef="#/components/schemas/Task" />
### Related guides
- [Get started with tasks](/influxdb/latest/process-data/get-started/)
- [Common data processing tasks](/influxdb/latest/process-data/common-tasks/)
name: Tasks
- name: Telegraf Plugins
- name: Telegrafs
- description: |
Export and apply InfluxDB **templates**.
Manage **stacks** of templated InfluxDB resources.
InfluxDB templates are prepackaged configurations for
everything from dashboards and Telegraf to notifications and alerts.
Use InfluxDB templates to quickly configure a fresh instance of InfluxDB,
back up your dashboard configuration, or share your configuration with the
InfluxData community.
Use the `/api/v2/templates` endpoints to export templates and apply templates.
**InfluxDB stacks** are stateful InfluxDB templates that let you
add, update, and remove installed template resources over time, avoid duplicating
resources when applying the same or similar templates more than once, and
apply changes to distributed instances of InfluxDB OSS or InfluxDB Cloud.
Use the `/api/v2/stacks` endpoints to manage installed template resources.
### Related guides
- [InfluxDB stacks](/influxdb/latest/influxdb-templates/stacks/)
- [InfluxDB templates](/influxdb/latest/influxdb-templates/)
name: Templates
- description: |
Manage users for your organization.
Users are those with access to InfluxDB.
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
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
- [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)
name: Users
- name: Variables
- name: Views
- description: |
Write time series data to [buckets](/influxdb/latest/reference/glossary/#bucket).
name: Write
x-tagGroups:
- name: Using the InfluxDB HTTP API
tags:
- Quick start
- Authentication
- Supported operations
- Headers
- Pagination
- Response codes
- Data I/O endpoints
- Security and access endpoints
- System information endpoints
- name: All endpoints
tags:
- Authorizations (API tokens)
- Backup
- Buckets
- Cells
- Checks
- Config
- Dashboards
- DBRPs
- Debug
- Delete
- Health
- Labels
- Legacy Authorizations
- Legacy Query
- Legacy Write
- Metrics
- NotificationEndpoints
- NotificationRules
- Organizations
- Ping
- Query
- Ready
- RemoteConnections
- Replications
- Resources
- Restore
- Routes
- Rules
- Scraper Targets
- Secrets
- Setup
- Signin
- Signout
- Sources
- Tasks
- Telegraf Plugins
- Telegrafs
- Templates
- Users
- Variables
- Views
- Write