작업 디바이스 HTTP API - AWS IoT Core

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

작업 디바이스 HTTP API

디바이스가 포트 443에서 HTTP 서명 버전 4를 사용하여 AWS IoT 작업과 통신할 수 있습니다. 이는 AWS SDK와 CLI에 의해 사용되는 방법입니다. 이 도구에 관한 자세한 내용은 AWS CLI 명령 참조: iot-jobs-data 또는 AWS SDK 및 도구를 참조하세요.

다음 명령은 작업을 실행하는 디바이스에 사용할 수 있습니다. MQTT 프로토콜에서 API 작업을 사용하는 방법에 대한 자세한 내용은 작업 디바이스 MQTT API 작업 섹션을 참조하세요.

지정된 사물에 대해 최종 상태가 아닌 모든 작업 목록을 가져옵니다.

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 섹션을 참조하세요.

사물의 다음 번 대기 중 작업 실행을 가져오고 시작합니다(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 섹션을 참조하세요.

작업 실행에 대한 세부 정보를 가져옵니다.

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 섹션을 참조하세요.

작업 실행의 상태를 업데이트합니다. 선택적으로 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 섹션을 참조하세요.