本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
设备可以在端口 443 上使用HTTP签名版本 4 与 AWS IoT Job 通信。这是 AWS SDKs和使用的方法CLI。有关这些工具的更多信息,请参阅AWS CLI 命令参考:iot-jobs-data或AWS
SDKs和工具
以下命令可用于执行任务的设备。有关使用MQTT协议API操作的信息,请参见作业设备MQTTAPI操作。
针对指定的事物,获取未处于最终状态的所有任务的列表。
- HTTPS request
GET /things/
thingName
/jobs响应:
{ "inProgressJobs" : [ JobExecutionSummary ... ], "queuedJobs" : [ JobExecutionSummary ... ] }
有关更多信息,请参阅
GetPendingJobExecutions
。- CLI syntax
aws iot-jobs-data get-pending-job-executions \ --thing-name <value> \ [--cli-input-json <value>] \ [--generate-cli-skeleton]
cli-input-json
格式:{ "thingName": "string" }
有关更多信息,请参阅
get-pending-job-executions
。
GetPendingJobExecutions
针对指定的事物,获取未处于最终状态的所有任务的列表。
- HTTPS request
GET /things/
thingName
/jobs响应:
{ "inProgressJobs" : [ JobExecutionSummary ... ], "queuedJobs" : [ JobExecutionSummary ... ] }
有关更多信息,请参阅
GetPendingJobExecutions
。- CLI syntax
aws iot-jobs-data get-pending-job-executions \ --thing-name <value> \ [--cli-input-json <value>] \ [--generate-cli-skeleton]
cli-input-json
格式:{ "thingName": "string" }
有关更多信息,请参阅
get-pending-job-executions
。
GET /things/
thingName
/jobs
响应:
{
"inProgressJobs" : [ JobExecutionSummary ... ],
"queuedJobs" : [ JobExecutionSummary ... ]
}
有关更多信息,请参阅 GetPendingJobExecutions
。
获取并启动事物的下一个待处理任务执行(状态为 IN_PROGRESS
或 QUEUED
)。
-
首先返回状态为
IN_PROGRESS
的所有任务执行。 -
按任务执行的创建顺序返回这些执行。
-
如果下一个待处理任务执行的状态为
QUEUED
,则其状态将更改为IN_PROGRESS
,并且任务执行的状态详细信息将设定为指定内容。 -
如果下一个待处理任务执行已处于
IN_PROGRESS
状态,其状态详细信息不会发生变化。 -
如果没有待处理的任务执行,则响应不包括
execution
字段。 -
(可选)您可以通过为
stepTimeoutInMinutes
属性设置值来创建步骤计时器。如果您没有通过运行UpdateJobExecution
更新此属性的值,任务执行将在步骤计时器到期时超时。
- HTTPS request
以下示例显示请求语法:
PUT /things/
thingName
/jobs/$next { "statusDetails": { "string": "string" ... }, "stepTimeoutInMinutes": long }有关更多信息,请参阅
StartNextPendingJobExecution
。- CLI syntax
摘要:
aws iot-jobs-data start-next-pending-job-execution \ --thing-name <value> \ {--step-timeout-in-minutes <value>] \ [--status-details <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]
cli-input-json
格式:{ "thingName": "string", "statusDetails": { "string": "string" }, "stepTimeoutInMinutes": long }
有关更多信息,请参阅
start-next-pending-job-execution
。
StartNextPendingJobExecution
获取并启动事物的下一个待处理任务执行(状态为 IN_PROGRESS
或 QUEUED
)。
-
首先返回状态为
IN_PROGRESS
的所有任务执行。 -
按任务执行的创建顺序返回这些执行。
-
如果下一个待处理任务执行的状态为
QUEUED
,则其状态将更改为IN_PROGRESS
,并且任务执行的状态详细信息将设定为指定内容。 -
如果下一个待处理任务执行已处于
IN_PROGRESS
状态,其状态详细信息不会发生变化。 -
如果没有待处理的任务执行,则响应不包括
execution
字段。 -
(可选)您可以通过为
stepTimeoutInMinutes
属性设置值来创建步骤计时器。如果您没有通过运行UpdateJobExecution
更新此属性的值,任务执行将在步骤计时器到期时超时。
- HTTPS request
以下示例显示请求语法:
PUT /things/
thingName
/jobs/$next { "statusDetails": { "string": "string" ... }, "stepTimeoutInMinutes": long }有关更多信息,请参阅
StartNextPendingJobExecution
。- CLI syntax
摘要:
aws iot-jobs-data start-next-pending-job-execution \ --thing-name <value> \ {--step-timeout-in-minutes <value>] \ [--status-details <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]
cli-input-json
格式:{ "thingName": "string", "statusDetails": { "string": "string" }, "stepTimeoutInMinutes": long }
有关更多信息,请参阅
start-next-pending-job-execution
。
以下示例显示请求语法:
PUT /things/
thingName
/jobs/$next { "statusDetails": { "string": "string" ... }, "stepTimeoutInMinutes": long }
有关更多信息,请参阅 StartNextPendingJobExecution
。
获取有关任务执行的详细信息。
您可以将 jobId
设置为 $next
以返回事物的下一个待处理任务执行。任务的执行状态必须为 QUEUED
或 IN_PROGRESS
。
- HTTPS request
请求:
GET /things/
thingName
/jobs/jobId
?executionNumber=executionNumber
&includeJobDocument=includeJobDocument
响应:
{ "execution" : JobExecution, }
有关更多信息,请参阅
DescribeJobExecution
。- CLI syntax
摘要:
aws iot-jobs-data describe-job-execution \ --job-id <value> \ --thing-name <value> \ [--include-job-document | --no-include-job-document] \ [--execution-number <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]
cli-input-json
格式:{ "jobId": "string", "thingName": "string", "includeJobDocument": boolean, "executionNumber": long }
有关更多信息,请参阅
describe-job-execution
。
DescribeJobExecution
获取有关任务执行的详细信息。
您可以将 jobId
设置为 $next
以返回事物的下一个待处理任务执行。任务的执行状态必须为 QUEUED
或 IN_PROGRESS
。
- HTTPS request
请求:
GET /things/
thingName
/jobs/jobId
?executionNumber=executionNumber
&includeJobDocument=includeJobDocument
响应:
{ "execution" : JobExecution, }
有关更多信息,请参阅
DescribeJobExecution
。- CLI syntax
摘要:
aws iot-jobs-data describe-job-execution \ --job-id <value> \ --thing-name <value> \ [--include-job-document | --no-include-job-document] \ [--execution-number <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]
cli-input-json
格式:{ "jobId": "string", "thingName": "string", "includeJobDocument": boolean, "executionNumber": long }
有关更多信息,请参阅
describe-job-execution
。
请求:
GET /things/
thingName
/jobs/jobId
?executionNumber=executionNumber
&includeJobDocument=includeJobDocument
响应:
{
"execution" : JobExecution,
}
有关更多信息,请参阅 DescribeJobExecution
。
更新任务执行的状态。(可选)您可以通过为 stepTimeoutInMinutes
属性设置值来创建步骤计时器。如果您没有通过再次运行 UpdateJobExecution
更新此属性的值,任务执行将在步骤计时器到期时超时。
- HTTPS request
请求:
POST /things/
thingName
/jobs/jobId
{ "status": "job-execution-state
", "statusDetails": { "string": "string" ... }, "expectedVersion": "number", "includeJobExecutionState": boolean, "includeJobDocument": boolean, "stepTimeoutInMinutes": long, "executionNumber": long }有关更多信息,请参阅
UpdateJobExecution
。- CLI syntax
-
摘要:
aws iot-jobs-data update-job-execution \ --job-id <value> \ --thing-name <value> \ --status <value> \ [--status-details <value>] \ [--expected-version <value>] \ [--include-job-execution-state | --no-include-job-execution-state] \ [--include-job-document | --no-include-job-document] \ [--execution-number <value>] \ [--cli-input-json <value>] \ [--step-timeout-in-minutes <value>] \ [--generate-cli-skeleton]
cli-input-json
格式:{ "jobId": "string", "thingName": "string", "status": "string", "statusDetails": { "string": "string" }, "stepTimeoutInMinutes": number, "expectedVersion": long, "includeJobExecutionState": boolean, "includeJobDocument": boolean, "executionNumber": long }
有关更多信息,请参阅
update-job-execution
。
UpdateJobExecution
更新任务执行的状态。(可选)您可以通过为 stepTimeoutInMinutes
属性设置值来创建步骤计时器。如果您没有通过再次运行 UpdateJobExecution
更新此属性的值,任务执行将在步骤计时器到期时超时。
- HTTPS request
请求:
POST /things/
thingName
/jobs/jobId
{ "status": "job-execution-state
", "statusDetails": { "string": "string" ... }, "expectedVersion": "number", "includeJobExecutionState": boolean, "includeJobDocument": boolean, "stepTimeoutInMinutes": long, "executionNumber": long }有关更多信息,请参阅
UpdateJobExecution
。- CLI syntax
-
摘要:
aws iot-jobs-data update-job-execution \ --job-id <value> \ --thing-name <value> \ --status <value> \ [--status-details <value>] \ [--expected-version <value>] \ [--include-job-execution-state | --no-include-job-execution-state] \ [--include-job-document | --no-include-job-document] \ [--execution-number <value>] \ [--cli-input-json <value>] \ [--step-timeout-in-minutes <value>] \ [--generate-cli-skeleton]
cli-input-json
格式:{ "jobId": "string", "thingName": "string", "status": "string", "statusDetails": { "string": "string" }, "stepTimeoutInMinutes": number, "expectedVersion": long, "includeJobExecutionState": boolean, "includeJobDocument": boolean, "executionNumber": long }
有关更多信息,请参阅
update-job-execution
。
请求:
POST /things/
thingName
/jobs/jobId
{ "status": "job-execution-state
", "statusDetails": { "string": "string" ... }, "expectedVersion": "number", "includeJobExecutionState": boolean, "includeJobDocument": boolean, "stepTimeoutInMinutes": long, "executionNumber": long }
有关更多信息,请参阅 UpdateJobExecution
。