InfluxDB v2 HTTP API 提供了一个用于与 InfluxDB v2 进行所有交互的编程接口。
InfluxDB v2 HTTP API 提供了一个编程接口,用于与 InfluxDB v2 进行所有交互。使用 /api/v2/ 和与 InfluxDB v1 兼容的端点访问 InfluxDB API。
此文档由 InfluxDB OpenAPI 规范 生成。
查看API快速入门以获取使用令牌进行身份验证、写入存储桶和查询数据的快速指南。
InfluxDB API 客户端库 适用于流行的语言,并准备好导入到您的应用程序中。
使用以下方案之一来验证 InfluxDB API:
对于支持 HTTP 基本认证方案的 InfluxDB /api/v2 API 操作,请使用该方案:
Authorization: Basic BASE64_ENCODED_CREDENTIALS
要构建 BASE64_ENCODED_CREDENTIALS,将用户名和密码用冒号 (USERNAME:PASSWORD) 连接,然后对结果字符串进行 base64 编码。许多HTTP客户端在发送请求之前会为您编码凭据。
警告: Base64 编码可以轻易地被反向解码以获得原始的 用户名和密码。它用于保持数据的完整性,并不提供 安全性。您在进行身份验证或发送敏感信息的请求时应始终使用 HTTPS。
在示例中,替换以下内容:
EMAIL_ADDRESS: InfluxDB Cloud username (the email address the user signed up with)PASSWORD: InfluxDB Cloud API tokenINFLUX_URL: your InfluxDB Cloud URL以下示例显示了如何使用cURL发送一个使用基本身份验证的API请求。
使用--user选项时,cURL对凭据进行编码并将其传递
在Authorization: Basic头中。
curl --get "INFLUX_URL/api/v2/signin"
--user "EMAIL_ADDRESS":"PASSWORD"The Flux http.basicAuth() function 返回一个使用指定的用户名和密码组合生成的 Base64 编码的基本身份验证头。
以下示例展示了如何使用JavaScript btoa() 函数创建一个Base64编码的字符串:
btoa('EMAIL_ADDRESS:PASSWORD')输出如下:
'VVNFUk5BTUU6UEFTU1dPUkQ='一旦您拥有了Base64编码的凭证,您可以将它们放入Authorization头中--例如:
curl --get "INFLUX_URL/api/v2/signin"
--header "Authorization: Basic VVNFUk5BTUU6UEFTU1dPUkQ="要了解有关HTTP验证的更多信息,请参见 Mozilla Developer Network (MDN) Web Docs, HTTP authentication._
| 安全方案类型 | HTTP |
|---|---|
| HTTP 授权方案 | basic |
使用令牌认证方案来对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: your InfluxDB Cloud URLINFLUX_API_TOKEN: your InfluxDB API token| 安全方案类型 | API Key |
|---|---|
| 头部参数名称: | 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 | string | 客户端可以理解的内容类型。 |
Authorization | string | 授权方案和凭证。 |
Content-Length | integer | 发送到数据库的实体主体的大小,单位为字节。 |
Content-Type | string | 请求体中数据的格式。 |
一些 InfluxDB API 列出操作 可能支持以下查询参数来分页结果:
| 查询参数 | 值类型 | 描述 |
|---|---|---|
limit | integer | 返回的最大记录数(在应用其他参数后)。 |
offset | integer | 要跳过的记录数量(在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 | 无内容 | 对于POST请求,204表示InfluxDB接受了请求并且请求数据是有效的。异步操作,例如write,可能尚未完成。 |
400 | 错误的请求 | 由于参数不正确或语法错误,InfluxDB 无法解析请求。对于 writes,错误可能指示以下问题之一:
|
401 | 未经授权 | 可能表明以下之一:
|
404 | 未找到 | 请求的资源未找到。message 在响应体中提供有关请求资源的详细信息。 |
405 | 方法不被允许 | API路径不支持请求中使用的HTTP方法——例如,你向一个仅允许GET的端点发送了POST请求。 |
413 | 请求实体过大 | 请求负载超过大小限制。 |
422 | 无法处理的实体 | 请求数据无效。 code 和 message 在响应体中提供有关问题的详细信息。 |
429 | 请求过多 | API令牌暂时超过请求配额。Retry-After头部描述了何时可以重新尝试请求。 |
500 | 内部服务器错误 | |
503 | 服务不可用 | 服务器暂时无法处理请求。Retry-After头部描述了何时可以再次尝试请求。 |
从存储桶中删除数据。
使用此端点在指定时间范围内从存储桶中删除点。
当你发送删除请求时,会执行以下操作:
2xx status code); error otherwise.为了确保 InfluxDB Cloud 按照您请求的顺序处理写入和删除,请在发送下一个请求之前等待成功响应(HTTP 2xx 状态码)。
因为写入和删除是异步的,当您收到响应时,您的更改可能尚不可读。
write-buckets or write-bucket BUCKET_ID.BUCKET_ID 是目标桶的ID。
write 速率限制适用。
有关更多信息,请参见 limits and adjustable quotas。
| 桶 | 字符串 桶名称或ID。
指定要删除数据的桶。
如果同时传递 |
| bucketID | string 一个桶的ID。
指定要删除数据的桶。
如果同时传递 |
| org | string 组织名称或ID。 InfluxDB Cloud
InfluxDB OSS
|
| orgID | string 组织 ID。 InfluxDB Cloud
InfluxDB OSS
|
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
时间范围参数和一个可选的 删除谓词表达式。
要选择在指定时间范围内删除的点,请在请求主体的 删除谓词表达式 的 predicate 属性中传递一个。如果不传递 predicate,InfluxDB 将删除指定时间范围内所有带有时间戳的数据。
| 谓词 | 字符串 在 删除谓词语法中的表达式。 |
| 开始 必填 | 字符串 <date-time> 一个时间戳(RFC3339 日期/时间格式)。 删除的最早时间。 |
| 停止 必需 | 字符串 <日期-时间> 一个时间戳(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"
}| 组织 | 字符串 组织名称或ID。 InfluxDB Cloud
InfluxDB OSS
|
| orgID | string 组织 ID. InfluxDB Cloud
InfluxDB OSS
|
| 接收编码 | 字符串 默认: 身份 枚举: "gzip" "身份" 客户端可以理解的内容编码(通常是一种压缩算法)。 |
| 内容类型 | 字符串 枚举: "application/json" "application/vnd.flux" |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要执行的Flux查询或规范
对象 (Dialect) 表格数据输出选项。 默认输出为 注释的 CSV,包含标题。 有关表格数据方言的更多信息, 请参见W3表格数据元数据词汇。 | |
对象 (文件) 表示来自单个文件的源 | |
| 现在 | 字符串 <日期-时间> 指定在查询中应报告的时间作为 |
对象 在查询执行期间作为参数传递的键值对。 要在查询中使用参数,请传递一个 并传递 在查询执行期间,InfluxDB 会将 限制
| |
| 查询 必需 | 字符串 要执行的查询脚本。 |
| 类型 | 字符串 值: "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",
- "params": { },
- "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
| 限制 | 整数 [ 0 .. 500 ] 默认: 100 返回的脚本的最大数量。默认值是 |
| 名称 | 字符串 脚本名称。列出具有指定名称的脚本。 |
| 偏移量 | 整数 >= 0 分页的偏移量。 要跳过的记录数。 有关分页参数的更多信息,请参见 分页。 |
curl --request GET "INFLUX_URL/api/v2/scripts?limit=100&offset=0" \ --header "Authorization: Token INFLUX_API_TOKEN" \ --header "Accept: application/json" \ --header "Content-Type: application/json"
{- "scripts": [
- {
- "createdAt": "2022-07-17T23:49:45.731237Z",
- "description": "find the last point from Sample Bucket",
- "id": "09afa3b220fe4000",
- "language": "flux",
- "name": "getLastPointFromSampleBucket",
- "orgID": "bea7ea952287f70d",
- "script": "from(bucket: SampleBucket) |> range(start: -7d) |> limit(n:1)",
- "updatedAt": "2022-07-17T23:49:45.731237Z"
}, - {
- "createdAt": "2022-07-17T23:43:26.660308Z",
- "description": "getLastPoint finds the last point in a bucket",
- "id": "09afa23ff13e4000",
- "language": "flux",
- "name": "getLastPoint",
- "orgID": "bea7ea952287f70d",
- "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)",
- "updatedAt": "2022-07-17T23:43:26.660308Z"
}
]
}{- "createdAt": "2022-07-17T23:49:45.731237Z",
- "description": "getLastPoint finds the last point in a bucket",
- "id": "09afa3b220fe4000",
- "language": "flux",
- "name": "getLastPoint",
- "orgID": "bea7ea952287f70d",
- "script": "from(bucket: my-bucket) |> range(start: -7d) |> limit(n:1)",
- "updatedAt": "2022-07-17T23:49:45.731237Z"
}运行脚本并返回结果。
当脚本运行时,InfluxDB 在脚本中引用的 params 键将被请求体中传递的 params 键值替换——例如:
以下示例脚本包含一个 mybucket 参数 :
"script": "from(bucket: params.mybucket)
|> range(start: -7d)
|> limit(n:1)"以下示例 POST /api/v2/scripts/SCRIPT_ID/invoke 请求正文
传递了 mybucket 参数的一个值:
{
"params": {
"mybucket": "air_sensor"
}
}| scriptID 必填 | 字符串 一个脚本 ID。 运行指定的脚本。 |
对象 脚本参数。
|
{- "params": { }
},result,table,_start,_stop,_time,_value,_field,_measurement,host ,_result,0,2019-10-30T01:28:02.52716421Z,2022-07-26T01:28:02.52716421Z,2020-01-01T00:00:00Z,72.01,used_percent,mem,host2
检索任务的列表。
要限制返回的任务,请在请求中传递查询参数。 如果没有传递查询参数,InfluxDB将返回所有任务,直到默认的 limit。
| 之后 | 字符串 A task ID. 仅返回在指定任务之后创建的任务。 |
| 限制 | 整数 [ -1 .. 500 ] 默认值: 100 示例:
要返回的最大任务数量。默认值为 为了减少负载大小,请结合 |
| 名称 | 字符串 一个 任务 名称。 |
| 偏移量 | 整数 >= 0 默认: 0 要跳过的记录数。 |
| 组织 | 字符串 一个 组织 名称。 |
| orgID | string 一个组织 ID。 |
| scriptID | 字符串 A script ID. |
| sortBy | 字符串 值: "name" 排序字段。仅支持 |
| 状态 | |
| 类型 | 字符串 默认: "" 枚举: "basic" "system" 一种 任务 类型 ( |
| 用户 | 字符串 A 用户 ID. 仅返回由指定用户拥有的任务。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
curl INFLUX_URL/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"
}, - "tasks": [
- {
- "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"
}
]
}创建一个 task 并返回该任务。
使用此端点创建一个运行 Flux 脚本的计划任务。
您可以使用 flux 或 scriptID 来提供任务脚本。
flux:一串“原始”的 Flux,包含任务选项和脚本——例如:
{
"flux": "option task = {name: \"CPU Total 1 Hour New\", every: 1h}\
from(bucket: \"telegraf\")
|> range(start: -1h)
|> filter(fn: (r) => (r._measurement == \"cpu\"))
|> filter(fn: (r) =>\n\t\t(r._field == \"usage_system\"))
|> filter(fn: (r) => (r.cpu == \"cpu-total\"))
|> aggregateWindow(every: 1h, fn: max)
|> to(bucket: \"cpu_usage_user_total_1h\", org: \"INFLUX_ORG\")",
"status": "active",
"description": "This task downsamples CPU data every hour"
}scriptID:要运行的 可调用脚本 的ID。
使用 scriptID 时,要传递任务选项,将选项作为请求体中的属性传递——例如:
{
"name": "CPU Total 1 Hour New",
"description": "This task downsamples CPU data every hour",
"every": "1h",
"scriptID": "SCRIPT_ID",
"scriptParameters":
{
"rangeStart": "-1h",
"bucket": "telegraf",
"filterField": "cpu-total"
}
}flux and scriptID for the same task.| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
创建任务
| cron | 字符串 一个 Cron 表达式,定义任务运行的时间表。InfluxDB 的 cron 运行基于系统时间。 |
| 描述 | 字符串 任务的描述。 |
| 每个 | 字符串 任务运行的时间间隔 (duration literal)。
|
| flux | 字符串 任务运行的Flux脚本。 限制
|
| 名称 | 字符串 任务的名称 |
| 偏移量 | 字符串 <持续时间> 在预定时间经过后,延迟执行任务的 持续时间。 |
| org | string 拥有该任务的组织的名称。 |
| orgID | string 拥有该任务的组织的ID。 |
| 脚本ID | 字符串 任务运行的脚本的ID。 限制
|
| scriptParameters | 对象 在任务运行期间传递给脚本(通过 限制
|
| 状态 | 字符串 (TaskStatusType) 枚举: "active" "inactive"
|
{- "cron": "string",
- "description": "string",
- "every": "string",
- "flux": "string",
- "name": "string",
- "offset": "string",
- "org": "string",
- "orgID": "string",
- "scriptID": "string",
- "scriptParameters": { },
- "status": "active"
}{- "authorizationID": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "cron": "string",
- "description": "string",
- "every": "string",
- "flux": "string",
- "id": "string",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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",
- "scriptID": "string",
- "scriptParameters": { },
- "status": "active",
- "updatedAt": "2019-08-24T14:15:22Z"
}检索一个 任务。
| 任务ID 必需 | 字符串 一个 任务 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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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",
- "scriptID": "string",
- "scriptParameters": { },
- "status": "active",
- "updatedAt": "2019-08-24T14:15:22Z"
}安排任务立即开始运行,忽略计划中的运行。
使用此端点手动启动任务运行。 计划的运行将继续按计划进行。 这可能会导致任务并发运行。
要重试之前的运行(并避免创建新的运行),使用POST /api/v2/tasks/{taskID}/runs/{runID}/retry端点。
| 任务ID 必需 | 字符串 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
| scheduledFor | 字符串或空值 <日期-时间> 运行的时间 RFC3339 日期/时间格式
用于 |
{- "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"
}, - "log": [
- {
- "message": "Halt and catch fire",
- "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": "scheduled",
- "taskID": "string"
}将数据写入存储桶。
使用此端点以行协议格式将数据发送到InfluxDB。
在发送写请求时执行以下操作:
2xx status code); error otherwise.为了确保 InfluxDB Cloud 按照您请求的顺序处理写入和删除,请在发送下一个请求之前等待成功响应(HTTP 2xx 状态码)。
因为写入和删除是异步的,当您收到响应时,您的更改可能尚不可读。
2xx status code;
otherwise, returns the first line that failed.write-buckets 或 write-bucket BUCKET_ID。
BUCKET_ID 是目标桶的ID。
write 速率限制适用。
有关更多信息,请参见 limits and adjustable quotas。
| 桶 必需 | 字符串 一个桶的名称或ID。 InfluxDB将所有批处理中的点写入指定的桶。 |
| 组织 必需 | 字符串 组织名称或ID。 InfluxDB Cloud
InfluxDB OSS
|
| orgID | 字符串 组织 ID。 InfluxDB Cloud
InfluxDB OSS
|
| 精度 | 字符串 (WritePrecision) 枚举: "ms" "s" "us" "ns" 线协议批次中 unix 时间戳的精度。 |
| 接受 | 字符串 默认:application/json 值:"application/json" 客户端可以理解的内容类型。 仅在失败时写入返回响应体——例如,因格式问题或配额限制。 InfluxDB Cloud
InfluxDB OSS
相关指南 |
| 内容编码 | 字符串 默认: identity 枚举: "gzip" "identity" 应用于请求有效负载的行协议的压缩。
要发送gzip有效负载,请传递 |
| 内容长度 | 整数 发送到 InfluxDB 的实体主体的大小,以字节为单位。如果长度大于 |
| 内容类型 | 字符串 默认: text/plain; charset=utf-8 枚举: "text/plain" "text/plain; charset=utf-8" 请求体中数据的格式。
要发送行协议有效负载,请传递 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
在请求体中,以行协议格式提供数据。
要发送压缩数据,请执行以下操作:
Content-Encoding: gzip header.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": "partial write error (2 written): unable to parse 'air_sensor,service=S1,sensor=L1 temperature=\"90.5\",humidity=70.0 1632850122': schema: field type for field \"temperature\" not permitted by schema; got String but expected Float"
}列出授权。
要限制返回的授权,请在请求中传递查询参数。 如果未传递查询参数,InfluxDB 将返回所有授权。
GET /api/v2/authorizations responses;
returns token: redacted for all authorizations.要获取授权,请求必须使用具有以下权限的API令牌:
read-authorizationsread-user for the user that the authorization is scoped to| 组织 | 字符串 一个组织名称。 仅返回属于指定的 organization 的授权。 |
| orgID | string 一个组织的ID。仅返回属于指定的 organization 的授权。 |
| token | 字符串 一个API token 值。
通过其 InfluxDB OSS
限制
|
| 用户 | 字符串 一个用户名。 仅返回限定于指定 用户 的授权。 |
| 用户ID | 字符串 用户ID。 仅返回限制在指定的 用户 的授权。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "authorizations": [
- {
- "description": "string",
- "status": "active",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "authorizations"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}
],
}创建一个授权并返回生成的授权与token。
使用此端点创建一个授权,该授权生成一个具有对特定资源或特定资源类型的read或write权限的API令牌。API令牌是授权的token属性值。
为了遵循安全API令牌生成和检索的最佳实践,InfluxDB 对API令牌实施访问限制。
我们建议您采取以下措施来管理您的令牌:
write-authorizationswrite-user for the user that the authorization is scoped to| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
创建的授权。
| 描述 | 字符串 这是令牌的描述。 |
| orgID 必需 | 字符串 一个组织ID。指定拥有授权的组织。 |
必需 | 对象的 数组 (Permission) 非空 授权的权限列表。
在列表中,提供至少一个 在 |
| 状态 | 字符串 默认: "active" 枚举: "active" "inactive" 令牌的状态。如果 |
| 用户ID | 字符串 一个用户ID。 指定授权范围内的用户。 当用户使用用户名和密码进行身份验证时, InfluxDB会生成一个用户会话,具有所有用户授权指定的权限。 |
创建授权。
{- "description": "iot_users read buckets",
- "orgID": "INFLUX_ORG_ID",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "type": "buckets"
}
}
]
}{- "description": "string",
- "status": "active",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "authorizations"
}
}
], - "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": "active",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "authorizations"
}
}
], - "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 上下文 |
在请求体中,提供要更新的授权属性。
| 描述 | 字符串 这是令牌的描述。 |
| 状态 | 字符串 默认: "active" 枚举: "active" "inactive" 令牌的状态。如果 |
{- "description": "string",
- "status": "active"
}{- "description": "string",
- "status": "active",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "authorizations"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}列出 organizations。
要限制返回的组织,可以在请求中传递查询参数。
如果未传递查询参数,InfluxDB 将返回所有组织,直到默认的 limit。
| 降序 | 布尔值 默认: false |
| 限制 | 整数 [ 1 .. 100 ] 默认: 20 限制返回的记录数量。默认值是 |
| 偏移量 | 整数 >= 0 分页的偏移量。 要跳过的记录数。 有关分页参数的更多信息,请参见 分页。 |
| org | string 一个组织名称。只返回指定的组织。 |
| orgID | 字符串 组织 ID。 |
| 用户ID | 字符串 用户ID。 仅返回指定用户为成员或所有者的组织。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "links": {
- "self": "/api/v2/orgs"
}, - "orgs": [
- {
- "createdAt": "2022-07-17T23:00:30.778487Z",
- "description": "Example InfluxDB organization",
- "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": "active",
- "updatedAt": "2019-08-24T14:15:22Z"
}列出所有属于一个组织的用户。
InfluxDB users 有权访问 InfluxDB。
成员 是组织内的用户。
owner and member roles.
Use /api/v2/authorizations to assign user permissions.read-orgs INFLUX_ORG_IDINFLUX_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 and member roles.
Use /api/v2/authorizations to assign user permissions.write-orgs INFLUX_ORG_IDINFLUX_ORG_ID 是您要移除所有者的组织的ID。
| orgID 必填 | string 要从中移除用户的组织的ID。 |
| 用户ID 必需 | 字符串 要移除的用户的ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "code": "unauthorized",
- "message": "unauthorized access"
}列出一个组织的所有拥有者。
owner and member roles.
Use /api/v2/authorizations to assign user permissions.read-orgs INFLUX_ORG_IDINFLUX_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 and member roles.
Use /api/v2/authorizations to assign user permissions.write-orgs INFLUX_ORG_IDINFLUX_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": [
- "string"
]
}{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}验证 基础认证凭据 为 用户,然后如果成功,则生成用户会话。
要验证用户,请使用 HTTP Authorization 标头,采用 Basic 方案,并提供 base64 编码的用户名和密码。
有关语法和更多信息,请参阅 Basic Authentication 以获取语法和更多信息。
如果身份验证成功,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 endpoint to create a user session and
generate a session cookie.GET /api/v2/me endpoint, passing the stored session cookie
from step 1 to retrieve user information.POST /api/v2/signout endpoint, passing the stored session
cookie to expire the session.请参阅请求示例中的完整示例。
InfluxDB仅将用户会话存储在内存中。 如果用户没有注销,则用户会话将在十分钟内自动过期或 在InfluxDB实例重启期间过期。
要了解更多关于HTTP请求中的cookie,请参阅 Mozilla Developer Network (MDN) Web Docs, HTTP cookies。
| 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"
}列出 users。
要限制返回哪些用户,请在请求中传递查询参数。
| 操作 | 所需权限 | 限制 |
|---|---|---|
| 列出所有用户 | 操作员令牌 | 仅供InfluxData内部使用 |
| 列出特定用户 | read-users 或 read-user USER_ID |
USER_ID 是您想要检索的用户的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": "active"
}
]
}更新用户密码。
| 用户ID 必需 | 字符串 要设置密码的用户的ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
为用户设置的新密码。
| 密码 必填 | 字符串 |
{- "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": "string"
}{- "code": "invalid",
- "message": "passwords cannot be changed through the InfluxDB Cloud API"
}检索 InfluxDB API 的所有顶级路由。
"tasks":"/api/v2/tasks", and doesn't contain resource-specific routes
for tasks (/api/v2/tasks/TASK_ID/...).| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "query": {
}, - "system": {
},
}创建和管理授权(API 令牌)。
一个授权包含组织资源的读和写
权限列表,并提供用于身份验证的API令牌。
一个授权属于一个组织,仅包含该组织的权限。
我们建议您采取以下措施来管理您的令牌:
可选地,在创建授权时,您可以将其限制为特定用户。
如果用户使用用户名和密码登录,创建一个用户会话,
该会话携带所有用户授权所授予的权限。
有关更多信息,请参见如何将令牌分配给特定用户。
要创建用户会话,请使用POST /api/v2/signin端点。
列出授权。
要限制返回的授权,请在请求中传递查询参数。 如果未传递查询参数,InfluxDB 将返回所有授权。
GET /api/v2/authorizations responses;
returns token: redacted for all authorizations.要获取授权,请求必须使用具有以下权限的API令牌:
read-authorizationsread-user for the user that the authorization is scoped to| 组织 | 字符串 一个组织名称。 仅返回属于指定的 organization 的授权。 |
| orgID | string 一个组织的ID。仅返回属于指定的 organization 的授权。 |
| token | 字符串 一个API token 值。
通过其 InfluxDB OSS
限制
|
| 用户 | 字符串 一个用户名。 仅返回限定于指定 用户 的授权。 |
| 用户ID | 字符串 用户ID。 仅返回限制在指定的 用户 的授权。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "authorizations": [
- {
- "description": "string",
- "status": "active",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "authorizations"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}
],
}创建一个授权并返回生成的授权与token。
使用此端点创建一个授权,该授权生成一个具有对特定资源或特定资源类型的read或write权限的API令牌。API令牌是授权的token属性值。
为了遵循安全API令牌生成和检索的最佳实践,InfluxDB 对API令牌实施访问限制。
我们建议您采取以下措施来管理您的令牌:
write-authorizationswrite-user for the user that the authorization is scoped to| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
创建的授权。
| 描述 | 字符串 这是令牌的描述。 |
| orgID 必需 | 字符串 一个组织ID。指定拥有授权的组织。 |
必需 | 对象的 数组 (Permission) 非空 授权的权限列表。
在列表中,提供至少一个 在 |
| 状态 | 字符串 默认: "active" 枚举: "active" "inactive" 令牌的状态。如果 |
| 用户ID | 字符串 一个用户ID。 指定授权范围内的用户。 当用户使用用户名和密码进行身份验证时, InfluxDB会生成一个用户会话,具有所有用户授权指定的权限。 |
创建授权。
{- "description": "iot_users read buckets",
- "orgID": "INFLUX_ORG_ID",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "type": "buckets"
}
}
]
}{- "description": "string",
- "status": "active",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "authorizations"
}
}
], - "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": "active",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "authorizations"
}
}
], - "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 上下文 |
在请求体中,提供要更新的授权属性。
| 描述 | 字符串 这是令牌的描述。 |
| 状态 | 字符串 默认: "active" 枚举: "active" "inactive" 令牌的状态。如果 |
{- "description": "string",
- "status": "active"
}{- "description": "string",
- "status": "active",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "authorizations"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}列出 显式
模式
("schemaType": "explicit") 用于一个存储桶。
显式 模式用于强制规定您的数据的列名、标签、字段和数据类型。
默认情况下,桶具有隐式模式类型("schemaType": "implicit")以符合您的数据。
| bucketID 必填 | 字符串 一个桶 ID。 列出指定桶的测量模式。 |
| 名称 | 字符串 一个测量名称。 |
| 组织 | 字符串 组织名称。 指定拥有模式的组织。 |
| orgID | string 一个组织 ID。 指定拥有该架构的组织。 |
{- "measurementSchemas": [
- {
- "bucketID": "ba3c5e7f9b0a0010",
- "createdAt": "2021-01-21T00:48:40.993Z",
- "id": "1a3c5e7f9b0a8642",
- "name": "cpu",
- "orgID": "0a3c5e7f9b0a0001",
- "updatedAt": "2021-01-21T00:48:40.993Z"
}, - {
- "bucketID": "ba3c5e7f9b0a0010",
- "createdAt": "2021-01-21T00:48:40.993Z",
- "id": "1a3c5e7f9b0a8643",
- "name": "memory",
- "orgID": "0a3c5e7f9b0a0001",
- "updatedAt": "2021-01-21T00:48:40.993Z"
}, - {
- "bucketID": "ba3c5e7f9b0a0010",
- "createdAt": "2021-01-21T00:48:40.993Z",
- "id": "1a3c5e7f9b0a8644",
- "name": "disk",
- "orgID": "0a3c5e7f9b0a0001",
- "updatedAt": "2021-01-21T00:48:40.993Z"
}
]
}为一个桶创建一个显式测量模式。
显式 模式用于强制规定您的数据的列名、标签、字段和数据类型。
默认情况下,桶具有隐式模式类型("schemaType": "implicit")以符合您的数据。
使用此端点创建防止不合规写请求的架构。
schemaType in order to use
schemas.| bucketID 必填 | 字符串 一个桶ID。 为指定的桶添加模式。 |
| 组织 | 字符串 组织名称。 指定拥有模式的组织。 |
| orgID | string 组织 ID。 指定拥有该 schema 的组织。 |
必填 | 数组 对象 (MeasurementSchemaColumn) 有序的列定义集合。 |
| 名称 必填 | 字符串 该 测量 名称。 |
{- "columns": [
- {
- "format": "unix timestamp",
- "name": "time",
- "type": "integer"
}, - {
- "name": "host",
- "type": "tag"
}, - {
- "name": "region",
- "type": "tag"
}, - {
- "dataType": "float",
- "name": "usage_user",
- "type": "field"
}, - {
- "dataType": "float",
- "name": "usage_user",
- "type": "field"
}
], - "name": "cpu"
}{- "bucketID": "ba3c5e7f9b0a0010",
- "columns": [
- {
- "format": "unix timestamp",
- "name": "time",
- "type": "integer"
}, - {
- "name": "host",
- "type": "tag"
}, - {
- "name": "region",
- "type": "tag"
}, - {
- "dataType": "float",
- "name": "usage_user",
- "type": "field"
}, - {
- "dataType": "float",
- "name": "usage_user",
- "type": "field"
}
], - "createdAt": "2021-01-21T00:48:40.993Z",
- "id": "1a3c5e7f9b0a8642",
- "name": "cpu",
- "orgID": "0a3c5e7f9b0a0001",
- "updatedAt": "2021-01-21T00:48:40.993Z"
}检索一个明确的测量 schema。
| bucketID 必需 | 字符串 桶的ID。 检索指定桶的架构。 |
| measurementID 必填 | 字符串 测量架构的ID。 指定要检索的测量架构。 |
| org | string 组织名称。 指定拥有该模式的组织。 |
| orgID | string 组织 ID。指定拥有该模式的组织。 |
{- "bucketID": "ba3c5e7f9b0a0010",
- "columns": [
- {
- "format": "unix timestamp",
- "name": "time",
- "type": "integer"
}, - {
- "name": "host",
- "type": "tag"
}, - {
- "name": "region",
- "type": "tag"
}, - {
- "dataType": "float",
- "name": "usage_user",
- "type": "field"
}, - {
- "dataType": "float",
- "name": "usage_user",
- "type": "field"
}
], - "createdAt": "2021-01-21T00:48:40.993Z",
- "id": "1a3c5e7f9b0a8642",
- "name": "cpu",
- "orgID": "0a3c5e7f9b0a0001",
- "updatedAt": "2021-01-21T00:48:40.993Z"
}更新一个测量schema。
使用此端点来更新测量模式的字段 (name, type, 和 dataType)。
name of a measurement.| bucketID 必需 | 字符串 一个桶 ID。 指定要检索架构的桶。 |
| measurementID 必需 | 字符串 一个测量架构ID。 检索指定的测量架构。 |
| 组织 | 字符串 组织名称。 指定拥有模式的组织。 |
| orgID | string 组织 ID。 指定拥有该 schema 的组织。 |
必需 | 对象的数组(MeasurementSchemaColumn) 列定义的有序集合 |
{- "columns": [
- {
- "format": "unix timestamp",
- "name": "time",
- "type": "integer"
}, - {
- "name": "host",
- "type": "tag"
}, - {
- "name": "region",
- "type": "tag"
}, - {
- "dataType": "float",
- "name": "usage_user",
- "type": "field"
}, - {
- "dataType": "float",
- "name": "usage_user",
- "type": "field"
}
]
}{- "bucketID": "ba3c5e7f9b0a0010",
- "columns": [
- {
- "format": "unix timestamp",
- "name": "time",
- "type": "integer"
}, - {
- "name": "host",
- "type": "tag"
}, - {
- "name": "region",
- "type": "tag"
}, - {
- "dataType": "float",
- "name": "usage_user",
- "type": "field"
}, - {
- "dataType": "float",
- "name": "usage_user",
- "type": "field"
}
], - "createdAt": "2021-01-21T00:48:40.993Z",
- "id": "1a3c5e7f9b0a8642",
- "name": "cpu",
- "orgID": "0a3c5e7f9b0a0001",
- "updatedAt": "2021-01-21T00:48:40.993Z"
}将您的数据存储在 InfluxDB buckets 中。 bucket 是一个命名的位置,用于存储时间序列数据。所有 bucket 都有一个 retention period, 每个数据点保留的时间段。InfluxDB 会丢弃所有时间戳早于 bucket 保留期限的点。 一个 bucket 属于一个组织。
列出 buckets。
InfluxDB 检索由
组织
拥有的存储桶,这些存储桶与授权
(API token) 相关联。
要限制返回的存储桶,可以在请求中传递查询参数。
如果没有传递查询参数,InfluxDB 将返回所有存储桶,直到
默认 limit。
org parameter or the orgID parameter to specify the organization.| 操作 | 所需权限 |
|---|---|
| 检索 用户桶 | read-buckets |
| 检索 系统桶 | read-orgs |
| 之后 | 字符串 |
| id | string 一个桶的ID。 |
| 限制 | 整数 [ 1 .. 100 ] 默认: 20 限制返回的记录数量。默认值是 |
| 名称 | 字符串 一个桶的名称。 |
| 偏移量 | 整数 >= 0 分页的偏移量。 要跳过的记录数。 有关分页参数的更多信息,请参见 分页。 |
| 组织 | 字符串 一个组织名称。 InfluxDB Cloud
InfluxDB OSS
|
| 组织ID | 字符串 一个组织的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"
}
}创建一个 桶 并返回桶资源。默认数据 保留期限 为 30 天。
403 status code.
For additional information regarding InfluxDB Cloud offerings, see
InfluxDB Cloud Pricing.| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要创建的桶。
| 描述 | 字符串 桶的描述。 |
| 名称 必需 | 字符串 存储桶名称。 |
| orgID 必填 | 字符串 组织ID。 指定拥有该存储桶的组织。 |
一组对象 (RetentionRules) 保留规则用于过期或保留数据。
InfluxDB InfluxDB Cloud
InfluxDB OSS
| |
| rp | |
| 模式类型 | 字符串 (SchemaType) 枚举: "隐式" "显式" |
{- "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 status code if queued; error otherwise.| 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 must have a length of 16 bytes"
}检索一个存储桶。
使用此端点检索特定存储桶的信息。
| 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 property in the request body. If you don't
provide retentionRules, InfluxDB responds with an HTTP 403 status code.retentionRules.| bucketID 必需 | 字符串 存储桶的ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
桶更新以应用。
| 描述 | 字符串 桶的描述。 |
| 名称 | 字符串 桶的名称。 |
对象的数组 (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 endpoint to retrieve and manage labels.| bucketID 必需 | 字符串 要检索标签的桶的ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "labels": [
- {
- "id": "09cbd068e7ebb000",
- "name": "production_buckets",
- "orgID": "INFLUX_ORG_ID"
}
], - "links": {
- "self": "/api/v2/labels"
}
}向桶中添加标签并返回新的标签信息。
标签是包含 labelID, name, description, 和 color 键值对的对象。它们可以用于对一个或多个 资源 进行分组和过滤——例如,您可以将名为 air_sensor 的标签应用于一个存储桶和一个任务,以快速组织资源。
POST
request to the /api/v2/labels endpoint)./api/v2/labels InfluxDB API endpoint to retrieve and manage labels.| 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。 |
| 姓名 | 字符串 要添加到资源中的用户姓名。 |
{- "id": "string",
- "name": "string"
}{- "id": "09cfb87051cbe000",
- "links": {
- "self": "/api/v2/users/09cfb87051cbe000"
}, - "name": "example_user_1",
- "role": "member",
- "status": "active"
}列出所有 owners 的存储桶。
桶的拥有者有权限删除桶以及从桶中移除用户和成员的权限。
owner and member roles.
Use /api/v2/authorizations to assign user permissions.read-orgs INFLUX_ORG_IDINFLUX_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"
}
]
}将拥有者添加到桶中,并返回带有角色和用户详细信息的 owners。
使用此端点为存储桶创建一个资源所有者。
存储桶所有者有权删除存储桶并移除用户和成员在存储桶中的权限。
owner and member roles.
Use /api/v2/authorizations to assign user permissions.write-orgs INFLUX_ORG_IDINFLUX_ORG_ID* is the ID of the organization that you want to add
an owner for.| bucketID 必填 | 字符串 要添加所有者的存储桶的ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
作为存储桶的所有者添加用户。
| id 必需 | 字符串 要添加到资源的用户ID。 |
| 姓名 | 字符串 要添加到资源中的用户姓名。 |
{- "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": "active",
- "role": "owner"
}从存储桶中移除一个所有者。
使用此端点移除用户的 owner 角色对一个存储桶。
owner and member roles.
Use /api/v2/authorizations to assign user permissions.write-orgs INFLUX_ORG_IDINFLUX_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"
}| dashboardID 必填 | 字符串 要更新的仪表板的ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
将要添加的单元格
| h | 整数 <int32> |
| 名称 | 字符串 |
| usingView | string 生成所提供视图的副本。 |
| w | 整数 <int32> |
| x | 整数 <int32> |
| y | 整数 <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 | 整数 <int32> |
| 身份证 | 字符串 |
对象 | |
| 视图ID | 字符串 对视图API中的视图的引用。 |
| w | 整数 <int32> |
| x | 整数 <int32> |
| y | 整数 <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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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 | 整数 <int32> |
| w | 整数 <int32> |
| x | 整数 <int32> |
| y | 整数 <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
}| 单元格ID 必需 | 字符串 单元格的ID。 |
| dashboardID 必需 | 字符串 仪表板 ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "id": "string",
- "links": {
- "self": "string"
}, - "name": "string",
- "properties": {
- "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 上下文 |
| 名称 必需 | 字符串 |
必需 | 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",
- "properties": {
- "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",
- "properties": {
- "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
}
}| 限制 | 整数 [ 1 .. 100 ] 默认: 20 限制返回的记录数量。默认值是 |
| 偏移量 | 整数 >= 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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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": "active",
- "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"
}
],
}检查以创建
| 描述 | 字符串 检查的可选描述。 |
数组对象(标签) | |
| 名称 必需 | 字符串 |
| orgID 必填 | 字符串 拥有此检查的组织的ID。 |
必需 | 对象 (DashboardQuery) |
| 状态 | 字符串 (TaskStatusType) 枚举: "active" "inactive"
|
| 任务ID | 字符串 与此检查相关的任务的ID。 |
| 类型 必需 | 字符串 自定义 后置检查 检查 阈值 死亡信号 自定义 |
{- "description": "string",
- "labels": [
- {
- "name": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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": "active",
- "taskID": "string",
- "type": "custom"
}{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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": "active",
- "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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": "active",
- "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 上下文 |
检查更新以应用
| 描述 | 字符串 |
| 名称 | 字符串 |
| 状态 | 字符串 枚举: "active" "inactive" |
{- "description": "string",
- "name": "string",
- "status": "active"
}{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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": "active",
- "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 上下文 |
检查更新以应用
| 描述 | 字符串 检查的可选描述。 |
数组对象(标签) | |
| 名称 必需 | 字符串 |
| orgID 必填 | 字符串 拥有此检查的组织的ID。 |
必需 | 对象 (DashboardQuery) |
| 状态 | 字符串 (TaskStatusType) 枚举: "active" "inactive"
|
| 任务ID | 字符串 与此检查相关的任务的ID。 |
| 类型 必需 | 字符串 自定义 后置检查 检查 阈值 死亡信号 自定义 |
{- "description": "string",
- "labels": [
- {
- "name": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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": "active",
- "taskID": "string",
- "type": "custom"
}{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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": "active",
- "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 上下文 |
{- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
],
}| 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",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
},
}检索为 InfluxDB 实例配置的特性标志键值对。 特性标志 是用于开发和测试实验性 InfluxDB 功能的配置选项,仅供内部使用。
此端点代表配置特性标志的以下三步过程中的第一步:
使用 token authentication 或 user session 与此端点来检索 功能标志及其值。
遵循说明 启用、禁用或覆盖功能标志的值。
可选: 要确认您的更改已应用,请执行以下操作之一:
GET /api/v2/config端点以获取当前运行时服务器配置。| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{ }| 降序 | 布尔值 默认: false |
| id | 字符串的 数组 仪表板ID的列表。 |
| 限制 | |
| 偏移量 | 整数 >= 0 分页的偏移量。 要跳过的记录数。 有关分页参数的更多信息,请参见 分页。 |
| 组织 | |
| orgID | 字符串 组织 ID。 仅返回属于指定的 organization 的dashboards。 |
| 所有者 | 字符串 用户 ID。仅返回指定用户具有 dashboards 的 |
| sortBy | string 枚举: "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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 上下文 |
创建仪表板
| 描述 | 字符串 仪表盘面向用户的描述。 |
| 名称 必填 | 字符串 仪表板的用户可见名称。 |
| orgID 必填 | string 拥有仪表板的组织的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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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。 |
| 包含 | 字符串 值: "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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 上下文 |
仪表板的修补
对象 (架构) | |
| 描述 | 字符串 可选,当提供时将替换描述 |
| 名称 | 字符串 可选,当提供时将替换名称 |
{- "cells": {
- "h": 0,
- "id": "string",
- "links": {
- "self": "string",
- "view": "string"
}, - "viewID": "string",
- "w": 0,
- "x": 0,
- "y": 0,
- "name": "string",
- "properties": {
- "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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 | 整数 <int32> |
| 名称 | 字符串 |
| usingView | string 生成所提供视图的副本。 |
| w | 整数 <int32> |
| x | 整数 <int32> |
| y | 整数 <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 | 整数 <int32> |
| 身份证 | 字符串 |
对象 | |
| 视图ID | 字符串 对视图API中的视图的引用。 |
| w | 整数 <int32> |
| x | 整数 <int32> |
| y | 整数 <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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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 | 整数 <int32> |
| w | 整数 <int32> |
| x | 整数 <int32> |
| y | 整数 <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
}| 单元格ID 必需 | 字符串 单元格的ID。 |
| dashboardID 必需 | 字符串 仪表板 ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "id": "string",
- "links": {
- "self": "string"
}, - "name": "string",
- "properties": {
- "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 上下文 |
| 名称 必需 | 字符串 |
必需 | 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",
- "properties": {
- "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",
- "properties": {
- "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 上下文 |
{- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
],
}| 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",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
},
}| dashboardID 必需 | 字符串 仪表板 ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
用户添加为成员
| id 必需 | 字符串 要添加到资源的用户ID。 |
| 姓名 | 字符串 要添加到资源中的用户姓名。 |
{- "id": "string",
- "name": "string"
}{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "active",
- "role": "member"
}| dashboardID 必需 | 字符串 仪表板 ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
用户添加为所有者
| id 必需 | 字符串 要添加到资源的用户ID。 |
| 姓名 | 字符串 要添加到资源中的用户姓名。 |
{- "id": "string",
- "name": "string"
}{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "active",
- "role": "owner"
}InfluxDB 1.x 数据模型包括 databases 和 retention policies。InfluxDB 2.x 用 buckets 替代了数据库和保留策略。为了在 InfluxDB 2.x 中支持 InfluxDB 1.x 查询和写入模式,数据库和保留策略通过数据库和保留策略 (DBRP) 映射服务映射到 buckets。DBRP 映射服务使用在 1.x 兼容 API 请求中指定的数据库和保留策略来将操作路由到一个 bucket。
| bucketID | string 一个桶ID。 仅返回属于指定桶的DBRP映射。 |
| 数据库 | 字符串 一个数据库。只有返回属于1.x数据库的DBRP映射。 |
| 默认 | 布尔值 指定默认的过滤 |
| id | string 一个 DBPR 映射 ID。 仅返回指定的 DBRP 映射。 |
| 组织 | 字符串 一个组织名称。 仅返回指定组织的DBRP映射。 |
| orgID | 字符串 组织 ID。 |
| 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 1.x API 兼容性添加到您的 InfluxDB Cloud 或 InfluxDB OSS 2.x 存储桶中。您的存储桶必须包含 DBRP 映射才能使用 InfluxDB 1.x API 进行查询和写入。
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加的数据库保留策略映射。
请注意,retention_policy 是请求体中的必需参数。
retention_policy 的值可以是任何任意的 string 名称或
值,默认值通常设置为 autogen。
retention_policy 的值不是一个 retention_policy
| bucketID 必填 | 字符串 一个桶 ID。 用于标识作为翻译目标的桶。 |
| 数据库 必需 | 字符串 一个数据库名称。 标识InfluxDB v1数据库。 |
| 默认 | 布尔值 设置为 |
| 组织 | 字符串 一个组织名称。 标识拥有该映射的组织。 |
| orgID | string 一个组织 ID。标识拥有该映射的 组织。 |
| 保留策略 必填 | 字符串 一个保留策略名称。确定 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 | string 一个组织名称。 指定拥有DBRP映射的组织。 |
| orgID | 字符串 一个组织的 ID。指定拥有 DBRP 映射的组织。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
查询参数包含无效值。
{- "code": "invalid",
- "message": "invalid ID"
}| dbrpID 必填 | 字符串 一个 DBRP 映射 ID。 指定 DBRP 映射。 |
| org | string 一个组织名称。 指定拥有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 | string 一个组织名称。 指定拥有DBRP映射的组织。 |
| orgID | 字符串 一个组织的 ID。指定拥有 DBRP 映射的组织。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
更新数据库保留策略 (DBRP) 映射并返回该映射。
使用此端点修改 保留策略 (retention_policy 属性) 的 DBRP 映射。
| 默认 | 布尔值 设置为 |
| retention_policy | string 一个 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"
}
}从存储桶中删除数据。
使用此端点在指定时间范围内从存储桶中删除点。
当你发送删除请求时,会执行以下操作:
2xx status code); error otherwise.为了确保 InfluxDB Cloud 按照您请求的顺序处理写入和删除,请在发送下一个请求之前等待成功响应(HTTP 2xx 状态码)。
因为写入和删除是异步的,当您收到响应时,您的更改可能尚不可读。
write-buckets or write-bucket BUCKET_ID.BUCKET_ID 是目标桶的ID。
write 速率限制适用。
有关更多信息,请参见 limits and adjustable quotas。
| 桶 | 字符串 桶名称或ID。
指定要删除数据的桶。
如果同时传递 |
| bucketID | string 一个桶的ID。
指定要删除数据的桶。
如果同时传递 |
| org | string 组织名称或ID。 InfluxDB Cloud
InfluxDB OSS
|
| orgID | string 组织 ID。 InfluxDB Cloud
InfluxDB OSS
|
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
时间范围参数和一个可选的 删除谓词表达式。
要选择在指定时间范围内删除的点,请在请求主体的 删除谓词表达式 的 predicate 属性中传递一个。如果不传递 predicate,InfluxDB 将删除指定时间范围内所有带有时间戳的数据。
| 谓词 | 字符串 在 删除谓词语法中的表达式。 |
| 开始 必填 | 字符串 <date-time> 一个时间戳(RFC3339 日期/时间格式)。 删除的最早时间。 |
| 停止 必需 | 字符串 <日期-时间> 一个时间戳(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"
}在 InfluxDB 中存储、管理和执行脚本。
脚本存储您的自定义 Flux 脚本并提供一个可调用的
端点,该端点接受运行时参数。
在脚本中,您可以指定自定义运行时参数
(params)——例如,params.myparameter。
一旦您创建了脚本,InfluxDB 将为您的组织生成一个/api/v2/scripts/SCRIPT_ID/invoke 端点。
您可以从 API 请求和任务运行该脚本,为每次运行定义参数值。
当脚本运行时,InfluxDB 会用您定义的运行时参数值替换脚本中的 params 引用。
使用 /api/v2/scripts 端点来创建和管理脚本。 参阅相关指南以了解如何定义参数和执行脚本。
| 限制 | 整数 [ 0 .. 500 ] 默认: 100 返回的脚本的最大数量。默认值是 |
| 名称 | 字符串 脚本名称。列出具有指定名称的脚本。 |
| 偏移量 | 整数 >= 0 分页的偏移量。 要跳过的记录数。 有关分页参数的更多信息,请参见 分页。 |
curl --request GET "INFLUX_URL/api/v2/scripts?limit=100&offset=0" \ --header "Authorization: Token INFLUX_API_TOKEN" \ --header "Accept: application/json" \ --header "Content-Type: application/json"
{- "scripts": [
- {
- "createdAt": "2022-07-17T23:49:45.731237Z",
- "description": "find the last point from Sample Bucket",
- "id": "09afa3b220fe4000",
- "language": "flux",
- "name": "getLastPointFromSampleBucket",
- "orgID": "bea7ea952287f70d",
- "script": "from(bucket: SampleBucket) |> range(start: -7d) |> limit(n:1)",
- "updatedAt": "2022-07-17T23:49:45.731237Z"
}, - {
- "createdAt": "2022-07-17T23:43:26.660308Z",
- "description": "getLastPoint finds the last point in a bucket",
- "id": "09afa23ff13e4000",
- "language": "flux",
- "name": "getLastPoint",
- "orgID": "bea7ea952287f70d",
- "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)",
- "updatedAt": "2022-07-17T23:43:26.660308Z"
}
]
}创建脚本。
| 描述 必需 | 字符串 脚本描述。脚本的描述。 |
| 语言 必需 | 字符串 (ScriptLanguage) 枚举: "flux" "sql" |
| 名称 必需 | 字符串 脚本名称。名称在组织内必须唯一。 |
| 脚本 必填 | 字符串 要执行的脚本。 |
{- "description": "string",
- "language": "flux",
- "name": "string",
- "script": "string"
}{- "createdAt": "2022-07-17T23:43:26.660308Z",
- "description": "getLastPoint finds the last point in a bucket",
- "id": "09afa23ff13e4000",
- "language": "flux",
- "name": "getLastPoint",
- "orgID": "bea7ea952287f70d",
- "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)",
- "updatedAt": "2022-07-17T23:43:26.660308Z"
}删除一个 script 及所有相关记录。
204 status code.| scriptID 必需 | 字符串 一个脚本ID。 |
curl -X 'DELETE' \ "https://cloud2.influxdata.com/api/v2/scripts/SCRIPT_ID" \ --header "Authorization: Token INFLUX_TOKEN" \ --header 'Accept: application/json'
{- "code": "unauthorized",
- "message": "unauthorized access"
}{- "createdAt": "2022-07-17T23:49:45.731237Z",
- "description": "getLastPoint finds the last point in a bucket",
- "id": "09afa3b220fe4000",
- "language": "flux",
- "name": "getLastPoint",
- "orgID": "bea7ea952287f70d",
- "script": "from(bucket: my-bucket) |> range(start: -7d) |> limit(n:1)",
- "updatedAt": "2022-07-17T23:49:45.731237Z"
}更新可调用的脚本。
使用此端点来修改脚本属性的值(description 和 script)。
要更新脚本,请传递一个包含更新后的键值对的对象。
200 status
code.| scriptID 必需 | 字符串 脚本 ID。 |
一个包含要应用的更新脚本属性的对象。
| 描述 | 字符串 脚本的描述。 |
| 脚本 | 字符串 要执行的脚本。 |
{- "description": "string",
- "script": "string"
}{- "createdAt": "2022-07-17T23:49:45.731237Z",
- "description": "get last point from new bucket",
- "id": "09afa3b220fe4000",
- "language": "flux",
- "name": "getLastPoint",
- "orgID": "bea7ea952287f70d",
- "script": "from(bucket: newBucket) |> range(start: -7d) |> limit(n:1)",
- "updatedAt": "2022-07-19T22:27:23.185436Z"
}运行脚本并返回结果。
当脚本运行时,InfluxDB 在脚本中引用的 params 键将被请求体中传递的 params 键值替换——例如:
以下示例脚本包含一个 mybucket 参数 :
"script": "from(bucket: params.mybucket)
|> range(start: -7d)
|> limit(n:1)"以下示例 POST /api/v2/scripts/SCRIPT_ID/invoke 请求正文
传递了 mybucket 参数的一个值:
{
"params": {
"mybucket": "air_sensor"
}
}| scriptID 必填 | 字符串 一个脚本 ID。 运行指定的脚本。 |
对象 脚本参数。
|
{- "params": { }
},result,table,_start,_stop,_time,_value,_field,_measurement,host ,_result,0,2019-10-30T01:28:02.52716421Z,2022-07-26T01:28:02.52716421Z,2020-01-01T00:00:00Z,72.01,used_percent,mem,host2
分析一个脚本并确定所需的参数。 params 中引用的所有键都会被找到并返回一个键的列表。如果可能的话,从上下文中确定值的类型,那么类型也会被返回——例如:
以下示例脚本包含一个 mybucket 参数 :
"script": "from(bucket: params.mybucket)
|> range(start: -7d)
|> limit(n:1)"使用 GET /api/v2/scripts/SCRIPT_ID/params 请求参数返回以下内容:
{
"params": {
"mybucket": "string"
}
}返回参数的类型名称将是以下之一:
anybooldurationfloatintstringtimeuint类型名称 any 用于当参数的类型不能从上下文中确定,或者类型被确定为结构类型,例如数组或记录。
| scriptID 必填 | 字符串 一个脚本ID。 要分析参数的脚本。 |
curl --request GET "https://cloud2.influxdata.com/api/v2/scripts/SCRIPT_ID/params" \ --header "Authorization: Token INFLUX_TOKEN"
{- "params": {
- "mybucket": "string"
}
}{- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}{- "label": {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
},
}| 标签ID 必需 | 字符串 要更新的标签的ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
标签更新。
| 名称 | 字符串 |
对象 |
{- "name": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}{- "label": {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
},
}| authID | 字符串 授权 ID。 返回指定的旧版授权。 |
| 组织 | 字符串 组织名称。 仅返回属于指定的 组织 的遗留授权。 |
| orgID | 字符串 一个组织 ID。 仅返回属于指定的 组织 的遗留授权。 |
| token | 字符串 一个授权名称令牌。 |
| 用户 | 字符串 用户名。 仅返回作用域限于指定 用户 的旧版授权。 |
| 用户ID | 字符串 用户ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "authorizations": [
- {
- "description": "string",
- "status": "active",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "authorizations"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}
],
}创建一个遗留授权并返回遗留授权。
write-users USER_ID if you pass the userID property in the request body.USER_ID 是您想要限制授权的用户的 ID。
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
创建的遗留授权。
| 描述 | 字符串 这是令牌的描述。 |
| orgID 必填 | 字符串 组织ID。标识授权所涉及的组织。 |
必需 | 对象的数组 (Permission) 非空 提供对组织资源的 |
| 状态 | 字符串 默认: "active" 枚举: "active" "inactive" 令牌的状态。如果 |
| token | string 您为授权提供的名称。 |
| 用户ID | 字符串 用户的ID。标识授权范围内的用户。 |
{- "description": "string",
- "status": "active",
- "orgID": "string",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "authorizations"
}
}
], - "token": "string",
- "userID": "string"
}{- "description": "string",
- "status": "active",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "authorizations"
}
}
], - "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": "active",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "authorizations"
}
}
], - "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 上下文 |
遗留授权以更新
| 描述 | 字符串 这是令牌的描述。 |
| 状态 | 字符串 默认: "active" 枚举: "active" "inactive" 令牌的状态。如果 |
{- "description": "string",
- "status": "active"
}{- "description": "string",
- "status": "active",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "authorizations"
}
}
], - "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": "string"
}{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}使用 InfluxQL 查询 InfluxDB。
| db 必需 | 字符串 要查询数据的数据库。 这映射到一个 InfluxDB bucket。 更多信息,请参见 数据库和保留策略映射。 |
| 纪元 | 字符串 枚举: "ns" "u" "µ" "ms" "s" "m" "h" Unix 时间戳精度。将时间戳格式化为 unix (纪元) 时间戳 以指定的精度,而不是具有纳秒精度的 RFC3339 时间戳。 |
| p | string 用于验证请求的 InfluxDB 1.x 密码。 |
| q 必需 | 字符串 要执行的InfluxQL查询。要执行多个查询,请用分号 ( |
| rp | 字符串 要查询数据的保留策略。 这映射到一个 InfluxDB bucket。 更多信息,请参见 数据库和保留策略映射。 |
| u | string 用来验证请求的 InfluxDB 1.x 用户名。 |
| 接受 | 字符串 默认: application/json 枚举: "application/json" "application/csv" "text/csv" "application/x-msgpack" 客户端可以理解的媒体类型。 注意: 使用 |
| 接收编码 | 字符串 默认: 身份 枚举: "gzip" "身份" 客户端可以理解的内容编码(通常是一种压缩算法)。 |
| 内容类型 | 字符串 值: "application/json" |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
| db 必填 | 字符串 要写入的存储桶。如果不存在,InfluxDB将创建一个默认保留策略为3天的存储桶。 |
| p | string 用于验证请求的 InfluxDB 1.x 密码。 |
| 精度 | 字符串 写入精度。 |
| rp | 字符串 保留策略名称。 |
| u | string 用来验证请求的 InfluxDB 1.x 用户名。 |
| 内容编码 | 字符串 默认: 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"
}{- "limits": {
- "bucket": {
- "maxBuckets": 0,
- "maxRetentionDuration": 0
}, - "check": {
- "maxChecks": 0
}, - "dashboard": {
- "maxDashboards": 0
}, - "features": {
- "allowDelete": true
}, - "notificationEndpoint": {
- "blockedNotificationEndpoints": "http,pagerduty"
}, - "notificationRule": {
- "blockedNotificationRules": "http,pagerduty",
- "maxNotifications": 0
}, - "orgID": "string",
- "rate": {
- "cardinality": 0,
- "concurrentDeleteRequests": 0,
- "concurrentReadRequests": 0,
- "concurrentWriteRequests": 0,
- "deleteRequestsPerSecond": 0,
- "queryTime": 0,
- "readKBs": 0,
- "writeKBs": 0
}, - "stack": {
- "enabled": true
}, - "task": {
- "maxTasks": 0
}, - "timeout": {
- "queryUnconditionalTimeoutSeconds": 0,
- "queryidleWriteTimeoutSeconds": 0
}
},
}| 限制 | 整数 [ 1 .. 100 ] 默认: 20 限制返回的记录数量。默认值是 |
| 偏移量 | 整数 >= 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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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": "active",
- "type": "slack",
- "updatedAt": "2019-08-24T14:15:22Z",
- "userID": "string",
- "token": "string",
- "url": "string"
}
]
}通知端点以创建
| authMethod 必需 | 字符串 枚举: "none" "basic" "bearer" |
| 内容模板 | 字符串 |
| 描述 | 字符串 通知端点的可选描述。 |
对象 自定义头部。 | |
| 身份证 | 字符串 |
数组对象(标签) | |
| 方法 必需 | 字符串 枚举: "POST" "GET" "PUT" |
| 名称 必需 | 字符串 |
| 组织编号 | 字符串 |
| 密码 | 字符串 |
| 状态 | 字符串 默认: "active" 枚举: "active" "inactive" 端点的状态。 |
| 令牌 | 字符串 |
| 类型 必需 | 字符串 (NotificationEndpointType) http PostNotificationEndpoint NotificationEndpoint slack pagerduty http telegram |
| 网址 必填 | 字符串 |
| 用户ID | 字符串 |
| 用户名 | 字符串 |
{- "description": "string",
- "id": "string",
- "labels": [
- {
- "name": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "name": "string",
- "orgID": "string",
- "status": "active",
- "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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": "active",
- "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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": "active",
- "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 上下文 |
检查更新以应用
| 描述 | 字符串 |
| 名称 | 字符串 |
| 状态 | 字符串 枚举: "active" "inactive" |
{- "description": "string",
- "name": "string",
- "status": "active"
}{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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": "active",
- "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" |
| 内容模板 | 字符串 |
| 描述 | 字符串 通知端点的可选描述。 |
对象 自定义头部。 | |
| 身份证 | 字符串 |
数组对象(标签) | |
| 方法 必需 | 字符串 枚举: "POST" "GET" "PUT" |
| 名称 必需 | 字符串 |
| 组织编号 | 字符串 |
| 密码 | 字符串 |
| 状态 | 字符串 默认: "active" 枚举: "active" "inactive" 端点的状态。 |
| 令牌 | 字符串 |
| 类型 必需 | 字符串 (NotificationEndpointType) http PostNotificationEndpoint NotificationEndpoint slack pagerduty http telegram |
| 网址 必填 | 字符串 |
| 用户ID | 字符串 |
| 用户名 | 字符串 |
{- "description": "string",
- "id": "string",
- "labels": [
- {
- "name": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "name": "string",
- "orgID": "string",
- "status": "active",
- "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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": "active",
- "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 上下文 |
{- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
],
}| 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",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
},
}| checkID | 字符串 仅显示属于特定检查 ID 的通知。 |
| 限制 | 整数 [ 1 .. 100 ] 默认: 20 限制返回的记录数量。默认值是 |
| 偏移量 | 整数 >= 0 分页的偏移量。 要跳过的记录数。 有关分页参数的更多信息,请参见 分页。 |
| orgID 必填 | 字符串 仅显示属于特定组织ID的通知规则。 |
| 标签 | 字符串^[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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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": "active",
- "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"
}
]
}创建通知规则
| 描述 | 字符串 通知规则的可选描述。 |
| 端点ID 必需 | 字符串 |
| 每个 | 字符串 通知重复间隔。 |
数组对象(标签) | |
| 限制 | 整数 每 |
| 限制每次 | 整数 不要在每 |
| 名称 必需 | 字符串 描述通知规则的人类可读名称。 |
| offset | string 在执行检查之前,延迟计划后的持续时间。 |
| orgID 必填 | string 拥有此通知规则的组织的ID。 |
| 运行手册链接 | 字符串 |
| 睡眠直到 | 字符串 |
| 状态 必填 | 字符串 (TaskStatusType) 枚举: "active" "inactive"
|
必填 | 数组 对象 (StatusRule) 非空 通知规则试图匹配的状态规则列表。 |
数组 对象 (TagRule) 通知规则尝试匹配的标签规则列表。 | |
| 任务ID | 字符串 与此通知规则相关联的任务的ID。 |
| 类型 必填 | 字符串 http PostNotificationRule NotificationRule telegram smtp slack pagerduty http |
| 网址 | 字符串 |
{- "description": "string",
- "endpointID": "string",
- "every": "string",
- "labels": [
- {
- "name": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "limit": 0,
- "limitEvery": 0,
- "name": "string",
- "offset": "string",
- "orgID": "string",
- "runbookLink": "string",
- "sleepUntil": "string",
- "status": "active",
- "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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": "active",
- "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"
}| 规则ID 必需 | 字符串 通知规则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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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": "active",
- "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"
}| 规则ID 必需 | 字符串 通知规则ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
通知规则更新以应用
| 描述 | 字符串 |
| 名称 | 字符串 |
| 状态 | 字符串 枚举: "active" "inactive" |
{- "description": "string",
- "name": "string",
- "status": "active"
}{- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "endpointID": "string",
- "every": "string",
- "id": "string",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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": "active",
- "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"
}| 规则ID 必需 | 字符串 通知规则ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
通知规则更新以应用
| 描述 | 字符串 通知规则的可选描述。 |
| 端点ID 必需 | 字符串 |
| 每个 | 字符串 通知重复间隔。 |
数组对象(标签) | |
| 限制 | 整数 每 |
| 限制每次 | 整数 不要在每 |
| 名称 必需 | 字符串 描述通知规则的人类可读名称。 |
| offset | string 在执行检查之前,延迟计划后的持续时间。 |
| orgID 必填 | string 拥有此通知规则的组织的ID。 |
| 运行手册链接 | 字符串 |
| 睡眠直到 | 字符串 |
| 状态 必填 | 字符串 (TaskStatusType) 枚举: "active" "inactive"
|
必填 | 数组 对象 (StatusRule) 非空 通知规则试图匹配的状态规则列表。 |
数组 对象 (TagRule) 通知规则尝试匹配的标签规则列表。 | |
| 任务ID | 字符串 与此通知规则相关联的任务的ID。 |
| 类型 必填 | 字符串 http PostNotificationRule NotificationRule telegram smtp slack pagerduty http |
| 网址 | 字符串 |
{- "description": "string",
- "endpointID": "string",
- "every": "string",
- "labels": [
- {
- "name": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "limit": 0,
- "limitEvery": 0,
- "name": "string",
- "offset": "string",
- "orgID": "string",
- "runbookLink": "string",
- "sleepUntil": "string",
- "status": "active",
- "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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": "active",
- "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"
}| 规则ID 必需 | 字符串 通知规则ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
],
}| 规则ID 必需 | 字符串 通知规则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",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
},
}管理你的 organization。 一个组织是一个用户组的工作空间。组织可以用来在 InfluxDB 中分隔不同的环境、项目、团队或用户。
使用 /api/v2/orgs 端点查看和管理组织。
列出 organizations。
要限制返回的组织,可以在请求中传递查询参数。
如果未传递查询参数,InfluxDB 将返回所有组织,直到默认的 limit。
| 降序 | 布尔值 默认: false |
| 限制 | 整数 [ 1 .. 100 ] 默认: 20 限制返回的记录数量。默认值是 |
| 偏移量 | 整数 >= 0 分页的偏移量。 要跳过的记录数。 有关分页参数的更多信息,请参见 分页。 |
| org | string 一个组织名称。只返回指定的组织。 |
| orgID | 字符串 组织 ID。 |
| 用户ID | 字符串 用户ID。 仅返回指定用户为成员或所有者的组织。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "links": {
- "self": "/api/v2/orgs"
}, - "orgs": [
- {
- "createdAt": "2022-07-17T23:00:30.778487Z",
- "description": "Example InfluxDB organization",
- "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"
}
]
}创建一个 organization 并返回新创建的组织。
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要创建的组织。
| 描述 | 字符串 组织的描述。 |
| 名称 必需 | 字符串 组织的名称。 |
{- "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 status code if queued; error otherwise.| 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": "active",
- "updatedAt": "2019-08-24T14:15:22Z"
}更新组织。
使用此端点更新组织的属性 (name, description)。
更新组织名称会影响所有引用该组织名称的资源,包括以下内容:
如果您更改了组织名称,请确保在这些资源中也更新组织名称。
| orgID 必填 | string 要更新的组织的ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
需要应用的组织更新。
| 描述 | 字符串 组织的描述。 |
| 名称 | 字符串 组织的名称。 |
{- "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": "active",
- "updatedAt": "2019-08-24T14:15:22Z"
}列出所有属于一个组织的用户。
InfluxDB users 有权访问 InfluxDB。
成员 是组织内的用户。
owner and member roles.
Use /api/v2/authorizations to assign user permissions.read-orgs INFLUX_ORG_IDINFLUX_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 users 有权访问 InfluxDB。
成员 是组织内的用户。
owner and member roles.
Use /api/v2/authorizations to assign user permissions.write-orgs INFLUX_ORG_IDINFLUX_ORG_ID 是您想要添加成员的组织的ID。
| orgID 必填 | 字符串 组织的ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加到组织的用户。
| id 必需 | 字符串 要添加到资源的用户ID。 |
| 姓名 | 字符串 要添加到资源中的用户姓名。 |
{- "id": "string",
- "name": "string"
}{- "id": "09cfb87051cbe000",
- "links": {
- "self": "/api/v2/users/09cfb87051cbe000"
}, - "name": "example_user_1",
- "role": "member",
- "status": "active"
}从组织中移除成员。
使用此端点来删除用户在组织中的成员权限。删除成员权限将从组织中移除用户的 read 和 write 权限。
owner and member roles.
Use /api/v2/authorizations to assign user permissions.write-orgs INFLUX_ORG_IDINFLUX_ORG_ID 是您要移除所有者的组织的ID。
| orgID 必填 | string 要从中移除用户的组织的ID。 |
| 用户ID 必需 | 字符串 要移除的用户的ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "code": "unauthorized",
- "message": "unauthorized access"
}列出一个组织的所有拥有者。
owner and member roles.
Use /api/v2/authorizations to assign user permissions.read-orgs INFLUX_ORG_IDINFLUX_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 and member roles.
Use /api/v2/authorizations to assign user permissions.write-orgs INFLUX_ORG_IDINFLUX_ORG_ID 是您希望为其添加所有者的组织的ID。
| orgID 必需 | 字符串 您想要添加所有者的组织的ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要添加为组织所有者的用户。
| id 必需 | 字符串 要添加到资源的用户ID。 |
| 姓名 | 字符串 要添加到资源中的用户姓名。 |
{- "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": "active",
- "role": "owner"
}从组织中移除一个 owner。
组织拥有者有权限删除组织并移除组织中用户和成员的权限。
owner and member roles.
Use /api/v2/authorizations to assign user permissions.write-orgs INFLUX_ORG_IDINFLUX_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"
}| 组织 | 字符串 组织名称或ID。 InfluxDB Cloud
InfluxDB OSS
|
| orgID | string 组织 ID. InfluxDB Cloud
InfluxDB OSS
|
| 接收编码 | 字符串 默认: 身份 枚举: "gzip" "身份" 客户端可以理解的内容编码(通常是一种压缩算法)。 |
| 内容类型 | 字符串 枚举: "application/json" "application/vnd.flux" |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要执行的Flux查询或规范
对象 (Dialect) 表格数据输出选项。 默认输出为 注释的 CSV,包含标题。 有关表格数据方言的更多信息, 请参见W3表格数据元数据词汇。 | |
对象 (文件) 表示来自单个文件的源 | |
| 现在 | 字符串 <日期-时间> 指定在查询中应报告的时间作为 |
对象 在查询执行期间作为参数传递的键值对。 要在查询中使用参数,请传递一个 并传递 在查询执行期间,InfluxDB 会将 限制
| |
| 查询 必需 | 字符串 要执行的查询脚本。 |
| 类型 | 字符串 值: "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",
- "params": { },
- "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 列表。
| 内容类型 | 字符串 值: "application/json" |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
用于分析的Flux查询
对象 (Dialect) 表格数据输出选项。 默认输出为 注释的 CSV,包含标题。 有关表格数据方言的更多信息, 请参见W3表格数据元数据词汇。 | |
对象 (文件) 表示来自单个文件的源 | |
| 现在 | 字符串 <日期-时间> 指定在查询中应报告的时间作为 |
对象 在查询执行期间作为参数传递的键值对。 要在查询中使用参数,请传递一个 并传递 在查询执行期间,InfluxDB 会将 限制
| |
| 查询 必需 | 字符串 要执行的查询脚本。 |
| 类型 | 字符串 值: "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",
- "params": { },
- "query": "string",
- "type": "flux"
}如果Flux查询缺少属性键,则返回错误对象。
以下示例查询缺少 bucket 属性键:
{
"query": "from(: \"iot_center\")\
...
}{- "errors": [
- {
- "character": 0,
- "column": 6,
- "line": 1,
- "message": "missing property key"
}
]
}分析一个 Flux 查询并返回一个完整的包源 抽象语法树 (AST) 用于该查询。
使用此端点进行深入查询分析,例如调试意外的查询结果。
A 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。
| 内容类型 | 字符串 值: "application/json" |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要分析的Flux查询。
| query 必填 | string 要分析的 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
}
}, - "properties": [
- {
- "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
}
}, - "properties": [
- {
- "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
}
}, - "properties": [
- {
- "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 function 名称和参数。
使用此端点检索在InfluxDB Flux查询构建器中使用的Flux查询建议列表。
编写查询时,避免使用由此端点暴露的 _functionName() 辅助函数。辅助函数名称以一个下划线 (_) 开头,并不意味着可以直接在查询中使用——例如:
top(n, columns=["_value"], tables=<-) function instead of the _sortLimit
helper function. top uses _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": "bool"
}
}, - {
- "name": "hourSelection",
- "params": {
- "location": "object",
- "start": "int",
- "stop": "int",
- "tables": "stream",
- "timeColumn": "string"
}
}, - {
- "name": "increase",
- "params": {
- "columns": "array",
- "tables": "stream"
}
}, - {
- "name": "int",
- "params": {
- "v": "invalid"
}
}, - {
- "name": "integral",
- "params": {
- "column": "string",
- "interpolate": "string",
- "tables": "stream",
- "timeColumn": "string",
- "unit": "duration"
}
}, - {
- "name": "join",
- "params": {
- "method": "string",
- "on": "array",
- "tables": "invalid"
}
}, - {
- "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": "array",
- "tables": "stream"
}
}, - {
- "name": "keys",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "last",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "length",
- "params": {
- "arr": "array"
}
}, - {
- "name": "limit",
- "params": {
- "n": "int",
- "offset": "int",
- "tables": "stream"
}
}, - {
- "name": "linearBins",
- "params": {
- "count": "int",
- "infinity": "bool",
- "start": "float",
- "width": "float"
}
}, - {
- "name": "logarithmicBins",
- "params": {
- "count": "int",
- "factor": "float",
- "infinity": "bool",
- "start": "float"
}
}, - {
- "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": "bool",
- "tables": "stream"
}
}, - {
- "name": "max",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "mean",
- "params": {
- "column": "string",
- "tables": "stream"
}
}, - {
- "name": "median",
- "params": {
- "column": "string",
- "compression": "float",
- "method": "string",
- "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": "array",
- "rowKey": "array",
- "tables": "stream",
- "valueColumn": "string"
}
}, - {
- "name": "quantile",
- "params": {
- "column": "string",
- "compression": "float",
- "method": "string",
- "q": "float",
- "tables": "stream"
}
}, - {
- "name": "range",
- "params": {
- "start": "invalid",
- "stop": "invalid",
- "tables": "stream"
}
}, - {
- "name": "reduce",
- "params": {
- "fn": "function",
- "identity": "invalid",
- "tables": "stream"
}
}, - {
- "name": "relativeStrengthIndex",
- "params": {
- "columns": "array",
- "n": "int",
- "tables": "stream"
}
}, - {
- "name": "rename",
- "params": {
- "columns": "invalid",
- "fn": "function",
- "tables": "stream"
}
}, - {
- "name": "sample",
- "params": {
- "column": "string",
- "n": "int",
- "pos": "int",
- "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": "string",
- "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": "int",
- "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": "function",
- "host": "string",
- "measurementColumn": "string",
- "org": "string",
- "orgID": "string",
- "tables": "stream",
- "tagColumns": "array",
- "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": "invalid",
- "unit": "duration"
}
}, - {
- "name": "uint",
- "params": {
- "v": "invalid"
}
}, - {
- "name": "union",
- "params": {
- "tables": "array"
}
}, - {
- "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 必须存在并且拼写正确。
| 名称 必填 | 字符串 一个 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"
}
}检索 InfluxDB API 的所有顶级路由。
"tasks":"/api/v2/tasks", and doesn't contain resource-specific routes
for tasks (/api/v2/tasks/TASK_ID/...).| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "query": {
}, - "system": {
},
}| 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": [
- "string"
]
}{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}发布一个入职请求以创建初始用户、组织和存储桶。
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
创建来源
| 桶 必需 | 字符串 |
对象 (限制) 这些是类似于在quartz中配置的组织限制。 | |
| 组织 必需 | 字符串 |
| 密码 | 字符串 |
| 保留周期小时 | 整数 已弃用 |
| 保留期限(秒) | 整数 |
| 用户名 必需 | 字符串 |
{- "bucket": "string",
- "limit": {
- "bucket": {
- "maxBuckets": 0,
- "maxRetentionDuration": 0
}, - "check": {
- "maxChecks": 0
}, - "dashboard": {
- "maxDashboards": 0
}, - "features": {
- "allowDelete": true
}, - "notificationEndpoint": {
- "blockedNotificationEndpoints": "http,pagerduty"
}, - "notificationRule": {
- "blockedNotificationRules": "http,pagerduty",
- "maxNotifications": 0
}, - "orgID": "string",
- "rate": {
- "cardinality": 0,
- "concurrentDeleteRequests": 0,
- "concurrentReadRequests": 0,
- "concurrentWriteRequests": 0,
- "deleteRequestsPerSecond": 0,
- "queryTime": 0,
- "readKBs": 0,
- "writeKBs": 0
}, - "stack": {
- "enabled": true
}, - "task": {
- "maxTasks": 0
}, - "timeout": {
- "queryUnconditionalTimeoutSeconds": 0,
- "queryidleWriteTimeoutSeconds": 0
}
}, - "org": "string",
- "password": "string",
- "retentionPeriodHrs": 0,
- "retentionPeriodSeconds": 0,
- "username": "string"
}{- "auth": {
- "description": "string",
- "status": "active",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "authorizations"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}, - "bucket": {
- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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": "active",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "user": {
- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "active"
}
}发布一个入职请求以创建新用户、组织和桶。
创建来源
| 桶 必需 | 字符串 |
对象 (限制) 这些是类似于 quartz 中配置的组织限制。 | |
| 组织 必需 | 字符串 |
| 密码 | 字符串 |
| 保留期小时 | 整数 已弃用 |
| 保留时间(秒) | 整数 |
| 用户名 必需 | 字符串 |
{- "bucket": "string",
- "limit": {
- "bucket": {
- "maxBuckets": 0,
- "maxRetentionDuration": 0
}, - "check": {
- "maxChecks": 0
}, - "dashboard": {
- "maxDashboards": 0
}, - "features": {
- "allowDelete": true
}, - "notificationEndpoint": {
- "blockedNotificationEndpoints": "http,pagerduty"
}, - "notificationRule": {
- "blockedNotificationRules": "http,pagerduty",
- "maxNotifications": 0
}, - "orgID": "string",
- "rate": {
- "cardinality": 0,
- "concurrentDeleteRequests": 0,
- "concurrentReadRequests": 0,
- "concurrentWriteRequests": 0,
- "deleteRequestsPerSecond": 0,
- "queryTime": 0,
- "readKBs": 0,
- "writeKBs": 0
}, - "stack": {
- "enabled": true
}, - "task": {
- "maxTasks": 0
}, - "timeout": {
- "queryUnconditionalTimeoutSeconds": 0,
- "queryidleWriteTimeoutSeconds": 0
}
}, - "org": "string",
- "password": "string",
- "retentionPeriodHrs": 0,
- "retentionPeriodSeconds": 0,
- "username": "string"
}{- "auth": {
- "description": "string",
- "status": "active",
- "createdAt": "2019-08-24T14:15:22Z",
- "id": "string",
- "links": {
- "self": "/api/v2/authorizations/1",
- "user": "/api/v2/users/12"
}, - "org": "string",
- "orgID": "string",
- "permissions": [
- {
- "action": "read",
- "resource": {
- "id": "string",
- "name": "string",
- "org": "string",
- "orgID": "string",
- "type": "authorizations"
}
}
], - "token": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "user": "string",
- "userID": "string"
}, - "bucket": {
- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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": "active",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "user": {
- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "active"
}
}验证 基础认证凭据 为 用户,然后如果成功,则生成用户会话。
要验证用户,请使用 HTTP Authorization 标头,采用 Basic 方案,并提供 base64 编码的用户名和密码。
有关语法和更多信息,请参阅 Basic Authentication 以获取语法和更多信息。
如果身份验证成功,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 endpoint to create a user session and
generate a session cookie.GET /api/v2/me endpoint, passing the stored session cookie
from step 1 to retrieve user information.POST /api/v2/signout endpoint, passing the stored session
cookie to expire the session.请参阅请求示例中的完整示例。
InfluxDB仅将用户会话存储在内存中。 如果用户没有注销,则用户会话将在十分钟内自动过期或 在InfluxDB实例重启期间过期。
要了解更多关于HTTP请求中的cookie,请参阅 Mozilla Developer Network (MDN) Web Docs, HTTP cookies。
| 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"
}处理和分析您的数据,使用 tasks 在 InfluxDB 任务引擎中。使用 /api/v2/tasks 接口调度和管理任务、重试任务运行以及检索运行日志。
要配置任务,请提供脚本和运行任务的计划。
有关示例,请参见如何使用 POST /api/v2/tasks 端点创建任务。
A task 对象包含关于 InfluxDB 任务资源的信息。
下表定义了在该对象中出现的属性:
| authorizationID | 字符串 授权 ID。 指定任务与查询引擎通信时使用的授权。 要查找授权 ID,请使用
|
| 创建时间 | 字符串 <日期-时间> |
| cron | 字符串 一个Cron 表达式,定义任务运行的时间表。InfluxDB在评估Cron表达式时使用系统时间。 |
| 描述 | 字符串 任务的描述。 |
| 每 | 字符串 <duration> 任务运行的间隔(duration literal)。 |
| flux | 字符串 任务执行的 Flux 脚本。 限制
|
| 编号 必填 | 字符串 |
数组对象(标签) | |
| 上次运行错误 | 字符串 |
| 最后运行状态 | 字符串 枚举: "失败" "成功" "已取消" |
| latestCompleted | 字符串 <日期-时间> 最新计划和完成运行的时间戳(RFC3339 日期/时间格式)。 |
对象 | |
| 名称 必填 | 字符串 任务的名称。 |
| 偏移量 | 字符串 <持续时间> 在预定时间经过后,延迟执行任务的 持续时间。 |
| 组织 | 字符串 一个 组织 名称。 指定拥有该任务的组织。 |
| orgID 必需 | 字符串 一个 组织 ID。 指定拥有该任务的组织。 |
| ownerID | string 一个 用户 ID。 指定任务的所有者。 要查找用户 ID,您可以使用 |
| scriptID | 字符串 |
| scriptParameters | object 脚本中 限制
|
| 状态 | 字符串 (TaskStatusType) 枚举: "active" "inactive"
|
| 更新时间 | 字符串 <日期-时间> |
{- "authorizationID": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "cron": "string",
- "description": "string",
- "every": "string",
- "flux": "string",
- "id": "string",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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",
- "scriptID": "string",
- "scriptParameters": { },
- "status": "active",
- "updatedAt": "2019-08-24T14:15:22Z"
}检索任务的列表。
要限制返回的任务,请在请求中传递查询参数。 如果没有传递查询参数,InfluxDB将返回所有任务,直到默认的 limit。
| 之后 | 字符串 A task ID. 仅返回在指定任务之后创建的任务。 |
| 限制 | 整数 [ -1 .. 500 ] 默认值: 100 示例:
要返回的最大任务数量。默认值为 为了减少负载大小,请结合 |
| 名称 | 字符串 一个 任务 名称。 |
| 偏移量 | 整数 >= 0 默认: 0 要跳过的记录数。 |
| 组织 | 字符串 一个 组织 名称。 |
| orgID | string 一个组织 ID。 |
| scriptID | 字符串 A script ID. |
| sortBy | 字符串 值: "name" 排序字段。仅支持 |
| 状态 | |
| 类型 | 字符串 默认: "" 枚举: "basic" "system" 一种 任务 类型 ( |
| 用户 | 字符串 A 用户 ID. 仅返回由指定用户拥有的任务。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
curl INFLUX_URL/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"
}, - "tasks": [
- {
- "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"
}
]
}创建一个 task 并返回该任务。
使用此端点创建一个运行 Flux 脚本的计划任务。
您可以使用 flux 或 scriptID 来提供任务脚本。
flux:一串“原始”的 Flux,包含任务选项和脚本——例如:
{
"flux": "option task = {name: \"CPU Total 1 Hour New\", every: 1h}\
from(bucket: \"telegraf\")
|> range(start: -1h)
|> filter(fn: (r) => (r._measurement == \"cpu\"))
|> filter(fn: (r) =>\n\t\t(r._field == \"usage_system\"))
|> filter(fn: (r) => (r.cpu == \"cpu-total\"))
|> aggregateWindow(every: 1h, fn: max)
|> to(bucket: \"cpu_usage_user_total_1h\", org: \"INFLUX_ORG\")",
"status": "active",
"description": "This task downsamples CPU data every hour"
}scriptID:要运行的 可调用脚本 的ID。
使用 scriptID 时,要传递任务选项,将选项作为请求体中的属性传递——例如:
{
"name": "CPU Total 1 Hour New",
"description": "This task downsamples CPU data every hour",
"every": "1h",
"scriptID": "SCRIPT_ID",
"scriptParameters":
{
"rangeStart": "-1h",
"bucket": "telegraf",
"filterField": "cpu-total"
}
}flux and scriptID for the same task.| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
创建任务
| cron | 字符串 一个 Cron 表达式,定义任务运行的时间表。InfluxDB 的 cron 运行基于系统时间。 |
| 描述 | 字符串 任务的描述。 |
| 每个 | 字符串 任务运行的时间间隔 (duration literal)。
|
| flux | 字符串 任务运行的Flux脚本。 限制
|
| 名称 | 字符串 任务的名称 |
| 偏移量 | 字符串 <持续时间> 在预定时间经过后,延迟执行任务的 持续时间。 |
| org | string 拥有该任务的组织的名称。 |
| orgID | string 拥有该任务的组织的ID。 |
| 脚本ID | 字符串 任务运行的脚本的ID。 限制
|
| scriptParameters | 对象 在任务运行期间传递给脚本(通过 限制
|
| 状态 | 字符串 (TaskStatusType) 枚举: "active" "inactive"
|
{- "cron": "string",
- "description": "string",
- "every": "string",
- "flux": "string",
- "name": "string",
- "offset": "string",
- "org": "string",
- "orgID": "string",
- "scriptID": "string",
- "scriptParameters": { },
- "status": "active"
}{- "authorizationID": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "cron": "string",
- "description": "string",
- "every": "string",
- "flux": "string",
- "id": "string",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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",
- "scriptID": "string",
- "scriptParameters": { },
- "status": "active",
- "updatedAt": "2019-08-24T14:15:22Z"
}删除一个 task 和相关记录。
使用此端点删除任务及所有相关记录(任务运行、日志和标签)。一旦任务被删除,InfluxDB 将取消该任务的所有计划运行。
如果您想要禁用一个任务而不是删除它,请将任务状态更新为 inactive。
| 任务ID 必填 | 字符串 A task ID. Specifies the task to delete. |
| 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"
}检索一个 任务。
| 任务ID 必需 | 字符串 一个 任务 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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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",
- "scriptID": "string",
- "scriptParameters": { },
- "status": "active",
- "updatedAt": "2019-08-24T14:15:22Z"
}更新一个 task,然后取消所有计划好的任务运行。
使用此端点来设置、修改或清除任务属性--例如: cron、 name、 flux、 status。 一旦 InfluxDB 应用更新,它将取消该任务之前计划的所有运行。
要更新一个任务,传递一个包含更新后的键值对的对象。 要激活或停用一个任务,设置 status 属性。 "status": "inactive" 取消已调度的运行并防止手动运行该任务。
使用 flux 或 scriptID 来提供任务脚本。
flux:一串“原始”的 Flux,包含任务选项和脚本——例如:
{
"flux": "option task = {name: \"CPU Total 1 Hour New\", every: 1h}\
from(bucket: \"telegraf\")
|> range(start: -1h)
|> filter(fn: (r) => (r._measurement == \"cpu\"))
|> filter(fn: (r) =>\n\t\t(r._field == \"usage_system\"))
|> filter(fn: (r) => (r.cpu == \"cpu-total\"))
|> aggregateWindow(every: 1h, fn: max)
|> to(bucket: \"cpu_usage_user_total_1h\", org: \"INFLUX_ORG\")",
"status": "active",
"description": "This task downsamples CPU data every hour"
}scriptID:要运行的 可调用脚本 的ID。
使用 scriptID 时,要传递任务选项,将选项作为请求体中的属性传递——例如:
{
"name": "CPU Total 1 Hour New",
"description": "This task downsamples CPU data every hour",
"every": "1h",
"scriptID": "SCRIPT_ID",
"scriptParameters":
{
"rangeStart": "-1h",
"bucket": "telegraf",
"filterField": "cpu-total"
}
}flux and scriptID for the same task.| 任务ID 必需 | 字符串 一个 任务 ID。指定要更新的任务。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
要应用的任务更新。
| 定时任务 | 字符串 更新flux脚本中的'cron'选项。 |
| 描述 | 字符串 更新任务的描述。 |
| 每个 | 字符串 更新flux脚本中的'every'选项。 |
| flux | string 更新任务运行的Flux脚本。 |
| 名称 | 字符串 更新flux脚本中的'名称'选项。 |
| offset | string 更新flux脚本中的'offset'选项。 |
| 脚本ID | 字符串 更新任务的 'scriptID'。 |
| scriptParameters | object 更新任务的 'scriptParameters'。 |
| 状态 | 字符串 (TaskStatusType) 枚举: "active" "inactive"
|
{- "cron": "string",
- "description": "string",
- "every": "string",
- "flux": "string",
- "name": "string",
- "offset": "string",
- "scriptID": "string",
- "scriptParameters": { },
- "status": "active"
}{- "authorizationID": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "cron": "string",
- "description": "string",
- "every": "string",
- "flux": "string",
- "id": "string",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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",
- "scriptID": "string",
- "scriptParameters": { },
- "status": "active",
- "updatedAt": "2019-08-24T14:15:22Z"
}检索任务的所有标签列表。
标签可以用于分组和过滤任务。
| 任务ID 必填 | 字符串 用于检索标签的任务的ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
],
}为任务添加标签。
使用此端点添加一个标签,以便您可以在InfluxDB UI中筛选任务。
| 任务ID 必填 | 字符串 要标记的任务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",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
},
}检索所有任务的日志列表。
当一个InfluxDB任务运行时,在任务历史中创建一个“运行”记录。与每次运行相关的日志提供相关的日志消息、时间戳和运行尝试的退出状态。
使用此端点仅检索任务的日志事件,而不包含额外的任务元数据。
| 任务ID 必填 | 字符串 任务的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 角色的用户。
| 任务ID 必填 | 字符串 任务的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": "active",
- "role": "member"
}
]
}已弃用: 任务不使用 owner 和 member 角色。 使用 /api/v2/authorizations 来分配用户权限。
将用户添加到任务的成员中并返回该成员。
| 任务ID 必填 | 字符串 任务的ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
一个用户作为任务的成员添加。
| id 必需 | 字符串 要添加到资源的用户ID。 |
| 姓名 | 字符串 要添加到资源中的用户姓名。 |
{- "id": "string",
- "name": "string"
}{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "active",
- "role": "member"
}已弃用: 任务不使用 owner 和 member 角色。 使用 /api/v2/authorizations 来分配用户权限。
从任务中移除一个成员。
| 任务ID 必填 | 字符串 任务的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": "active",
- "role": "owner"
}
]
}已弃用: 任务不使用 owner 和 member 角色。 使用 /api/v2/authorizations 来分配用户权限。
将任务 owner 角色分配给用户。
使用此端点为任务创建一个 资源拥有者。 资源拥有者 是对于特定资源具有 role: owner 的用户。
| 任务ID 必填 | 字符串 任务的ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
一个用户被添加为任务的拥有者。
| id 必需 | 字符串 要添加到资源的用户ID。 |
| 姓名 | 字符串 要添加到资源中的用户姓名。 |
{- "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 来分配用户权限。
| 任务ID 必填 | 字符串 任务的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。
| 任务ID 必填 | 字符串 获取运行的任务ID。 |
| 之后 | 字符串 一个任务运行ID。仅返回在此运行之后创建的运行。 |
| afterTime | 字符串 <日期-时间> 一个时间戳(RFC3339 日期/时间格式)。仅返回在此时间之后调度的运行。 |
| beforeTime | 字符串 <日期-时间> 一个时间戳(RFC3339日期/时间格式)。 |
| 限制 | 整数 [ 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"
}, - "log": [
- {
- "message": "Halt and catch fire",
- "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": "scheduled",
- "taskID": "string"
}
]
}安排任务立即开始运行,忽略计划中的运行。
使用此端点手动启动任务运行。 计划的运行将继续按计划进行。 这可能会导致任务并发运行。
要重试之前的运行(并避免创建新的运行),使用POST /api/v2/tasks/{taskID}/runs/{runID}/retry端点。
| 任务ID 必需 | 字符串 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
| scheduledFor | 字符串或空值 <日期-时间> 运行的时间 RFC3339 日期/时间格式
用于 |
{- "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"
}, - "log": [
- {
- "message": "Halt and catch fire",
- "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": "scheduled",
- "taskID": "string"
}检索特定的任务的运行。
使用此端点检索特定任务运行的详细信息和日志。
| runID 必填 | 字符串 要检索的运行的ID。 |
| 任务ID 必填 | 字符串 要检索运行的任务的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"
}, - "log": [
- {
- "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").| 运行ID 必填 | 字符串 A task run ID. 指定要重试的任务运行。 要查找任务运行ID,请使用
|
| 任务ID 必需 | 字符串 一个 任务 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": "scheduled",
- "taskID": "09a776832f381000"
}| orgID | string 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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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": "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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。 |
| 接受 | 字符串 默认: 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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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": "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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 上下文 |
{- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
],
}| 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",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
},
}| telegrafID 必填 | 字符串 Telegraf 配置 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": "active",
- "role": "member"
}
]
}| telegrafID 必填 | 字符串 Telegraf 配置 ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
用户添加为成员
| id 必需 | 字符串 要添加到资源的用户ID。 |
| 姓名 | 字符串 要添加到资源中的用户姓名。 |
{- "id": "string",
- "name": "string"
}{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "active",
- "role": "member"
}| telegrafID 必填 | 字符串 Telegraf 配置 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": "active",
- "role": "owner"
}
]
}| telegrafID 必填 | 字符串 Telegraf 配置 ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
用户添加为所有者
| id 必需 | 字符串 要添加到资源的用户ID。 |
| 姓名 | 字符串 要添加到资源中的用户姓名。 |
{- "id": "string",
- "name": "string"
}{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "active",
- "role": "owner"
}导出并应用 InfluxDB 模板。管理 堆栈 的模板化 InfluxDB 资源。
InfluxDB 模板是资源的预打包配置。 使用 InfluxDB 模板来配置一个新的 InfluxDB 实例,备份您的仪表板配置,或共享您的配置。
使用 /api/v2/templates 端点来导出模板和应用模板。
InfluxDB 堆栈 是有状态的 InfluxDB 模板,让你能够随着时间的推移添加、更新和删除已安装的模板资源,避免在多次应用相同或相似模板时重复资源,并对 InfluxDB OSS 或 InfluxDB Cloud 的分布式实例应用更改。
使用 /api/v2/stacks 接口来管理已安装的模板资源。
列出已安装的 InfluxDB 堆栈。
要限制响应中的堆栈,请在您的请求中传递查询参数。 如果未传递查询参数,InfluxDB 将返回该组织的所有已安装堆栈。
| 名称 | 字符串 示例:
一个堆栈名称。
查找具有此名称的 可重复。 要过滤多个堆栈名称, 重复此参数并使用每个名称,例如:
|
| orgID 必填 | 字符串 |
| stackID | 字符串 示例:
一个堆栈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 permission for the organization要创建的堆栈。
| 描述 | 字符串 |
| 名称 | 字符串 |
| 组织编号 | 字符串 |
| 网址 | 字符串的数组 |
{- "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"
}{- "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"
}应用模板以创建或更新一个 stack 的 InfluxDB resources。响应包含更改的差异和堆栈 ID。
使用此端点将 InfluxDB 模板安装到组织中。 提供模板 URL 或模板对象作为您的请求。 要自定义安装哪些模板资源,请使用 actions 参数。
默认情况下,当您应用一个模板时,InfluxDB 会安装该模板以创建和更新堆栈资源,然后生成更改的差异。如果您在请求主体中传递 dryRun: true,InfluxDB 将验证模板并生成资源差异,但不会对您的实例进行任何更改。
一些模板可能包含环境引用用于自定义元数据。
要为环境引用提供自定义值,请在请求正文中传递envRefs
属性。
有关更多信息和示例,请参见如何定义环境引用。
某些模板可能包含使用secrets的查询。为了提供自定义秘密值,请在请求体中传递secrets属性。不要在模板中公开秘密值。有关更多信息,请参见如何在安装模板时传递秘密。
write permissions for resource types in the template.应用模板的参数。
对象或对象的数组 一个 您可以使用以下操作来防止创建或更新资源:
| |
| dryRun | boolean 仅对请求中传递的模板进行干运行。
|
对象 一个包含键值对的对象,这些键值对映射到模板中的 环境引用。 模板中的环境引用是具有 当您应用模板时,InfluxDB 会将模板中的 以下模板字段可能使用环境引用:
有关在模板字段中包含环境引用的更多信息,请参见如何 包括用户定义的资源名称。 | |
| orgID | string 组织 ID。 InfluxDB 将模板应用于该组织。 该组织拥有模板创建的所有资源。 要找到您的组织,请参阅如何 查看组织。 |
数组对象 模板文件的 URL 列表。 要应用位于 URL 的模板清单文件,请将 | |
对象 一个包含映射到查询中的 机密 的键值对的对象。 查询可以引用存储在 InfluxDB 中的机密--例如,
以下 Flux 脚本检索 要在您的 InfluxDB 将键值对存储为机密,您可以通过 相关指南 | |
| stackID | string 要更新的堆栈的ID。 要将模板应用于组织中的现有堆栈,请使用 要查找堆栈ID,请使用InfluxDB 相关指南 |
对象 要应用的模板对象。
模板对象具有一个 传递 | |
对象的 数组 要应用的模板对象列表。
模板对象具有一个 使用 |
{- "actions": [
- {
- "action": "skipKind",
- "properties": {
- "kind": "Bucket"
}
}, - {
- "action": "skipKind",
- "properties": {
- "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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": "active",
- "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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": "active",
- "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,
- "properties": {
- "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,
- "properties": {
- "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"
}
], - "labels": [
- {
- "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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": "active",
- "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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": "active",
- "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"
}
], - "tasks": [
- {
- "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",
- "properties": {
- "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "lastRunError": "string",
- "lastRunStatus": "failed",
- "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": "active",
- "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",
- "properties": {
- "color": "string",
- "description": "string"
}, - "templateMetaName": "string"
}
], - "templateMetaName": "string"
}
], - "dashboards": [
- {
- "charts": [
- {
- "height": 0,
- "properties": {
- "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",
- "properties": {
- "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"
}
], - "labels": [
- {
- "envReferences": [
- {
- "defaultValue": "string",
- "envRefKey": "string",
- "resourceField": "string",
- "value": "string"
}
], - "id": "string",
- "kind": "Bucket",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "string",
- "description": "string"
}, - "templateMetaName": "string"
}
], - "missingEnvRefs": [
- "string"
], - "missingSecrets": [
- "string"
], - "notificationEndpoints": [
- {
- "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a 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": "active",
- "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",
- "properties": {
- "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",
- "properties": {
- "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"
}
], - "tasks": [
- {
- "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",
- "properties": {
- "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",
- "properties": {
- "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": { }
}
]| orgID 必填 | 字符串 组织的ID。 |
| 原始 | 布尔值 默认: false 返回原始使用数据 |
| 开始 必填 | 整数 包含在结果中的最早时间。有关时间戳的更多信息,请参见 使用 Flux 操作时间戳。 |
| 停止 | 整数 要包含在结果中的最新时间。 有关时间戳的更多信息,请参见 使用 Flux 操作时间戳。 |
{- "code": "internal error",
- "err": "string",
- "message": "string",
- "op": "string"
}检索特定用户。
InfluxDB Cloud 允许您邀请和与您组织中的多个用户协作。 要邀请和移除您组织中的用户,请使用 InfluxDB Cloud 用户界面 (UI); 您不能使用 InfluxDB API 来管理 InfluxDB Cloud 中的用户。 一旦用户被添加到您的组织,您可以使用 GET /api/v2/users 和 GET /api/v2/users/USER_ID API 端点来查看特定成员。
可选地,您可以将授权(及其API令牌)范围限定为某个用户。
如果用户使用用户名和密码登录,创建一个 用户会话,
该会话携带所有用户授权所授予的权限。
要创建用户会话,请使用 POST /api/v2/signin 端点。
更新已登录的 user 的密码。
此端点代表以下三步过程中的第三步,让具有用户会话的用户更新他们的密码:
POST /api/v2/signin
endpoint to create a user session and generate a session cookie.Set-Cookie) header.PUT /api/v2/me/password endpoint:Set-Cookie 头Authorization Basic头{"password": "NEW_PASSWORD"} 在请求体中| influxdb-oss-session 必需 | 字符串 示例: influxdb-oss-session=influxdb-oss-session=19aaaZZZGOvP2GGryXVT2qYftlFKu3bIopurM6AGFow1yF1abhtOlbHfsc-d8gozZFC_6WxmlQIAwLMW5xs523w== |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
新密码。
| 密码 必填 | 字符串 |
{- "password": "string"
}{- "code": "unauthorized",
- "message": "unauthorized access"
}列出 users。
要限制返回哪些用户,请在请求中传递查询参数。
| 操作 | 所需权限 | 限制 |
|---|---|---|
| 列出所有用户 | 操作员令牌 | 仅供InfluxData内部使用 |
| 列出特定用户 | read-users 或 read-user USER_ID |
USER_ID 是您想要检索的用户的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": "active"
}
]
}(仅供InfluxData内部使用)
创建并返回一个 user,可以访问 InfluxDB。
| 操作 | 所需权限 | 限制 |
|---|---|---|
| 创建用户 | 操作员令牌 | 仅限InfluxData内部使用 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
在请求体中,提供用户。
| 名称 必需 | 字符串 |
| 组织 ID | 字符串 |
| 角色 | 字符串 枚举: "owner" "member" |
| 状态 | 字符串 默认: "active" 枚举: "active" "inactive" 如果为非活动状态,则用户处于非活动状态。 |
{- "name": "string",
- "org_id": "string",
- "role": "owner",
- "status": "active"
}{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "active"
}(仅供InfluxData内部使用)
删除一个 user。
出于安全考虑,一旦从组织中删除一个InfluxDB用户账户,该用户(及其令牌)将无法重新激活。
| 操作 | 所需权限 | 限制 |
|---|---|---|
| 删除用户 | 操作员令牌 | 仅供InfluxData内部使用 |
| 用户ID 必填 | 字符串 一个用户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"
}| 用户ID 必填 | 字符串 用户ID。 检索指定的 用户。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "id": "string",
- "links": {
- "self": "/api/v2/users/1"
}, - "name": "string",
- "status": "active"
}(仅供InfluxData内部使用)
更新一个 user 并返回该用户。
| 操作 | 所需权限 | 限制 |
|---|---|---|
| 更新用户 | 操作员令牌 | 仅供InfluxData内部使用 |
| 用户ID 必填 | 字符串 用户ID。 更新指定的 用户。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
用户更新以应用。
| 名称 必需 | 字符串 |
| 组织 ID | 字符串 |
| 角色 | 字符串 枚举: "owner" "member" |
| 状态 | 字符串 默认: "active" 枚举: "active" "inactive" 如果未激活,用户处于非活跃状态。 |
{- "name": "string",
- "org_id": "string",
- "role": "owner",
- "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": "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": "string"
}{- "code": "invalid",
- "message": "passwords cannot be changed through the InfluxDB Cloud API"
}| org | string 组织的名称。 |
| 组织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) |
| 创建时间 | 字符串 <日期-时间> |
| 描述 | 字符串 |
数组对象(标签) | |
| 名称 必需 | 字符串 |
| 组织ID 必填 | 字符串 |
| 选中 | 字符串的 数组 |
| 排序顺序 | 整数 |
| 更新时间 | 字符串 <日期-时间> |
{- "arguments": {
- "type": "query",
- "values": {
- "language": "string",
- "query": "string"
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "labels": [
- {
- "name": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "name": "string",
- "orgID": "string",
- "selected": [
- "string"
], - "sort_order": 0,
- "updatedAt": "2019-08-24T14:15:22Z"
}{- "arguments": {
- "type": "query",
- "values": {
- "language": "string",
- "query": "string"
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "name": "string",
- "orgID": "string",
- "selected": [
- "string"
], - "sort_order": 0,
- "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",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "name": "string",
- "orgID": "string",
- "selected": [
- "string"
], - "sort_order": 0,
- "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) |
| 创建时间 | 字符串 <日期-时间> |
| 描述 | 字符串 |
数组对象(标签) | |
| 名称 必需 | 字符串 |
| 组织ID 必填 | 字符串 |
| 选中 | 字符串的 数组 |
| 排序顺序 | 整数 |
| 更新时间 | 字符串 <日期-时间> |
{- "arguments": {
- "type": "query",
- "values": {
- "language": "string",
- "query": "string"
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "labels": [
- {
- "name": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "name": "string",
- "orgID": "string",
- "selected": [
- "string"
], - "sort_order": 0,
- "updatedAt": "2019-08-24T14:15:22Z"
}{- "arguments": {
- "type": "query",
- "values": {
- "language": "string",
- "query": "string"
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "name": "string",
- "orgID": "string",
- "selected": [
- "string"
], - "sort_order": 0,
- "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) |
| 创建时间 | 字符串 <日期-时间> |
| 描述 | 字符串 |
数组对象(标签) | |
| 名称 必需 | 字符串 |
| 组织ID 必填 | 字符串 |
| 选中 | 字符串的 数组 |
| 排序顺序 | 整数 |
| 更新时间 | 字符串 <日期-时间> |
{- "arguments": {
- "type": "query",
- "values": {
- "language": "string",
- "query": "string"
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "labels": [
- {
- "name": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "name": "string",
- "orgID": "string",
- "selected": [
- "string"
], - "sort_order": 0,
- "updatedAt": "2019-08-24T14:15:22Z"
}{- "arguments": {
- "type": "query",
- "values": {
- "language": "string",
- "query": "string"
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "id": "string",
- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
], - "name": "string",
- "orgID": "string",
- "selected": [
- "string"
], - "sort_order": 0,
- "updatedAt": "2019-08-24T14:15:22Z"
}| variableID 必需 | 字符串 变量ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "labels": [
- {
- "id": "string",
- "name": "string",
- "orgID": "string",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
}
],
}| 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",
- "properties": {
- "color": "ffb3b3",
- "description": "this is a description"
}
},
}| 单元格ID 必需 | 字符串 单元格的ID。 |
| dashboardID 必需 | 字符串 仪表板 ID。 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
{- "id": "string",
- "links": {
- "self": "string"
}, - "name": "string",
- "properties": {
- "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 上下文 |
| 名称 必需 | 字符串 |
必需 | 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",
- "properties": {
- "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",
- "properties": {
- "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 status code); error otherwise.为了确保 InfluxDB Cloud 按照您请求的顺序处理写入和删除,请在发送下一个请求之前等待成功响应(HTTP 2xx 状态码)。
因为写入和删除是异步的,当您收到响应时,您的更改可能尚不可读。
2xx status code;
otherwise, returns the first line that failed.write-buckets 或 write-bucket BUCKET_ID。
BUCKET_ID 是目标桶的ID。
write 速率限制适用。
有关更多信息,请参见 limits and adjustable quotas。
| 桶 必需 | 字符串 一个桶的名称或ID。 InfluxDB将所有批处理中的点写入指定的桶。 |
| 组织 必需 | 字符串 组织名称或ID。 InfluxDB Cloud
InfluxDB OSS
|
| orgID | 字符串 组织 ID。 InfluxDB Cloud
InfluxDB OSS
|
| 精度 | 字符串 (WritePrecision) 枚举: "ms" "s" "us" "ns" 线协议批次中 unix 时间戳的精度。 |
| 接受 | 字符串 默认:application/json 值:"application/json" 客户端可以理解的内容类型。 仅在失败时写入返回响应体——例如,因格式问题或配额限制。 InfluxDB Cloud
InfluxDB OSS
相关指南 |
| 内容编码 | 字符串 默认: identity 枚举: "gzip" "identity" 应用于请求有效负载的行协议的压缩。
要发送gzip有效负载,请传递 |
| 内容长度 | 整数 发送到 InfluxDB 的实体主体的大小,以字节为单位。如果长度大于 |
| 内容类型 | 字符串 默认: text/plain; charset=utf-8 枚举: "text/plain" "text/plain; charset=utf-8" 请求体中数据的格式。
要发送行协议有效负载,请传递 |
| Zap-Trace-Span | 字符串 示例: baggage,[object Object],span_id,1,trace_id,1 OpenTracing span 上下文 |
在请求体中,以行协议格式提供数据。
要发送压缩数据,请执行以下操作:
Content-Encoding: gzip header.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": "partial write error (2 written): unable to parse 'air_sensor,service=S1,sensor=L1 temperature=\"90.5\",humidity=70.0 1632850122': schema: field type for field \"temperature\" not permitted by schema; got String but expected Float"
}