本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
Amazon IoT Analytics 使用示例 Amazon CLI
以下代码示例向您展示了如何使用with来执行操作和实现常见场景 Amazon IoT Analytics。 Amazon Command Line Interface
操作是大型程序的代码摘录,必须在上下文中运行。您可以通过操作了解如何调用单个服务函数,还可以通过函数相关场景和跨服务示例的上下文查看操作。
场景是展示如何通过在同一服务中调用多个函数来完成特定任务任务的代码示例。
每个示例都包含一个指向的链接 GitHub,您可以在其中找到有关如何在上下文中设置和运行代码的说明。
主题
操作
以下代码示例演示如何使用 batch-put-message
。
- Amazon CLI
-
向频道发送消息
以下
batch-put-message
示例向指定频道发送消息。aws iotanalytics batch-put-message \ --cli-binary-format raw-in-base64-out \ --cli-input-json file://batch-put-message.json
batch-put-message.json
的内容:{ "channelName": "mychannel", "messages": [ { "messageId": "0001", "payload": "eyAidGVtcGVyYXR1cmUiOiAyMCB9" } ] }
输出:
{ "batchPutMessageErrorEntries": [] }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》BatchPutMessage中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考BatchPutMessage
中的。
-
以下代码示例演示如何使用 cancel-pipeline-reprocessing
。
- Amazon CLI
-
取消通过管道对数据的重新处理
以下
cancel-pipeline-reprocessing
示例取消了通过指定管道对数据的重新处理。aws iotanalytics cancel-pipeline-reprocessing \ --pipeline-name mypipeline \ --reprocessing-id "6ad2764f-fb13-4de3-b101-4e74af03b043"
此命令不生成任何输出。
有关更多信息,请参阅《Amazon IoT Analytics API 参考》CancelPipelineReprocessing中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考CancelPipelineReprocessing
中的。
-
以下代码示例演示如何使用 create-channel
。
- Amazon CLI
-
创建频道
以下
create-channel
示例创建了一个具有指定配置的频道。通道收集来自 MQTT 主题的数据,并在将数据发布到管道之前将原始未处理消息归档。aws iotanalytics create-channel \ --cli-input-json file://create-channel.json
create-channel.json
的内容:{ "channelName": "mychannel", "retentionPeriod": { "unlimited": true }, "tags": [ { "key": "Environment", "value": "Production" } ] }
输出:
{ "channelArn": "arn:aws:iotanalytics:us-west-2:123456789012:channel/mychannel", "channelName": "mychannel", "retentionPeriod": { "unlimited": true } }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》CreateChannel中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考CreateChannel
中的。
-
以下代码示例演示如何使用 create-dataset-content
。
- Amazon CLI
-
创建数据集的内容
以下
create-dataset-content
示例通过应用(SQL 查询)或queryAction
containerAction
(执行容器化应用程序)来创建指定数据集的内容。aws iotanalytics create-dataset-content \ --dataset-name mydataset
输出:
{ "versionId": "d494b416-9850-4670-b885-ca22f1e89d62" }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》CreateDatasetContent中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考CreateDatasetContent
中的。
-
以下代码示例演示如何使用 create-dataset
。
- Amazon CLI
-
创建数据集
以下
create-dataset
示例创建了一个数据集。数据集存储通过应用queryAction
(SQL 查询)或containerAction
(执行容器化应用程序)从数据存储中检索的数据。此操作创建数据集的骨架。您可以通过调用手动填充数据集,CreateDatasetContent
也可以根据trigger
您指定的自动填充数据集。aws iotanalytics create-dataset \ --cli-input-json file://create-dataset.json
create-dataset.json
的内容:{ "datasetName": "mydataset", "actions": [ { "actionName": "myDatasetAction", "queryAction": { "sqlQuery": "SELECT * FROM mydatastore" } } ], "retentionPeriod": { "unlimited": true }, "tags": [ { "key": "Environment", "value": "Production" } ] }
输出:
{ "datasetName": "mydataset", "retentionPeriod": { "unlimited": true }, "datasetArn": "arn:aws:iotanalytics:us-west-2:123456789012:dataset/mydataset" }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》CreateDataset中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考CreateDataset
中的。
-
以下代码示例演示如何使用 create-datastore
。
- Amazon CLI
-
创建数据存储
以下
create-datastore
示例创建了一个数据存储,它是一个消息存储库。aws iotanalytics create-datastore \ --cli-input-json file://create-datastore.json
create-datastore.json
的内容:{ "datastoreName": "mydatastore", "retentionPeriod": { "numberOfDays": 90 }, "tags": [ { "key": "Environment", "value": "Production" } ] }
输出:
{ "datastoreName": "mydatastore", "datastoreArn": "arn:aws:iotanalytics:us-west-2:123456789012:datastore/mydatastore", "retentionPeriod": { "numberOfDays": 90, "unlimited": false } }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》CreateDatastore中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考CreateDatastore
中的。
-
以下代码示例演示如何使用 create-pipeline
。
- Amazon CLI
-
创建 IoT Analytics 管道
以下
create-pipeline
示例创建了一个管道。管道使用来自通道的消息,并允许您在将消息存储在数据存储之前处理消息。您必须同时指定通道和数据存储活动,并可选择在pipelineActivities
数组中指定多达 23 个其他活动。aws iotanalytics create-pipeline \ --cli-input-json file://create-pipeline.json
create-pipeline.json
的内容:{ "pipelineName": "mypipeline", "pipelineActivities": [ { "channel": { "name": "myChannelActivity", "channelName": "mychannel", "next": "myMathActivity" } }, { "datastore": { "name": "myDatastoreActivity", "datastoreName": "mydatastore" } }, { "math": { "name": "myMathActivity", "math": "((temp - 32) * 5.0) / 9.0", "attribute": "tempC", "next": "myDatastoreActivity" } } ], "tags": [ { "key": "Environment", "value": "Beta" } ] }
输出:
{ "pipelineArn": "arn:aws:iotanalytics:us-west-2:123456789012:pipeline/mypipeline", "pipelineName": "mypipeline" }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》CreatePipeline中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考CreatePipeline
中的。
-
以下代码示例演示如何使用 delete-channel
。
- Amazon CLI
-
删除 IoT Analytics 频道
以下
delete-channel
示例删除了指定的频道。aws iotanalytics delete-channel \ --channel-name mychannel
此命令不生成任何输出。
有关更多信息,请参阅《Amazon IoT Analytics API 参考》DeleteChannel中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考DeleteChannel
中的。
-
以下代码示例演示如何使用 delete-dataset-content
。
- Amazon CLI
-
删除数据集内容
以下
delete-dataset-content
示例删除了指定数据集的内容。aws iotanalytics delete-dataset-content \ --dataset-name mydataset
此命令不生成任何输出。
有关更多信息,请参阅《Amazon IoT Analytics API 参考》DeleteDatasetContent中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考DeleteDatasetContent
中的。
-
以下代码示例演示如何使用 delete-dataset
。
- Amazon CLI
-
删除数据集
以下
delete-dataset
示例删除了指定的数据集。在执行此操作之前,您不必删除数据集的内容。aws iotanalytics delete-dataset \ --dataset-name mydataset
此命令不生成任何输出。
有关更多信息,请参阅《Amazon IoT Analytics API 参考》DeleteDataset中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考DeleteDataset
中的。
-
以下代码示例演示如何使用 delete-datastore
。
- Amazon CLI
-
删除数据存储
以下
delete-datastore
示例删除了指定的数据存储。aws iotanalytics delete-datastore \ --datastore-name mydatastore
此命令不生成任何输出。
有关更多信息,请参阅《Amazon IoT Analytics API 参考》DeleteDatastore中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考DeleteDatastore
中的。
-
以下代码示例演示如何使用 delete-pipeline
。
- Amazon CLI
-
删除管道
以下
delete-pipeline
示例删除了指定的管道。aws iotanalytics delete-pipeline \ --pipeline-name mypipeline
此命令不生成任何输出。
有关更多信息,请参阅《Amazon IoT Analytics API 参考》DeletePipeline中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考DeletePipeline
中的。
-
以下代码示例演示如何使用 describe-channel
。
- Amazon CLI
-
检索有关频道的信息
以下
describe-channel
示例显示了指定频道的详细信息,包括统计信息。aws iotanalytics describe-channel \ --channel-name mychannel \ --include-statistics
输出:
{ "statistics": { "size": { "estimatedSizeInBytes": 402.0, "estimatedOn": 1561504380.0 } }, "channel": { "status": "ACTIVE", "name": "mychannel", "lastUpdateTime": 1557860351.001, "creationTime": 1557860351.001, "retentionPeriod": { "unlimited": true }, "arn": "arn:aws:iotanalytics:us-west-2:123456789012:channel/mychannel" } }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》DescribeChannel中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考DescribeChannel
中的。
-
以下代码示例演示如何使用 describe-dataset
。
- Amazon CLI
-
检索有关数据集的信息
以下
describe-dataset
示例显示了指定数据集的详细信息。aws iotanalytics describe-dataset \ --dataset-name mydataset
输出:
{ "dataset": { "status": "ACTIVE", "contentDeliveryRules": [], "name": "mydataset", "lastUpdateTime": 1557859240.658, "triggers": [], "creationTime": 1557859240.658, "actions": [ { "actionName": "query_32", "queryAction": { "sqlQuery": "SELECT * FROM mydatastore", "filters": [] } } ], "retentionPeriod": { "numberOfDays": 90, "unlimited": false }, "arn": "arn:aws:iotanalytics:us-west-2:123456789012:dataset/mydataset" } }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》DescribeDataset中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考DescribeDataset
中的。
-
以下代码示例演示如何使用 describe-datastore
。
- Amazon CLI
-
检索有关数据存储的信息
以下
describe-datastore
示例显示了指定数据存储的详细信息,包括统计信息。aws iotanalytics describe-datastore \ --datastore-name mydatastore \ --include-statistics
输出:
{ "datastore": { "status": "ACTIVE", "name": "mydatastore", "lastUpdateTime": 1557858971.02, "creationTime": 1557858971.02, "retentionPeriod": { "unlimited": true }, "arn": "arn:aws:iotanalytics:us-west-2:123456789012:datastore/mydatastore" }, "statistics": { "size": { "estimatedSizeInBytes": 397.0, "estimatedOn": 1561592040.0 } } }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》DescribeDatastore中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考DescribeDatastore
中的。
-
以下代码示例演示如何使用 describe-logging-options
。
- Amazon CLI
-
检索当前的日志记录选项
以下
describe-logging-options
示例显示了当前的 Amazon IoT Analytics 日志选项。aws iotanalytics describe-logging-options
此命令不生成任何输出。输出:
{ "loggingOptions": { "roleArn": "arn:aws:iam::123456789012:role/service-role/myIoTAnalyticsRole", "enabled": true, "level": "ERROR" } }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》DescribeLoggingOptions中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考DescribeLoggingOptions
中的。
-
以下代码示例演示如何使用 describe-pipeline
。
- Amazon CLI
-
检索有关管道的信息
以下
describe-pipeline
示例显示了指定管道的详细信息。aws iotanalytics describe-pipeline \ --pipeline-name mypipeline
输出:
{ "pipeline": { "activities": [ { "channel": { "channelName": "mychannel", "name": "mychannel_28", "next": "mydatastore_29" } }, { "datastore": { "datastoreName": "mydatastore", "name": "mydatastore_29" } } ], "name": "mypipeline", "lastUpdateTime": 1561676362.515, "creationTime": 1557859124.432, "reprocessingSummaries": [ { "status": "SUCCEEDED", "creationTime": 1561676362.189, "id": "6ad2764f-fb13-4de3-b101-4e74af03b043" } ], "arn": "arn:aws:iotanalytics:us-west-2:123456789012:pipeline/mypipeline" } }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》DescribePipeline中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考DescribePipeline
中的。
-
以下代码示例演示如何使用 get-dataset-content
。
- Amazon CLI
-
检索数据集的内容
以下
get-dataset-content
示例以预签名 URI 的形式检索数据集的内容。aws iotanalytics get-dataset-content --dataset-name mydataset
输出:
{ "status": { "state": "SUCCEEDED" }, "timestamp": 1557863215.995, "entries": [ { "dataURI": "https://aws-radiant-dataset-12345678-1234-1234-1234-123456789012.s3.us-west-2.amazonaws.com/results/12345678-e8b3-46ba-b2dd-efe8d86cf385.csv?X-Amz-Security-Token=...-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20190628T173437Z&X-Amz-SignedHeaders=host&X-Amz-Expires=7200&X-Amz-Credential=...F20190628%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Signature=..." } ] }
有关更多信息,请参阅指南GetDatasetContent中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考GetDatasetContent
中的。
-
以下代码示例演示如何使用 list-channels
。
- Amazon CLI
-
检索频道列表
以下
list-channels
示例显示可用频道的摘要信息。aws iotanalytics list-channels
输出:
{ "channelSummaries": [ { "status": "ACTIVE", "channelName": "mychannel", "creationTime": 1557860351.001, "lastUpdateTime": 1557860351.001 } ] }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》ListChannels中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考ListChannels
中的。
-
以下代码示例演示如何使用 list-dataset-contents
。
- Amazon CLI
-
列出有关数据集内容的信息
以下
list-dataset-contents
示例列出了有关已创建的数据集内容的信息。aws iotanalytics list-dataset-contents \ --dataset-name mydataset
输出:
{ "datasetContentSummaries": [ { "status": { "state": "SUCCEEDED" }, "scheduleTime": 1557863215.995, "version": "b10ea2a9-66c1-4d99-8d1f-518113b738d0", "creationTime": 1557863215.995 } ] }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》ListDatasetContents中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考ListDatasetContents
中的。
-
以下代码示例演示如何使用 list-datasets
。
- Amazon CLI
-
检索有关数据集的信息
以下
list-datasets
示例列出了有关可用数据集的摘要信息。aws iotanalytics list-datasets
输出:
{ "datasetSummaries": [ { "status": "ACTIVE", "datasetName": "mydataset", "lastUpdateTime": 1557859240.658, "triggers": [], "creationTime": 1557859240.658, "actions": [ { "actionName": "query_32", "actionType": "QUERY" } ] } ] }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》ListDatasets中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考ListDatasets
中的。
-
以下代码示例演示如何使用 list-datastores
。
- Amazon CLI
-
检索数据存储列表
以下
list-datastores
示例显示有关可用数据存储的摘要信息。aws iotanalytics list-datastores
输出:
{ "datastoreSummaries": [ { "status": "ACTIVE", "datastoreName": "mydatastore", "creationTime": 1557858971.02, "lastUpdateTime": 1557858971.02 } ] }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》ListDatastores中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考ListDatastores
中的。
-
以下代码示例演示如何使用 list-pipelines
。
- Amazon CLI
-
检索管道列表
以下
list-pipelines
示例显示了可用管道的列表。aws iotanalytics list-pipelines
输出:
{ "pipelineSummaries": [ { "pipelineName": "mypipeline", "creationTime": 1557859124.432, "lastUpdateTime": 1557859124.432, "reprocessingSummaries": [] } ] }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》ListPipelines中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考ListPipelines
中的。
-
以下代码示例演示如何使用 list-tags-for-resource
。
- Amazon CLI
-
列出资源的标签
以下
list-tags-for-resource
示例列出了您已附加到指定资源的标签。aws iotanalytics list-tags-for-resource \ --resource-arn "arn:aws:iotanalytics:us-west-2:123456789012:channel/mychannel"
输出:
{ "tags": [ { "value": "bar", "key": "foo" } ] }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》ListTagsForResource中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考ListTagsForResource
中的。
-
以下代码示例演示如何使用 put-logging-options
。
- Amazon CLI
-
设置或更新日志记录选项
以下
put-logging-options
示例设置或更新 Amazon IoT Analytics 日志选项。如果您更新任何loggingOptions
字段的值,则更改最多可能需要一分钟才能生效。此外,如果您更改附加到您在 “roLearn” 字段中指定的角色的策略(例如,更正无效的策略),则该更改最多可能需要五分钟才能生效。aws iotanalytics put-logging-options \ --cli-input-json file://put-logging-options.json
put-logging-options.json
的内容:{ "loggingOptions": { "roleArn": "arn:aws:iam::123456789012:role/service-role/myIoTAnalyticsRole", "level": "ERROR", "enabled": true } }
此命令不生成任何输出。
有关更多信息,请参阅《Amazon IoT Analytics API 参考》PutLoggingOptions中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考PutLoggingOptions
中的。
-
以下代码示例演示如何使用 run-pipeline-activity
。
- Amazon CLI
-
模拟管道活动
以下
run-pipeline-activity
示例模拟了在消息负载上运行管道活动的结果。aws iotanalytics run-pipeline-activity \ --pipeline-activity file://maths.json \ --payloads file://payloads.json
maths.json
的内容:{ "math": { "name": "MyMathActivity", "math": "((temp - 32) * 5.0) / 9.0", "attribute": "tempC" } }
payloads.json
的内容:[ "{\"humidity\": 52, \"temp\": 68 }", "{\"humidity\": 52, \"temp\": 32 }" ]
输出:
{ "logResult": "", "payloads": [ "eyJodW1pZGl0eSI6NTIsInRlbXAiOjY4LCJ0ZW1wQyI6MjB9", "eyJodW1pZGl0eSI6NTIsInRlbXAiOjMyLCJ0ZW1wQyI6MH0=" ] }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》RunPipelineActivity中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考RunPipelineActivity
中的。
-
以下代码示例演示如何使用 sample-channel-data
。
- Amazon CLI
-
从频道检索示例消息
以下
sample-channel-data
示例检索在指定时间段内从指定频道收录的消息示例。您最多可以检索 10 条消息。aws iotanalytics sample-channel-data \ --channel-name mychannel
输出:
{ "payloads": [ "eyAidGVtcGVyYXR1cmUiOiAyMCB9", "eyAiZm9vIjogImJhciIgfQ==" ] }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》SampleChannelData中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考SampleChannelData
中的。
-
以下代码示例演示如何使用 start-pipeline-reprocessing
。
- Amazon CLI
-
开始管道再处理
以下
start-pipeline-reprocessing
示例通过指定的管道开始重新处理原始消息数据。aws iotanalytics start-pipeline-reprocessing \ --pipeline-name mypipeline
输出:
{ "reprocessingId": "6ad2764f-fb13-4de3-b101-4e74af03b043" }
有关更多信息,请参阅《Amazon IoT Analytics API 参考》StartPipelineReprocessing中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考StartPipelineReprocessing
中的。
-
以下代码示例演示如何使用 tag-resource
。
- Amazon CLI
-
为资源添加或修改标签
以下
tag-resource
示例添加或修改了附加到指定资源的标签。aws iotanalytics tag-resource \ --resource-arn "arn:aws:iotanalytics:us-west-2:123456789012:channel/mychannel" \ --tags "[{\"key\": \"Environment\", \"value\": \"Production\"}]"
此命令不生成任何输出。
有关更多信息,请参阅《Amazon IoT Analytics API 参考》TagResource中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考TagResource
中的。
-
以下代码示例演示如何使用 untag-resource
。
- Amazon CLI
-
要从资源中删除标签
以下
untag-resource
示例从指定资源中删除具有指定密钥名称的标签。aws iotanalytics untag-resource \ --resource-arn "arn:aws:iotanalytics:us-west-2:123456789012:channel/mychannel" \ --tag-keys "[\"Environment\"]"
此命令不生成任何输出。
有关更多信息,请参阅《Amazon 物联网分析 API 参考》中的 UntagResource < https://docs.aws.amazon.com/iotanalytics/latest/APIReference/API_ UntagResource .html >。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考UntagResource
中的。
-
以下代码示例演示如何使用 update-channel
。
- Amazon CLI
-
修改频道
以下
update-channel
示例修改了指定频道的设置。aws iotanalytics update-channel \ --cli-input-json file://update-channel.json
update-channel.json
的内容:{ "channelName": "mychannel", "retentionPeriod": { "numberOfDays": 92 } }
此命令不生成任何输出。
有关更多信息,请参阅《Amazon IoT Analytics API 参考》UpdateChannel中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考UpdateChannel
中的。
-
以下代码示例演示如何使用 update-dataset
。
- Amazon CLI
-
更新数据集
以下
update-dataset
示例修改了指定数据集的设置。aws iotanalytics update-dataset \ --cli-input-json file://update-dataset.json
update-dataset.json
的内容:{ "datasetName": "mydataset", "actions": [ { "actionName": "myDatasetUpdateAction", "queryAction": { "sqlQuery": "SELECT * FROM mydatastore" } } ], "retentionPeriod": { "numberOfDays": 92 } }
此命令不生成任何输出。
有关更多信息,请参阅《Amazon 物联网分析 API 参考》中的 UpdateDataset < https://docs.aws.amazon.com/iotanalytics/latest/APIReference/API_ UpdateDataset .html >。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考UpdateDataset
中的。
-
以下代码示例演示如何使用 update-datastore
。
- Amazon CLI
-
更新数据存储
以下
update-datastore
示例修改了指定数据存储的设置。aws iotanalytics update-datastore \ --cli-input-json file://update-datastore.json
update-datastore.json 的内容:
{ "datastoreName": "mydatastore", "retentionPeriod": { "numberOfDays": 93 } }
此命令不生成任何输出。
有关更多信息,请参阅《Amazon IoT Analytics API 参考》UpdateDatastore中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考UpdateDatastore
中的。
-
以下代码示例演示如何使用 update-pipeline
。
- Amazon CLI
-
更新管道
以下
update-pipeline
示例修改了指定管道的设置。您必须在pipelineActivities
数组中同时指定通道和数据存储活动,还可以指定多达 23 个其他活动。aws iotanalytics update-pipeline \ --cli-input-json file://update-pipeline.json
update-pipeline.json 的内容:
{ "pipelineName": "mypipeline", "pipelineActivities": [ { "channel": { "name": "myChannelActivity", "channelName": "mychannel", "next": "myMathActivity" } }, { "datastore": { "name": "myDatastoreActivity", "datastoreName": "mydatastore" } }, { "math": { "name": "myMathActivity", "math": "(((temp - 32) * 5.0) / 9.0) + 273.15", "attribute": "tempK", "next": "myDatastoreActivity" } } ] }
此命令不生成任何输出。
有关更多信息,请参阅《Amazon IoT Analytics API 参考》UpdatePipeline中的。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考UpdatePipeline
中的。
-