InfluxDB v2 HTTP API 为所有与 InfluxDB v2 实例的交互提供程序化接口。
InfluxDB v2 HTTP API 为所有与 InfluxDB v2 实例的交互提供程序化接口。使用 /api/v2/
和 InfluxDB v1 兼容的端点访问 InfluxDB API。
此文档从 InfluxDB OpenAPI 规范生成。
请参阅 API 快速入门,了解如何开始运行并使用令牌进行身份验证、写入存储桶和查询数据。
InfluxDB API 客户端库 适用于常用语言,并已准备好导入到您的应用程序中。
对于支持 HTTP 基本身份验证方案的 InfluxDB /api/v2
API 操作,请使用该方案
Authorization: Basic BASE64_ENCODED_CREDENTIALS
要构造 BASE64_ENCODED_CREDENTIALS
,请将用户名和密码用冒号 (USERNAME:PASSWORD
) 组合起来,然后将结果字符串编码为 base64。许多 HTTP 客户端会在发送请求之前为您编码凭据。
警告: Base64 编码可以很容易地被逆向以获得原始用户名和密码。它用于保持数据完整,并不提供安全性。在进行身份验证或发送包含敏感信息的请求时,应始终使用 HTTPS。
在示例中,替换以下内容
USERNAME
: InfluxDB 用户名PASSWORD
: InfluxDB API 令牌INFLUX_URL
: 您的 InfluxDB URL以下示例演示了如何使用 cURL 发送使用基本身份验证的 API 请求。使用 --user
选项,cURL 会编码凭据并将它们传递到 Authorization: Basic
标头中。
curl --get "INFLUX_URL/api/v2/signin"
--user "USERNAME":"PASSWORD"
Flux http.basicAuth()
函数 使用指定的用户名和密码组合返回 Base64 编码的基本身份验证标头。
以下示例演示了如何使用 JavaScript btoa()
函数创建 Base64 编码的字符串
btoa('USERNAME:PASSWORD')
输出如下
'VVNFUk5BTUU6UEFTU1dPUkQ='
获得 Base64 编码的凭据后,您可以将它们传递到 Authorization
标头中,例如
curl --get "INFLUX_URL/api/v2/signin"
--header "Authorization: Basic VVNFUk5BTUU6UEFTU1dPUkQ="
要了解有关 HTTP 身份验证的更多信息,请参阅 Mozilla 开发者网络 (MDN) Web 文档,HTTP 身份验证。
安全方案类型 | HTTP |
---|---|
HTTP 授权方案 | 基本 |
使用 令牌身份验证方案对 InfluxDB API 进行身份验证。
在您的 API 请求中,发送 Authorization
标头。对于标头值,提供单词 Token
,后跟一个空格和一个 InfluxDB API 令牌。单词 Token
区分大小写。
Authorization: Token INFLUX_API_TOKEN
以下示例演示了如何使用 cURL 发送使用令牌身份验证的 API 请求
curl --request GET "INFLUX_URL/api/v2/buckets" \
--header "Authorization: Token INFLUX_API_TOKEN"
替换以下内容
INFLUX_URL
: 您的 InfluxDB URLINFLUX_API_TOKEN
: 您的 InfluxDB API 令牌安全方案类型 | API 密钥 |
---|---|
标头参数名称 | Authorization |
下表显示了 InfluxDB /api/v2
API 支持的最常用操作。某些资源可能支持执行更特定于这些资源的功能的其他操作。例如,您可以使用 PATCH /api/v2/scripts
端点来更新脚本资源的属性。
操作 | |
---|---|
写入 | 将 (POST ) 数据写入存储桶。 |
运行 | 执行 (POST ) 查询或脚本并返回结果。 |
列表 | 检索 (GET ) 零个或多个资源的列表。 |
创建 | 创建 (POST ) 新资源并返回资源。 |
更新 | 修改 (PUT ) 现有资源以反映您请求中的数据。 |
删除 | 移除 (DELETE ) 特定资源。 |
InfluxDB HTTP API 端点使用标准 HTTP 请求和响应标头。下表显示了许多 InfluxDB API 端点使用的常用标头。某些端点可能使用执行更特定于这些端点的功能的其他标头,例如,POST /api/v2/write
端点接受 Content-Encoding
标头,以指示应用于请求正文中的行协议的压缩。
标头 | 值类型 | 描述 |
---|---|---|
Accept | 字符串 | 客户端可以理解的内容类型。 |
Authorization | 字符串 | 授权方案和凭据。 |
Content-Length | 整数 | 发送到数据库的实体主体的大小(以字节为单位)。 |
Content-Type | 字符串 | 请求正文中的数据格式。 |
某些 InfluxDB API 列表操作可能支持以下查询参数用于分页结果
查询参数 | 值类型 | 描述 |
---|---|---|
limit | 整数 | 要返回的最大记录数(在应用其他参数之后)。 |
offset | 整数 | 要跳过的记录数(在 limit 之前,在应用其他参数之后)。 |
after | 字符串(资源 ID) | 仅返回在指定资源之后创建的资源。 |
有关特定端点参数和示例,请参阅端点定义。
如果您指定的 offset
参数值大于记录总数,则 InfluxDB 会在响应中返回一个空列表(因为 offset
跳过了指定数量的记录)。
以下示例传递 offset=50
以跳过前 50 个结果,但用户只有 10 个存储桶
curl --request GET "INFLUX_URL/api/v2/buckets?limit=1&offset=50" \
--header "Authorization: Token INFLUX_API_TOKEN"
响应包含以下内容
{
"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": []
}
InfluxDB HTTP API 端点对成功和失败响应使用标准 HTTP 状态代码。响应正文可能包含其他详细信息。有关特定操作响应的详细信息,请参阅该操作的响应和响应示例。
API 操作可能返回以下 HTTP 状态代码
代码 | 状态 | 描述 |
---|---|---|
200 | 成功 | |
204 | 成功。无内容 | InfluxDB 不会返回请求的数据。 |
400 | 错误请求 | 可能指示以下情况之一
|
401 | 未授权 | 可能指示以下情况之一
|
404 | 未找到 | 找不到请求的资源。响应正文中的 message 提供了有关请求资源的详细信息。 |
413 | 请求实体过大 | 请求有效负载超出大小限制。 |
422 | 不可处理的实体 | 请求数据无效。响应正文中的 code 和 message 提供了有关问题的详细信息。 |
429 | 请求过多 | API 令牌暂时超出请求配额。Retry-After 标头描述了何时再次尝试请求。 |
500 | 内部服务器错误 | |
503 | 服务不可用 | 服务器暂时不可用以处理请求。Retry-After 标头描述了何时再次尝试请求。 |
从存储桶中删除数据。
使用此端点从指定时间范围内的存储桶中删除点。
当您发送删除请求时,执行以下操作
2xx
状态代码)响应;否则为错误。为确保 InfluxDB Cloud 按照您请求的顺序处理写入和删除操作,请等待成功响应(HTTP 2xx
状态代码),然后再发送下一个请求。
由于写入和删除操作是异步的,因此当您收到响应时,您的更改可能尚未可读。
write-buckets
或 write-bucket BUCKET_ID
。BUCKET_ID
是目标存储桶的 ID。
应用 write
速率限制。有关更多信息,请参阅限制和可调整的配额。
bucket | 字符串 存储桶名称或 ID。指定要从中删除数据的存储桶。如果您同时传递 |
bucketID | 字符串 存储桶 ID。指定要从中删除数据的存储桶。如果您同时传递 |
org | 字符串 组织名称或 ID。 InfluxDB Cloud
InfluxDB OSS
|
orgID | 字符串 组织 ID。 InfluxDB Cloud
InfluxDB OSS
|
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
时间范围参数和可选的 删除谓词表达式。
要在指定时间范围内选择要删除的点,请在请求正文的 predicate
属性中传递 删除谓词表达式。如果您不传递 predicate
,则 InfluxDB 会删除时间戳在指定时间范围内的所有数据。
predicate | 字符串 删除谓词语法中的表达式。 |
start 必需 | 字符串 <date-time> 时间戳 (RFC3339 日期/时间格式)。要从中删除的最早时间。 |
stop 必需 | 字符串 <date-time> 时间戳 (RFC3339 日期/时间格式)。要从中删除的最晚时间。 |
{- "predicate": "tag1=\"value1\" and (tag2=\"value2\" and tag3!=\"value3\")",
- "start": "2019-08-24T14:15:22Z",
- "stop": "2019-08-24T14:15:22Z"
}
{- "code": "invalid",
- "message": "failed to decode request body: organization not found"
}
org | 字符串 组织名称或 ID。 InfluxDB Cloud
InfluxDB OSS
|
orgID | 字符串 组织 ID。 InfluxDB Cloud
InfluxDB OSS
|
Accept-Encoding | 字符串 默认: identity 枚举: "gzip" "identity" 客户端可以理解的内容编码(通常是压缩算法)。 |
Content-Type | 字符串 枚举: "application/json" "application/vnd.flux" |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要执行的 Flux 查询或规范
对象 (Dialect) 表格数据输出的选项。默认输出是带有标头的带注释的 CSV。 有关表格数据dialect的更多信息,请参阅 表格数据的 W3 元数据词汇表。 | |
对象 (File) 表示来自单个文件的源 | |
now | 字符串 <date-time> 指定在查询中应报告为 |
query 必需 | 字符串 要执行的查询脚本。 |
type | 字符串 值: "flux" 查询类型。必须为 "flux"。 |
{- "dialect": {
- "annotations": [
- "group"
], - "commentPrefix": "#",
- "dateTimeFormat": "RFC3339",
- "delimiter": ",",
- "header": true
}, - "extern": {
- "body": [
- {
- "text": "string",
- "type": "string"
}
], - "imports": [
- {
- "as": {
- "name": "string",
- "type": "string"
}, - "path": {
- "type": "string",
- "value": "string"
}, - "type": "string"
}
], - "name": "string",
- "package": {
- "name": {
- "name": "string",
- "type": "string"
}, - "type": "string"
}, - "type": "string"
}, - "now": "2019-08-24T14:15:22Z",
- "query": "string",
- "type": "flux"
}
result,table,_start,_stop,_time,region,host,_value mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:00Z,east,A,15.43 mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:20Z,east,B,59.25 mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:40Z,east,C,52.62
after | 字符串 任务 ID。仅返回在指定任务之后创建的任务。 |
limit | 整数 [ 1 .. 500 ] 默认: 100 要返回的最大任务数。默认为 要减小有效负载大小,请组合使用 |
name | 字符串 任务名称。仅返回具有指定名称的任务。不同的任务可能具有相同的名称。 |
org | 字符串 一个组织名称。仅返回指定组织拥有的任务。 |
orgID | 字符串 一个组织 ID。仅返回指定组织拥有的任务。 |
status | |
type | 字符串 默认: "" 枚举: "basic" "system" 任务类型( |
user | 字符串 一个用户 ID。仅返回指定用户拥有的任务。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
curl https://localhost:8086/api/v2/tasks/?limit=-1&type=basic \ --header 'Content-Type: application/json' \ --header 'Authorization: Token INFLUX_API_TOKEN'
?type=basic
参数的示例响应正文。type=basic
省略了响应中的某些任务字段(createdAt
和 updatedAt
)和字段值(org
、flux
)。
{- "links": {
- "self": "/api/v2/tasks?limit=100"
}, - “任务”: [
- {
- "every": "30m",
- "flux": "",
- "id": "09956cbb6d378000",
- "labels": [ ],
- "lastRunStatus": "success",
- "latestCompleted": "2022-06-30T15:00:00Z",
- "links": {
- "labels": "/api/v2/tasks/09956cbb6d378000/labels",
- "logs": "/api/v2/tasks/09956cbb6d378000/logs",
- "members": "/api/v2/tasks/09956cbb6d378000/members",
- "owners": "/api/v2/tasks/09956cbb6d378000/owners",
- "runs": "/api/v2/tasks/09956cbb6d378000/runs",
- "self": "/api/v2/tasks/09956cbb6d378000"
}, - "name": "task1",
- "org": "",
- "orgID": "48c88459ee424a04",
- "ownerID": "0772396d1f411000",
- "status": "active"
}
]
}
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要创建的任务。
描述 | 字符串 任务的可选描述。 |
flux 必需 | 字符串 此任务要运行的 Flux 脚本。 |
org | 字符串 拥有此任务的组织的名称。 |
orgID | 字符串 拥有此任务的组织的 ID。 |
status | string (TaskStatusType) 枚举: "active" "inactive"
|
{- "description": "string",
- "flux": "string",
- "org": "string",
- "orgID": "string",
- "status": "active"
}
{- "authorizationID": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "cron": "string",
- "description": "string",
- "every": "string",
- "flux": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "links": {
- "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"
}, - "name": "string",
- "offset": "string",
- "org": "string",
- "orgID": "string",
- "ownerID": "string",
- "status": "活动",
- "updatedAt": "2019-08-24T14:15:22Z"
}
检索 任务。
taskID 必需 | 字符串 要检索的任务的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "authorizationID": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "cron": "string",
- "description": "string",
- "every": "string",
- "flux": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "links": {
- "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"
}, - "name": "string",
- "offset": "string",
- "org": "string",
- "orgID": "string",
- "ownerID": "string",
- "status": "活动",
- "updatedAt": "2019-08-24T14:15:22Z"
}
计划任务运行立即启动,忽略计划的运行。
使用此端点手动启动任务运行。计划的运行将继续按计划运行。这可能会导致并发运行的任务。
要重试之前的运行(并避免创建新的运行),请使用 POST /api/v2/tasks/{taskID}/runs/{runID}/retry
端点。
taskID 必需 | 字符串 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
scheduledFor | string or null <date-time> 用于运行的 |
{- "scheduledFor": "2019-08-24T14:15:22Z"
}
{- "finishedAt": "2006-01-02T15:04:05.999999999Z07:00",
- "flux": "string",
- "id": "string",
- "links": {
- "retry": "/api/v2/tasks/1/runs/1/retry",
- "self": "/api/v2/tasks/1/runs/1",
- "task": "/api/v2/tasks/1"
}, - “日志”: [
- {
- "message": "停止并着火",
- "runID": "string",
- "time": "2006-01-02T15:04:05.999999999Z07:00"
}
], - "requestedAt": "2006-01-02T15:04:05.999999999Z07:00",
- "scheduledFor": "2019-08-24T14:15:22Z",
- "startedAt": "2006-01-02T15:04:05.999999999Z07:00",
- "status": "已计划",
- "taskID": "string"
}
将数据写入存储桶。
使用此端点以 行协议 格式将数据发送到 InfluxDB。
当您发送写入请求时,执行以下操作
2xx
状态代码)响应;否则为错误。为确保 InfluxDB Cloud 按照您请求的顺序处理写入和删除操作,请等待成功响应(HTTP 2xx
状态代码),然后再发送下一个请求。
由于写入和删除操作是异步的,因此当您收到响应时,您的更改可能尚未可读。
2xx
状态代码;否则,返回第一个失败的行。write-buckets
或 write-bucket BUCKET_ID
。
BUCKET_ID
是目标存储桶的 ID。
应用 write
速率限制。有关更多信息,请参阅限制和可调整的配额。
bucket 必需 | 字符串 存储桶名称或 ID。InfluxDB 将批处理中的所有点写入指定的存储桶。 |
org 必需 | 字符串 组织名称或 ID。 InfluxDB Cloud
InfluxDB OSS
|
orgID | 字符串 组织 ID。 InfluxDB Cloud
InfluxDB OSS
|
精度 | string (WritePrecision) Enum: "ms" "s" "us" "ns" 行协议批处理中 Unix 时间戳的精度。 |
Accept | 字符串 默认值: application/json 值: "application/json" 客户端可以理解的内容类型。只有在写入失败时(例如,由于格式问题或配额限制)才返回响应正文。 InfluxDB Cloud
InfluxDB OSS
相关指南 |
Content-Encoding | 字符串 默认: identity 枚举: "gzip" "identity" 应用于请求负载中的行协议的压缩。要发送 gzip 负载,请传递 |
Content-Length | integer 发送到 InfluxDB 的实体正文的大小(以字节为单位)。如果长度大于 |
Content-Type | 字符串 默认值: text/plain; charset=utf-8 Enum: "text/plain" "text/plain; charset=utf-8" 请求正文中的数据格式。要发送行协议负载,请传递 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
airSensors,sensor_id=TLM0201 temperature=73.97038159354763,humidity=35.23103248356096,co=0.48445310567793615 1630424257000000000 airSensors,sensor_id=TLM0202 temperature=75.30007505999716,humidity=35.651929918691714,co=0.5141876544505826 1630424257000000000
{- "code": "invalid",
- "message": "部分写入错误(已写入 2 个):无法解析 'air_sensor,service=S1,sensor=L1 temperature=\"90.5\",humidity=70.0 1632850122':架构:架构不允许字段 \"temperature\" 的字段类型;获取了 String 但预期为 Float"
}
org | 字符串 组织名称。仅返回属于指定 组织 的授权。 |
orgID | 字符串 组织 ID。仅返回属于指定 组织 的授权。 |
令牌 | 字符串 API 令牌 值。通过其 InfluxDB OSS
限制
|
user | 字符串 用户名。仅返回范围限定为指定 用户 的授权。 |
用户ID | 字符串 用户 ID。仅返回范围限定为指定 用户 的授权。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- “授权”: [
- {
- "description": "string",
- "status": "活动",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- “权限”: [
- {
- "action": "读取",
- “资源”: {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "授权"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}
],
}
创建授权并返回带有生成的 API 令牌 的授权。
使用此端点创建授权,这将生成一个 API 令牌,该令牌具有对特定资源或资源 type
进行 read
或 write
的权限。API 令牌是授权的 token
属性值。
为了遵循安全 API 令牌生成和检索的最佳实践,InfluxDB 对 API 令牌强制执行访问限制。
我们建议您按照以下方式管理令牌
write-authorizations
write-user
用于授权范围限定的用户Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要创建的授权。
描述 | 字符串 令牌的描述。 |
orgID 必需 | 字符串 组织 ID。指定拥有授权的组织。 |
必需 | Array of objects (Permission) non-empty 授权的权限列表。在该列表中,至少提供一个 在 |
status | 字符串 默认值: "active" 枚举: "active" "inactive" 令牌的状态。如果为 |
用户ID | 字符串 用户 ID。指定授权范围限定的用户。 当用户使用用户名和密码进行身份验证时,InfluxDB 会生成一个用户会话,其中包含用户所有授权指定的所有权限。 |
创建授权。
{- "description": "iot_users read buckets",
- "orgID": "INFLUX_ORG_ID",
- “权限”: [
- {
- "action": "读取",
- “资源”: {
- "type": "buckets"
}
}
]
}
{- "description": "string",
- "status": "活动",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- “权限”: [
- {
- "action": "读取",
- “资源”: {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "授权"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}
检索授权。
使用此端点检索有关 API 令牌的信息,包括令牌的权限和令牌范围限定的用户。
authID 必需 | 字符串 授权 ID。指定要检索的授权。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "description": "string",
- "status": "活动",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- “权限”: [
- {
- "action": "读取",
- “资源”: {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "授权"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}
更新授权。
使用此端点将 API 令牌的状态设置为活动或非活动。InfluxDB 拒绝使用非活动 API 令牌的请求。
authID 必需 | 字符串 授权 ID。指定要更新的授权。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
在请求正文中,提供要更新的授权属性。
描述 | 字符串 令牌的描述。 |
status | 字符串 默认值: "active" 枚举: "active" "inactive" 令牌的状态。如果为 |
{- "description": "string",
- "status": "active"
}
{- "description": "string",
- "status": "活动",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- “权限”: [
- {
- "action": "读取",
- “资源”: {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "授权"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}
降序 | boolean 默认值: false |
limit | integer [ 1 .. 100 ] 默认值: 20 限制返回的记录数。默认为 |
偏移量 | integer >= 0 分页的偏移量。要跳过的记录数。 有关分页参数的更多信息,请参阅 分页。 |
org | 字符串 组织名称。仅返回指定的组织。 |
orgID | 字符串 组织 ID。仅返回指定的组织。 |
用户ID | 字符串 用户 ID。仅返回指定用户是成员或所有者的组织。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "links": {
- "self": "/api/v2/orgs"
}, - “组织”: [
- {
- "createdAt": "2022-07-17T23:00:30.778487Z",
- "description": "InfluxDB 组织示例",
- "id": "INFLUX_ORG_ID",
- "links": {
- "buckets": "/api/v2/buckets?org=INFLUX_ORG",
- "dashboards": "/api/v2/dashboards?org=INFLUX_ORG",
- "labels": "/api/v2/orgs/INFLUX_ORG_ID/labels",
- "logs": "/api/v2/orgs/INFLUX_ORG_ID/logs",
- "members": "/api/v2/orgs/INFLUX_ORG_ID/members",
- "owners": "/api/v2/orgs/INFLUX_ORG_ID/owners",
- "secrets": "/api/v2/orgs/INFLUX_ORG_ID/secrets",
- "self": "/api/v2/orgs/INFLUX_ORG_ID",
- "tasks": "/api/v2/tasks?org=InfluxData"
}, - "name": "INFLUX_ORG",
- "updatedAt": "2022-07-17T23:00:30.778487Z"
}
]
}
orgID 必需 | 字符串 要检索的组织的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "createdAt": "2019-08-24T14:15:22Z",
- "defaultStorageType": "tsm",
- "description": "string",
- "id": "string",
- "links": {
- "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"
}, - "name": "string",
- "status": "活动",
- "updatedAt": "2019-08-24T14:15:22Z"
}
列出属于某个组织的所有用户。
InfluxDB 用户 有权访问 InfluxDB。
成员 是组织内的用户。
owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。read-orgs INFLUX_ORG_ID
INFLUX_ORG_ID
是您要检索成员的组织的 ID。
orgID 必需 | 字符串 要检索用户的组织的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "links": {
- "self": "/api/v2/orgs/055aa4783aa38398/members"
}, - "users": [
- {
- "id": "791df274afd48a83",
- "links": {
- "self": "/api/v2/users/791df274afd48a83"
}, - "name": "example_user_1",
- "role": "member",
- "status": "active"
}, - {
- "id": "09cfb87051cbe000",
- "links": {
- "self": "/api/v2/users/09cfb87051cbe000"
}, - "name": "example_user_2",
- "role": "owner",
- "status": "active"
}
]
}
从组织中移除成员。
使用此端点移除用户在组织中的成员权限。移除成员权限会移除用户的 read
和 write
组织权限。
owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。write-orgs INFLUX_ORG_ID
INFLUX_ORG_ID
是您要从中移除所有者的组织的 ID。
orgID 必需 | 字符串 要从中移除用户的组织的 ID。 |
用户ID 必需 | 字符串 要移除的用户的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "code": "unauthorized",
- "message": "unauthorized access"
}
列出组织的所有所有者。
owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。read-orgs INFLUX_ORG_ID
INFLUX_ORG_ID
是您要从中检索所有者列表的组织的 ID。
orgID 必需 | 字符串 要列出所有者的组织的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "links": {
- "self": "/api/v2/orgs/055aa4783aa38398/owners"
}, - "users": [
- {
- "id": "09cfb87051cbe000",
- "links": {
- "self": "/api/v2/users/09cfb87051cbe000"
}, - "name": "example_user_2",
- "role": "owner",
- "status": "active"
}
]
}
从组织中移除 所有者。
组织所有者有权删除组织并从组织中移除用户和成员权限。
owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。write-orgs INFLUX_ORG_ID
INFLUX_ORG_ID
是您要从中移除所有者的组织的 ID。
orgID 必需 | 字符串 要从中移除所有者的组织的 ID。 |
用户ID 必需 | 字符串 要移除的用户的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "code": "unauthorized",
- "message": "unauthorized access"
}
orgID 必需 | 字符串 组织 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要删除的密钥
secrets | Array of strings |
{- "secrets": [
- "string"
]
}
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
验证 基本身份验证凭据 用户,然后,如果成功,则生成用户会话。
要验证用户身份,请传递带有 Basic
方案和 base64 编码的用户名和密码的 HTTP Authorization
标头。有关语法和更多信息,请参阅 基本身份验证。
如果身份验证成功,InfluxDB 会为用户创建一个新会话,然后在 Set-Cookie
响应标头中返回会话 Cookie。
InfluxDB 仅在内存中存储用户会话。它们在十分钟内过期,并在 InfluxDB 实例重启期间过期。
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
curl --request POST http://localhost:8086/api/v2/signin \ --user "USERNAME:PASSWORD"
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
使会话 Cookie 指定的用户会话过期。
使用此端点使在用户使用 InfluxDB 开发人员控制台 (UI) 或 POST /api/v2/signin
端点进行身份验证时生成的用户会话过期。
例如,POST /api/v2/signout
端点表示以下三步流程中的第三步,用于验证用户身份、检索 user
资源,然后使会话过期
POST /api/v2/signin
端点发送带有用户的 基本身份验证凭据 的请求,以创建用户会话并生成会话 Cookie。GET /api/v2/me
端点发送请求,传递来自步骤 1 的存储的会话 Cookie 以检索用户信息。POST /api/v2/signout
端点发送请求,传递存储的会话 Cookie 以使会话过期。请参阅请求示例中的完整示例。
InfluxDB 仅在内存中存储用户会话。如果用户未注销,则用户会话将在十分钟内或在 InfluxDB 实例重启期间自动过期。
要了解有关 HTTP 请求中 Cookie 的更多信息,请参阅 Mozilla 开发者网络 (MDN) Web 文档,HTTP Cookie。
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# The following example shows how to use cURL and the InfluxDB API # to do the following: # 1. Sign in a user with a username and password. # 2. Check that the user session exists for the user. # 3. Sign out the user to expire the session. # 4. Check that the session is no longer active. # 1. Send a request to `POST /api/v2/signin` to sign in the user. # In your request, pass the following: # # - `--user` option with basic authentication credentials. # - `-c` option with a file path where cURL will write cookies. curl --request POST \ -c ./cookie-file.tmp \ "$INFLUX_URL/api/v2/signin" \ --user "${INFLUX_USER_NAME}:${INFLUX_USER_PASSWORD}" # 2. To check that a user session exists for the user in step 1, # send a request to `GET /api/v2/me`. # In your request, pass the `-b` option with the session cookie file path from step 1. curl --request GET \ -b ./cookie-file.tmp \ "$INFLUX_URL/api/v2/me" # InfluxDB responds with the `user` resource. # 3. Send a request to `POST /api/v2/signout` to expire the user session. # In your request, pass the `-b` option with the session cookie file path from step 1. curl --request POST \ -b ./cookie-file.tmp \ "$INFLUX_URL/api/v2/signout" # If the user session is successfully expired, InfluxDB responds with an HTTP `204` status code. # 4. To check that the user session is expired, call `GET /api/v2/me` again, # passing the `-b` option with the cookie file path. curl --request GET \ -b ./cookie-file.tmp \ "$INFLUX_URL/api/v2/me" # If the user session is expired, InfluxDB responds with an HTTP `401` status code.
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
after | 字符串 要从中查找的资源 ID。返回在指定记录之后创建的记录;结果不包括指定的记录。 使用 |
id | 字符串 用户 ID。仅列出指定的 用户。 |
limit | integer [ 1 .. 100 ] 默认值: 20 限制返回的记录数。默认为 |
name | 字符串 用户名。仅列出指定的 用户。 |
偏移量 | integer >= 0 分页的偏移量。要跳过的记录数。 有关分页参数的更多信息,请参阅 分页。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "users": [
- {
- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "active"
}
]
}
更新用户密码。
用户ID 必需 | 字符串 要为其设置密码的用户的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要为用户设置的新密码。
password 必需 | 字符串 |
{- "password": "string"
}
{- "code": "invalid",
- "message": "passwords cannot be changed through the InfluxDB Cloud API"
}
更新用户密码。
使用此端点让用户使用 基本身份验证凭据 进行身份验证并设置新密码。
用户ID 必需 | 字符串 要为其设置密码的用户的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要为用户设置的新密码。
password 必需 | 字符串 |
{- "password": "string"
}
{- "code": "invalid",
- "message": "passwords cannot be changed through the InfluxDB Cloud API"
}
收集样本并返回以下 Go 运行时配置文件 的报告
cpu
查询参数来包含。等效于来自 GET /debug/pprof/profile?seconds=NUMBER_OF_SECONDS
的报告。cpu |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Download and extract a `tar.gz` of all profiles after 10 seconds of CPU sampling. curl "http://localhost:8086/debug/pprof/all?cpu=10s" | tar -xz # x profiles/cpu.pb.gz # x profiles/goroutine.pb.gz # x profiles/block.pb.gz # x profiles/mutex.pb.gz # x profiles/heap.pb.gz # x profiles/allocs.pb.gz # x profiles/threadcreate.pb.gz # Analyze a profile. go tool pprof profiles/heap.pb.gz
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
返回所有过去内存分配的 Go 运行时配置文件 报告。 allocs 与 heap 配置文件相同,但将默认 pprof 显示更改为 -alloc_space,即自程序开始以来分配的总字节数(包括垃圾回收的字节数)。
debug | integer <int64> Enum: 0 1
|
seconds | string <int64> 要收集统计信息的秒数。
|
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Analyze the profile in interactive mode. go tool pprof http://localhost:8086/debug/pprof/allocs # `pprof` returns the following prompt: # Entering interactive mode (type "help" for commands, "o" for options) # (pprof) # At the prompt, get the top N memory allocations. (pprof) top10
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
收集样本并返回导致阻塞同步原语的堆栈跟踪的 Go 运行时配置文件 报告。
debug | integer <int64> Enum: 0 1
|
seconds | string <int64> 要收集统计信息的秒数。
|
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Analyze the profile in interactive mode. go tool pprof http://localhost:8086/debug/pprof/block # `pprof` returns the following prompt: # Entering interactive mode (type "help" for commands, "o" for options) # (pprof) # At the prompt, get the top N entries. (pprof) top10
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
收集统计信息并返回所有当前 goroutine 的 Go 运行时配置文件 报告。
debug | integer <int64> Enum: 0 1
|
seconds | string <int64> 要收集统计信息的秒数。
|
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Analyze the profile in interactive mode. go tool pprof http://localhost:8086/debug/pprof/goroutine # `pprof` returns the following prompt: # Entering interactive mode (type "help" for commands, "o" for options) # (pprof) # At the prompt, get the top N entries. (pprof) top10
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
收集统计信息并返回活动对象的内存分配的 Go 运行时配置文件 报告。
要在采样前运行垃圾回收,请传递值为 1
的 gc
查询参数。
debug | integer <int64> Enum: 0 1
|
gc | integer <int64> Enum: 0 1
|
seconds | string <int64> 要收集统计信息的秒数。
|
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Analyze the profile in interactive mode. go tool pprof http://localhost:8086/debug/pprof/heap # `pprof` returns the following prompt: # Entering interactive mode (type "help" for commands, "o" for options) # (pprof) # At the prompt, get the top N memory-intensive nodes. (pprof) top10 # pprof displays the list: # Showing nodes accounting for 142.46MB, 85.43% of 166.75MB total # Dropped 895 nodes (cum <= 0.83MB) # Showing top 10 nodes out of 143
收集统计信息并返回锁争用的 Go 运行时配置文件 报告。该配置文件包含有争议的互斥锁(mutexes)持有者的堆栈跟踪。
debug | integer <int64> Enum: 0 1
|
seconds | string <int64> 要收集统计信息的秒数。
|
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Analyze the profile in interactive mode. go tool pprof http://localhost:8086/debug/pprof/mutex # `pprof` returns the following prompt: # Entering interactive mode (type "help" for commands, "o" for options) # (pprof) # At the prompt, get the top N entries. (pprof) top10
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
收集统计信息并返回执行堆栈上程序计数器的 Go 运行时配置文件 报告。
seconds | string <int64> 要收集配置文件数据的秒数。默认为 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Download the profile report. curl http://localhost:8086/debug/pprof/profile -o cpu # Analyze the profile in interactive mode. go tool pprof ./cpu # At the prompt, get the top N functions most often running # or waiting during the sample period. (pprof) top10
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
收集统计信息并返回导致创建新操作系统线程的堆栈跟踪的 Go 运行时配置文件 报告。
debug | integer <int64> Enum: 0 1
|
seconds | string <int64> 要收集统计信息的秒数。
|
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Analyze the profile in interactive mode. go tool pprof http://localhost:8086/debug/pprof/threadcreate # `pprof` returns the following prompt: # Entering interactive mode (type "help" for commands, "o" for options) # (pprof) # At the prompt, get the top N entries. (pprof) top10
收集配置文件数据并返回当前程序的跟踪执行事件。
seconds | string <int64> 要收集配置文件数据的秒数。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Download the trace file. curl http://localhost:8086/debug/pprof/trace -o trace # Analyze the trace. go tool trace ./trace
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
返回关于 InfluxDB 实例工作负载性能的指标。
使用此端点获取性能、资源和使用指标。
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# HELP go_threads Number of OS threads created. # TYPE go_threads gauge go_threads 19 # HELP http_api_request_duration_seconds Time taken to respond to HTTP request # TYPE http_api_request_duration_seconds histogram http_api_request_duration_seconds_bucket{handler="platform",method="GET",path="/:fallback_path",response_code="200",status="2XX",user_agent="curl",le="0.005"} 4 http_api_request_duration_seconds_bucket{handler="platform",method="GET",path="/:fallback_path",response_code="200",status="2XX",user_agent="curl",le="0.01"} 4 http_api_request_duration_seconds_bucket{handler="platform",method="GET",path="/:fallback_path",response_code="200",status="2XX",user_agent="curl",le="0.025"} 5
创建和管理授权 (API 令牌)。
授权 包含组织资源的 read
和 write
权限列表,并提供用于身份验证的 API 令牌。授权属于一个组织,并且仅包含该组织的权限。
我们建议创建一个通用用户来创建和管理用于写入数据的令牌。
可选地,在创建授权时,您可以将其限定为特定用户。如果用户使用用户名和密码登录,创建用户会话,则该会话将携带用户所有授权授予的权限。有关更多信息,请参阅 如何将令牌分配给特定用户。要创建用户会话,请使用 POST /api/v2/signin
端点。
org | 字符串 组织名称。仅返回属于指定 组织 的授权。 |
orgID | 字符串 组织 ID。仅返回属于指定 组织 的授权。 |
令牌 | 字符串 API 令牌 值。通过其 InfluxDB OSS
限制
|
user | 字符串 用户名。仅返回范围限定为指定 用户 的授权。 |
用户ID | 字符串 用户 ID。仅返回范围限定为指定 用户 的授权。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- “授权”: [
- {
- "description": "string",
- "status": "活动",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- “权限”: [
- {
- "action": "读取",
- “资源”: {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "授权"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}
],
}
创建授权并返回带有生成的 API 令牌 的授权。
使用此端点创建授权,这将生成一个 API 令牌,该令牌具有对特定资源或资源 type
进行 read
或 write
的权限。API 令牌是授权的 token
属性值。
为了遵循安全 API 令牌生成和检索的最佳实践,InfluxDB 对 API 令牌强制执行访问限制。
我们建议您按照以下方式管理令牌
write-authorizations
write-user
用于授权范围限定的用户Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要创建的授权。
描述 | 字符串 令牌的描述。 |
orgID 必需 | 字符串 组织 ID。指定拥有授权的组织。 |
必需 | Array of objects (Permission) non-empty 授权的权限列表。在该列表中,至少提供一个 在 |
status | 字符串 默认值: "active" 枚举: "active" "inactive" 令牌的状态。如果为 |
用户ID | 字符串 用户 ID。指定授权范围限定的用户。 当用户使用用户名和密码进行身份验证时,InfluxDB 会生成一个用户会话,其中包含用户所有授权指定的所有权限。 |
创建授权。
{- "description": "iot_users read buckets",
- "orgID": "INFLUX_ORG_ID",
- “权限”: [
- {
- "action": "读取",
- “资源”: {
- "type": "buckets"
}
}
]
}
{- "description": "string",
- "status": "活动",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- “权限”: [
- {
- "action": "读取",
- “资源”: {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "授权"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}
检索授权。
使用此端点检索有关 API 令牌的信息,包括令牌的权限和令牌范围限定的用户。
authID 必需 | 字符串 授权 ID。指定要检索的授权。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "description": "string",
- "status": "活动",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- “权限”: [
- {
- "action": "读取",
- “资源”: {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "授权"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}
更新授权。
使用此端点将 API 令牌的状态设置为活动或非活动。InfluxDB 拒绝使用非活动 API 令牌的请求。
authID 必需 | 字符串 授权 ID。指定要更新的授权。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
在请求正文中,提供要更新的授权属性。
描述 | 字符串 令牌的描述。 |
status | 字符串 默认值: "active" 枚举: "active" "inactive" 令牌的状态。如果为 |
{- "description": "string",
- "status": "active"
}
{- "description": "string",
- "status": "活动",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- “权限”: [
- {
- "action": "读取",
- “资源”: {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "授权"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}
获取存储在服务器嵌入式 KV 存储中的元数据快照。高于 2.1.x 的 InfluxDB 版本不包含存储在嵌入式 SQL 中的元数据;避免在高于 2.1.x 的版本中使用此端点。
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
shardID 必需 | integer <int64> 分片 ID。 |
since | 字符串 <date-time> 示例
要包含在快照中的最早时间 RFC3339 日期/时间格式。 |
Accept-Encoding | 字符串 默认: identity 枚举: "gzip" "identity" 指示客户端可以理解的内容编码(通常是压缩算法)。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
after | 字符串 要从中查找的资源 ID。返回在指定记录之后创建的记录;结果不包括指定的记录。 使用 |
id | 字符串 存储桶 ID。仅返回具有指定 ID 的存储桶。 |
limit | integer [ 1 .. 100 ] 默认值: 20 限制返回的记录数。默认为 |
name | 字符串 存储桶名称。仅返回具有指定名称的存储桶。 |
偏移量 | integer >= 0 分页的偏移量。要跳过的记录数。 有关分页参数的更多信息,请参阅 分页。 |
org | 字符串 组织名称。 InfluxDB Cloud
InfluxDB OSS
|
orgID | 字符串 组织 ID。 InfluxDB Cloud
InfluxDB OSS
|
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
curl --request GET "http://localhost:8086/api/v2/buckets?name=_monitoring" \ --header "Authorization: Token INFLUX_TOKEN" \ --header "Accept: application/json" \ --header "Content-Type: application/json"
{- "buckets": [
- {
- "createdAt": "2022-03-15T17:22:33.72617939Z",
- "description": "System bucket for monitoring logs",
- "id": "77ca9dace40a9bfc",
- "labels": [ ],
- "links": {
- "labels": "/api/v2/buckets/77ca9dace40a9bfc/labels",
- "members": "/api/v2/buckets/77ca9dace40a9bfc/members",
- "org": "/api/v2/orgs/INFLUX_ORG_ID",
- "owners": "/api/v2/buckets/77ca9dace40a9bfc/owners",
- "self": "/api/v2/buckets/77ca9dace40a9bfc",
- "write": "/api/v2/write?org=ORG_ID&bucket=77ca9dace40a9bfc"
}, - "name": "_monitoring",
- "orgID": "INFLUX_ORG_ID",
- "retentionRules": [
- {
- "everySeconds": 604800,
- "type": "expire"
}
], - "schemaType": "implicit",
- "type": "system",
- "updatedAt": "2022-03-15T17:22:33.726179487Z"
}
], - "links": {
- "self": "/api/v2/buckets?descending=false&limit=20&name=_monitoring&offset=0&orgID=ORG_ID"
}
}
403
状态代码。有关 InfluxDB Cloud 产品的更多信息,请参阅 InfluxDB Cloud 定价。Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要创建的存储桶。
描述 | 字符串 存储桶的描述。 |
name 必需 | 字符串 存储桶名称。 |
orgID 必需 | 字符串 组织 ID。指定拥有存储桶的组织。 |
对象数组 (RetentionRules) 用于过期或保留数据的保留规则。InfluxDB InfluxDB Cloud
InfluxDB OSS
| |
rp | |
schemaType | string (SchemaType) 枚举: "implicit" "explicit" |
{- "description": "string",
- "name": "string",
- "orgID": "string",
- "retentionRules": [
- {
- "everySeconds": 86400,
- "shardGroupDurationSeconds": 0,
- "type": "expire"
}
], - "rp": "0",
- "schemaType": "implicit"
}
{- "createdAt": "2022-08-03T23:04:41.073704121Z",
- "description": "A bucket holding air sensor data",
- "id": "37407e232b3911d8",
- "labels": [ ],
- "links": {
- "labels": "/api/v2/buckets/37407e232b3911d8/labels",
- "members": "/api/v2/buckets/37407e232b3911d8/members",
- "org": "/api/v2/orgs/INFLUX_ORG_ID",
- "owners": "/api/v2/buckets/37407e232b3911d8/owners",
- "self": "/api/v2/buckets/37407e232b3911d8",
- "write": "/api/v2/write?org=INFLUX_ORG_ID&bucket=37407e232b3911d8"
}, - "name": "air_sensor",
- "orgID": "INFLUX_ORG_ID",
- "retentionRules": [
- {
- "everySeconds": 2592000,
- "type": "expire"
}
], - "schemaType": "implicit",
- "type": "user",
- "updatedAt": "2022-08-03T23:04:41.073704228Z"
}
删除存储桶和所有关联的记录。
当您发送删除请求时,执行以下操作
204
状态代码;否则返回错误。bucketID 必需 | 字符串 存储桶 ID。要删除的存储桶的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
curl --request DELETE "http://localhost:8086/api/v2/buckets/BUCKET_ID" \ --header "Authorization: Token INFLUX_TOKEN" \ --header 'Accept: application/json'
{- "code": "invalid",
- "message": "id 必须为 16 个字节长"
}
检索存储桶。
使用此端点检索特定存储桶的信息。
bucketID 必需 | 字符串 要检索的存储桶的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "createdAt": "2022-08-03T23:04:41.073704121Z",
- "description": "bucket for air sensor data",
- "id": "37407e232b3911d8",
- "labels": [ ],
- "links": {
- "labels": "/api/v2/buckets/37407e232b3911d8/labels",
- "members": "/api/v2/buckets/37407e232b3911d8/members",
- "org": "/api/v2/orgs/INFLUX_ORG_ID",
- "owners": "/api/v2/buckets/37407e232b3911d8/owners",
- "self": "/api/v2/buckets/37407e232b3911d8",
- "write": "/api/v2/write?org=INFLUX_ORG_ID&bucket=37407e232b3911d8"
}, - "name": "air-sensor",
- "orgID": "bea7ea952287f70d",
- "retentionRules": [
- {
- "everySeconds": 2592000,
- "type": "expire"
}
], - "schemaType": "implicit",
- "type": "user",
- "updatedAt": "2022-08-03T23:04:41.073704228Z"
}
更新存储桶。
使用此端点更新存储桶的属性(name
、description
和 retentionRules
)。
retentionRules
属性。如果您不提供 retentionRules
,InfluxDB 将响应 HTTP 403
状态代码。retentionRules
。bucketID 必需 | 字符串 存储桶 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要应用的存储桶更新。
描述 | 字符串 存储桶的描述。 |
name | 字符串 存储桶的名称。 |
对象数组 (PatchRetentionRules) 更新过期或保留数据的规则。没有规则意味着没有更新。 |
{- "description": "string",
- "name": "string",
- "retentionRules": [
- {
- "everySeconds": 86400,
- "shardGroupDurationSeconds": 0,
- "type": "expire"
}
]
}
{- "createdAt": "2022-08-03T23:04:41.073704121Z",
- "description": "bucket holding air sensor data",
- "id": "37407e232b3911d8",
- "labels": [ ],
- "links": {
- "labels": "/api/v2/buckets/37407e232b3911d8/labels",
- "members": "/api/v2/buckets/37407e232b3911d8/members",
- "org": "/api/v2/orgs/INFLUX_ORG_ID",
- "owners": "/api/v2/buckets/37407e232b3911d8/owners",
- "self": "/api/v2/buckets/37407e232b3911d8",
- "write": "/api/v2/write?org=INFLUX_ORG_ID&bucket=37407e232b3911d8"
}, - "name": "air_sensor",
- "orgID": "INFLUX_ORG_ID",
- "retentionRules": [
- {
- "everySeconds": 2592000,
- "type": "expire"
}
], - "schemaType": "implicit",
- "type": "user",
- "updatedAt": "2022-08-07T22:49:49.422962913Z"
}
列出存储桶的所有标签。
标签是包含 labelID
、name
、description
和 color
键值对的对象。它们可用于分组和筛选 InfluxDB 资源。标签还能够跨不同资源进行分组——例如,您可以将名为 air_sensor
的标签应用于存储桶和任务,以快速组织资源。
/api/v2/labels
InfluxDB API 端点 来检索和管理标签。bucketID 必需 | 字符串 要检索标签的存储桶的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- “标签”: [
- {
- "id": "09cbd068e7ebb000",
- "name": "production_buckets",
- "orgID": "INFLUX_ORG_ID"
}
], - "links": {
- "self": "/api/v2/labels"
}
}
向存储桶添加标签并返回新的标签信息。
标签是包含 labelID
、name
、description
和 color
键值对的对象。它们可用于跨一种或多种资源进行分组和筛选——例如,您可以将名为 air_sensor
的标签应用于存储桶和任务,以快速组织资源。
/api/v2/labels
端点 发送 POST
请求)。/api/v2/labels
InfluxDB API 端点 来检索和管理标签。bucketID 必需 | 字符串 存储桶 ID。要标记的存储桶的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
包含要添加到存储桶的 labelID
的对象。
labelID 必需 | 字符串 标签 ID。指定要附加的标签。 |
{- "labelID": "string"
}
{- "label": {
- "id": "09cbd068e7ebb000",
- "name": "production_buckets",
- "orgID": "INFLUX_ORG_ID"
}, - "links": {
- "self": "/api/v2/labels"
}
}
bucketID 必需 | 字符串 要检索用户的存储桶的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "links": {
- "self": "/api/v2/buckets/37407e232b3911d8/members"
}, - "users": [
- {
- "id": "791df274afd48a83",
- "links": {
- "self": "/api/v2/users/791df274afd48a83"
}, - "name": "example_user_1",
- "role": "member",
- "status": "active"
}, - {
- "id": "09cfb87051cbe000",
- "links": {
- "self": "/api/v2/users/09cfb87051cbe000"
}, - "name": "example_user_2",
- "role": "owner",
- "status": "active"
}
]
}
bucketID 必需 | 字符串 要检索用户的存储桶的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加为存储桶成员的用户。
id 必需 | 字符串 要添加到资源的用户的 ID。 |
name | 字符串 要添加到资源的用户的名称。 |
{- "id": "string",
- "name": "string"
}
{- "id": "09cfb87051cbe000",
- "links": {
- "self": "/api/v2/users/09cfb87051cbe000"
}, - "name": "example_user_1",
- "role": "member",
- "status": "active"
}
列出存储桶的所有所有者。
存储桶所有者有权删除存储桶并从存储桶中删除用户和成员权限。
owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。read-orgs INFLUX_ORG_ID
INFLUX_ORG_ID
是您要检索所有者列表的组织的 ID。
bucketID 必需 | 字符串 要检索所有者的存储桶的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "links": {
- "self": "/api/v2/buckets/BUCKET_ID/owners"
}, - "users": [
- {
- "id": "d88d182d91b0950f",
- "links": {
- "self": "/api/v2/users/d88d182d91b0950f"
}, - "name": "example-owner",
- "role": "owner",
- "status": "active"
}
]
}
向存储桶添加所有者,并返回具有角色和用户详细信息的所有者。
使用此端点为存储桶创建资源所有者。存储桶所有者有权删除存储桶并从存储桶中删除用户和成员权限。
owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。write-orgs INFLUX_ORG_ID
INFLUX_ORG_ID
* 是您要添加所有者的组织的 ID。bucketID 必需 | 字符串 要为其添加所有者的存储桶的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加为存储桶所有者的用户。
id 必需 | 字符串 要添加到资源的用户的 ID。 |
name | 字符串 要添加到资源的用户的名称。 |
{- "id": "d88d182d91b0950f",
- "links": {
- "self": "/api/v2/users/d88d182d91b0950f"
}, - "name": "example-user",
- "role": "owner",
- "status": "active"
}
{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "活动",
- "role": "owner"
}
从存储桶中删除所有者。
使用此端点删除用户对存储桶的 owner
角色。
owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。write-orgs INFLUX_ORG_ID
INFLUX_ORG_ID
是您要从中移除所有者的组织的 ID。
bucketID 必需 | 字符串 要从中删除所有者的存储桶的 ID。 |
用户ID 必需 | 字符串 要删除的所有者的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "code": "unauthorized",
- "message": "unauthorized access"
}
sourceID 必需 | 字符串 源 ID。 |
org | 字符串 组织的名称。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "buckets": [
- {
- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "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"
}, - "name": "string",
- "orgID": "string",
- "retentionRules": [
- {
- "everySeconds": 86400,
- "shardGroupDurationSeconds": 0,
- "type": "expire"
}
], - "rp": "string",
- "schemaType": "implicit",
- "type": "user",
- "updatedAt": "2019-08-24T14:15:22Z"
}
],
}
dashboardID 必需 | 字符串 要更新的仪表盘的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
将要添加的单元格
h | integer <int32> |
name | 字符串 |
usingView | 字符串 制作所提供视图的副本。 |
w | integer <int32> |
x | integer <int32> |
y | integer <int32> |
{- "h": 0,
- "name": "string",
- "usingView": "string",
- "w": 0,
- "x": 0,
- "y": 0
}
{- "h": 0,
- "id": "string",
- "links": {
- "self": "string",
- "view": "string"
}, - "viewID": "string",
- "w": 0,
- "x": 0,
- "y": 0
}
替换仪表盘中的所有单元格。这主要用于更新所有单元格的位置信息。
dashboardID 必需 | 字符串 要更新的仪表盘的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
h | integer <int32> |
id | 字符串 |
object | |
viewID | 字符串 引用视图 API 中的视图。 |
w | integer <int32> |
x | integer <int32> |
y | integer <int32> |
[- {
- "h": 0,
- "id": "string",
- "links": {
- "self": "string",
- "view": "string"
}, - "viewID": "string",
- "w": 0,
- "x": 0,
- "y": 0
}
]
{- "description": "string",
- "name": "string",
- "orgID": "string",
- "cells": [
- {
- "h": 0,
- "id": "string",
- "links": {
- "self": "string",
- "view": "string"
}, - "viewID": "string",
- "w": 0,
- "x": 0,
- "y": 0
}
], - "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "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"
}, - "meta": {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}
更新与单元格相关的非位置信息。更新单个单元格的位置数据可能会导致网格冲突。
cellID 必需 | 字符串 要更新的单元格的 ID。 |
dashboardID 必需 | 字符串 要更新的仪表盘的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
h | integer <int32> |
w | integer <int32> |
x | integer <int32> |
y | integer <int32> |
{- "h": 0,
- "w": 0,
- "x": 0,
- "y": 0
}
{- "h": 0,
- "id": "string",
- "links": {
- "self": "string",
- "view": "string"
}, - "viewID": "string",
- "w": 0,
- "x": 0,
- "y": 0
}
cellID 必需 | 字符串 单元格 ID。 |
dashboardID 必需 | 字符串 仪表盘 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "id": "string",
- "links": {
- "self": "string"
}, - "name": "string",
- “属性”: {
- "adaptiveZoomHide": true,
- "axes": {
- "x": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}, - "y": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}
}, - "colors": [
- {
- "hex": "strings",
- "id": "string",
- "name": "string",
- "type": "min",
- "value": 0
}
], - "decimalPlaces": {
- "digits": 0,
- "isEnforced": true
}, - "generateXAxisTicks": [
- "string"
], - "generateYAxisTicks": [
- "string"
], - "hoverDimension": "auto",
- "legendColorizeRows": true,
- "legendHide": true,
- "legendOpacity": 0,
- "legendOrientationThreshold": 0,
- "note": "string",
- "position": "overlaid",
- "prefix": "string",
- "queries": [
- {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}
], - "shadeBelow": true,
- "shape": "chronograf-v2",
- "showNoteWhenEmpty": true,
- "staticLegend": {
- "colorizeRows": true,
- "heightRatio": 0,
- "opacity": 0,
- "orientationThreshold": 0,
- "show": true,
- "valueAxis": "string",
- "widthRatio": 0
}, - "suffix": "string",
- "timeFormat": "string",
- "type": "line-plus-single-stat",
- "xColumn": "string",
- "xTickStart": 0,
- "xTickStep": 0,
- "xTotalTicks": 0,
- "yColumn": "string",
- "yTickStart": 0,
- "yTickStep": 0,
- "yTotalTicks": 0
}
}
cellID 必需 | 字符串 要更新的单元格的 ID。 |
dashboardID 必需 | 字符串 要更新的仪表盘的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
name 必需 | 字符串 |
必需 | LinePlusSingleStatProperties (object) 或 XYViewProperties (object) 或 SingleStatViewProperties (object) 或 HistogramViewProperties (object) 或 GaugeViewProperties (object) 或 TableViewProperties (object) 或 SimpleTableViewProperties (object) 或 MarkdownViewProperties (object) 或 CheckViewProperties (object) 或 ScatterViewProperties (object) 或 HeatmapViewProperties (object) 或 MosaicViewProperties (object) 或 BandViewProperties (object) 或 GeoViewProperties (object) (ViewProperties) |
{- "name": "string",
- “属性”: {
- "adaptiveZoomHide": true,
- "axes": {
- "x": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}, - "y": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}
}, - "colors": [
- {
- "hex": "strings",
- "id": "string",
- "name": "string",
- "type": "min",
- "value": 0
}
], - "decimalPlaces": {
- "digits": 0,
- "isEnforced": true
}, - "generateXAxisTicks": [
- "string"
], - "generateYAxisTicks": [
- "string"
], - "hoverDimension": "auto",
- "legendColorizeRows": true,
- "legendHide": true,
- "legendOpacity": 0,
- "legendOrientationThreshold": 0,
- "note": "string",
- "position": "overlaid",
- "prefix": "string",
- "queries": [
- {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}
], - "shadeBelow": true,
- "shape": "chronograf-v2",
- "showNoteWhenEmpty": true,
- "staticLegend": {
- "colorizeRows": true,
- "heightRatio": 0,
- "opacity": 0,
- "orientationThreshold": 0,
- "show": true,
- "valueAxis": "string",
- "widthRatio": 0
}, - "suffix": "string",
- "timeFormat": "string",
- "type": "line-plus-single-stat",
- "xColumn": "string",
- "xTickStart": 0,
- "xTickStep": 0,
- "xTotalTicks": 0,
- "yColumn": "string",
- "yTickStart": 0,
- "yTickStep": 0,
- "yTotalTicks": 0
}
}
{- "id": "string",
- "links": {
- "self": "string"
}, - "name": "string",
- “属性”: {
- "adaptiveZoomHide": true,
- "axes": {
- "x": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}, - "y": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}
}, - "colors": [
- {
- "hex": "strings",
- "id": "string",
- "name": "string",
- "type": "min",
- "value": 0
}
], - "decimalPlaces": {
- "digits": 0,
- "isEnforced": true
}, - "generateXAxisTicks": [
- "string"
], - "generateYAxisTicks": [
- "string"
], - "hoverDimension": "auto",
- "legendColorizeRows": true,
- "legendHide": true,
- "legendOpacity": 0,
- "legendOrientationThreshold": 0,
- "note": "string",
- "position": "overlaid",
- "prefix": "string",
- "queries": [
- {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}
], - "shadeBelow": true,
- "shape": "chronograf-v2",
- "showNoteWhenEmpty": true,
- "staticLegend": {
- "colorizeRows": true,
- "heightRatio": 0,
- "opacity": 0,
- "orientationThreshold": 0,
- "show": true,
- "valueAxis": "string",
- "widthRatio": 0
}, - "suffix": "string",
- "timeFormat": "string",
- "type": "line-plus-single-stat",
- "xColumn": "string",
- "xTickStart": 0,
- "xTickStep": 0,
- "xTotalTicks": 0,
- "yColumn": "string",
- "yTickStart": 0,
- "yTickStep": 0,
- "yTotalTicks": 0
}
}
limit | integer [ 1 .. 100 ] 默认值: 20 限制返回的记录数。默认为 |
偏移量 | integer >= 0 分页的偏移量。要跳过的记录数。 有关分页参数的更多信息,请参阅 分页。 |
orgID 必需 | 字符串 仅显示属于特定组织 ID 的检查项。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "checks": [
- {
- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "links": {
- "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"
}, - "name": "string",
- "orgID": "string",
- "ownerID": "string",
- "query": {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}, - "status": "活动",
- "taskID": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "every": "string",
- "level": "UNKNOWN",
- "offset": "string",
- "reportZero": true,
- "staleTime": "string",
- "statusMessageTemplate": "string",
- "tags": [
- {
- "key": "string",
- "value": "string"
}
], - "timeSince": "string",
- "type": "deadman"
}
],
}
要创建的检查项
描述 | 字符串 检查项的可选描述。 |
Array of objects (Labels) | |
name 必需 | 字符串 |
orgID 必需 | 字符串 拥有此检查项的组织的 ID。 |
必需 | object (DashboardQuery) |
status | string (TaskStatusType) 枚举: "active" "inactive"
|
taskID | 字符串 与此检查项关联的任务的 ID。 |
type 必需 | 字符串 custom PostCheck Check threshold deadman custom |
{- "description": "string",
- “标签”: [
- {
- "name": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "name": "string",
- "orgID": "string",
- "query": {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}, - "status": "活动",
- "taskID": "string",
- "type": "custom"
}
{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "links": {
- "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"
}, - "name": "string",
- "orgID": "string",
- "ownerID": "string",
- "query": {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}, - "status": "活动",
- "taskID": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "type": "custom"
}
checkID 必需 | 字符串 检查项 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "links": {
- "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"
}, - "name": "string",
- "orgID": "string",
- "ownerID": "string",
- "query": {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}, - "status": "活动",
- "taskID": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "type": "custom"
}
checkID 必需 | 字符串 检查项 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要应用的检查项更新
描述 | 字符串 |
name | 字符串 |
status | 字符串 枚举: "active" "inactive" |
{- "description": "string",
- "name": "string",
- "status": "active"
}
{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "links": {
- "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"
}, - "name": "string",
- "orgID": "string",
- "ownerID": "string",
- "query": {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}, - "status": "活动",
- "taskID": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "type": "custom"
}
checkID 必需 | 字符串 检查项 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要应用的检查项更新
描述 | 字符串 检查项的可选描述。 |
Array of objects (Labels) | |
name 必需 | 字符串 |
orgID 必需 | 字符串 拥有此检查项的组织的 ID。 |
必需 | object (DashboardQuery) |
status | string (TaskStatusType) 枚举: "active" "inactive"
|
taskID | 字符串 与此检查项关联的任务的 ID。 |
type 必需 | 字符串 custom PostCheck Check threshold deadman custom |
{- "description": "string",
- “标签”: [
- {
- "name": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "name": "string",
- "orgID": "string",
- "query": {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}, - "status": "活动",
- "taskID": "string",
- "type": "custom"
}
{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "links": {
- "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"
}, - "name": "string",
- "orgID": "string",
- "ownerID": "string",
- "query": {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}, - "status": "活动",
- "taskID": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "type": "custom"
}
checkID 必需 | 字符串 检查项 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加的标签
labelID 必需 | 字符串 标签 ID。指定要附加的标签。 |
{- "labelID": "string"
}
{- "label": {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
},
}
检索为 InfluxDB 实例配置的功能标志键值对。功能标志是用于开发和测试实验性 InfluxDB 功能的配置选项,仅供内部使用。
此端点代表配置功能标志的以下三步过程的第一步
按照说明启用、禁用或覆盖功能标志的值。
可选:要确认您的更改已应用,请执行以下操作之一
GET /api/v2/config
端点发送请求以检索当前运行时服务器配置。Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{ }
降序 | boolean 默认值: false |
id | Array of strings 仪表盘 ID 列表。仅返回指定的仪表盘。如果同时指定 |
limit | integer [ 1 .. 100 ] 默认值: 20 限制返回的记录数。默认为 |
偏移量 | integer >= 0 分页的偏移量。要跳过的记录数。 有关分页参数的更多信息,请参阅 分页。 |
org | |
orgID | |
owner | 字符串 用户 ID。仅返回指定用户拥有 |
sortBy | 字符串 Enum: "ID" "CreatedAt" "UpdatedAt" 要排序的列。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "dashboards": [
- {
- "description": "string",
- "name": "string",
- "orgID": "string",
- "cells": [
- {
- "h": 0,
- "id": "string",
- "links": {
- "self": "string",
- "view": "string"
}, - "viewID": "string",
- "w": 0,
- "x": 0,
- "y": 0
}
], - "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "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"
}, - "meta": {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}
],
}
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要创建的仪表盘
描述 | 字符串 面向用户的仪表盘描述。 |
name 必需 | 字符串 面向用户的仪表盘名称。 |
orgID 必需 | 字符串 拥有该仪表盘的组织的 ID。 |
{- "description": "string",
- "name": "string",
- "orgID": "string"
}
{- "description": "string",
- "name": "string",
- "orgID": "string",
- "cells": [
- {
- "h": 0,
- "id": "string",
- "links": {
- "self": "string",
- "view": "string"
}, - "viewID": "string",
- "w": 0,
- "x": 0,
- "y": 0
}
], - "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "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"
}, - "meta": {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}
dashboardID 必需 | 字符串 要更新的仪表盘的 ID。 |
include | 字符串 Value: "properties" 如果为 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "description": "string",
- "name": "string",
- "orgID": "string",
- "cells": [
- {
- "h": 0,
- "id": "string",
- "links": {
- "self": "string",
- "view": "string"
}, - "viewID": "string",
- "w": 0,
- "x": 0,
- "y": 0
}
], - "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "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"
}, - "meta": {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}
dashboardID 必需 | 字符串 要更新的仪表盘的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
仪表盘的修补
object (schemas) | |
描述 | 字符串 可选,如果提供,将替换描述 |
name | 字符串 可选,如果提供,将替换名称 |
{- "cells": {
- "h": 0,
- "id": "string",
- "links": {
- "self": "string",
- "view": "string"
}, - "viewID": "string",
- "w": 0,
- "x": 0,
- "y": 0,
- "name": "string",
- “属性”: {
- "adaptiveZoomHide": true,
- "axes": {
- "x": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}, - "y": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}
}, - "colors": [
- {
- "hex": "strings",
- "id": "string",
- "name": "string",
- "type": "min",
- "value": 0
}
], - "decimalPlaces": {
- "digits": 0,
- "isEnforced": true
}, - "generateXAxisTicks": [
- "string"
], - "generateYAxisTicks": [
- "string"
], - "hoverDimension": "auto",
- "legendColorizeRows": true,
- "legendHide": true,
- "legendOpacity": 0,
- "legendOrientationThreshold": 0,
- "note": "string",
- "position": "overlaid",
- "prefix": "string",
- "queries": [
- {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}
], - "shadeBelow": true,
- "shape": "chronograf-v2",
- "showNoteWhenEmpty": true,
- "staticLegend": {
- "colorizeRows": true,
- "heightRatio": 0,
- "opacity": 0,
- "orientationThreshold": 0,
- "show": true,
- "valueAxis": "string",
- "widthRatio": 0
}, - "suffix": "string",
- "timeFormat": "string",
- "type": "line-plus-single-stat",
- "xColumn": "string",
- "xTickStart": 0,
- "xTickStep": 0,
- "xTotalTicks": 0,
- "yColumn": "string",
- "yTickStart": 0,
- "yTickStep": 0,
- "yTotalTicks": 0
}
}, - "description": "string",
- "name": "string"
}
{- "description": "string",
- "name": "string",
- "orgID": "string",
- "cells": [
- {
- "h": 0,
- "id": "string",
- "links": {
- "self": "string",
- "view": "string"
}, - "viewID": "string",
- "w": 0,
- "x": 0,
- "y": 0
}
], - "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "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"
}, - "meta": {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}
dashboardID 必需 | 字符串 要更新的仪表盘的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
将要添加的单元格
h | integer <int32> |
name | 字符串 |
usingView | 字符串 制作所提供视图的副本。 |
w | integer <int32> |
x | integer <int32> |
y | integer <int32> |
{- "h": 0,
- "name": "string",
- "usingView": "string",
- "w": 0,
- "x": 0,
- "y": 0
}
{- "h": 0,
- "id": "string",
- "links": {
- "self": "string",
- "view": "string"
}, - "viewID": "string",
- "w": 0,
- "x": 0,
- "y": 0
}
替换仪表盘中的所有单元格。这主要用于更新所有单元格的位置信息。
dashboardID 必需 | 字符串 要更新的仪表盘的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
h | integer <int32> |
id | 字符串 |
object | |
viewID | 字符串 引用视图 API 中的视图。 |
w | integer <int32> |
x | integer <int32> |
y | integer <int32> |
[- {
- "h": 0,
- "id": "string",
- "links": {
- "self": "string",
- "view": "string"
}, - "viewID": "string",
- "w": 0,
- "x": 0,
- "y": 0
}
]
{- "description": "string",
- "name": "string",
- "orgID": "string",
- "cells": [
- {
- "h": 0,
- "id": "string",
- "links": {
- "self": "string",
- "view": "string"
}, - "viewID": "string",
- "w": 0,
- "x": 0,
- "y": 0
}
], - "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "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"
}, - "meta": {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}
更新与单元格相关的非位置信息。更新单个单元格的位置数据可能会导致网格冲突。
cellID 必需 | 字符串 要更新的单元格的 ID。 |
dashboardID 必需 | 字符串 要更新的仪表盘的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
h | integer <int32> |
w | integer <int32> |
x | integer <int32> |
y | integer <int32> |
{- "h": 0,
- "w": 0,
- "x": 0,
- "y": 0
}
{- "h": 0,
- "id": "string",
- "links": {
- "self": "string",
- "view": "string"
}, - "viewID": "string",
- "w": 0,
- "x": 0,
- "y": 0
}
cellID 必需 | 字符串 单元格 ID。 |
dashboardID 必需 | 字符串 仪表盘 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "id": "string",
- "links": {
- "self": "string"
}, - "name": "string",
- “属性”: {
- "adaptiveZoomHide": true,
- "axes": {
- "x": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}, - "y": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}
}, - "colors": [
- {
- "hex": "strings",
- "id": "string",
- "name": "string",
- "type": "min",
- "value": 0
}
], - "decimalPlaces": {
- "digits": 0,
- "isEnforced": true
}, - "generateXAxisTicks": [
- "string"
], - "generateYAxisTicks": [
- "string"
], - "hoverDimension": "auto",
- "legendColorizeRows": true,
- "legendHide": true,
- "legendOpacity": 0,
- "legendOrientationThreshold": 0,
- "note": "string",
- "position": "overlaid",
- "prefix": "string",
- "queries": [
- {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}
], - "shadeBelow": true,
- "shape": "chronograf-v2",
- "showNoteWhenEmpty": true,
- "staticLegend": {
- "colorizeRows": true,
- "heightRatio": 0,
- "opacity": 0,
- "orientationThreshold": 0,
- "show": true,
- "valueAxis": "string",
- "widthRatio": 0
}, - "suffix": "string",
- "timeFormat": "string",
- "type": "line-plus-single-stat",
- "xColumn": "string",
- "xTickStart": 0,
- "xTickStep": 0,
- "xTotalTicks": 0,
- "yColumn": "string",
- "yTickStart": 0,
- "yTickStep": 0,
- "yTotalTicks": 0
}
}
cellID 必需 | 字符串 要更新的单元格的 ID。 |
dashboardID 必需 | 字符串 要更新的仪表盘的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
name 必需 | 字符串 |
必需 | LinePlusSingleStatProperties (object) 或 XYViewProperties (object) 或 SingleStatViewProperties (object) 或 HistogramViewProperties (object) 或 GaugeViewProperties (object) 或 TableViewProperties (object) 或 SimpleTableViewProperties (object) 或 MarkdownViewProperties (object) 或 CheckViewProperties (object) 或 ScatterViewProperties (object) 或 HeatmapViewProperties (object) 或 MosaicViewProperties (object) 或 BandViewProperties (object) 或 GeoViewProperties (object) (ViewProperties) |
{- "name": "string",
- “属性”: {
- "adaptiveZoomHide": true,
- "axes": {
- "x": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}, - "y": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}
}, - "colors": [
- {
- "hex": "strings",
- "id": "string",
- "name": "string",
- "type": "min",
- "value": 0
}
], - "decimalPlaces": {
- "digits": 0,
- "isEnforced": true
}, - "generateXAxisTicks": [
- "string"
], - "generateYAxisTicks": [
- "string"
], - "hoverDimension": "auto",
- "legendColorizeRows": true,
- "legendHide": true,
- "legendOpacity": 0,
- "legendOrientationThreshold": 0,
- "note": "string",
- "position": "overlaid",
- "prefix": "string",
- "queries": [
- {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}
], - "shadeBelow": true,
- "shape": "chronograf-v2",
- "showNoteWhenEmpty": true,
- "staticLegend": {
- "colorizeRows": true,
- "heightRatio": 0,
- "opacity": 0,
- "orientationThreshold": 0,
- "show": true,
- "valueAxis": "string",
- "widthRatio": 0
}, - "suffix": "string",
- "timeFormat": "string",
- "type": "line-plus-single-stat",
- "xColumn": "string",
- "xTickStart": 0,
- "xTickStep": 0,
- "xTotalTicks": 0,
- "yColumn": "string",
- "yTickStart": 0,
- "yTickStep": 0,
- "yTotalTicks": 0
}
}
{- "id": "string",
- "links": {
- "self": "string"
}, - "name": "string",
- “属性”: {
- "adaptiveZoomHide": true,
- "axes": {
- "x": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}, - "y": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}
}, - "colors": [
- {
- "hex": "strings",
- "id": "string",
- "name": "string",
- "type": "min",
- "value": 0
}
], - "decimalPlaces": {
- "digits": 0,
- "isEnforced": true
}, - "generateXAxisTicks": [
- "string"
], - "generateYAxisTicks": [
- "string"
], - "hoverDimension": "auto",
- "legendColorizeRows": true,
- "legendHide": true,
- "legendOpacity": 0,
- "legendOrientationThreshold": 0,
- "note": "string",
- "position": "overlaid",
- "prefix": "string",
- "queries": [
- {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}
], - "shadeBelow": true,
- "shape": "chronograf-v2",
- "showNoteWhenEmpty": true,
- "staticLegend": {
- "colorizeRows": true,
- "heightRatio": 0,
- "opacity": 0,
- "orientationThreshold": 0,
- "show": true,
- "valueAxis": "string",
- "widthRatio": 0
}, - "suffix": "string",
- "timeFormat": "string",
- "type": "line-plus-single-stat",
- "xColumn": "string",
- "xTickStart": 0,
- "xTickStep": 0,
- "xTotalTicks": 0,
- "yColumn": "string",
- "yTickStart": 0,
- "yTickStep": 0,
- "yTotalTicks": 0
}
}
dashboardID 必需 | 字符串 仪表盘 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加的标签
labelID 必需 | 字符串 标签 ID。指定要附加的标签。 |
{- "labelID": "string"
}
{- "label": {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
},
}
dashboardID 必需 | 字符串 仪表盘 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加为成员的用户
id 必需 | 字符串 要添加到资源的用户的 ID。 |
name | 字符串 要添加到资源的用户的名称。 |
{- "id": "string",
- "name": "string"
}
{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "活动",
- "role": "member"
}
dashboardID 必需 | 字符串 仪表盘 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加为所有者的用户
id 必需 | 字符串 要添加到资源的用户的 ID。 |
name | 字符串 要添加到资源的用户的名称。 |
{- "id": "string",
- "name": "string"
}
{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "活动",
- "role": "owner"
}
bucketID | 字符串 存储桶 ID。仅返回属于指定存储桶的 DBRP 映射。 |
db | 字符串 数据库。仅返回属于 1.x 数据库的 DBRP 映射。 |
default | boolean 指定默认设置的筛选 |
id | 字符串 DBPR 映射 ID。仅返回指定的 DBRP 映射。 |
org | 字符串 组织名称。仅返回指定组织的 DBRP 映射。 |
orgID | 字符串 组织 ID。仅返回指定组织的 DBRP 映射。 |
rp | 字符串 一个 保留策略。指定要筛选的 1.x 保留策略。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "content": [
- {
- "bucketID": "4d4d9d5b61dee751",
- "database": "example_database_1",
- "default": true,
- "id": "0a3cbb5dd526a000",
- "orgID": "bea7ea952287f70d",
- "retention_policy": "autogen"
}, - {
- "bucketID": "4d4d9d5b61dee751",
- "database": "example_database_2",
- "default": false,
- "id": "0a3cbcde20e38000",
- "orgID": "bea7ea952287f70d",
- "retention_policy": "example_retention_policy"
}
]
}
创建数据库保留策略 (DBRP) 映射并返回映射。
使用此端点向 InfluxDB Cloud 或 InfluxDB OSS 2.x 存储桶添加 InfluxDB 1.x API 兼容性。您的存储桶必须包含 DBRP 映射才能使用 InfluxDB 1.x API 查询和写入。 object.
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加的数据库保留策略映射。
请注意,retention_policy
是请求正文中的必需参数。retention_policy
的值可以是任何任意 string
名称或值,默认值通常设置为 autogen
。retention_policy
的值不是一个 保留策略
bucketID 必需 | 字符串 存储桶 ID。标识用作翻译目标的存储桶。 |
数据库 必需 | 字符串 数据库名称。标识 InfluxDB v1 数据库。 |
default | boolean 设置为 |
org | 字符串 组织名称。标识拥有此映射的组织。 |
orgID | 字符串 组织 ID。标识拥有此映射的组织。 |
retention_policy 必需 | 字符串 保留策略名称。标识 InfluxDB v1 保留策略映射。 |
{- "bucketID": "string",
- "database": "string",
- "default": true,
- "org": "string",
- "orgID": "string",
- "retention_policy": "string"
}
{- "bucketID": "4d4d9d5b61dee751",
- "database": "example_database",
- "default": true,
- "id": "0a3cbb5dd526a000",
- "orgID": "bea7ea952287f70d",
- "retention_policy": "autogen"
}
dbrpID 必需 | 字符串 DBRP 映射 ID。指定 DBRP 映射。 |
org | 字符串 组织名称。指定拥有 DBRP 映射的组织。 |
orgID | 字符串 组织 ID。指定拥有 DBRP 映射的组织。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "content": {
- "bucketID": "4d4d9d5b61dee751",
- "database": "example_database_1",
- "default": true,
- "id": "0a3cbb5dd526a000",
- "orgID": "bea7ea952287f70d",
- "retention_policy": "autogen"
}
}
dbrpID 必需 | 字符串 DBRP 映射 ID。指定 DBRP 映射。 |
org | 字符串 组织名称。指定拥有 DBRP 映射的组织。 |
orgID | 字符串 组织 ID。指定拥有 DBRP 映射的组织。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
default | boolean 设置为 |
retention_policy | 字符串 保留策略名称。标识 InfluxDB v1 保留策略映射。 |
{- "default": true,
- "retention_policy": "string"
}
{- "content": {
- "bucketID": "4d4d9d5b61dee751",
- "database": "example_database",
- "default": false,
- "id": "0a3cbb5dd526a000",
- "orgID": "bea7ea952287f70d",
- "retention_policy": "example_retention_policy"
}
}
生成性能分析和跟踪报告。
使用 /debug/pprof
下的路由来分析 InfluxDB 的 Go 运行时。这些端点生成 Go 运行时配置文件 和 trace 报告。配置文件是堆栈跟踪的集合,显示导致特定事件实例(例如,分配)的调用序列。
有关 pprof 配置文件和 trace 报告的更多信息,请参阅以下资源
收集样本并返回以下 Go 运行时配置文件 的报告
cpu
查询参数来包含。等效于来自 GET /debug/pprof/profile?seconds=NUMBER_OF_SECONDS
的报告。cpu |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Download and extract a `tar.gz` of all profiles after 10 seconds of CPU sampling. curl "http://localhost:8086/debug/pprof/all?cpu=10s" | tar -xz # x profiles/cpu.pb.gz # x profiles/goroutine.pb.gz # x profiles/block.pb.gz # x profiles/mutex.pb.gz # x profiles/heap.pb.gz # x profiles/allocs.pb.gz # x profiles/threadcreate.pb.gz # Analyze a profile. go tool pprof profiles/heap.pb.gz
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
返回所有过去内存分配的 Go 运行时配置文件 报告。 allocs 与 heap 配置文件相同,但将默认 pprof 显示更改为 -alloc_space,即自程序开始以来分配的总字节数(包括垃圾回收的字节数)。
debug | integer <int64> Enum: 0 1
|
seconds | string <int64> 要收集统计信息的秒数。
|
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Analyze the profile in interactive mode. go tool pprof http://localhost:8086/debug/pprof/allocs # `pprof` returns the following prompt: # Entering interactive mode (type "help" for commands, "o" for options) # (pprof) # At the prompt, get the top N memory allocations. (pprof) top10
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
收集样本并返回导致阻塞同步原语的堆栈跟踪的 Go 运行时配置文件 报告。
debug | integer <int64> Enum: 0 1
|
seconds | string <int64> 要收集统计信息的秒数。
|
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Analyze the profile in interactive mode. go tool pprof http://localhost:8086/debug/pprof/block # `pprof` returns the following prompt: # Entering interactive mode (type "help" for commands, "o" for options) # (pprof) # At the prompt, get the top N entries. (pprof) top10
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
收集统计信息并返回所有当前 goroutine 的 Go 运行时配置文件 报告。
debug | integer <int64> Enum: 0 1
|
seconds | string <int64> 要收集统计信息的秒数。
|
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Analyze the profile in interactive mode. go tool pprof http://localhost:8086/debug/pprof/goroutine # `pprof` returns the following prompt: # Entering interactive mode (type "help" for commands, "o" for options) # (pprof) # At the prompt, get the top N entries. (pprof) top10
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
收集统计信息并返回活动对象的内存分配的 Go 运行时配置文件 报告。
要在采样前运行垃圾回收,请传递值为 1
的 gc
查询参数。
debug | integer <int64> Enum: 0 1
|
gc | integer <int64> Enum: 0 1
|
seconds | string <int64> 要收集统计信息的秒数。
|
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Analyze the profile in interactive mode. go tool pprof http://localhost:8086/debug/pprof/heap # `pprof` returns the following prompt: # Entering interactive mode (type "help" for commands, "o" for options) # (pprof) # At the prompt, get the top N memory-intensive nodes. (pprof) top10 # pprof displays the list: # Showing nodes accounting for 142.46MB, 85.43% of 166.75MB total # Dropped 895 nodes (cum <= 0.83MB) # Showing top 10 nodes out of 143
收集统计信息并返回锁争用的 Go 运行时配置文件 报告。该配置文件包含有争议的互斥锁(mutexes)持有者的堆栈跟踪。
debug | integer <int64> Enum: 0 1
|
seconds | string <int64> 要收集统计信息的秒数。
|
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Analyze the profile in interactive mode. go tool pprof http://localhost:8086/debug/pprof/mutex # `pprof` returns the following prompt: # Entering interactive mode (type "help" for commands, "o" for options) # (pprof) # At the prompt, get the top N entries. (pprof) top10
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
收集统计信息并返回执行堆栈上程序计数器的 Go 运行时配置文件 报告。
seconds | string <int64> 要收集配置文件数据的秒数。默认为 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Download the profile report. curl http://localhost:8086/debug/pprof/profile -o cpu # Analyze the profile in interactive mode. go tool pprof ./cpu # At the prompt, get the top N functions most often running # or waiting during the sample period. (pprof) top10
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
收集统计信息并返回导致创建新操作系统线程的堆栈跟踪的 Go 运行时配置文件 报告。
debug | integer <int64> Enum: 0 1
|
seconds | string <int64> 要收集统计信息的秒数。
|
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Analyze the profile in interactive mode. go tool pprof http://localhost:8086/debug/pprof/threadcreate # `pprof` returns the following prompt: # Entering interactive mode (type "help" for commands, "o" for options) # (pprof) # At the prompt, get the top N entries. (pprof) top10
收集配置文件数据并返回当前程序的跟踪执行事件。
seconds | string <int64> 要收集配置文件数据的秒数。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# Download the trace file. curl http://localhost:8086/debug/pprof/trace -o trace # Analyze the trace. go tool trace ./trace
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
从存储桶中删除数据。
使用此端点从指定时间范围内的存储桶中删除点。
当您发送删除请求时,执行以下操作
2xx
状态代码)响应;否则为错误。为确保 InfluxDB Cloud 按照您请求的顺序处理写入和删除操作,请等待成功响应(HTTP 2xx
状态代码),然后再发送下一个请求。
由于写入和删除操作是异步的,因此当您收到响应时,您的更改可能尚未可读。
write-buckets
或 write-bucket BUCKET_ID
。BUCKET_ID
是目标存储桶的 ID。
应用 write
速率限制。有关更多信息,请参阅限制和可调整的配额。
bucket | 字符串 存储桶名称或 ID。指定要从中删除数据的存储桶。如果您同时传递 |
bucketID | 字符串 存储桶 ID。指定要从中删除数据的存储桶。如果您同时传递 |
org | 字符串 组织名称或 ID。 InfluxDB Cloud
InfluxDB OSS
|
orgID | 字符串 组织 ID。 InfluxDB Cloud
InfluxDB OSS
|
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
时间范围参数和可选的 删除谓词表达式。
要在指定时间范围内选择要删除的点,请在请求正文的 predicate
属性中传递 删除谓词表达式。如果您不传递 predicate
,则 InfluxDB 会删除时间戳在指定时间范围内的所有数据。
predicate | 字符串 删除谓词语法中的表达式。 |
start 必需 | 字符串 <date-time> 时间戳 (RFC3339 日期/时间格式)。要从中删除的最早时间。 |
stop 必需 | 字符串 <date-time> 时间戳 (RFC3339 日期/时间格式)。要从中删除的最晚时间。 |
{- "predicate": "tag1=\"value1\" and (tag2=\"value2\" and tag3!=\"value3\")",
- "start": "2019-08-24T14:15:22Z",
- "stop": "2019-08-24T14:15:22Z"
}
{- "code": "invalid",
- "message": "failed to decode request body: organization not found"
}
要创建的标签。
name 必需 | 字符串 |
orgID 必需 | 字符串 |
object 与此标签关联的键值对。 要删除属性,请发送一个更新,其中键的值为空 ( |
{- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
{- "label": {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
},
}
labelID 必需 | 字符串 要更新的标签的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
标签更新。
name | 字符串 |
object |
{- "name": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
{- "label": {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
},
}
authID | 字符串 授权 ID。返回指定的旧版授权。 |
org | 字符串 组织名称。仅返回属于指定组织的旧版授权。 |
orgID | 字符串 组织 ID。仅返回属于指定组织的旧版授权。 |
令牌 | 字符串 授权名称令牌。仅返回具有指定名称的旧版授权。 |
user | 字符串 用户名。仅返回作用域限定为指定用户的旧版授权。 |
用户ID | 字符串 用户 ID。仅返回作用域限定为指定用户的旧版授权。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- “授权”: [
- {
- "description": "string",
- "status": "活动",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- “权限”: [
- {
- "action": "读取",
- “资源”: {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "授权"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}
],
}
创建旧版授权并返回该旧版授权。
userID
属性,则为 write-users USER_ID
。USER_ID
是您要将授权范围限定到的用户的 ID。
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要创建的旧版授权。
描述 | 字符串 令牌的描述。 |
orgID 必需 | 字符串 组织 ID。标识授权范围限定到的组织。 |
必需 | Array of objects (Permission) non-empty 提供对组织资源 |
status | 字符串 默认值: "active" 枚举: "active" "inactive" 令牌的状态。如果为 |
令牌 | 字符串 您为授权提供的名称。 |
用户ID | 字符串 用户 ID。标识授权范围限定到的用户。 |
{- "description": "string",
- "status": "活动",
- "orgID": "string",
- “权限”: [
- {
- "action": "读取",
- “资源”: {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "授权"
}
}
], - "token": "string",
- "userID": "string"
}
{- "description": "string",
- "status": "活动",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- “权限”: [
- {
- "action": "读取",
- “资源”: {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "授权"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}
authID 必需 | 字符串 要获取的旧版授权的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "description": "string",
- "status": "活动",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- “权限”: [
- {
- "action": "读取",
- “资源”: {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "授权"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}
authID 必需 | 字符串 要更新的旧版授权的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要更新的旧版授权
描述 | 字符串 令牌的描述。 |
status | 字符串 默认值: "active" 枚举: "active" "inactive" 令牌的状态。如果为 |
{- "description": "string",
- "status": "active"
}
{- "description": "string",
- "status": "活动",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- “权限”: [
- {
- "action": "读取",
- “资源”: {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "授权"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}
authID 必需 | 字符串 要更新的旧版授权的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
新密码
password 必需 | 字符串 |
{- "password": "string"
}
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
使用 InfluxQL 查询 InfluxDB。
db 必需 | 字符串 从中查询数据的数据库。这映射到 InfluxDB 存储桶。有关更多信息,请参阅数据库和保留策略映射。 |
epoch | |
p | 字符串 用于验证请求的 InfluxDB 1.x 密码。 |
q 必需 | 字符串 要执行的 InfluxQL 查询。要执行多个查询,请使用分号 ( |
rp | 字符串 从中查询数据的保留策略。这映射到 InfluxDB 存储桶。有关更多信息,请参阅数据库和保留策略映射。 |
u | 字符串 用于验证请求的 InfluxDB 1.x 用户名。 |
Accept | 字符串 默认值: application/json 枚举: "application/json" "application/csv" "text/csv" "application/x-msgpack" 客户端可以理解的媒体类型。 注意:使用 |
Accept-Encoding | 字符串 默认: identity 枚举: "gzip" "identity" 客户端可以理解的内容编码(通常是压缩算法)。 |
Content-Type | 字符串 值: "application/json" |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
db 必需 | 字符串 要写入的存储桶。如果不存在,InfluxDB 将创建一个具有默认 3 天保留策略的存储桶。 |
p | 字符串 用于验证请求的 InfluxDB 1.x 密码。 |
精度 | 字符串 写入精度。 |
rp | 字符串 保留策略名称。 |
u | 字符串 用于验证请求的 InfluxDB 1.x 用户名。 |
Content-Encoding | 字符串 默认: identity 枚举: "gzip" "identity" 如果存在,则其值向数据库指示压缩已应用于行协议正文。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
行协议正文
{- "code": "internal error",
- "err": "string",
- "line": 0,
- "message": "string",
- "op": "string"
}
返回关于 InfluxDB 实例工作负载性能的指标。
使用此端点获取性能、资源和使用指标。
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# HELP go_threads Number of OS threads created. # TYPE go_threads gauge go_threads 19 # HELP http_api_request_duration_seconds Time taken to respond to HTTP request # TYPE http_api_request_duration_seconds histogram http_api_request_duration_seconds_bucket{handler="platform",method="GET",path="/:fallback_path",response_code="200",status="2XX",user_agent="curl",le="0.005"} 4 http_api_request_duration_seconds_bucket{handler="platform",method="GET",path="/:fallback_path",response_code="200",status="2XX",user_agent="curl",le="0.01"} 4 http_api_request_duration_seconds_bucket{handler="platform",method="GET",path="/:fallback_path",response_code="200",status="2XX",user_agent="curl",le="0.025"} 5
limit | integer [ 1 .. 100 ] 默认值: 20 限制返回的记录数。默认为 |
偏移量 | integer >= 0 分页的偏移量。要跳过的记录数。 有关分页参数的更多信息,请参阅 分页。 |
orgID 必需 | 字符串 仅显示属于特定组织 ID 的通知端点。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "notificationEndpoints": [
- {
- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "labels": "/api/v2/notificationEndpoints/1/labels",
- "members": "/api/v2/notificationEndpoints/1/members",
- "owners": "/api/v2/notificationEndpoints/1/owners",
- "self": "/api/v2/notificationEndpoints/1"
}, - "name": "string",
- "orgID": "string",
- "status": "活动",
- "type": "slack",
- "updatedAt": "2019-08-24T14:15:22Z",
- "userID": "string",
- "token": "string",
- "url": "string"
}
]
}
要创建的通知端点
authMethod 必需 | 字符串 枚举: "none" "basic" "bearer" |
contentTemplate | 字符串 |
描述 | 字符串 通知端点的可选描述。 |
object 自定义标头。 | |
id | 字符串 |
Array of objects (Labels) | |
method 必需 | 字符串 枚举: "POST" "GET" "PUT" |
name 必需 | 字符串 |
orgID | 字符串 |
password | 字符串 |
status | 字符串 默认值: "active" 枚举: "active" "inactive" 端点的状态。 |
令牌 | 字符串 |
type 必需 | string (NotificationEndpointType) http PostNotificationEndpoint NotificationEndpoint slack pagerduty http telegram |
url 必需 | 字符串 |
用户ID | 字符串 |
username | 字符串 |
{- "description": "string",
- "id": "string",
- “标签”: [
- {
- "name": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "name": "string",
- "orgID": "string",
- "status": "活动",
- "type": "http",
- "userID": "string",
- "authMethod": "none",
- "contentTemplate": "string",
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "method": "POST",
- "password": "string",
- "token": "string",
- "url": "string",
- "username": "string"
}
{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "labels": "/api/v2/notificationEndpoints/1/labels",
- "members": "/api/v2/notificationEndpoints/1/members",
- "owners": "/api/v2/notificationEndpoints/1/owners",
- "self": "/api/v2/notificationEndpoints/1"
}, - "name": "string",
- "orgID": "string",
- "status": "活动",
- "type": "http",
- "updatedAt": "2019-08-24T14:15:22Z",
- "userID": "string",
- "authMethod": "none",
- "contentTemplate": "string",
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "method": "POST",
- "password": "string",
- "token": "string",
- "url": "string",
- "username": "string"
}
endpointID 必需 | 字符串 通知端点 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "labels": "/api/v2/notificationEndpoints/1/labels",
- "members": "/api/v2/notificationEndpoints/1/members",
- "owners": "/api/v2/notificationEndpoints/1/owners",
- "self": "/api/v2/notificationEndpoints/1"
}, - "name": "string",
- "orgID": "string",
- "status": "活动",
- "type": "http",
- "updatedAt": "2019-08-24T14:15:22Z",
- "userID": "string",
- "authMethod": "none",
- "contentTemplate": "string",
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "method": "POST",
- "password": "string",
- "token": "string",
- "url": "string",
- "username": "string"
}
endpointID 必需 | 字符串 通知端点 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要应用的检查项更新
描述 | 字符串 |
name | 字符串 |
status | 字符串 枚举: "active" "inactive" |
{- "description": "string",
- "name": "string",
- "status": "active"
}
{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "labels": "/api/v2/notificationEndpoints/1/labels",
- "members": "/api/v2/notificationEndpoints/1/members",
- "owners": "/api/v2/notificationEndpoints/1/owners",
- "self": "/api/v2/notificationEndpoints/1"
}, - "name": "string",
- "orgID": "string",
- "status": "活动",
- "type": "http",
- "updatedAt": "2019-08-24T14:15:22Z",
- "userID": "string",
- "authMethod": "none",
- "contentTemplate": "string",
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "method": "POST",
- "password": "string",
- "token": "string",
- "url": "string",
- "username": "string"
}
endpointID 必需 | 字符串 通知端点 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
用于替换现有端点的新通知端点
authMethod 必需 | 字符串 枚举: "none" "basic" "bearer" |
contentTemplate | 字符串 |
描述 | 字符串 通知端点的可选描述。 |
object 自定义标头。 | |
id | 字符串 |
Array of objects (Labels) | |
method 必需 | 字符串 枚举: "POST" "GET" "PUT" |
name 必需 | 字符串 |
orgID | 字符串 |
password | 字符串 |
status | 字符串 默认值: "active" 枚举: "active" "inactive" 端点的状态。 |
令牌 | 字符串 |
type 必需 | string (NotificationEndpointType) http PostNotificationEndpoint NotificationEndpoint slack pagerduty http telegram |
url 必需 | 字符串 |
用户ID | 字符串 |
username | 字符串 |
{- "description": "string",
- "id": "string",
- “标签”: [
- {
- "name": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "name": "string",
- "orgID": "string",
- "status": "活动",
- "type": "http",
- "userID": "string",
- "authMethod": "none",
- "contentTemplate": "string",
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "method": "POST",
- "password": "string",
- "token": "string",
- "url": "string",
- "username": "string"
}
{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "labels": "/api/v2/notificationEndpoints/1/labels",
- "members": "/api/v2/notificationEndpoints/1/members",
- "owners": "/api/v2/notificationEndpoints/1/owners",
- "self": "/api/v2/notificationEndpoints/1"
}, - "name": "string",
- "orgID": "string",
- "status": "活动",
- "type": "http",
- "updatedAt": "2019-08-24T14:15:22Z",
- "userID": "string",
- "authMethod": "none",
- "contentTemplate": "string",
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "method": "POST",
- "password": "string",
- "token": "string",
- "url": "string",
- "username": "string"
}
endpointID 必需 | 字符串 通知端点 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加的标签
labelID 必需 | 字符串 标签 ID。指定要附加的标签。 |
{- "labelID": "string"
}
{- "label": {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
},
}
checkID | 字符串 仅显示属于特定检查 ID 的通知。 |
limit | integer [ 1 .. 100 ] 默认值: 20 限制返回的记录数。默认为 |
偏移量 | integer >= 0 分页的偏移量。要跳过的记录数。 有关分页参数的更多信息,请参阅 分页。 |
orgID 必需 | 字符串 仅显示属于特定组织 ID 的通知规则。 |
tag | string^[a-zA-Z0-9_]+:[a-zA-Z0-9_]+$ 示例: tag=env:prod 仅返回“将匹配”包含所提供标签键值对的状态的通知规则。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "notificationRules": [
- {
- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "endpointID": "string",
- "every": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "limit": 0,
- "limitEvery": 0,
- "links": {
- "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"
}, - "name": "string",
- "offset": "string",
- "orgID": "string",
- "ownerID": "string",
- "runbookLink": "string",
- "sleepUntil": "string",
- "status": "活动",
- "statusRules": [
- {
- "count": 0,
- "currentLevel": "UNKNOWN",
- "period": "string",
- "previousLevel": "UNKNOWN"
}
], - "tagRules": [
- {
- "key": "string",
- "operator": "equal",
- "value": "string"
}
], - "taskID": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "channel": "string",
- "messageTemplate": "string",
- "type": "slack"
}
]
}
要创建的通知规则
描述 | 字符串 通知规则的可选描述。 |
endpointID 必需 | 字符串 |
every | 字符串 通知重复间隔。 |
Array of objects (Labels) | |
limit | integer 通知我的频率不要超过 |
limitEvery | integer 通知我的频率不要超过 |
name 必需 | 字符串 描述通知规则的人性化名称。 |
偏移量 | 字符串 计划后延迟的持续时间,在执行检查之前。 |
orgID 必需 | 字符串 拥有此通知规则的组织的 ID。 |
runbookLink | 字符串 |
sleepUntil | 字符串 |
status 必需 | string (TaskStatusType) 枚举: "active" "inactive"
|
必需 | 对象数组 objects (StatusRule) 非空 通知规则尝试匹配的状态规则列表。 |
对象数组 objects (TagRule) 通知规则尝试匹配的标签规则列表。 | |
taskID | 字符串 与此通知规则关联的任务的 ID。 |
type 必需 | 字符串 http PostNotificationRule NotificationRule telegram smtp slack pagerduty http |
url | 字符串 |
{- "description": "string",
- "endpointID": "string",
- "every": "string",
- “标签”: [
- {
- "name": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "limit": 0,
- "limitEvery": 0,
- "name": "string",
- "offset": "string",
- "orgID": "string",
- "runbookLink": "string",
- "sleepUntil": "string",
- "status": "活动",
- "statusRules": [
- {
- "count": 0,
- "currentLevel": "UNKNOWN",
- "period": "string",
- "previousLevel": "UNKNOWN"
}
], - "tagRules": [
- {
- "key": "string",
- "operator": "equal",
- "value": "string"
}
], - "taskID": "string",
- "type": "http",
- "url": "string"
}
{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "endpointID": "string",
- "every": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "limit": 0,
- "limitEvery": 0,
- "links": {
- "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"
}, - "name": "string",
- "offset": "string",
- "orgID": "string",
- "ownerID": "string",
- "runbookLink": "string",
- "sleepUntil": "string",
- "status": "活动",
- "statusRules": [
- {
- "count": 0,
- "currentLevel": "UNKNOWN",
- "period": "string",
- "previousLevel": "UNKNOWN"
}
], - "tagRules": [
- {
- "key": "string",
- "operator": "equal",
- "value": "string"
}
], - "taskID": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "type": "http",
- "url": "string"
}
ruleID 必需 | 字符串 通知规则 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "endpointID": "string",
- "every": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "limit": 0,
- "limitEvery": 0,
- "links": {
- "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"
}, - "name": "string",
- "offset": "string",
- "orgID": "string",
- "ownerID": "string",
- "runbookLink": "string",
- "sleepUntil": "string",
- "status": "活动",
- "statusRules": [
- {
- "count": 0,
- "currentLevel": "UNKNOWN",
- "period": "string",
- "previousLevel": "UNKNOWN"
}
], - "tagRules": [
- {
- "key": "string",
- "operator": "equal",
- "value": "string"
}
], - "taskID": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "type": "http",
- "url": "string"
}
ruleID 必需 | 字符串 通知规则 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要应用的通知规则更新
描述 | 字符串 |
name | 字符串 |
status | 字符串 枚举: "active" "inactive" |
{- "description": "string",
- "name": "string",
- "status": "active"
}
{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "endpointID": "string",
- "every": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "limit": 0,
- "limitEvery": 0,
- "links": {
- "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"
}, - "name": "string",
- "offset": "string",
- "orgID": "string",
- "ownerID": "string",
- "runbookLink": "string",
- "sleepUntil": "string",
- "status": "活动",
- "statusRules": [
- {
- "count": 0,
- "currentLevel": "UNKNOWN",
- "period": "string",
- "previousLevel": "UNKNOWN"
}
], - "tagRules": [
- {
- "key": "string",
- "operator": "equal",
- "value": "string"
}
], - "taskID": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "type": "http",
- "url": "string"
}
ruleID 必需 | 字符串 通知规则 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要应用的通知规则更新
描述 | 字符串 通知规则的可选描述。 |
endpointID 必需 | 字符串 |
every | 字符串 通知重复间隔。 |
Array of objects (Labels) | |
limit | integer 通知我的频率不要超过 |
limitEvery | integer 通知我的频率不要超过 |
name 必需 | 字符串 描述通知规则的人性化名称。 |
偏移量 | 字符串 计划后延迟的持续时间,在执行检查之前。 |
orgID 必需 | 字符串 拥有此通知规则的组织的 ID。 |
runbookLink | 字符串 |
sleepUntil | 字符串 |
status 必需 | string (TaskStatusType) 枚举: "active" "inactive"
|
必需 | 对象数组 objects (StatusRule) 非空 通知规则尝试匹配的状态规则列表。 |
对象数组 objects (TagRule) 通知规则尝试匹配的标签规则列表。 | |
taskID | 字符串 与此通知规则关联的任务的 ID。 |
type 必需 | 字符串 http PostNotificationRule NotificationRule telegram smtp slack pagerduty http |
url | 字符串 |
{- "description": "string",
- "endpointID": "string",
- "every": "string",
- “标签”: [
- {
- "name": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "limit": 0,
- "limitEvery": 0,
- "name": "string",
- "offset": "string",
- "orgID": "string",
- "runbookLink": "string",
- "sleepUntil": "string",
- "status": "活动",
- "statusRules": [
- {
- "count": 0,
- "currentLevel": "UNKNOWN",
- "period": "string",
- "previousLevel": "UNKNOWN"
}
], - "tagRules": [
- {
- "key": "string",
- "operator": "equal",
- "value": "string"
}
], - "taskID": "string",
- "type": "http",
- "url": "string"
}
{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "endpointID": "string",
- "every": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "limit": 0,
- "limitEvery": 0,
- "links": {
- "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"
}, - "name": "string",
- "offset": "string",
- "orgID": "string",
- "ownerID": "string",
- "runbookLink": "string",
- "sleepUntil": "string",
- "status": "活动",
- "statusRules": [
- {
- "count": 0,
- "currentLevel": "UNKNOWN",
- "period": "string",
- "previousLevel": "UNKNOWN"
}
], - "tagRules": [
- {
- "key": "string",
- "operator": "equal",
- "value": "string"
}
], - "taskID": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "type": "http",
- "url": "string"
}
ruleID 必需 | 字符串 通知规则 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加的标签
labelID 必需 | 字符串 标签 ID。指定要附加的标签。 |
{- "labelID": "string"
}
{- "label": {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
},
}
创建和管理您的 组织。组织是用户群组的工作空间。组织可用于分隔 InfluxDB 中的不同环境、项目、团队或用户。
使用 /api/v2/orgs
端点来创建、查看和管理组织。
降序 | boolean 默认值: false |
limit | integer [ 1 .. 100 ] 默认值: 20 限制返回的记录数。默认为 |
偏移量 | integer >= 0 分页的偏移量。要跳过的记录数。 有关分页参数的更多信息,请参阅 分页。 |
org | 字符串 组织名称。仅返回指定的组织。 |
orgID | 字符串 组织 ID。仅返回指定的组织。 |
用户ID | 字符串 用户 ID。仅返回指定用户是成员或所有者的组织。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "links": {
- "self": "/api/v2/orgs"
}, - “组织”: [
- {
- "createdAt": "2022-07-17T23:00:30.778487Z",
- "description": "InfluxDB 组织示例",
- "id": "INFLUX_ORG_ID",
- "links": {
- "buckets": "/api/v2/buckets?org=INFLUX_ORG",
- "dashboards": "/api/v2/dashboards?org=INFLUX_ORG",
- "labels": "/api/v2/orgs/INFLUX_ORG_ID/labels",
- "logs": "/api/v2/orgs/INFLUX_ORG_ID/logs",
- "members": "/api/v2/orgs/INFLUX_ORG_ID/members",
- "owners": "/api/v2/orgs/INFLUX_ORG_ID/owners",
- "secrets": "/api/v2/orgs/INFLUX_ORG_ID/secrets",
- "self": "/api/v2/orgs/INFLUX_ORG_ID",
- "tasks": "/api/v2/tasks?org=InfluxData"
}, - "name": "INFLUX_ORG",
- "updatedAt": "2022-07-17T23:00:30.778487Z"
}
]
}
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要创建的组织。
描述 | 字符串 组织的描述。 |
name 必需 | 字符串 组织的名称。 |
{- "description": "string",
- "name": "string"
}
{- "createdAt": "2022-08-24T23:05:52.881317Z",
- "description": "",
- "id": "INFLUX_ORG_ID",
- "links": {
- "buckets": "/api/v2/buckets?org=INFLUX_ORG",
- "dashboards": "/api/v2/dashboards?org=INFLUX_ORG",
- "labels": "/api/v2/orgs/INFLUX_ORG_ID/labels",
- "logs": "/api/v2/orgs/INFLUX_ORG_ID/logs",
- "members": "/api/v2/orgs/INFLUX_ORG_ID/members",
- "owners": "/api/v2/orgs/INFLUX_ORG_ID/owners",
- "secrets": "/api/v2/orgs/INFLUX_ORG_ID/secrets",
- "self": "/api/v2/orgs/INFLUX_ORG_ID",
- "tasks": "/api/v2/tasks?org=INFLUX_ORG"
}, - "name": "INFLUX_ORG",
- "updatedAt": "2022-08-24T23:05:52.881318Z"
}
删除一个组织。
从 InfluxDB Cloud 中删除组织的操作无法撤消。一旦删除,所有与该组织关联的数据都将被移除。
当您发送删除请求时,执行以下操作
204
状态代码;否则返回错误。orgID 必需 | 字符串 要删除的组织的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "code": "invalid",
- "message": "failed to decode request body: organization not found"
}
orgID 必需 | 字符串 要检索的组织的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "createdAt": "2019-08-24T14:15:22Z",
- "defaultStorageType": "tsm",
- "description": "string",
- "id": "string",
- "links": {
- "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"
}, - "name": "string",
- "status": "活动",
- "updatedAt": "2019-08-24T14:15:22Z"
}
更新一个组织。
使用此端点来更新组织的属性(name
,description
)。
更新组织的名称会影响所有通过名称引用该组织的资源,包括以下内容:
如果您更改了组织名称,请务必同时更新这些资源中的组织名称。
orgID 必需 | 字符串 要更新的组织的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要应用的组织更新。
描述 | 字符串 组织的描述。 |
name | 字符串 组织的名称。 |
{- "description": "string",
- "name": "string"
}
{- "createdAt": "2019-08-24T14:15:22Z",
- "defaultStorageType": "tsm",
- "description": "string",
- "id": "string",
- "links": {
- "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"
}, - "name": "string",
- "status": "活动",
- "updatedAt": "2019-08-24T14:15:22Z"
}
列出属于某个组织的所有用户。
InfluxDB 用户 有权访问 InfluxDB。
成员 是组织内的用户。
owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。read-orgs INFLUX_ORG_ID
INFLUX_ORG_ID
是您要检索成员的组织的 ID。
orgID 必需 | 字符串 要检索用户的组织的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "links": {
- "self": "/api/v2/orgs/055aa4783aa38398/members"
}, - "users": [
- {
- "id": "791df274afd48a83",
- "links": {
- "self": "/api/v2/users/791df274afd48a83"
}, - "name": "example_user_1",
- "role": "member",
- "status": "active"
}, - {
- "id": "09cfb87051cbe000",
- "links": {
- "self": "/api/v2/users/09cfb87051cbe000"
}, - "name": "example_user_2",
- "role": "owner",
- "status": "active"
}
]
}
向组织添加用户。
InfluxDB 用户 有权访问 InfluxDB。
成员 是组织内的用户。
owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。write-orgs INFLUX_ORG_ID
INFLUX_ORG_ID
是您想要向其添加成员的组织的 ID。
orgID 必需 | 字符串 组织的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加到组织的用户。
id 必需 | 字符串 要添加到资源的用户的 ID。 |
name | 字符串 要添加到资源的用户的名称。 |
{- "id": "string",
- "name": "string"
}
{- "id": "09cfb87051cbe000",
- "links": {
- "self": "/api/v2/users/09cfb87051cbe000"
}, - "name": "example_user_1",
- "role": "member",
- "status": "active"
}
从组织中移除成员。
使用此端点移除用户在组织中的成员权限。移除成员权限会移除用户的 read
和 write
组织权限。
owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。write-orgs INFLUX_ORG_ID
INFLUX_ORG_ID
是您要从中移除所有者的组织的 ID。
orgID 必需 | 字符串 要从中移除用户的组织的 ID。 |
用户ID 必需 | 字符串 要移除的用户的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "code": "unauthorized",
- "message": "unauthorized access"
}
列出组织的所有所有者。
owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。read-orgs INFLUX_ORG_ID
INFLUX_ORG_ID
是您要从中检索所有者列表的组织的 ID。
orgID 必需 | 字符串 要列出所有者的组织的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "links": {
- "self": "/api/v2/orgs/055aa4783aa38398/owners"
}, - "users": [
- {
- "id": "09cfb87051cbe000",
- "links": {
- "self": "/api/v2/users/09cfb87051cbe000"
}, - "name": "example_user_2",
- "role": "owner",
- "status": "active"
}
]
}
向组织添加所有者。
使用此端点为用户分配组织的 owner
角色。
owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。write-orgs INFLUX_ORG_ID
INFLUX_ORG_ID
是您想要为其添加所有者的组织的 ID。
orgID 必需 | 字符串 您想要为其添加所有者的组织的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加为组织所有者的用户。
id 必需 | 字符串 要添加到资源的用户的 ID。 |
name | 字符串 要添加到资源的用户的名称。 |
{- "id": "09cfb87051cbe000",
- "links": {
- "self": "/api/v2/users/09cfb87051cbe000"
}, - "name": "example_user_1",
- "role": "owner",
- "status": "active"
}
{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "活动",
- "role": "owner"
}
从组织中移除 所有者。
组织所有者有权删除组织并从组织中移除用户和成员权限。
owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。write-orgs INFLUX_ORG_ID
INFLUX_ORG_ID
是您要从中移除所有者的组织的 ID。
orgID 必需 | 字符串 要从中移除所有者的组织的 ID。 |
用户ID 必需 | 字符串 要移除的用户的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "code": "unauthorized",
- "message": "unauthorized access"
}
org | 字符串 组织名称或 ID。 InfluxDB Cloud
InfluxDB OSS
|
orgID | 字符串 组织 ID。 InfluxDB Cloud
InfluxDB OSS
|
Accept-Encoding | 字符串 默认: identity 枚举: "gzip" "identity" 客户端可以理解的内容编码(通常是压缩算法)。 |
Content-Type | 字符串 枚举: "application/json" "application/vnd.flux" |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要执行的 Flux 查询或规范
对象 (Dialect) 表格数据输出的选项。默认输出是带有标头的带注释的 CSV。 有关表格数据dialect的更多信息,请参阅 表格数据的 W3 元数据词汇表。 | |
对象 (File) 表示来自单个文件的源 | |
now | 字符串 <date-time> 指定在查询中应报告为 |
query 必需 | 字符串 要执行的查询脚本。 |
type | 字符串 值: "flux" 查询类型。必须为 "flux"。 |
{- "dialect": {
- "annotations": [
- "group"
], - "commentPrefix": "#",
- "dateTimeFormat": "RFC3339",
- "delimiter": ",",
- "header": true
}, - "extern": {
- "body": [
- {
- "text": "string",
- "type": "string"
}
], - "imports": [
- {
- "as": {
- "name": "string",
- "type": "string"
}, - "path": {
- "type": "string",
- "value": "string"
}, - "type": "string"
}
], - "name": "string",
- "package": {
- "name": {
- "name": "string",
- "type": "string"
}, - "type": "string"
}, - "type": "string"
}, - "now": "2019-08-24T14:15:22Z",
- "query": "string",
- "type": "flux"
}
result,table,_start,_stop,_time,region,host,_value mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:00Z,east,A,15.43 mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:20Z,east,B,59.25 mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:40Z,east,C,52.62
分析 Flux 查询 中的语法错误,并返回错误列表。
在以下示例查询中,from()
缺少属性键。
```json
{ "query": "from(: \"iot_center\")\
|> range(start: -90d)\
|> filter(fn: (r) => r._measurement == \"environment\")",
"type": "flux"
}
```
如果您在请求中将此内容传递给 /api/v2/analyze
端点,InfluxDB 将返回一个 errors
列表,其中包含缺少键的错误对象。
该端点不验证查询中的值——例如:
以下示例查询具有正确的语法,但包含不正确的 from()
属性键。
{ "query": "from(foo: \"iot_center\")\
|> range(start: -90d)\
|> filter(fn: (r) => r._measurement == \"environment\")",
"type": "flux"
}
如果您在请求中将此内容传递给 /api/v2/analyze
端点,InfluxDB 将返回一个空的 errors
列表。
Content-Type | 字符串 值: "application/json" |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要分析的 Flux 查询
对象 (Dialect) 表格数据输出的选项。默认输出是带有标头的带注释的 CSV。 有关表格数据dialect的更多信息,请参阅 表格数据的 W3 元数据词汇表。 | |
对象 (File) 表示来自单个文件的源 | |
now | 字符串 <date-time> 指定在查询中应报告为 |
query 必需 | 字符串 要执行的查询脚本。 |
type | 字符串 值: "flux" 查询类型。必须为 "flux"。 |
{- "dialect": {
- "annotations": [
- "group"
], - "commentPrefix": "#",
- "dateTimeFormat": "RFC3339",
- "delimiter": ",",
- "header": true
}, - "extern": {
- "body": [
- {
- "text": "string",
- "type": "string"
}
], - "imports": [
- {
- "as": {
- "name": "string",
- "type": "string"
}, - "path": {
- "type": "string",
- "value": "string"
}, - "type": "string"
}
], - "name": "string",
- "package": {
- "name": {
- "name": "string",
- "type": "string"
}, - "type": "string"
}, - "type": "string"
}, - "now": "2019-08-24T14:15:22Z",
- "query": "string",
- "type": "flux"
}
如果 Flux 查询缺少属性键,则返回错误对象。
以下示例查询缺少 bucket
属性键:
{
"query": "from(: \"iot_center\")\
...
}
{- "errors": [
- {
- "character": 0,
- "column": 6,
- "line": 1,
- "message": "missing property key"
}
]
}
分析 Flux 查询并返回查询的完整包源 抽象语法树 (AST)。
使用此端点进行深度查询分析,例如调试意外的查询结果。
Flux 查询 AST 提供了一个语义化的、树状的表示,其中包含关于查询的上下文信息。AST 说明了查询如何分布到不同的组件以供执行。
该端点不验证查询中的值——例如:
以下示例 Flux 查询具有正确的语法,但包含不正确的 from()
属性键:
from(foo: "iot_center")
|> range(start: -90d)
|> filter(fn: (r) => r._measurement == "environment")
以下示例 JSON 显示了如何在请求正文中传递查询:
from(foo: "iot_center")
|> range(start: -90d)
|> filter(fn: (r) => r._measurement == "environment")
以下代码示例显示了如何在请求正文中以 JSON 格式传递查询:
{ "query": "from(foo: \"iot_center\")\
|> range(start: -90d)\
|> filter(fn: (r) => r._measurement == \"environment\")"
}
将此内容传递给 /api/v2/query/ast
将返回成功的响应,并生成 AST。
Content-Type | 字符串 值: "application/json" |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要分析的 Flux 查询。
query 必需 | 字符串 要分析的 Flux 查询脚本。 |
{- "query": "string"
}
{- "ast": {
- "files": [
- {
- "body": [
- {
- "expression": {
- "argument": {
- "argument": {
- "arguments": [
- {
- "location": {
- "end": {
- "column": 25,
- "line": 1
}, - "source": "bucket: \"example-bucket\"",
- "start": {
- "column": 6,
- "line": 1
}
}, - “属性”: [
- {
- "key": {
- "location": {
- "end": {
- "column": 12,
- "line": 1
}, - "source": "bucket",
- "start": {
- "column": 6,
- "line": 1
}
}, - "name": "bucket",
- "type": "Identifier"
}, - "location": {
- "end": {
- "column": 25,
- "line": 1
}, - "source": "bucket: \"example-bucket\"",
- "start": {
- "column": 6,
- "line": 1
}
}, - "type": "Property",
- "value": {
- "location": {
- "end": {
- "column": 25,
- "line": 1
}, - "source": "\"example-bucket\"",
- "start": {
- "column": 14,
- "line": 1
}
}, - "type": "StringLiteral",
- "value": "example-bucket"
}
}
], - "type": "ObjectExpression"
}
], - "callee": {
- "location": {
- "end": {
- "column": 5,
- "line": 1
}, - "source": "from",
- "start": {
- "column": 1,
- "line": 1
}
}, - "name": "from",
- "type": "Identifier"
}, - "location": {
- "end": {
- "column": 26,
- "line": 1
}, - "source": "from(bucket: \"example-bucket\")",
- "start": {
- "column": 1,
- "line": 1
}
}, - "type": "CallExpression"
}, - "call": {
- "arguments": [
- {
- "location": {
- "end": {
- "column": 46,
- "line": 1
}, - "source": "start: -5m",
- "start": {
- "column": 36,
- "line": 1
}
}, - “属性”: [
- {
- "key": {
- "location": {
- "end": {
- "column": 41,
- "line": 1
}, - "source": "start",
- "start": {
- "column": 36,
- "line": 1
}
}, - "name": "start",
- "type": "Identifier"
}, - "location": {
- "end": {
- "column": 46,
- "line": 1
}, - "source": "start: -5m",
- "start": {
- "column": 36,
- "line": 1
}
}, - "type": "Property",
- "value": {
- "argument": {
- "location": {
- "end": {
- "column": 46,
- "line": 1
}, - "source": "5m",
- "start": {
- "column": 44,
- "line": 1
}
}, - "type": "DurationLiteral",
- "values": [
- {
- "magnitude": 5,
- "unit": "m"
}
]
}, - "location": {
- "end": {
- "column": 46,
- "line": 1
}, - "source": "-5m",
- "start": {
- "column": 43,
- "line": 1
}
}, - "operator": "-",
- "type": "UnaryExpression"
}
}
], - "type": "ObjectExpression"
}
], - "callee": {
- "location": {
- "end": {
- "column": 35,
- "line": 1
}, - "source": "range",
- "start": {
- "column": 30,
- "line": 1
}
}, - "name": "range",
- "type": "Identifier"
}, - "location": {
- "end": {
- "column": 47,
- "line": 1
}, - "source": "range(start: -5m)",
- "start": {
- "column": 30,
- "line": 1
}
}, - "type": "CallExpression"
}, - "location": {
- "end": {
- "column": 47,
- "line": 1
}, - "source": "from(bucket: \"example-bucket\") |> range(start: -5m)",
- "start": {
- "column": 1,
- "line": 1
}
}, - "type": "PipeExpression"
}, - "call": {
- "arguments": [
- {
- "location": {
- "end": {
- "column": 108,
- "line": 1
}, - "source": "fn: (r) => r._measurement == \"example-measurement\"",
- "start": {
- "column": 58,
- "line": 1
}
}, - “属性”: [
- {
- "key": {
- "location": {
- "end": {
- "column": 60,
- "line": 1
}, - "source": "fn",
- "start": {
- "column": 58,
- "line": 1
}
}, - "name": "fn",
- "type": "Identifier"
}, - "location": {
- "end": {
- "column": 108,
- "line": 1
}, - "source": "fn: (r) => r._measurement == \"example-measurement\"",
- "start": {
- "column": 58,
- "line": 1
}
}, - "type": "Property",
- "value": {
- "body": {
- "left": {
- "location": {
- "end": {
- "column": 83,
- "line": 1
}, - "source": "r._measurement",
- "start": {
- "column": 69,
- "line": 1
}
}, - "object": {
- "location": {
- "end": {
- "column": 70,
- "line": 1
}, - "source": "r",
- "start": {
- "column": 69,
- "line": 1
}
}, - "name": "r",
- "type": "Identifier"
}, - "property": {
- "location": {
- "end": {
- "column": 83,
- "line": 1
}, - "source": "_measurement",
- "start": {
- "column": 71,
- "line": 1
}
}, - "name": "_measurement",
- "type": "Identifier"
}, - "type": "MemberExpression"
}, - "location": {
- "end": {
- "column": 108,
- "line": 1
}, - "source": "r._measurement == \"example-measurement\"",
- "start": {
- "column": 69,
- "line": 1
}
}, - "operator": "==",
- "right": {
- "location": {
- "end": {
- "column": 108,
- "line": 1
}, - "source": "\"example-measurement\"",
- "start": {
- "column": 87,
- "line": 1
}
}, - "type": "StringLiteral",
- "value": "example-measurement"
}, - "type": "BinaryExpression"
}, - "location": {
- "end": {
- "column": 108,
- "line": 1
}, - "source": "(r) => r._measurement == \"example-measurement\"",
- "start": {
- "column": 62,
- "line": 1
}
}, - "params": [
- {
- "key": {
- "location": {
- "end": {
- "column": 64,
- "line": 1
}, - "source": "r",
- "start": {
- "column": 63,
- "line": 1
}
}, - "name": "r",
- "type": "Identifier"
}, - "location": {
- "end": {
- "column": 64,
- "line": 1
}, - "source": "r",
- "start": {
- "column": 63,
- "line": 1
}
}, - "type": "Property",
- "value": null
}
], - "type": "FunctionExpression"
}
}
], - "type": "ObjectExpression"
}
], - "callee": {
- "location": {
- "end": {
- "column": 57,
- "line": 1
}, - "source": "filter",
- "start": {
- "column": 51,
- "line": 1
}
}, - "name": "filter",
- "type": "Identifier"
}, - "location": {
- "end": {
- "column": 109,
- "line": 1
}, - "source": "filter(fn: (r) => r._measurement == \"example-measurement\")",
- "start": {
- "column": 51,
- "line": 1
}
}, - "type": "CallExpression"
}, - "location": {
- "end": {
- "column": 109,
- "line": 1
}, - "source": "from(bucket: \"example-bucket\") |> range(start: -5m) |> filter(fn: (r) => r._measurement == \"example-measurement\")",
- "start": {
- "column": 1,
- "line": 1
}
}, - "type": "PipeExpression"
}, - "location": {
- "end": {
- "column": 109,
- "line": 1
}, - "source": "from(bucket: \"example-bucket\") |> range(start: -5m) |> filter(fn: (r) => r._measurement == \"example-measurement\")",
- "start": {
- "column": 1,
- "line": 1
}
}, - "type": "ExpressionStatement"
}
], - "imports": null,
- "location": {
- "end": {
- "column": 109,
- "line": 1
}, - "source": "from(bucket: \"example-bucket\") |> range(start: -5m) |> filter(fn: (r) => r._measurement == \"example-measurement\")",
- "start": {
- "column": 1,
- "line": 1
}
}, - "metadata": "parser-type=rust",
- "package": null,
- "type": "File"
}
], - "package": "main",
- "type": "Package"
}
}
列出 Flux 查询建议。每个建议都包含一个 Flux 函数 名称和参数。
使用此端点检索 InfluxDB Flux 查询构建器中使用的 Flux 查询建议列表。
在编写查询时,请避免使用此端点公开的 _functionName()
辅助函数。辅助函数名称带有下划线 (_
) 前缀,不应直接在查询中使用——例如:
top(n, columns=["_value"], tables=<-)
函数,而不是 _sortLimit
辅助函数。top
使用 _sortLimit
。Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
curl --request GET "INFLUX_URL/api/v2/query/suggestions" \ --header "Accept: application/json" \ --header "Authorization: Token INFLUX_API_TOKEN"
{- "funcs": [
- {
- "name": "_fillEmpty",
- "params": {
- "createEmpty": "bool",
- "tables": "stream"
}
}, - {
- "name": "_highestOrLowest",
- "params": {
- "_sortLimit": "function",
- "column": "invalid",
- "groupColumns": "array",
- "n": "invalid",
- "reducer": "function",
- "tables": "stream"
}
}, - {
- "name": "_hourSelection",
- "params": {
- "location": "object",
- "start": "int",
- "stop": "int",
- "tables": "stream",
- "timeColumn": "string"
}
}, - {
- "name": "_sortLimit",
- "params": {
- "columns": "array",
- "desc": "bool",
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "_window",
- "params": {
- "createEmpty": "bool",
- "every": "duration",
- "location": "object",
- "offset": "duration",
- "period": "duration",
- "startColumn": "string",
- "stopColumn": "string",
- "tables": "stream",
- "timeColumn": "string"
}
}, - {
- "name": "aggregateWindow",
- "params": {
- "column": "invalid",
- "createEmpty": "bool",
- "every": "duration",
- "fn": "function",
- "location": "object",
- "offset": "duration",
- "period": "duration",
- "tables": "stream",
- "timeDst": "string",
- "timeSrc": "string"
}
}, - {
- "name": "bool",
- "params": {
- "v": "invalid"
}
}, - {
- "name": "bottom",
- "params": {
- "columns": "array",
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "buckets",
- "params": {
- "host": "string",
- "org": "string",
- "orgID": "string",
- "token": "string"
}
}, - {
- "name": "bytes",
- "params": {
- "v": "invalid"
}
}, - {
- "name": "cardinality",
- "params": {
- "bucket": "string",
- "bucketID": "string",
- "host": "string",
- "org": "string",
- "orgID": "string",
- "predicate": "function",
- "start": "invalid",
- "stop": "invalid",
- "token": "string"
}
}, - {
- "name": "chandeMomentumOscillator",
- "params": {
- "columns": "array",
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "columns",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "contains",
- "params": {
- "set": "array",
- "value": "invalid"
}
}, - {
- "name": "count",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "cov",
- "params": {
- "on": "array",
- "pearsonr": "bool",
- "x": "invalid",
- "y": "invalid"
}
}, - {
- "name": "covariance",
- "params": {
- "columns": "array",
- "pearsonr": "bool",
- "tables": "stream",
- "valueDst": "string"
}
}, - {
- "name": "cumulativeSum",
- "params": {
- "columns": "array",
- "tables": "stream"
}
}, - {
- "name": "derivative",
- "params": {
- "columns": "array",
- "initialZero": "bool",
- "nonNegative": "bool",
- "tables": "stream",
- "timeColumn": "string",
- "unit": "duration"
}
}, - {
- "name": "die",
- "params": {
- "msg": "string"
}
}, - {
- "name": "difference",
- "params": {
- "columns": "array",
- "initialZero": "bool",
- "keepFirst": "bool",
- "nonNegative": "bool",
- "tables": "stream"
}
}, - {
- "name": "display",
- "params": {
- "v": "invalid"
}
}, - {
- "name": "distinct",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "doubleEMA",
- "params": {
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "drop",
- "params": {
- "columns": "array",
- "fn": "function",
- "tables": "stream"
}
}, - {
- "name": "duplicate",
- "params": {
- "as": "string",
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "duration",
- "params": {
- "v": "invalid"
}
}, - {
- "name": "elapsed",
- "params": {
- "columnName": "string",
- "tables": "stream",
- "timeColumn": "string",
- "unit": "duration"
}
}, - {
- "name": "exponentialMovingAverage",
- "params": {
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "fill",
- "params": {
- "column": "string",
- "tables": "stream",
- "usePrevious": "bool",
- "value": "invalid"
}
}, - {
- "name": "filter",
- "params": {
- "fn": "function",
- "onEmpty": "string",
- "tables": "stream"
}
}, - {
- "name": "findColumn",
- "params": {
- "column": "string",
- "fn": "function",
- "tables": "stream"
}
}, - {
- "name": "findRecord",
- "params": {
- "fn": "function",
- "idx": "int",
- "tables": "stream"
}
}, - {
- "name": "first",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "float",
- "params": {
- "v": "invalid"
}
}, - {
- "name": "from",
- "params": {
- "bucket": "string",
- "bucketID": "string",
- "host": "string",
- "org": "string",
- "orgID": "string",
- "token": "string"
}
}, - {
- "name": "getColumn",
- "params": {
- "column": "string"
}
}, - {
- "name": "getRecord",
- "params": {
- "idx": "int"
}
}, - {
- "name": "group",
- "params": {
- "columns": "array",
- "mode": "string",
- "tables": "stream"
}
}, - {
- "name": "highestAverage",
- "params": {
- "column": "string",
- "groupColumns": "array",
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "highestCurrent",
- "params": {
- "column": "string",
- "groupColumns": "array",
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "highestMax",
- "params": {
- "column": "string",
- "groupColumns": "array",
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "histogram",
- "params": {
- "bins": "array",
- "column": "string",
- "countColumn": "string",
- "normalize": "bool",
- "tables": "stream",
- "upperBoundColumn": "string"
}
}, - {
- "name": "histogramQuantile",
- "params": {
- "countColumn": "string",
- "minValue": "float",
- "quantile": "float",
- "tables": "stream",
- "upperBoundColumn": "string",
- "valueColumn": "string"
}
}, - {
- "name": "holtWinters",
- "params": {
- "column": "string",
- "interval": "duration",
- "n": "int",
- "seasonality": "int",
- "tables": "stream",
- "timeColumn": "string",
- "withFit": "布尔值"
}
}, - {
- "name": "hourSelection",
- "params": {
- "location": "object",
- "start": "int",
- "stop": "int",
- "tables": "stream",
- "timeColumn": "string"
}
}, - {
- "name": "increase",
- "params": {
- "columns": "array",
- "tables": "stream"
}
}, - {
- "name": "整数",
- "params": {
- "v": "invalid"
}
}, - {
- "name": "integral",
- "params": {
- "column": "string",
- "interpolate": "字符串",
- "tables": "stream",
- "timeColumn": "string",
- "unit": "duration"
}
}, - {
- "name": "join",
- "params": {
- "method": "字符串",
- "on": "array",
- "tables": "无效"
}
}, - {
- "name": "kaufmansAMA",
- "params": {
- "column": "string",
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "kaufmansER",
- "params": {
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "keep",
- "params": {
- "columns": "array",
- "fn": "function",
- "tables": "stream"
}
}, - {
- "name": "keyValues",
- "params": {
- "keyColumns": "数组",
- "tables": "stream"
}
}, - {
- "name": "keys",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "last",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "length",
- "params": {
- "arr": "数组"
}
}, - {
- "name": "limit",
- "params": {
- "n": "int",
- "offset": "整数",
- "tables": "stream"
}
}, - {
- "name": "linearBins",
- "params": {
- "count": "整数",
- "infinity": "布尔值",
- "start": "浮点数",
- "width": "浮点数"
}
}, - {
- "name": "logarithmicBins",
- "params": {
- "count": "整数",
- "factor": "浮点数",
- "infinity": "布尔值",
- "start": "浮点数"
}
}, - {
- "name": "lowestAverage",
- "params": {
- "column": "string",
- "groupColumns": "array",
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "lowestCurrent",
- "params": {
- "column": "string",
- "groupColumns": "array",
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "lowestMin",
- "params": {
- "column": "string",
- "groupColumns": "array",
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "map",
- "params": {
- "fn": "function",
- "mergeKey": "布尔值",
- "tables": "stream"
}
}, - {
- "name": "max",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "mean",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "median",
- "params": {
- "column": "string",
- "compression": "浮点数",
- "method": "字符串",
- "tables": "stream"
}
}, - {
- "name": "min",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "mode",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "movingAverage",
- "params": {
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "now",
- "params": { }
}, - {
- "name": "pearsonr",
- "params": {
- "on": "array",
- "x": "invalid",
- "y": "invalid"
}
}, - {
- "name": "pivot",
- "params": {
- "columnKey": "数组",
- "rowKey": "数组",
- "tables": "stream",
- "valueColumn": "string"
}
}, - {
- "name": "quantile",
- "params": {
- "column": "string",
- "compression": "浮点数",
- "method": "字符串",
- "q": "浮点数",
- "tables": "stream"
}
}, - {
- "name": "range",
- "params": {
- "start": "invalid",
- "stop": "invalid",
- "tables": "stream"
}
}, - {
- "name": "reduce",
- "params": {
- "fn": "function",
- "identity": "无效",
- "tables": "stream"
}
}, - {
- "name": "relativeStrengthIndex",
- "params": {
- "columns": "array",
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "rename",
- "params": {
- "columns": "无效",
- "fn": "function",
- "tables": "stream"
}
}, - {
- "name": "sample",
- "params": {
- "column": "string",
- "n": "int",
- "pos": "整数",
- "tables": "stream"
}
}, - {
- "name": "set",
- "params": {
- "key": "string",
- "tables": "stream",
- "value": "string"
}
}, - {
- "name": "skew",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "sort",
- "params": {
- "columns": "array",
- "desc": "bool",
- "tables": "stream"
}
}, - {
- "name": "spread",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "stateCount",
- "params": {
- "column": "string",
- "fn": "function",
- "tables": "stream"
}
}, - {
- "name": "stateDuration",
- "params": {
- "column": "string",
- "fn": "function",
- "tables": "stream",
- "timeColumn": "string",
- "unit": "duration"
}
}, - {
- "name": "stateTracking",
- "params": {
- "countColumn": "string",
- "durationColumn": "字符串",
- "durationUnit": "duration",
- "fn": "function",
- "tables": "stream",
- "timeColumn": "string"
}
}, - {
- "name": "stddev",
- "params": {
- "column": "string",
- "mode": "string",
- "tables": "stream"
}
}, - {
- "name": "string",
- "params": {
- "v": "invalid"
}
}, - {
- "name": "sum",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "tableFind",
- "params": {
- "fn": "function",
- "tables": "stream"
}
}, - {
- "name": "tail",
- "params": {
- "n": "int",
- "offset": "整数",
- "tables": "stream"
}
}, - {
- "name": "time",
- "params": {
- "v": "invalid"
}
}, - {
- "name": "timeShift",
- "params": {
- "columns": "array",
- "duration": "duration",
- "tables": "stream"
}
}, - {
- "name": "timeWeightedAvg",
- "params": {
- "tables": "stream",
- "unit": "duration"
}
}, - {
- "name": "timedMovingAverage",
- "params": {
- "column": "string",
- "every": "duration",
- "period": "duration",
- "tables": "stream"
}
}, - {
- "name": "to",
- "params": {
- "bucket": "string",
- "bucketID": "string",
- "fieldFn": "函数",
- "host": "string",
- "measurementColumn": "字符串",
- "org": "string",
- "orgID": "string",
- "tables": "stream",
- "tagColumns": "数组",
- "timeColumn": "string",
- "token": "string"
}
}, - {
- "name": "toBool",
- "params": {
- "tables": "stream"
}
}, - {
- "name": "toFloat",
- "params": {
- "tables": "stream"
}
}, - {
- "name": "toInt",
- "params": {
- "tables": "stream"
}
}, - {
- "name": "toString",
- "params": {
- "tables": "stream"
}
}, - {
- "name": "toTime",
- "params": {
- "tables": "stream"
}
}, - {
- "name": "toUInt",
- "params": {
- "tables": "stream"
}
}, - {
- "name": "today",
- "params": { }
}, - {
- "name": "top",
- "params": {
- "columns": "array",
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "tripleEMA",
- "params": {
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "tripleExponentialDerivative",
- "params": {
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "truncateTimeColumn",
- "params": {
- "tables": "stream",
- "timeColumn": "无效",
- "unit": "duration"
}
}, - {
- "name": "uint",
- "params": {
- "v": "invalid"
}
}, - {
- "name": "union",
- "params": {
- "tables": "数组"
}
}, - {
- "name": "unique",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "wideTo",
- "params": {
- "bucket": "string",
- "bucketID": "string",
- "host": "string",
- "org": "string",
- "orgID": "string",
- "tables": "stream",
- "token": "string"
}
}, - {
- "name": "window",
- "params": {
- "createEmpty": "bool",
- "every": "duration",
- "location": "object",
- "offset": "duration",
- "period": "duration",
- "startColumn": "string",
- "stopColumn": "string",
- "tables": "stream",
- "timeColumn": "string"
}
}, - {
- "name": "yield",
- "params": {
- "name": "string",
- "tables": "stream"
}
}
]
}
检索包含所请求函数的名称和参数的查询建议。
使用此端点传递分支建议(Flux 函数名称)并检索所请求函数的参数。
使用 /api/v2/query/suggestions/{name}
(没有尾部斜杠)。/api/v2/query/suggestions/{name}/
(注意尾部斜杠) 会导致 HTTP 301 Moved Permanently
状态。
函数 name
必须存在且必须拼写正确。
name 必需 | 字符串 Flux 函数 名称。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
curl --request GET "INFLUX_URL/api/v2/query/suggestions/sum/" \ --header "Accept: application/json" \ --header "Authorization: Token INFLUX_API_TOKEN"
{- "name": "sum",
- "params": {
- "column": "string",
- "tables": "stream"
}
}
name | 字符串 |
orgID 必需 | 字符串 组织 ID。 |
remoteURL | 字符串 <uri> |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "remotes": [
- {
- "allowInsecureTLS": false,
- "description": "string",
- "id": "string",
- "name": "string",
- "orgID": "string",
- "remoteOrgID": "字符串",
}
]
}
allowInsecureTLS 必需 | boolean 默认值: false |
描述 | 字符串 |
name 必需 | 字符串 |
orgID 必需 | 字符串 |
remoteAPIToken 必需 | 字符串 |
remoteOrgID | 字符串 |
remoteURL 必需 | 字符串 <uri> |
{- "allowInsecureTLS": false,
- "description": "string",
- "name": "string",
- "orgID": "string",
- "remoteAPIToken": "字符串",
- "remoteOrgID": "字符串",
}
{- "allowInsecureTLS": false,
- "description": "string",
- "id": "string",
- "name": "string",
- "orgID": "string",
- "remoteOrgID": "字符串",
}
remoteID 必需 | 字符串 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
allowInsecureTLS | boolean 默认值: false |
描述 | 字符串 |
name | 字符串 |
remoteAPIToken | 字符串 |
remoteOrgID | 字符串 |
remoteURL | 字符串 <uri> |
{- "allowInsecureTLS": false,
- "description": "string",
- "name": "string",
- "remoteAPIToken": "字符串",
- "remoteOrgID": "字符串",
}
{- "allowInsecureTLS": false,
- "description": "string",
- "id": "string",
- "name": "string",
- "orgID": "string",
- "remoteOrgID": "字符串",
}
localBucketID | 字符串 |
name | 字符串 |
orgID 必需 | 字符串 组织 ID。 |
remoteID | 字符串 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "replications": [
- {
- "currentQueueSizeBytes": 0,
- "description": "string",
- "dropNonRetryableData": true,
- "id": "string",
- "latestErrorMessage": "字符串",
- "latestResponseCode": 0,
- "localBucketID": "字符串",
- "maxQueueSizeBytes": 0,
- "name": "string",
- "orgID": "string",
- "remainingBytesToBeSynced": 0,
- "remoteBucketID": "字符串",
- "remoteBucketName": "字符串",
- "remoteID": "字符串"
}
]
}
validate | boolean 默认值: false 如果为 true,则验证复制,但不保存。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
描述 | 字符串 |
dropNonRetryableData | boolean 默认值: false |
localBucketID 必需 | 字符串 |
maxAgeSeconds 必需 | 整数 <int64> >= 0 默认值:604800 |
maxQueueSizeBytes 必需 | 整数 <int64> >= 33554430 默认值:67108860 |
name 必需 | 字符串 |
orgID 必需 | 字符串 |
remoteBucketID | 字符串 |
remoteBucketName | 字符串 |
remoteID 必需 | 字符串 |
{- "description": "string",
- "dropNonRetryableData": false,
- "localBucketID": "字符串",
- "maxAgeSeconds": 604800,
- "maxQueueSizeBytes": 67108860,
- "name": "string",
- "orgID": "string",
- "remoteBucketID": "字符串",
- "remoteBucketName": "字符串",
- "remoteID": "字符串"
}
{- "currentQueueSizeBytes": 0,
- "description": "string",
- "dropNonRetryableData": true,
- "id": "string",
- "latestErrorMessage": "字符串",
- "latestResponseCode": 0,
- "localBucketID": "字符串",
- "maxQueueSizeBytes": 0,
- "name": "string",
- "orgID": "string",
- "remainingBytesToBeSynced": 0,
- "remoteBucketID": "字符串",
- "remoteBucketName": "字符串",
- "remoteID": "字符串"
}
replicationID 必需 | 字符串 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "currentQueueSizeBytes": 0,
- "description": "string",
- "dropNonRetryableData": true,
- "id": "string",
- "latestErrorMessage": "字符串",
- "latestResponseCode": 0,
- "localBucketID": "字符串",
- "maxQueueSizeBytes": 0,
- "name": "string",
- "orgID": "string",
- "remainingBytesToBeSynced": 0,
- "remoteBucketID": "字符串",
- "remoteBucketName": "字符串",
- "remoteID": "字符串"
}
replicationID 必需 | 字符串 |
validate | boolean 默认值: false 如果为 true,则验证更新的信息,但不保存。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
描述 | 字符串 |
dropNonRetryableData | boolean |
maxAgeSeconds | 整数 <int64> >= 0 |
maxQueueSizeBytes | 整数 <int64> >= 33554430 |
name | 字符串 |
remoteBucketID | 字符串 |
remoteBucketName | 字符串 |
remoteID | 字符串 |
{- "description": "string",
- "dropNonRetryableData": true,
- "maxAgeSeconds": 0,
- "maxQueueSizeBytes": 33554430,
- "name": "string",
- "remoteBucketID": "字符串",
- "remoteBucketName": "字符串",
- "remoteID": "字符串"
}
{- "currentQueueSizeBytes": 0,
- "description": "string",
- "dropNonRetryableData": true,
- "id": "string",
- "latestErrorMessage": "字符串",
- "latestResponseCode": 0,
- "localBucketID": "字符串",
- "maxQueueSizeBytes": 0,
- "name": "string",
- "orgID": "string",
- "remainingBytesToBeSynced": 0,
- "remoteBucketID": "字符串",
- "remoteBucketName": "字符串",
- "remoteID": "字符串"
}
bucketID 必需 | 字符串 存储桶 ID。 |
Content-Type | 字符串 默认值:application/octet-stream 值: "application/octet-stream" |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
数据库信息序列化为 protobuf。
"string"
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
存储桶的元数据清单。
bucketID 必需 | 字符串 |
bucketName 必需 | 字符串 |
defaultRetentionPolicy 必需 | 字符串 |
描述 | 字符串 |
organizationID 必需 | 字符串 |
organizationName 必需 | 字符串 |
必需 | 对象数组 (RetentionPolicyManifests) |
{- "bucketID": "string",
- "bucketName": "字符串",
- "defaultRetentionPolicy": "字符串",
- "description": "string",
- "organizationID": "字符串",
- "organizationName": "字符串",
- "retentionPolicies": [
- {
- "duration": 0,
- "name": "string",
- "replicaN": 0,
- "shardGroupDuration": 0,
- "shardGroups": [
- {
- "deletedAt": "2019-08-24T14:15:22Z",
- "endTime": "2019-08-24T14:15:22Z",
- "id": 0,
- "shards": [
- {
- "id": 0,
- "shardOwners": [
- {
- "nodeID": 0
}
]
}
], - "startTime": "2019-08-24T14:15:22Z",
- "truncatedAt": "2019-08-24T14:15:22Z"
}
], - "subscriptions": [
- {
- "destinations": [
- "string"
], - "mode": "string",
- "name": "string"
}
]
}
]
}
{- "id": "string",
- "name": "string",
- "shardMappings": [
- {
- "newId": 0,
- "oldId": 0
}
]
}
Content-Encoding | 字符串 默认: identity 枚举: "gzip" "identity" 该值告诉 InfluxDB 请求负载中应用于行协议的压缩类型。要使用 gzip 负载发出 API 请求,请发送 |
Content-Type | 字符串 默认值:application/octet-stream 值: "application/octet-stream" |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
完整 KV 快照。
{- "token": "string"
}
shardID 必需 | 字符串 分片 ID。 |
Content-Encoding | 字符串 默认: identity 枚举: "gzip" "identity" 该值告诉 InfluxDB 请求负载中应用于行协议的压缩类型。要使用 gzip 负载发出 API 请求,请发送 |
Content-Type | 字符串 默认值:application/octet-stream 值: "application/octet-stream" |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
TSM 快照。
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
Content-Encoding | 字符串 默认: identity 枚举: "gzip" "identity" 该值告诉 InfluxDB 请求负载中应用于行协议的压缩类型。要使用 gzip 压缩负载发出 API 请求,请发送 |
Content-Type | 字符串 默认值:application/octet-stream 值: "application/octet-stream" |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
完整 SQL 快照。
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
id | Array of strings 要返回的抓取目标 ID 列表。如果同时指定了 |
name | 字符串 指定抓取目标的名称。 |
org | 字符串 指定抓取目标的组织名称。 |
orgID | 字符串 指定抓取目标的组织 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "configurations": [
- {
- "allowInsecure": false,
- "bucketID": "string",
- "name": "string",
- "orgID": "string",
- "type": "prometheus",
- "bucket": "string",
- "id": "string",
- "links": {
- "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"
}, - "org": "字符串"
}
]
}
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要创建的抓取目标
allowInsecure | boolean 默认值: false 跳过端点上的 TLS 验证。 |
bucketID | 字符串 要写入的存储桶的 ID。 |
name | 字符串 抓取目标的名称。 |
orgID | 字符串 组织 ID。 |
type | 字符串 值: "prometheus" 要解析的指标类型。 |
url | 字符串 指标端点的 URL。 |
{- "allowInsecure": false,
- "bucketID": "string",
- "name": "string",
- "orgID": "string",
- "type": "prometheus",
}
{- "allowInsecure": false,
- "bucketID": "string",
- "name": "string",
- "orgID": "string",
- "type": "prometheus",
- "bucket": "string",
- "id": "string",
- "links": {
- "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"
}, - "org": "字符串"
}
scraperTargetID 必需 | 字符串 抓取目标的标识符。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "allowInsecure": false,
- "bucketID": "string",
- "name": "string",
- "orgID": "string",
- "type": "prometheus",
- "bucket": "string",
- "id": "string",
- "links": {
- "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"
}, - "org": "字符串"
}
scraperTargetID 必需 | 字符串 抓取目标的标识符。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要应用的抓取目标更新
allowInsecure | boolean 默认值: false 跳过端点上的 TLS 验证。 |
bucketID | 字符串 要写入的存储桶的 ID。 |
name | 字符串 抓取目标的名称。 |
orgID | 字符串 组织 ID。 |
type | 字符串 值: "prometheus" 要解析的指标类型。 |
url | 字符串 指标端点的 URL。 |
{- "allowInsecure": false,
- "bucketID": "string",
- "name": "string",
- "orgID": "string",
- "type": "prometheus",
}
{- "allowInsecure": false,
- "bucketID": "string",
- "name": "string",
- "orgID": "string",
- "type": "prometheus",
- "bucket": "string",
- "id": "string",
- "links": {
- "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"
}, - "org": "字符串"
}
scraperTargetID 必需 | 字符串 抓取目标 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加的标签
labelID 必需 | 字符串 标签 ID。指定要附加的标签。 |
{- "labelID": "string"
}
{- "label": {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
},
}
scraperTargetID 必需 | 字符串 抓取目标 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加为成员的用户
id 必需 | 字符串 要添加到资源的用户的 ID。 |
name | 字符串 要添加到资源的用户的名称。 |
{- "id": "string",
- "name": "string"
}
{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "活动",
- "role": "member"
}
scraperTargetID 必需 | 字符串 抓取目标 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加为所有者的用户
id 必需 | 字符串 要添加到资源的用户的 ID。 |
name | 字符串 要添加到资源的用户的名称。 |
{- "id": "string",
- "name": "string"
}
{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "活动",
- "role": "owner"
}
orgID 必需 | 字符串 组织 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要更新/添加的密钥-值对
属性名称* | 字符串 |
{- "apikey": "abc123xyz"
}
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
orgID 必需 | 字符串 组织 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要删除的密钥
secrets | Array of strings |
{- "secrets": [
- "string"
]
}
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
发送一个入职请求以设置初始用户、组织和存储桶。
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
创建源
bucket 必需 | 字符串 |
org 必需 | 字符串 |
password | 字符串 |
retentionPeriodHrs | integer 已弃用 新存储桶的保留期限,单位为纳秒。自 OSS 2.0 GA 以来,此键的名称具有误导性,请过渡到使用 |
retentionPeriodSeconds | integer <int64> |
令牌 | 字符串 要设置在初始用户上的身份验证令牌。如果未指定,服务器将生成一个令牌。 |
username 必需 | 字符串 |
{- "bucket": "string",
- "org": "string",
- "password": "string",
- "retentionPeriodHrs": 0,
- "retentionPeriodSeconds": 0,
- "token": "string",
- "username": "string"
}
{- "auth": {
- "description": "string",
- "status": "活动",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- “权限”: [
- {
- "action": "读取",
- “资源”: {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "授权"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}, - "bucket": {
- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "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"
}, - "name": "string",
- "orgID": "string",
- "retentionRules": [
- {
- "everySeconds": 86400,
- "shardGroupDurationSeconds": 0,
- "type": "expire"
}
], - "rp": "string",
- "schemaType": "implicit",
- "type": "user",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "org": {
- "createdAt": "2019-08-24T14:15:22Z",
- "defaultStorageType": "tsm",
- "description": "string",
- "id": "string",
- "links": {
- "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"
}, - "name": "string",
- "status": "活动",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "user": {
- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "active"
}
}
验证 基本身份验证凭据 用户,然后,如果成功,则生成用户会话。
要验证用户身份,请传递带有 Basic
方案和 base64 编码的用户名和密码的 HTTP Authorization
标头。有关语法和更多信息,请参阅 基本身份验证。
如果身份验证成功,InfluxDB 会为用户创建一个新会话,然后在 Set-Cookie
响应标头中返回会话 Cookie。
InfluxDB 仅在内存中存储用户会话。它们在十分钟内过期,并在 InfluxDB 实例重启期间过期。
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
curl --request POST http://localhost:8086/api/v2/signin \ --user "USERNAME:PASSWORD"
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
使会话 Cookie 指定的用户会话过期。
使用此端点使在用户使用 InfluxDB 开发人员控制台 (UI) 或 POST /api/v2/signin
端点进行身份验证时生成的用户会话过期。
例如,POST /api/v2/signout
端点表示以下三步流程中的第三步,用于验证用户身份、检索 user
资源,然后使会话过期
POST /api/v2/signin
端点发送带有用户的 基本身份验证凭据 的请求,以创建用户会话并生成会话 Cookie。GET /api/v2/me
端点发送请求,传递来自步骤 1 的存储的会话 Cookie 以检索用户信息。POST /api/v2/signout
端点发送请求,传递存储的会话 Cookie 以使会话过期。请参阅请求示例中的完整示例。
InfluxDB 仅在内存中存储用户会话。如果用户未注销,则用户会话将在十分钟内或在 InfluxDB 实例重启期间自动过期。
要了解有关 HTTP 请求中 Cookie 的更多信息,请参阅 Mozilla 开发者网络 (MDN) Web 文档,HTTP Cookie。
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
# The following example shows how to use cURL and the InfluxDB API # to do the following: # 1. Sign in a user with a username and password. # 2. Check that the user session exists for the user. # 3. Sign out the user to expire the session. # 4. Check that the session is no longer active. # 1. Send a request to `POST /api/v2/signin` to sign in the user. # In your request, pass the following: # # - `--user` option with basic authentication credentials. # - `-c` option with a file path where cURL will write cookies. curl --request POST \ -c ./cookie-file.tmp \ "$INFLUX_URL/api/v2/signin" \ --user "${INFLUX_USER_NAME}:${INFLUX_USER_PASSWORD}" # 2. To check that a user session exists for the user in step 1, # send a request to `GET /api/v2/me`. # In your request, pass the `-b` option with the session cookie file path from step 1. curl --request GET \ -b ./cookie-file.tmp \ "$INFLUX_URL/api/v2/me" # InfluxDB responds with the `user` resource. # 3. Send a request to `POST /api/v2/signout` to expire the user session. # In your request, pass the `-b` option with the session cookie file path from step 1. curl --request POST \ -b ./cookie-file.tmp \ "$INFLUX_URL/api/v2/signout" # If the user session is successfully expired, InfluxDB responds with an HTTP `204` status code. # 4. To check that the user session is expired, call `GET /api/v2/me` again, # passing the `-b` option with the cookie file path. curl --request GET \ -b ./cookie-file.tmp \ "$INFLUX_URL/api/v2/me" # If the user session is expired, InfluxDB responds with an HTTP `401` status code.
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
org | 字符串 组织的名称。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "sources": [
- {
- "default": true,
- "defaultRP": "string",
- "id": "string",
- "insecureSkipVerify": true,
- "languages": [
- "flux"
], - "links": {
- "buckets": "string",
- "health": "string",
- "query": "string",
- "self": "string"
}, - "name": "string",
- "orgID": "string",
- "password": "string",
- "sharedSecret": "string",
- "telegraf": "string",
- "token": "string",
- "type": "v1",
- "username": "string"
}
]
}
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
创建源
default | boolean |
defaultRP | 字符串 |
id | 字符串 |
insecureSkipVerify | boolean |
object | |
metaUrl | 字符串 <uri> |
name | 字符串 |
orgID | 字符串 |
password | 字符串 |
sharedSecret | 字符串 |
telegraf | 字符串 |
令牌 | 字符串 |
type | 字符串 枚举: "v1" "v2" "self" |
url | 字符串 <uri> |
username | 字符串 |
{- "default": true,
- "defaultRP": "string",
- "id": "string",
- "insecureSkipVerify": true,
- "links": {
- "buckets": "string",
- "health": "string",
- "query": "string",
- "self": "string"
}, - "name": "string",
- "orgID": "string",
- "password": "string",
- "sharedSecret": "string",
- "telegraf": "string",
- "token": "string",
- "type": "v1",
- "username": "string"
}
{- "default": true,
- "defaultRP": "string",
- "id": "string",
- "insecureSkipVerify": true,
- "languages": [
- "flux"
], - "links": {
- "buckets": "string",
- "health": "string",
- "query": "string",
- "self": "string"
}, - "name": "string",
- "orgID": "string",
- "password": "string",
- "sharedSecret": "string",
- "telegraf": "string",
- "token": "string",
- "type": "v1",
- "username": "string"
}
sourceID 必需 | 字符串 源 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "default": true,
- "defaultRP": "string",
- "id": "string",
- "insecureSkipVerify": true,
- "languages": [
- "flux"
], - "links": {
- "buckets": "string",
- "health": "string",
- "query": "string",
- "self": "string"
}, - "name": "string",
- "orgID": "string",
- "password": "string",
- "sharedSecret": "string",
- "telegraf": "string",
- "token": "string",
- "type": "v1",
- "username": "string"
}
sourceID 必需 | 字符串 源 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
源更新
default | boolean |
defaultRP | 字符串 |
id | 字符串 |
insecureSkipVerify | boolean |
object | |
metaUrl | 字符串 <uri> |
name | 字符串 |
orgID | 字符串 |
password | 字符串 |
sharedSecret | 字符串 |
telegraf | 字符串 |
令牌 | 字符串 |
type | 字符串 枚举: "v1" "v2" "self" |
url | 字符串 <uri> |
username | 字符串 |
{- "default": true,
- "defaultRP": "string",
- "id": "string",
- "insecureSkipVerify": true,
- "links": {
- "buckets": "string",
- "health": "string",
- "query": "string",
- "self": "string"
}, - "name": "string",
- "orgID": "string",
- "password": "string",
- "sharedSecret": "string",
- "telegraf": "string",
- "token": "string",
- "type": "v1",
- "username": "string"
}
{- "default": true,
- "defaultRP": "string",
- "id": "string",
- "insecureSkipVerify": true,
- "languages": [
- "flux"
], - "links": {
- "buckets": "string",
- "health": "string",
- "query": "string",
- "self": "string"
}, - "name": "string",
- "orgID": "string",
- "password": "string",
- "sharedSecret": "string",
- "telegraf": "string",
- "token": "string",
- "type": "v1",
- "username": "string"
}
sourceID 必需 | 字符串 源 ID。 |
org | 字符串 组织的名称。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "buckets": [
- {
- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "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"
}, - "name": "string",
- "orgID": "string",
- "retentionRules": [
- {
- "everySeconds": 86400,
- "shardGroupDurationSeconds": 0,
- "type": "expire"
}
], - "rp": "string",
- "schemaType": "implicit",
- "type": "user",
- "updatedAt": "2019-08-24T14:15:22Z"
}
],
}
使用 InfluxDB 任务引擎中的任务处理和分析您的数据。使用 /api/v2/tasks
端点来安排和管理任务、重试任务运行以及检索运行日志。
要配置任务,请提供脚本和运行任务的计划。有关示例,请参阅如何使用 POST /api/v2/tasks
端点创建任务。
一个 task
对象包含有关 InfluxDB 任务资源的信息。
下表定义了 task
对象中出现的属性
authorizationID | 字符串 一个授权 ID。指定任务与查询引擎通信时使用的授权。 要查找授权 ID,请使用 |
createdAt | 字符串 <date-time> |
cron | 字符串 一个 Cron 表达式,用于定义任务运行的计划。InfluxDB 在评估 Cron 表达式时使用系统时间。 |
描述 | 字符串 任务的描述。 |
every | string <duration> 任务运行的间隔(持续时间字面量)。 |
flux 必需 | string <flux> 任务执行的 Flux 脚本。 |
id 必需 | 字符串 |
Array of objects (Labels) | |
lastRunError | 字符串 |
lastRunStatus | 字符串 枚举: "failed" "success" "canceled" |
latestCompleted | 字符串 <date-time> 最近一次计划和完成运行的时间戳(RFC3339 日期/时间格式)。 |
object | |
name 必需 | 字符串 任务的名称。 |
偏移量 | string <duration> 计划时间过后延迟执行任务的持续时间。 |
org | 字符串 组织名称。指定拥有任务的组织。 |
orgID 必需 | 字符串 组织 ID。指定拥有任务的组织。 |
ownerID | 字符串 用户 ID。指定任务的所有者。 要查找用户 ID,您可以使用 |
status | string (TaskStatusType) 枚举: "active" "inactive"
|
updatedAt | 字符串 <date-time> |
{- "authorizationID": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "cron": "string",
- "description": "string",
- "every": "string",
- "flux": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "links": {
- "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"
}, - "name": "string",
- "offset": "string",
- "org": "string",
- "orgID": "string",
- "ownerID": "string",
- "status": "活动",
- "updatedAt": "2019-08-24T14:15:22Z"
}
after | 字符串 任务 ID。仅返回在指定任务之后创建的任务。 |
limit | 整数 [ 1 .. 500 ] 默认: 100 要返回的最大任务数。默认为 要减小有效负载大小,请组合使用 |
name | 字符串 任务名称。仅返回具有指定名称的任务。不同的任务可能具有相同的名称。 |
org | 字符串 一个组织名称。仅返回指定组织拥有的任务。 |
orgID | 字符串 一个组织 ID。仅返回指定组织拥有的任务。 |
status | |
type | 字符串 默认: "" 枚举: "basic" "system" 任务类型( |
user | 字符串 一个用户 ID。仅返回指定用户拥有的任务。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
curl https://localhost:8086/api/v2/tasks/?limit=-1&type=basic \ --header 'Content-Type: application/json' \ --header 'Authorization: Token INFLUX_API_TOKEN'
?type=basic
参数的示例响应正文。type=basic
省略了响应中的某些任务字段(createdAt
和 updatedAt
)和字段值(org
、flux
)。
{- "links": {
- "self": "/api/v2/tasks?limit=100"
}, - “任务”: [
- {
- "every": "30m",
- "flux": "",
- "id": "09956cbb6d378000",
- "labels": [ ],
- "lastRunStatus": "success",
- "latestCompleted": "2022-06-30T15:00:00Z",
- "links": {
- "labels": "/api/v2/tasks/09956cbb6d378000/labels",
- "logs": "/api/v2/tasks/09956cbb6d378000/logs",
- "members": "/api/v2/tasks/09956cbb6d378000/members",
- "owners": "/api/v2/tasks/09956cbb6d378000/owners",
- "runs": "/api/v2/tasks/09956cbb6d378000/runs",
- "self": "/api/v2/tasks/09956cbb6d378000"
}, - "name": "task1",
- "org": "",
- "orgID": "48c88459ee424a04",
- "ownerID": "0772396d1f411000",
- "status": "active"
}
]
}
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要创建的任务。
描述 | 字符串 任务的可选描述。 |
flux 必需 | 字符串 此任务要运行的 Flux 脚本。 |
org | 字符串 拥有此任务的组织的名称。 |
orgID | 字符串 拥有此任务的组织的 ID。 |
status | string (TaskStatusType) 枚举: "active" "inactive"
|
{- "description": "string",
- "flux": "string",
- "org": "string",
- "orgID": "string",
- "status": "active"
}
{- "authorizationID": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "cron": "string",
- "description": "string",
- "every": "string",
- "flux": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "links": {
- "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"
}, - "name": "string",
- "offset": "string",
- "org": "string",
- "orgID": "string",
- "ownerID": "string",
- "status": "活动",
- "updatedAt": "2019-08-24T14:15:22Z"
}
删除任务和关联的记录。
使用此端点删除任务和所有关联的记录(任务运行、日志和标签)。任务删除后,InfluxDB 会取消任务的所有计划运行。
如果您想禁用任务而不是删除它,请将任务状态更新为 inactive
。
taskID 必需 | 字符串 要删除的任务的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "code": "invalid",
- "message": "failed to decode request body: organization not found"
}
检索 任务。
taskID 必需 | 字符串 要检索的任务的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "authorizationID": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "cron": "string",
- "description": "string",
- "every": "string",
- "flux": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "links": {
- "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"
}, - "name": "string",
- "offset": "string",
- "org": "string",
- "orgID": "string",
- "ownerID": "string",
- "status": "活动",
- "updatedAt": "2019-08-24T14:15:22Z"
}
更新任务,然后取消任务的所有计划运行。
使用此端点设置、修改和清除任务属性(例如:cron
、name
、flux
、status
)。一旦 InfluxDB 应用更新,它将取消任务的所有先前计划的运行。
要更新任务,请传递一个包含更新的键值对的对象。要激活或停用任务,请设置 status
属性。"status": "inactive"
取消计划运行并阻止手动运行任务。
taskID 必需 | 字符串 要更新的任务的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
一个包含要应用的更新的任务属性的对象。
cron | 字符串 更新 flux 脚本中的 'cron' 选项。 |
描述 | 字符串 更新任务的描述。 |
every | 字符串 更新 flux 脚本中的 'every' 选项。 |
flux | 字符串 任务运行的 Flux 脚本。 |
name | 字符串 更新 flux 脚本中的 'name' 选项。 |
偏移量 | 字符串 更新 flux 脚本中的 'offset' 选项。 |
status | string (TaskStatusType) 枚举: "active" "inactive"
|
{- "cron": "string",
- "description": "string",
- "every": "string",
- "flux": "string",
- "name": "string",
- "offset": "string",
- "status": "active"
}
{- "authorizationID": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "cron": "string",
- "description": "string",
- "every": "string",
- "flux": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "links": {
- "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"
}, - "name": "string",
- "offset": "string",
- "org": "string",
- "orgID": "string",
- "ownerID": "string",
- "status": "活动",
- "updatedAt": "2019-08-24T14:15:22Z"
}
检索任务的所有标签的列表。
标签可用于分组和过滤任务。
taskID 必需 | 字符串 要检索标签的任务的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
],
}
向任务添加标签。
使用此端点添加标签,您可以使用该标签在 InfluxDB UI 中过滤任务。
taskID 必需 | 字符串 要标记的任务的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
一个包含要添加到任务的 labelID
的对象。
labelID 必需 | 字符串 标签 ID。指定要附加的标签。 |
{- "labelID": "string"
}
{- "label": {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
},
}
检索 任务的所有日志的列表。
当 InfluxDB 任务运行时,会在任务的历史记录中创建一个“运行”记录。与每次运行关联的日志提供相关的日志消息、时间戳和运行尝试的退出状态。
使用此端点仅检索任务的日志事件,而无需额外的任务元数据。
taskID 必需 | 字符串 任务 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "events": [
- {
- "message": "Started task from script: \"option task = {name: \\\"test task\\\", every: 3d, offset: 0s}\"",
- "runID": "09a946fc3167d000",
- "time": "2022-07-13T07:06:54.198167Z"
}, - {
- "message": "Completed(failed)",
- "runID": "09a946fc3167d000",
- "time": "2022-07-13T07:07:13.104037Z"
}, - {
- "message": "error exhausting result iterator: error in query specification while starting program: this Flux script returns no streaming data. Consider adding a \"yield\" or invoking streaming functions directly, without performing an assignment",
- "runID": "09a946fc3167d000",
- "time": "2022-07-13T08:24:37.115323Z"
}
]
}
已弃用:任务不使用 owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。
列出所有对指定的 任务具有 member
角色的用户。
taskID 必需 | 字符串 任务 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "users": [
- {
- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "活动",
- "role": "member"
}
]
}
已弃用:任务不使用 owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。
将用户添加到任务的成员并返回该成员。
taskID 必需 | 字符串 任务 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加为任务成员的用户。
id 必需 | 字符串 要添加到资源的用户的 ID。 |
name | 字符串 要添加到资源的用户的名称。 |
{- "id": "string",
- "name": "string"
}
{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "活动",
- "role": "member"
}
已弃用:任务不使用 owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。
从 任务中删除成员。
taskID 必需 | 字符串 任务 ID。 |
用户ID 必需 | 字符串 要移除的成员的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
已弃用:任务不使用 owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。
检索对任务具有所有者权限的所有用户。
taskID 必需 | 字符串 要检索所有者的任务的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "users": [
- {
- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "活动",
- "role": "owner"
}
]
}
已弃用:任务不使用 owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。
为用户分配任务 owner
角色。
使用此端点为任务创建资源所有者。资源所有者是对于特定资源具有 role: owner
的用户。
taskID 必需 | 字符串 任务 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加为任务所有者的用户。
id 必需 | 字符串 要添加到资源的用户的 ID。 |
name | 字符串 要添加到资源的用户的名称。 |
{- "id": "string",
- "name": "string"
}
{- "id": "0772396d1f411000",
- "links": {
- "logs": "/api/v2/users/0772396d1f411000/logs",
- "self": "/api/v2/users/0772396d1f411000"
}, - "name": "USER_NAME",
- "role": "owner",
- "status": "active"
}
已弃用:任务不使用 owner
和 member
角色。使用 /api/v2/authorizations
分配用户权限。
taskID 必需 | 字符串 任务 ID。 |
用户ID 必需 | 字符串 要删除的所有者的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
检索 任务的运行列表。
要限制返回的任务运行,请在您的请求中传递查询参数。如果未传递任何查询参数,InfluxDB 将返回所有任务运行,最多为默认 limit
。
taskID 必需 | 字符串 要获取运行的任务的 ID。仅返回此任务的运行。 |
after | 字符串 任务运行 ID。仅返回在此运行之后创建的运行。 |
afterTime | 字符串 <date-time> 时间戳(RFC3339 日期/时间格式)。仅返回在此时间之后计划的运行。 |
beforeTime | 字符串 <date-time> 时间戳(RFC3339 日期/时间格式)。仅返回在此时间之前计划的运行。 |
limit | 整数 [ 1 .. 500 ] 默认: 100 限制返回的任务运行数。默认为 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "runs": [
- {
- "finishedAt": "2006-01-02T15:04:05.999999999Z07:00",
- "flux": "string",
- "id": "string",
- "links": {
- "retry": "/api/v2/tasks/1/runs/1/retry",
- "self": "/api/v2/tasks/1/runs/1",
- "task": "/api/v2/tasks/1"
}, - “日志”: [
- {
- "message": "停止并着火",
- "runID": "string",
- "time": "2006-01-02T15:04:05.999999999Z07:00"
}
], - "requestedAt": "2006-01-02T15:04:05.999999999Z07:00",
- "scheduledFor": "2019-08-24T14:15:22Z",
- "startedAt": "2006-01-02T15:04:05.999999999Z07:00",
- "status": "已计划",
- "taskID": "string"
}
]
}
计划任务运行立即启动,忽略计划的运行。
使用此端点手动启动任务运行。计划的运行将继续按计划运行。这可能会导致并发运行的任务。
要重试之前的运行(并避免创建新的运行),请使用 POST /api/v2/tasks/{taskID}/runs/{runID}/retry
端点。
taskID 必需 | 字符串 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
scheduledFor | string or null <date-time> 用于运行的 |
{- "scheduledFor": "2019-08-24T14:15:22Z"
}
{- "finishedAt": "2006-01-02T15:04:05.999999999Z07:00",
- "flux": "string",
- "id": "string",
- "links": {
- "retry": "/api/v2/tasks/1/runs/1/retry",
- "self": "/api/v2/tasks/1/runs/1",
- "task": "/api/v2/tasks/1"
}, - “日志”: [
- {
- "message": "停止并着火",
- "runID": "string",
- "time": "2006-01-02T15:04:05.999999999Z07:00"
}
], - "requestedAt": "2006-01-02T15:04:05.999999999Z07:00",
- "scheduledFor": "2019-08-24T14:15:22Z",
- "startedAt": "2006-01-02T15:04:05.999999999Z07:00",
- "status": "已计划",
- "taskID": "string"
}
检索 任务的特定运行。
使用此端点检索特定任务运行的详细信息和日志。
runID 必需 | 字符串 要检索的运行的 ID。 |
taskID 必需 | 字符串 要检索运行的任务的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "finishedAt": "2022-07-18T14:46:07.308254Z",
- "id": "09b070dadaa7d000",
- "links": {
- "logs": "/api/v2/tasks/0996e56b2f378000/runs/09b070dadaa7d000/logs",
- "retry": "/api/v2/tasks/0996e56b2f378000/runs/09b070dadaa7d000/retry",
- "self": "/api/v2/tasks/0996e56b2f378000/runs/09b070dadaa7d000",
- "task": "/api/v2/tasks/0996e56b2f378000"
}, - “日志”: [
- {
- "message": "Started task from script: \"option task = {name: \\\"task1\\\", every: 30m} from(bucket: \\\"iot_center\\\") |> range(start: -90d) |> filter(fn: (r) => r._measurement == \\\"environment\\\") |> aggregateWindow(every: 1h, fn: mean)\"",
- "runID": "09b070dadaa7d000",
- "time": "2022-07-18T14:46:07.101231Z"
}, - {
- "message": "Completed(success)",
- "runID": "09b070dadaa7d000",
- "time": "2022-07-18T14:46:07.242859Z"
}
], - "requestedAt": "2022-07-18T14:46:06Z",
- "scheduledFor": "2022-07-18T14:46:06Z",
- "startedAt": "2022-07-18T14:46:07.16222Z",
- "status": "success",
- "taskID": "0996e56b2f378000"
}
检索任务运行的所有日志。日志是包含 runID
、time
和 message
属性的运行事件列表。
使用此端点帮助分析任务性能并排除失败的任务运行的故障。
runID 必需 | 字符串 要获取日志的运行的 ID。 |
taskID 必需 | 字符串 要获取日志的任务的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "events": [
- {
- "message": "Started task from script: \"option task = {name: \\\"test task\\\", every: 3d, offset: 0s}\"",
- "runID": "09a946fc3167d000",
- "time": "2022-07-13T07:06:54.198167Z"
}, - {
- "message": "Completed(failed)",
- "runID": "09a946fc3167d000",
- "time": "2022-07-13T07:07:13.104037Z"
}, - {
- "message": "error exhausting result iterator: error in query specification while starting program: this Flux script returns no streaming data. Consider adding a \"yield\" or invoking streaming functions directly, without performing an assignment",
- "runID": "09a946fc3167d000",
- "time": "2022-07-13T08:24:37.115323Z"
}
]
}
将 任务运行排队以进行重试,并返回计划的运行。
要手动启动新的任务运行,请使用 POST /api/v2/tasks/{taskID}/runs
端点。
status: "active"
)。runID 必需 | 字符串 任务运行 ID。指定要重试的任务运行。 要查找任务运行 ID,请使用 |
taskID 必需 | 字符串 任务 ID。指定要重试的任务。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{ }
{- "id": "09d60ffe08738000",
- "links": {
- "logs": "/api/v2/tasks/09a776832f381000/runs/09d60ffe08738000/logs",
- "retry": "/api/v2/tasks/09a776832f381000/runs/09d60ffe08738000/retry",
- "self": "/api/v2/tasks/09a776832f381000/runs/09d60ffe08738000",
- "task": "/api/v2/tasks/09a776832f381000"
}, - "requestedAt": "2022-08-16T20:05:11.84145Z",
- "scheduledFor": "2022-08-15T00:00:00Z",
- "status": "已计划",
- "taskID": "09a776832f381000"
}
orgID | 字符串 Telegraf 配置所属的组织 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "configurations": [
- {
- "config": "string",
- "description": "string",
- "metadata": {
- "buckets": [
- "string"
]
}, - "name": "string",
- "orgID": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "labels": "/api/v2/telegrafs/1/labels",
- "members": "/api/v2/telegrafs/1/members",
- "owners": "/api/v2/telegrafs/1/owners",
- "self": "/api/v2/telegrafs/1"
}
}
]
}
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要创建的 Telegraf 配置
config | 字符串 |
描述 | 字符串 |
object | |
name | 字符串 |
orgID | 字符串 |
对象数组objects |
{- "config": "string",
- "description": "string",
- "metadata": {
- "buckets": [
- "string"
]
}, - "name": "string",
- "orgID": "string",
- "plugins": [
- {
- "alias": "string",
- "config": "string",
- "description": "string",
- "name": "string",
- "type": "string"
}
]
}
{- "config": "string",
- "description": "string",
- "metadata": {
- "buckets": [
- "string"
]
}, - "name": "string",
- "orgID": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "labels": "/api/v2/telegrafs/1/labels",
- "members": "/api/v2/telegrafs/1/members",
- "owners": "/api/v2/telegrafs/1/owners",
- "self": "/api/v2/telegrafs/1"
}
}
telegrafID 必需 | 字符串 Telegraf 配置 ID。 |
Accept | 字符串 默认值: application/toml 枚举: "application/toml" "application/json" "application/octet-stream" |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "config": "string",
- "description": "string",
- "metadata": {
- "buckets": [
- "string"
]
}, - "name": "string",
- "orgID": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "labels": "/api/v2/telegrafs/1/labels",
- "members": "/api/v2/telegrafs/1/members",
- "owners": "/api/v2/telegrafs/1/owners",
- "self": "/api/v2/telegrafs/1"
}
}
telegrafID 必需 | 字符串 Telegraf 配置 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要应用的 Telegraf 配置更新
config | 字符串 |
描述 | 字符串 |
object | |
name | 字符串 |
orgID | 字符串 |
对象数组objects |
{- "config": "string",
- "description": "string",
- "metadata": {
- "buckets": [
- "string"
]
}, - "name": "string",
- "orgID": "string",
- "plugins": [
- {
- "alias": "string",
- "config": "string",
- "description": "string",
- "name": "string",
- "type": "string"
}
]
}
{- "config": "string",
- "description": "string",
- "metadata": {
- "buckets": [
- "string"
]
}, - "name": "string",
- "orgID": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "labels": "/api/v2/telegrafs/1/labels",
- "members": "/api/v2/telegrafs/1/members",
- "owners": "/api/v2/telegrafs/1/owners",
- "self": "/api/v2/telegrafs/1"
}
}
telegrafID 必需 | 字符串 Telegraf 配置 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加的标签
labelID 必需 | 字符串 标签 ID。指定要附加的标签。 |
{- "labelID": "string"
}
{- "label": {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
},
}
telegrafID 必需 | 字符串 Telegraf 配置 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加为成员的用户
id 必需 | 字符串 要添加到资源的用户的 ID。 |
name | 字符串 要添加到资源的用户的名称。 |
{- "id": "string",
- "name": "string"
}
{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "活动",
- "role": "member"
}
telegrafID 必需 | 字符串 Telegraf 配置 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加为所有者的用户
id 必需 | 字符串 要添加到资源的用户的 ID。 |
name | 字符串 要添加到资源的用户的名称。 |
{- "id": "string",
- "name": "string"
}
{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "活动",
- "role": "owner"
}
导出和应用 InfluxDB 模板。管理模板化 InfluxDB 资源的堆栈。
InfluxDB 模板是预先打包的配置,适用于从仪表板和 Telegraf 到通知和警报的所有内容。使用 InfluxDB 模板可以快速配置新的 InfluxDB 实例、备份仪表板配置或与 InfluxData 社区共享配置。
使用 /api/v2/templates
端点导出和应用模板。
InfluxDB 堆栈是有状态的 InfluxDB 模板,可让您随着时间的推移添加、更新和删除已安装的模板资源,避免在多次应用相同或相似模板时重复资源,并将更改应用于 InfluxDB OSS 或 InfluxDB Cloud 的分布式实例。
使用 /api/v2/stacks
端点管理已安装的模板资源。
name | 字符串 示例
堆栈名称。查找具有此名称的堆栈 可重复。要过滤多个堆栈名称,请为每个名称重复此参数--例如
|
orgID 必需 | 字符串 |
stackID | 字符串 示例
堆栈 ID。仅返回指定的堆栈。 可重复。要过滤多个堆栈 ID,请为每个 ID 重复此参数--例如
|
{- "stacks": [
- {
- "createdAt": "2019-08-24T14:15:22Z",
- "events": [
- {
- "description": "string",
- "eventType": "string",
- "name": "string",
- "resources": [
- {
- "apiVersion": "string",
- "associations": [
- {
- "kind": "Bucket",
- "metaName": "string"
}
], - "kind": "Bucket",
- "links": {
- "self": "string"
}, - "resourceID": "string",
- "templateMetaName": "string"
}
], - "sources": [
- "string"
], - "updatedAt": "2019-08-24T14:15:22Z",
- "urls": [
- "string"
]
}
], - "id": "string",
- "orgID": "string"
}
]
}
创建或初始化堆栈。
使用此端点手动初始化新堆栈,并提供以下可选信息
要在应用模板时自动创建堆栈,请使用 /api/v2/templates/apply endpoint。
write
权限要创建的堆栈。
描述 | 字符串 |
name | 字符串 |
orgID | 字符串 |
urls | Array of strings |
{- "description": "string",
- "name": "string",
- "orgID": "string",
- "urls": [
- "string"
]
}
{- "createdAt": "2019-08-24T14:15:22Z",
- "events": [
- {
- "description": "string",
- "eventType": "string",
- "name": "string",
- "resources": [
- {
- "apiVersion": "string",
- "associations": [
- {
- "kind": "Bucket",
- "metaName": "string"
}
], - "kind": "Bucket",
- "links": {
- "self": "string"
}, - "resourceID": "string",
- "templateMetaName": "string"
}
], - "sources": [
- "string"
], - "updatedAt": "2019-08-24T14:15:22Z",
- "urls": [
- "string"
]
}
], - "id": "string",
- "orgID": "string"
}
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
{- "createdAt": "2019-08-24T14:15:22Z",
- "events": [
- {
- "description": "string",
- "eventType": "string",
- "name": "string",
- "resources": [
- {
- "apiVersion": "string",
- "associations": [
- {
- "kind": "Bucket",
- "metaName": "string"
}
], - "kind": "Bucket",
- "links": {
- "self": "string"
}, - "resourceID": "string",
- "templateMetaName": "string"
}
], - "sources": [
- "string"
], - "updatedAt": "2019-08-24T14:15:22Z",
- "urls": [
- "string"
]
}
], - "id": "string",
- "orgID": "string"
}
stack_id 必需 | 字符串 堆栈的标识符。 |
要更新的堆栈。
对象数组objects | |
描述 | string or null |
name | string or null |
templateURLs | Array of strings or null |
{- "additionalResources": [
- {
- "kind": "string",
- "resourceID": "string",
- "templateMetaName": "string"
}
], - "description": "string",
- "name": "string",
- "templateURLs": [
- "string"
]
}
{- "createdAt": "2019-08-24T14:15:22Z",
- "events": [
- {
- "description": "string",
- "eventType": "string",
- "name": "string",
- "resources": [
- {
- "apiVersion": "string",
- "associations": [
- {
- "kind": "Bucket",
- "metaName": "string"
}
], - "kind": "Bucket",
- "links": {
- "self": "string"
}, - "resourceID": "string",
- "templateMetaName": "string"
}
], - "sources": [
- "string"
], - "updatedAt": "2019-08-24T14:15:22Z",
- "urls": [
- "string"
]
}
], - "id": "string",
- "orgID": "string"
}
{- "createdAt": "2019-08-24T14:15:22Z",
- "events": [
- {
- "description": "string",
- "eventType": "string",
- "name": "string",
- "resources": [
- {
- "apiVersion": "string",
- "associations": [
- {
- "kind": "Bucket",
- "metaName": "string"
}
], - "kind": "Bucket",
- "links": {
- "self": "string"
}, - "resourceID": "string",
- "templateMetaName": "string"
}
], - "sources": [
- "string"
], - "updatedAt": "2019-08-24T14:15:22Z",
- "urls": [
- "string"
]
}
], - "id": "string",
- "orgID": "string"
}
应用模板以创建或更新 InfluxDB 堆栈的 资源。响应包含更改差异和堆栈 ID。
使用此端点将 InfluxDB 模板安装到组织。在请求中提供模板 URL 或模板对象。要自定义安装哪些模板资源,请使用 actions
参数。
默认情况下,当您应用模板时,InfluxDB 会安装模板以创建和更新堆栈资源,然后生成更改差异。如果您在请求正文中传递 dryRun: true
,InfluxDB 将验证模板并生成资源差异,但不会对您的实例进行任何更改。
某些模板可能包含用于自定义元数据的环境引用。要为环境引用提供自定义值,请在请求正文中传递 envRefs
属性。有关更多信息和示例,请参阅如何定义环境引用。
某些模板可能包含使用密钥的查询。要提供自定义密钥值,请在请求正文中传递 secrets
属性。不要在模板中暴露密钥值。有关更多信息,请参阅如何在安装模板时传递密钥。
write
权限。应用模板的参数。
Array of objects or objects
您可以使用以下操作来阻止创建或更新资源
| |
dryRun | boolean 仅对请求中传递的模板执行干运行。
|
object 一个对象,其中包含键值对,这些键值对映射到模板中的环境引用。 模板中的环境引用是具有 当您应用模板时,InfluxDB 会将模板中的 以下模板字段可以使用环境引用
有关在模板字段中包含环境引用的更多信息,请参阅如何包含用户可定义的资源名称。 | |
orgID | 字符串 组织 ID。InfluxDB 将模板应用于此组织。该组织拥有模板创建的所有资源。 要查找您的组织,请参阅如何查看组织。 |
对象数组objects 模板文件的 URL 列表。 要应用位于 URL 的模板清单文件,请传递包含 URL 的数组的 | |
object 一个对象,其中包含键值对,这些键值对映射到查询中的密钥。 查询可以引用存储在 InfluxDB 中的密钥--例如,以下 Flux 脚本检索
要在
InfluxDB 将键值对存储为密钥,您可以使用 相关指南 | |
stackID | 字符串 要更新的堆栈 ID。 要将模板应用于组织中现有的堆栈,请使用 要查找堆栈 ID,请使用 InfluxDB 相关指南 |
object 要应用的模板对象。模板对象具有 传递 | |
对象数组objects 要应用的模板对象列表。模板对象具有 使用 |
{- "actions": [
- {
- "action": "skipKind",
- “属性”: {
- "kind": "Bucket"
}
}, - {
- "action": "skipKind",
- “属性”: {
- "kind": "Task"
}
}
], - "orgID": "INFLUX_ORG_ID",
- "templates": [
- {
- "contents": [
- {
- "[object Object]": null
}
]
}
]
}
{- "diff": {
- "buckets": [
- {
- "id": "string",
- "kind": "Bucket",
- "new": {
- "description": "string",
- "name": "string",
- "retentionRules": [
- {
- "everySeconds": 86400,
- "shardGroupDurationSeconds": 0,
- "type": "expire"
}
]
}, - "old": {
- "description": "string",
- "name": "string",
- "retentionRules": [
- {
- "everySeconds": 86400,
- "shardGroupDurationSeconds": 0,
- "type": "expire"
}
]
}, - "stateStatus": "string",
- "templateMetaName": "string"
}
], - "checks": [
- {
- "id": "string",
- "kind": "Bucket",
- "new": {
- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "links": {
- "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"
}, - "name": "string",
- "orgID": "string",
- "ownerID": "string",
- "query": {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- null
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}, - "status": "活动",
- "taskID": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "every": "string",
- "level": "UNKNOWN",
- "offset": "string",
- "reportZero": true,
- "staleTime": "string",
- "statusMessageTemplate": "string",
- "tags": [
- {
- "key": "string",
- "value": "string"
}
], - "timeSince": "string",
- "type": "deadman"
}, - "old": {
- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "links": {
- "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"
}, - "name": "string",
- "orgID": "string",
- "ownerID": "string",
- "query": {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- null
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}, - "status": "活动",
- "taskID": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "every": "string",
- "level": "UNKNOWN",
- "offset": "string",
- "reportZero": true,
- "staleTime": "string",
- "statusMessageTemplate": "string",
- "tags": [
- {
- "key": "string",
- "value": "string"
}
], - "timeSince": "string",
- "type": "deadman"
}, - "stateStatus": "string",
- "templateMetaName": "string"
}
], - "dashboards": [
- {
- "id": "string",
- "kind": "Bucket",
- "new": {
- "charts": [
- {
- "height": 0,
- “属性”: {
- "adaptiveZoomHide": true,
- "axes": {
- "x": {
- "base": null,
- "bounds": [ ],
- "label": null,
- "prefix": null,
- "scale": null,
- "suffix": null
}, - "y": {
- "base": null,
- "bounds": [ ],
- "label": null,
- "prefix": null,
- "scale": null,
- "suffix": null
}
}, - "colors": [
- {
- "hex": null,
- "id": null,
- "name": null,
- "type": null,
- "value": null
}
], - "decimalPlaces": {
- "digits": 0,
- "isEnforced": true
}, - "generateXAxisTicks": [
- "string"
], - "generateYAxisTicks": [
- "string"
], - "hoverDimension": "auto",
- "legendColorizeRows": true,
- "legendHide": true,
- "legendOpacity": 0,
- "legendOrientationThreshold": 0,
- "note": "string",
- "position": "overlaid",
- "prefix": "string",
- "queries": [
- {
- "builderConfig": null,
- "editMode": null,
- "name": null,
- "text": null
}
], - "shadeBelow": true,
- "shape": "chronograf-v2",
- "showNoteWhenEmpty": true,
- "staticLegend": {
- "colorizeRows": true,
- "heightRatio": 0,
- "opacity": 0,
- "orientationThreshold": 0,
- "show": true,
- "valueAxis": "string",
- "widthRatio": 0
}, - "suffix": "string",
- "timeFormat": "string",
- "type": "line-plus-single-stat",
- "xColumn": "string",
- "xTickStart": 0,
- "xTickStep": 0,
- "xTotalTicks": 0,
- "yColumn": "string",
- "yTickStart": 0,
- "yTickStep": 0,
- "yTotalTicks": 0
}, - "width": 0,
- "xPos": 0,
- "yPos": 0
}
], - "description": "string",
- "name": "string"
}, - "old": {
- "charts": [
- {
- "height": 0,
- “属性”: {
- "adaptiveZoomHide": true,
- "axes": {
- "x": {
- "base": null,
- "bounds": [ ],
- "label": null,
- "prefix": null,
- "scale": null,
- "suffix": null
}, - "y": {
- "base": null,
- "bounds": [ ],
- "label": null,
- "prefix": null,
- "scale": null,
- "suffix": null
}
}, - "colors": [
- {
- "hex": null,
- "id": null,
- "name": null,
- "type": null,
- "value": null
}
], - "decimalPlaces": {
- "digits": 0,
- "isEnforced": true
}, - "generateXAxisTicks": [
- "string"
], - "generateYAxisTicks": [
- "string"
], - "hoverDimension": "auto",
- "legendColorizeRows": true,
- "legendHide": true,
- "legendOpacity": 0,
- "legendOrientationThreshold": 0,
- "note": "string",
- "position": "overlaid",
- "prefix": "string",
- "queries": [
- {
- "builderConfig": null,
- "editMode": null,
- "name": null,
- "text": null
}
], - "shadeBelow": true,
- "shape": "chronograf-v2",
- "showNoteWhenEmpty": true,
- "staticLegend": {
- "colorizeRows": true,
- "heightRatio": 0,
- "opacity": 0,
- "orientationThreshold": 0,
- "show": true,
- "valueAxis": "string",
- "widthRatio": 0
}, - "suffix": "string",
- "timeFormat": "string",
- "type": "line-plus-single-stat",
- "xColumn": "string",
- "xTickStart": 0,
- "xTickStep": 0,
- "xTotalTicks": 0,
- "yColumn": "string",
- "yTickStart": 0,
- "yTickStep": 0,
- "yTotalTicks": 0
}, - "width": 0,
- "xPos": 0,
- "yPos": 0
}
], - "description": "string",
- "name": "string"
}, - "stateStatus": "string",
- "templateMetaName": "string"
}
], - "labelMappings": [
- {
- "labelID": "string",
- "labelName": "string",
- "labelTemplateMetaName": "string",
- "resourceID": "string",
- "resourceName": "string",
- "resourceTemplateMetaName": "string",
- "resourceType": "string",
- "status": "string"
}
], - “标签”: [
- {
- "id": "string",
- "kind": "Bucket",
- "new": {
- "color": "string",
- "description": "string",
- "name": "string"
}, - "old": {
- "color": "string",
- "description": "string",
- "name": "string"
}, - "stateStatus": "string",
- "templateMetaName": "string"
}
], - "notificationEndpoints": [
- {
- "id": "string",
- "kind": "Bucket",
- "new": {
- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "labels": "/api/v2/notificationEndpoints/1/labels",
- "members": "/api/v2/notificationEndpoints/1/members",
- "owners": "/api/v2/notificationEndpoints/1/owners",
- "self": "/api/v2/notificationEndpoints/1"
}, - "name": "string",
- "orgID": "string",
- "status": "活动",
- "type": "slack",
- "updatedAt": "2019-08-24T14:15:22Z",
- "userID": "string",
- "token": "string",
- "url": "string"
}, - "old": {
- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "labels": "/api/v2/notificationEndpoints/1/labels",
- "members": "/api/v2/notificationEndpoints/1/members",
- "owners": "/api/v2/notificationEndpoints/1/owners",
- "self": "/api/v2/notificationEndpoints/1"
}, - "name": "string",
- "orgID": "string",
- "status": "活动",
- "type": "slack",
- "updatedAt": "2019-08-24T14:15:22Z",
- "userID": "string",
- "token": "string",
- "url": "string"
}, - "stateStatus": "string",
- "templateMetaName": "string"
}
], - "notificationRules": [
- {
- "id": "string",
- "kind": "Bucket",
- "new": {
- "description": "string",
- "endpointID": "string",
- "endpointName": "string",
- "endpointType": "string",
- "every": "string",
- "messageTemplate": "string",
- "name": "string",
- "offset": "string",
- "status": "string",
- "statusRules": [
- {
- "currentLevel": "string",
- "previousLevel": "string"
}
], - "tagRules": [
- {
- "key": "string",
- "operator": "string",
- "value": "string"
}
]
}, - "old": {
- "description": "string",
- "endpointID": "string",
- "endpointName": "string",
- "endpointType": "string",
- "every": "string",
- "messageTemplate": "string",
- "name": "string",
- "offset": "string",
- "status": "string",
- "statusRules": [
- {
- "currentLevel": "string",
- "previousLevel": "string"
}
], - "tagRules": [
- {
- "key": "string",
- "operator": "string",
- "value": "string"
}
]
}, - "stateStatus": "string",
- "templateMetaName": "string"
}
], - “任务”: [
- {
- "id": "string",
- "kind": "Bucket",
- "new": {
- "cron": "string",
- "description": "string",
- "every": "string",
- "name": "string",
- "offset": "string",
- "query": "string",
- "status": "string"
}, - "old": {
- "cron": "string",
- "description": "string",
- "every": "string",
- "name": "string",
- "offset": "string",
- "query": "string",
- "status": "string"
}, - "stateStatus": "string",
- "templateMetaName": "string"
}
], - "telegrafConfigs": [
- {
- "id": "string",
- "kind": "Bucket",
- "new": {
- "config": "string",
- "description": "string",
- "metadata": {
- "buckets": [
- "string"
]
}, - "name": "string",
- "orgID": "string"
}, - "old": {
- "config": "string",
- "description": "string",
- "metadata": {
- "buckets": [
- "string"
]
}, - "name": "string",
- "orgID": "string"
}, - "stateStatus": "string",
- "templateMetaName": "string"
}
], - "variables": [
- {
- "id": "string",
- "kind": "Bucket",
- "new": {
- "args": {
- "type": "query",
- "values": {
- "language": "string",
- "query": "string"
}
}, - "description": "string",
- "name": "string"
}, - "old": {
- "args": {
- "type": "query",
- "values": {
- "language": "string",
- "query": "string"
}
}, - "description": "string",
- "name": "string"
}, - "stateStatus": "string",
- "templateMetaName": "string"
}
]
}, - "errors": [
- {
- "fields": [
- "string"
], - "indexes": [
- 0
], - "kind": "Bucket",
- "reason": "string"
}
], - "sources": [
- "string"
], - "stackID": "string",
- "summary": {
- "buckets": [
- {
- "description": "string",
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "id": "string",
- "kind": "Bucket",
- "labelAssociations": [
- {
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "id": "string",
- "kind": "Bucket",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "string",
- "description": "string"
}, - "templateMetaName": "string"
}
], - "name": "string",
- "orgID": "string",
- "retentionPeriod": 0,
- "templateMetaName": "string"
}
], - "checks": [
- {
- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "失败",
- "latestCompleted": "2019-08-24T14:15:22Z",
- "links": {
- "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"
}, - "name": "string",
- "orgID": "string",
- "ownerID": "string",
- "query": {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}, - "status": "活动",
- "taskID": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "every": "string",
- "level": "UNKNOWN",
- "offset": "string",
- "reportZero": true,
- "staleTime": "string",
- "statusMessageTemplate": "string",
- "tags": [
- {
- "key": "string",
- "value": "string"
}
], - "timeSince": "string",
- "type": "deadman",
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "kind": "Bucket",
- "labelAssociations": [
- {
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "id": "string",
- "kind": "Bucket",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "string",
- "description": "string"
}, - "templateMetaName": "string"
}
], - "templateMetaName": "string"
}
], - "dashboards": [
- {
- "charts": [
- {
- "height": 0,
- “属性”: {
- "adaptiveZoomHide": true,
- "axes": {
- "x": {
- "base": "",
- "bounds": [
- null
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}, - "y": {
- "base": "",
- "bounds": [
- null
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}
}, - "colors": [
- {
- "hex": "strings",
- "id": "string",
- "name": "string",
- "type": "min",
- "value": 0
}
], - "decimalPlaces": {
- "digits": 0,
- "isEnforced": true
}, - "generateXAxisTicks": [
- "string"
], - "generateYAxisTicks": [
- "string"
], - "hoverDimension": "auto",
- "legendColorizeRows": true,
- "legendHide": true,
- "legendOpacity": 0,
- "legendOrientationThreshold": 0,
- "note": "string",
- "position": "overlaid",
- "prefix": "string",
- "queries": [
- {
- "builderConfig": {
- "aggregateWindow": { },
- "buckets": [ ],
- "functions": [ ],
- "tags": [ ]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}
], - "shadeBelow": true,
- "shape": "chronograf-v2",
- "showNoteWhenEmpty": true,
- "staticLegend": {
- "colorizeRows": true,
- "heightRatio": 0,
- "opacity": 0,
- "orientationThreshold": 0,
- "show": true,
- "valueAxis": "string",
- "widthRatio": 0
}, - "suffix": "string",
- "timeFormat": "string",
- "type": "line-plus-single-stat",
- "xColumn": "string",
- "xTickStart": 0,
- "xTickStep": 0,
- "xTotalTicks": 0,
- "yColumn": "string",
- "yTickStart": 0,
- "yTickStep": 0,
- "yTotalTicks": 0
}, - "width": 0,
- "xPos": 0,
- "yPos": 0
}
], - "description": "string",
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "id": "string",
- "kind": "Bucket",
- "labelAssociations": [
- {
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "id": "string",
- "kind": "Bucket",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "string",
- "description": "string"
}, - "templateMetaName": "string"
}
], - "name": "string",
- "orgID": "string",
- "templateMetaName": "string"
}
], - "labelMappings": [
- {
- "labelID": "string",
- "labelName": "string",
- "labelTemplateMetaName": "string",
- "resourceID": "string",
- "resourceName": "string",
- "resourceTemplateMetaName": "string",
- "resourceType": "string",
- "status": "string"
}
], - “标签”: [
- {
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "id": "string",
- "kind": "Bucket",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "string",
- "description": "string"
}, - "templateMetaName": "string"
}
], - "missingEnvRefs": [
- "string"
], - "missingSecrets": [
- "string"
], - "notificationEndpoints": [
- {
- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "links": {
- "labels": "/api/v2/notificationEndpoints/1/labels",
- "members": "/api/v2/notificationEndpoints/1/members",
- "owners": "/api/v2/notificationEndpoints/1/owners",
- "self": "/api/v2/notificationEndpoints/1"
}, - "name": "string",
- "orgID": "string",
- "status": "活动",
- "type": "slack",
- "updatedAt": "2019-08-24T14:15:22Z",
- "userID": "string",
- "token": "string",
- "url": "string",
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "kind": "Bucket",
- "labelAssociations": [
- {
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "id": "string",
- "kind": "Bucket",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "string",
- "description": "string"
}, - "templateMetaName": "string"
}
], - "templateMetaName": "string"
}
], - "notificationRules": [
- {
- "description": "string",
- "endpointID": "string",
- "endpointTemplateMetaName": "string",
- "endpointType": "string",
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "every": "string",
- "kind": "Bucket",
- "labelAssociations": [
- {
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "id": "string",
- "kind": "Bucket",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "string",
- "description": "string"
}, - "templateMetaName": "string"
}
], - "messageTemplate": "string",
- "name": "string",
- "offset": "string",
- "status": "string",
- "statusRules": [
- {
- "currentLevel": "string",
- "previousLevel": "string"
}
], - "tagRules": [
- {
- "key": "string",
- "operator": "string",
- "value": "string"
}
], - "templateMetaName": "string"
}
], - “任务”: [
- {
- "cron": "string",
- "description": "string",
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "every": "string",
- "id": "string",
- "kind": "Bucket",
- "name": "string",
- "offset": "string",
- "query": "string",
- "status": "string",
- "templateMetaName": "string"
}
], - "telegrafConfigs": [
- {
- "config": "string",
- "description": "string",
- "metadata": {
- "buckets": [
- "string"
]
}, - "name": "string",
- "orgID": "string",
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "kind": "Bucket",
- "labelAssociations": [
- {
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "id": "string",
- "kind": "Bucket",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "string",
- "description": "string"
}, - "templateMetaName": "string"
}
], - "templateMetaName": "string"
}
], - "variables": [
- {
- "arguments": {
- "type": "query",
- "values": {
- "language": "string",
- "query": "string"
}
}, - "description": "string",
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "id": "string",
- "kind": "Bucket",
- "labelAssociations": [
- {
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "id": "string",
- "kind": "Bucket",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "string",
- "description": "string"
}, - "templateMetaName": "string"
}
], - "name": "string",
- "orgID": "string",
- "templateMetaName": "string"
}
]
}
}
{- "orgIDs": [
- {
- "orgID": "string",
- "resourceFilters": {
- "byLabel": [
- "string"
], - "byResourceKind": [
- "Bucket"
]
}
}
], - "resources": [
- {
- "id": "string",
- "kind": "Bucket",
- "name": "string"
}
], - "stackID": "string"
}
[- {
- "apiVersion": "influxdata.com/v2alpha1",
- "kind": "Bucket",
- "metadata": {
- "name": "string"
}, - "spec": { }
}
]
管理您组织的用户。用户是指有权访问 InfluxDB 的人。要授予用户访问数据的权限,请将其添加为组织的成员并为其提供 API 令牌。
(可选)您可以将授权(及其 API 令牌)限定于用户。如果用户使用用户名和密码登录,从而创建用户会话,则该会话将携带用户所有授权授予的权限。要创建用户会话,请使用 POST /api/v2/signin
端点。
更新已登录用户的密码。
此端点代表以下三步流程中的第三步,允许具有用户会话的用户更新其密码
POST /api/v2/signin
端点,以创建用户会话并生成会话 Cookie。Set-Cookie
) 标头。PUT /api/v2/me/password
端点Set-Cookie
标头Authorization Basic
标头{"password": "NEW_PASSWORD"}
influxdb-oss-session 必需 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
新密码。
password 必需 | 字符串 |
{- "password": "string"
}
{- "code": "unauthorized",
- "message": "unauthorized access"
}
after | 字符串 要从中查找的资源 ID。返回在指定记录之后创建的记录;结果不包括指定的记录。 使用 |
id | 字符串 用户 ID。仅列出指定的 用户。 |
limit | integer [ 1 .. 100 ] 默认值: 20 限制返回的记录数。默认为 |
name | 字符串 用户名。仅列出指定的 用户。 |
偏移量 | integer >= 0 分页的偏移量。要跳过的记录数。 有关分页参数的更多信息,请参阅 分页。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "users": [
- {
- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "active"
}
]
}
创建可以访问 InfluxDB 的用户。返回该用户。
使用此端点创建一个用户,该用户可以通过以下接口之一登录以启动用户会话
/api/v2/signin
InfluxDB API 端点此端点代表四步流程中的前两步,允许用户使用用户名和密码进行身份验证,然后访问组织中的数据
POST /api/v2/users
发送 POST
请求。name
属性是必需的。id
属性)值。POST /api/v2/authorizations
发送 POST
请求,传递步骤 2 中的用户 ID (id
)。POST /api/v2/users/USER_ID/password
发送 POST
请求,传递步骤 2 中的用户 ID。操作 | 必需权限 | 限制 |
---|---|---|
创建用户 | 操作员令牌 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要创建的用户。
name 必需 | 字符串 用户名。 |
status | 字符串 默认值: "active" 枚举: "active" "inactive" 如果 |
{- "name": "string",
- "status": "active"
}
{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "active"
}
用户ID 必需 | 字符串 用户 ID。指定要删除的用户。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}
用户ID 必需 | 字符串 用户 ID。指定要更新的用户。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
在请求正文中,提供要更新的用户属性。
name 必需 | 字符串 用户名。 |
status | 字符串 默认值: "active" 枚举: "active" "inactive" 如果 |
{- "name": "string",
- "status": "active"
}
{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "active"
}
更新用户密码。
用户ID 必需 | 字符串 要为其设置密码的用户的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要为用户设置的新密码。
password 必需 | 字符串 |
{- "password": "string"
}
{- "code": "invalid",
- "message": "passwords cannot be changed through the InfluxDB Cloud API"
}
更新用户密码。
使用此端点让用户使用 基本身份验证凭据 进行身份验证并设置新密码。
用户ID 必需 | 字符串 要为其设置密码的用户的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要为用户设置的新密码。
password 必需 | 字符串 |
{- "password": "string"
}
{- "code": "invalid",
- "message": "passwords cannot be changed through the InfluxDB Cloud API"
}
org | 字符串 组织的名称。 |
orgID | 字符串 组织 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "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"
]
}
]
}
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要创建的变量
必需 | QueryVariableProperties (object) or ConstantVariableProperties (object) or MapVariableProperties (object) (VariableProperties) |
createdAt | 字符串 <date-time> |
描述 | 字符串 |
Array of objects (Labels) | |
name 必需 | 字符串 |
orgID 必需 | 字符串 |
selected | Array of strings |
updatedAt | 字符串 <date-time> |
{- "arguments": {
- "type": "query",
- "values": {
- "language": "string",
- "query": "string"
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- “标签”: [
- {
- "name": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "name": "string",
- "orgID": "string",
- "selected": [
- "string"
], - "updatedAt": "2019-08-24T14:15:22Z"
}
{- "arguments": {
- "type": "query",
- "values": {
- "language": "string",
- "query": "string"
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "name": "string",
- "orgID": "string",
- "selected": [
- "string"
], - "updatedAt": "2019-08-24T14:15:22Z"
}
variableID 必需 | 字符串 变量 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "arguments": {
- "type": "query",
- "values": {
- "language": "string",
- "query": "string"
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "name": "string",
- "orgID": "string",
- "selected": [
- "string"
], - "updatedAt": "2019-08-24T14:15:22Z"
}
variableID 必需 | 字符串 变量 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要应用的变量更新
必需 | QueryVariableProperties (object) or ConstantVariableProperties (object) or MapVariableProperties (object) (VariableProperties) |
createdAt | 字符串 <date-time> |
描述 | 字符串 |
Array of objects (Labels) | |
name 必需 | 字符串 |
orgID 必需 | 字符串 |
selected | Array of strings |
updatedAt | 字符串 <date-time> |
{- "arguments": {
- "type": "query",
- "values": {
- "language": "string",
- "query": "string"
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- “标签”: [
- {
- "name": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "name": "string",
- "orgID": "string",
- "selected": [
- "string"
], - "updatedAt": "2019-08-24T14:15:22Z"
}
{- "arguments": {
- "type": "query",
- "values": {
- "language": "string",
- "query": "string"
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "name": "string",
- "orgID": "string",
- "selected": [
- "string"
], - "updatedAt": "2019-08-24T14:15:22Z"
}
variableID 必需 | 字符串 变量 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要替换的变量
必需 | QueryVariableProperties (object) or ConstantVariableProperties (object) or MapVariableProperties (object) (VariableProperties) |
createdAt | 字符串 <date-time> |
描述 | 字符串 |
Array of objects (Labels) | |
name 必需 | 字符串 |
orgID 必需 | 字符串 |
selected | Array of strings |
updatedAt | 字符串 <date-time> |
{- "arguments": {
- "type": "query",
- "values": {
- "language": "string",
- "query": "string"
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- “标签”: [
- {
- "name": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "name": "string",
- "orgID": "string",
- "selected": [
- "string"
], - "updatedAt": "2019-08-24T14:15:22Z"
}
{- "arguments": {
- "type": "query",
- "values": {
- "language": "string",
- "query": "string"
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- “标签”: [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
}
], - "name": "string",
- "orgID": "string",
- "selected": [
- "string"
], - "updatedAt": "2019-08-24T14:15:22Z"
}
variableID 必需 | 字符串 变量 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加的标签
labelID 必需 | 字符串 标签 ID。指定要附加的标签。 |
{- "labelID": "string"
}
{- "label": {
- "id": "string",
- "name": "string",
- "orgID": "string",
- “属性”: {
- "color": "ffb3b3",
- "description": "这是一个描述"
}
},
}
cellID 必需 | 字符串 单元格 ID。 |
dashboardID 必需 | 字符串 仪表盘 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "id": "string",
- "links": {
- "self": "string"
}, - "name": "string",
- “属性”: {
- "adaptiveZoomHide": true,
- "axes": {
- "x": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}, - "y": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}
}, - "colors": [
- {
- "hex": "strings",
- "id": "string",
- "name": "string",
- "type": "min",
- "value": 0
}
], - "decimalPlaces": {
- "digits": 0,
- "isEnforced": true
}, - "generateXAxisTicks": [
- "string"
], - "generateYAxisTicks": [
- "string"
], - "hoverDimension": "auto",
- "legendColorizeRows": true,
- "legendHide": true,
- "legendOpacity": 0,
- "legendOrientationThreshold": 0,
- "note": "string",
- "position": "overlaid",
- "prefix": "string",
- "queries": [
- {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}
], - "shadeBelow": true,
- "shape": "chronograf-v2",
- "showNoteWhenEmpty": true,
- "staticLegend": {
- "colorizeRows": true,
- "heightRatio": 0,
- "opacity": 0,
- "orientationThreshold": 0,
- "show": true,
- "valueAxis": "string",
- "widthRatio": 0
}, - "suffix": "string",
- "timeFormat": "string",
- "type": "line-plus-single-stat",
- "xColumn": "string",
- "xTickStart": 0,
- "xTickStep": 0,
- "xTotalTicks": 0,
- "yColumn": "string",
- "yTickStart": 0,
- "yTickStep": 0,
- "yTotalTicks": 0
}
}
cellID 必需 | 字符串 要更新的单元格的 ID。 |
dashboardID 必需 | 字符串 要更新的仪表盘的 ID。 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
name 必需 | 字符串 |
必需 | LinePlusSingleStatProperties (object) 或 XYViewProperties (object) 或 SingleStatViewProperties (object) 或 HistogramViewProperties (object) 或 GaugeViewProperties (object) 或 TableViewProperties (object) 或 SimpleTableViewProperties (object) 或 MarkdownViewProperties (object) 或 CheckViewProperties (object) 或 ScatterViewProperties (object) 或 HeatmapViewProperties (object) 或 MosaicViewProperties (object) 或 BandViewProperties (object) 或 GeoViewProperties (object) (ViewProperties) |
{- "name": "string",
- “属性”: {
- "adaptiveZoomHide": true,
- "axes": {
- "x": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}, - "y": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}
}, - "colors": [
- {
- "hex": "strings",
- "id": "string",
- "name": "string",
- "type": "min",
- "value": 0
}
], - "decimalPlaces": {
- "digits": 0,
- "isEnforced": true
}, - "generateXAxisTicks": [
- "string"
], - "generateYAxisTicks": [
- "string"
], - "hoverDimension": "auto",
- "legendColorizeRows": true,
- "legendHide": true,
- "legendOpacity": 0,
- "legendOrientationThreshold": 0,
- "note": "string",
- "position": "overlaid",
- "prefix": "string",
- "queries": [
- {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}
], - "shadeBelow": true,
- "shape": "chronograf-v2",
- "showNoteWhenEmpty": true,
- "staticLegend": {
- "colorizeRows": true,
- "heightRatio": 0,
- "opacity": 0,
- "orientationThreshold": 0,
- "show": true,
- "valueAxis": "string",
- "widthRatio": 0
}, - "suffix": "string",
- "timeFormat": "string",
- "type": "line-plus-single-stat",
- "xColumn": "string",
- "xTickStart": 0,
- "xTickStep": 0,
- "xTotalTicks": 0,
- "yColumn": "string",
- "yTickStart": 0,
- "yTickStep": 0,
- "yTotalTicks": 0
}
}
{- "id": "string",
- "links": {
- "self": "string"
}, - "name": "string",
- “属性”: {
- "adaptiveZoomHide": true,
- "axes": {
- "x": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}, - "y": {
- "base": "",
- "bounds": [
- "string"
], - "label": "string",
- "prefix": "string",
- "scale": "log",
- "suffix": "string"
}
}, - "colors": [
- {
- "hex": "strings",
- "id": "string",
- "name": "string",
- "type": "min",
- "value": 0
}
], - "decimalPlaces": {
- "digits": 0,
- "isEnforced": true
}, - "generateXAxisTicks": [
- "string"
], - "generateYAxisTicks": [
- "string"
], - "hoverDimension": "auto",
- "legendColorizeRows": true,
- "legendHide": true,
- "legendOpacity": 0,
- "legendOrientationThreshold": 0,
- "note": "string",
- "position": "overlaid",
- "prefix": "string",
- "queries": [
- {
- "builderConfig": {
- "aggregateWindow": {
- "fillValues": true,
- "period": "string"
}, - "buckets": [
- "string"
], - "functions": [
- {
- "name": "string"
}
], - "tags": [
- {
- "aggregateFunctionType": "filter",
- "key": "string",
- "values": [
- "string"
]
}
]
}, - "editMode": "builder",
- "name": "string",
- "text": "string"
}
], - "shadeBelow": true,
- "shape": "chronograf-v2",
- "showNoteWhenEmpty": true,
- "staticLegend": {
- "colorizeRows": true,
- "heightRatio": 0,
- "opacity": 0,
- "orientationThreshold": 0,
- "show": true,
- "valueAxis": "string",
- "widthRatio": 0
}, - "suffix": "string",
- "timeFormat": "string",
- "type": "line-plus-single-stat",
- "xColumn": "string",
- "xTickStart": 0,
- "xTickStep": 0,
- "xTotalTicks": 0,
- "yColumn": "string",
- "yTickStart": 0,
- "yTickStep": 0,
- "yTotalTicks": 0
}
}
将时间序列数据写入buckets。
将数据写入存储桶。
使用此端点以 行协议 格式将数据发送到 InfluxDB。
当您发送写入请求时,执行以下操作
2xx
状态代码)响应;否则为错误。为确保 InfluxDB Cloud 按照您请求的顺序处理写入和删除操作,请等待成功响应(HTTP 2xx
状态代码),然后再发送下一个请求。
由于写入和删除操作是异步的,因此当您收到响应时,您的更改可能尚未可读。
2xx
状态代码;否则,返回第一个失败的行。write-buckets
或 write-bucket BUCKET_ID
。
BUCKET_ID
是目标存储桶的 ID。
应用 write
速率限制。有关更多信息,请参阅限制和可调整的配额。
bucket 必需 | 字符串 存储桶名称或 ID。InfluxDB 将批处理中的所有点写入指定的存储桶。 |
org 必需 | 字符串 组织名称或 ID。 InfluxDB Cloud
InfluxDB OSS
|
orgID | 字符串 组织 ID。 InfluxDB Cloud
InfluxDB OSS
|
精度 | string (WritePrecision) Enum: "ms" "s" "us" "ns" 行协议批处理中 Unix 时间戳的精度。 |
Accept | 字符串 默认值: application/json 值: "application/json" 客户端可以理解的内容类型。只有在写入失败时(例如,由于格式问题或配额限制)才返回响应正文。 InfluxDB Cloud
InfluxDB OSS
相关指南 |
Content-Encoding | 字符串 默认: identity 枚举: "gzip" "identity" 应用于请求负载中的行协议的压缩。要发送 gzip 负载,请传递 |
Content-Length | integer 发送到 InfluxDB 的实体正文的大小(以字节为单位)。如果长度大于 |
Content-Type | 字符串 默认值: text/plain; charset=utf-8 Enum: "text/plain" "text/plain; charset=utf-8" 请求正文中的数据格式。要发送行协议负载,请传递 |
Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
airSensors,sensor_id=TLM0201 temperature=73.97038159354763,humidity=35.23103248356096,co=0.48445310567793615 1630424257000000000 airSensors,sensor_id=TLM0202 temperature=75.30007505999716,humidity=35.651929918691714,co=0.5141876544505826 1630424257000000000
{- "code": "invalid",
- "message": "部分写入错误(已写入 2 个):无法解析 'air_sensor,service=S1,sensor=L1 temperature=\"90.5\",humidity=70.0 1632850122':架构:架构不允许字段 \"temperature\" 的字段类型;获取了 String 但预期为 Float"
}