文档文档

influx scripts update(更新脚本)

The influx scripts update command updates information related to an invokable script in InfluxDB.(influx scripts update 命令更新与 InfluxDB 中可调用脚本相关的信息。)

Usage(用法)

influx scripts update [flags]

Flags(标志)

Flag(标志)Description(描述)Input type(输入类型)Maps to ?(映射到 ?
-c--active-configCLI configuration to use for command(用于命令的 CLI 配置)string(字符串)
--configs-pathPath to influx CLI configurations (default ~/.influxdbv2/configs)(influx CLI 配置的路径(默认为 ~/.influxdbv2/configs))string(字符串)INFLUX_CONFIGS_PATH
-d--descriptionNew script description(新的脚本描述)string(字符串)
-h--helpHelp for the update command(update 命令的帮助信息)
--hide-headersHide table headers (default false)(隐藏表格标题(默认为 false))INFLUX_HIDE_HEADERS
--hostHTTP address of InfluxDB (default https://127.0.0.1:8086)(InfluxDB 的 HTTP 地址(默认为 https://127.0.0.1:8086))string(字符串)INFLUX_HOST
--http-debugInspect communication with InfluxDB servers.(检查与 InfluxDB 服务器的通信。)string(字符串)
-n--nameNew script name(新的脚本名称)string(字符串)
-s--scriptNew script contents(新的脚本内容)string(字符串)
-i--scriptID(Required) Script ID((必需)脚本 ID)string(字符串)
--jsonOutput data as JSON (default false)(以 JSON 格式输出数据(默认为 false))INFLUX_OUTPUT_JSON
--skip-verifySkip TLS certificate verification(跳过 TLS 证书验证)INFLUX_SKIP_VERIFY
-t--tokenAPI token(API 令牌)string(字符串)INFLUX_TOKEN

Example(示例)

Authentication credentials(身份验证凭据)

The examples below assume your InfluxDB host, organization, and token are provided by either the active influx CLI configuration or by environment variables (INFLUX_HOST, INFLUX_ORG, and INFLUX_TOKEN). If you do not have a CLI configuration set up or the environment variables set, include these required credentials for each command with the following flags(以下示例假设您的 InfluxDB hostorganizationtokenactive influx CLI 配置或环境变量(INFLUX_HOSTINFLUX_ORGINFLUX_TOKEN)提供。如果您没有设置 CLI 配置或设置环境变量,请为每个命令包含以下必需的凭据标志)

  • --host: InfluxDB host--host: InfluxDB 主机
  • -o, --org or --org-id: InfluxDB organization name or ID(-o, --org--org-id: InfluxDB 组织名称或 ID)
  • -t, --token: InfluxDB API token(-t, --token: InfluxDB API 令牌)
Update the source code of an invokable script(更新可调用脚本的源代码)
export UPDATED_FLUX='
  from(bucket: "example-bucket")
    |> range(start: -10h)
    |> filter(fn: (r) => r._measurement == "m")
    |> aggregateWindow(every: 1h, fn: mean)
    |> to(bucket: "default-ds-1d", org: "my-org")
'

influx scripts update \
  -i 0Xx0oox00XXoxxoo1 \
  -s $UPDATED_FLUX

Was this page helpful?(此页面是否对您有帮助?)

Thank you for your feedback!(感谢您的反馈!)


The future of Flux(Flux 的未来)

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.(Flux 将进入维护模式。您可以继续像现在一样使用它,而无需对代码进行任何更改。)

Read more(阅读更多)

InfluxDB 3 Open Source Now in Public Alpha(InfluxDB 3 开源版本现已进入公开 Alpha 阶段)

InfluxDB 3 Open Source is now available for alpha testing, licensed under MIT or Apache 2 licensing.(InfluxDB 3 开源版本现已可用于 alpha 测试,并根据 MIT 或 Apache 2 许可进行许可。)

We are releasing two products as part of the alpha.(我们正在发布两个产品作为 alpha 的一部分。)

InfluxDB 3 Core 是我们新的开源产品。 它是用于时间序列和事件数据的最新数据引擎。 InfluxDB 3 Enterprise 是一个商业版本,它建立在 Core 的基础上,增加了历史查询能力、只读副本、高可用性、可扩展性和细粒度的安全性。

有关如何开始使用的更多信息,请查看