• 沒有找到結果。

Response Elements

在文檔中 AWS IoT Greengrass (頁 25-75)

If the action is successful, the service sends back an HTTP 201 response.

The following data is returned in JSON format by the service.

arn (p. 15)

The ARN of the component version.

Type: String

Pattern: arn:aws(-cn|-us-gov)?:greengrass:[^:]+:(aws|[0-9]+):components:

[^:]+:versions:[^:]+

componentName (p. 15)

The name of the component.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [a-zA-Z0-9-_.]+

componentVersion (p. 15) The version of the component.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [0-9a-zA-Z-.+]+

creationTimestamp (p. 15)

The time at which the component was created, expressed in ISO 8601 format.

Type: Timestamp status (p. 15)

The status of the component version in AWS IoT Greengrass V2. This status is different from the status of the component on a core device.

Type: CloudComponentStatus (p. 88) object

Errors

For information about the errors that are common to all actions, see Common Errors (p. 135).

AccessDeniedException

You don't have permission to perform the action.

See Also

HTTP Status Code: 403 ConflictException

Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.

HTTP Status Code: 409 InternalServerException

AWS IoT Greengrass can't process your request right now. Try again later.

HTTP Status Code: 500

RequestAlreadyInProgressException

The request is already in progress. This exception occurs when you use a client token for multiple requests while AWS IoT Greengrass is still processing an earlier request that uses the same client token.

HTTP Status Code: 400 ServiceQuotaExceededException

Your request exceeds a service quota. For example, you might have the maximum number of components that you can create.

HTTP Status Code: 402 ThrottlingException

Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.

HTTP Status Code: 429 ValidationException

The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

CreateDeployment

CreateDeployment

Creates a continuous deployment for a target, which is a Greengrass core device or group of core devices.

When you add a new core device to a group of core devices that has a deployment, AWS IoT Greengrass deploys that group's deployment to the new device.

You can define one deployment for each target. When you create a new deployment for a target that has an existing deployment, you replace the previous deployment. AWS IoT Greengrass applies the new deployment to the target devices.

Every deployment has a revision number that indicates how many deployment revisions you define for a target. Use this operation to create a new revision of an existing deployment.

For more information, see the Create deployments in the AWS IoT Greengrass V2 Developer Guide.

Request Syntax

POST /greengrass/v2/deployments HTTP/1.1 Content-type: application/json

{

"clientToken": "string", "components": {

"deploymentName": "string", "deploymentPolicies": { "componentUpdatePolicy": { "action": "string", "timeoutInSeconds": number },

"configurationValidationPolicy": { "timeoutInSeconds": number },

"failureHandlingPolicy": "string"

},

"iotJobConfiguration": { "abortConfig": {

URI Request Parameters

"jobExecutionsRolloutConfig": { "exponentialRate": {

"inProgressTimeoutInMinutes": number }

},

"tags": {

"string" : "string"

},

"targetArn": "string"

}

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

clientToken (p. 18)

A unique, case-sensitive identifier that you can provide to ensure that the request is idempotent.

Idempotency means that the request is successfully processed only once, even if you send the request multiple times. When a request succeeds, and you specify the same client token for subsequent successful requests, the AWS IoT Greengrass V2 service returns the successful response that it caches from the previous request. AWS IoT Greengrass V2 caches successful responses for idempotent requests for up to 8 hours.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: ^[a-zA-Z0-9-]+$

Required: No components (p. 18)

The components to deploy. This is a dictionary, where each key is the name of a component, and each key's value is the version and configuration to deploy for that component.

Type: String to ComponentDeploymentSpecification (p. 93) object map Key Length Constraints: Minimum length of 1.

Required: No

deploymentName (p. 18)

The name of the deployment.

Type: String

Response Syntax

Length Constraints: Minimum length of 1.

Required: No

deploymentPolicies (p. 18)

The deployment policies for the deployment. These policies define how the deployment updates components and handles failure.

Type: DeploymentPolicies (p. 107) object Required: No

iotJobConfiguration (p. 18)

The job configuration for the deployment configuration. The job configuration specifies the rollout, timeout, and stop configurations for the deployment configuration.

Type: DeploymentIoTJobConfiguration (p. 106) object Required: No

tags (p. 18)

A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the AWS IoT Greengrass V2 Developer Guide.

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: ^(?!aws:)[a-zA-Z+-=._:/]+$

Value Length Constraints: Maximum length of 256.

Required: No targetArn (p. 18)

The ARN of the target AWS IoT thing or thing group.

Type: String { "deploymentId": "string", "iotJobArn": "string", "iotJobId": "string"

}

Response Elements

If the action is successful, the service sends back an HTTP 201 response.

Errors

The following data is returned in JSON format by the service.

deploymentId (p. 20)

The ID of the deployment.

Type: String

Length Constraints: Minimum length of 1.

iotJobArn (p. 20)

The ARN of the AWS IoT job that applies the deployment to target devices.

Type: String

Pattern: arn:aws(-cn|-us-gov)?:iot:[^:]+:[0-9]+:job/.+

iotJobId (p. 20)

The ID of the AWS IoT job that applies the deployment to target devices.

Type: String

Length Constraints: Minimum length of 1.

Errors

For information about the errors that are common to all actions, see Common Errors (p. 135).

AccessDeniedException

You don't have permission to perform the action.

HTTP Status Code: 403 InternalServerException

AWS IoT Greengrass can't process your request right now. Try again later.

HTTP Status Code: 500

RequestAlreadyInProgressException

The request is already in progress. This exception occurs when you use a client token for multiple requests while AWS IoT Greengrass is still processing an earlier request that uses the same client token.

HTTP Status Code: 400 ResourceNotFoundException

The requested resource can't be found.

HTTP Status Code: 404 ThrottlingException

Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.

HTTP Status Code: 429

See Also

ValidationException

The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

DeleteComponent

DeleteComponent

Deletes a version of a component from AWS IoT Greengrass.

NoteThis operation deletes the component's recipe and artifacts. As a result, deployments that refer to this component version will fail. If you have deployments that use this component version, you can remove the component from the deployment or update the deployment to use a valid version.

Request Syntax

DELETE /greengrass/v2/components/arn HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

arn (p. 23)

The ARN of the component version.

Pattern: arn:aws(-cn|-us-gov)?:greengrass:[^:]+:(aws|[0-9]+):components:

[^:]+:versions:[^:]+

Required: Yes

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 204

Response Elements

If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body.

Errors

For information about the errors that are common to all actions, see Common Errors (p. 135).

AccessDeniedException

You don't have permission to perform the action.

HTTP Status Code: 403 ConflictException

Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.

See Also

HTTP Status Code: 409 InternalServerException

AWS IoT Greengrass can't process your request right now. Try again later.

HTTP Status Code: 500 ResourceNotFoundException

The requested resource can't be found.

HTTP Status Code: 404 ThrottlingException

Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.

HTTP Status Code: 429 ValidationException

The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

DeleteCoreDevice

DeleteCoreDevice

Deletes a Greengrass core device, which is an AWS IoT thing. This operation removes the core device from the list of core devices. This operation doesn't delete the AWS IoT thing. For more information about how to delete the AWS IoT thing, see DeleteThing in the AWS IoT API Reference.

Request Syntax

DELETE /greengrass/v2/coreDevices/coreDeviceThingName HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

coreDeviceThingName (p. 25)

The name of the core device. This is also the name of the AWS IoT thing.

Length Constraints: Minimum length of 1. Maximum length of 128.

Required: Yes

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 204

Response Elements

If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body.

Errors

For information about the errors that are common to all actions, see Common Errors (p. 135).

AccessDeniedException

You don't have permission to perform the action.

HTTP Status Code: 403 ConflictException

Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.

HTTP Status Code: 409 InternalServerException

AWS IoT Greengrass can't process your request right now. Try again later.

See Also

HTTP Status Code: 500 ResourceNotFoundException

The requested resource can't be found.

HTTP Status Code: 404 ThrottlingException

Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.

HTTP Status Code: 429 ValidationException

The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

DescribeComponent

DescribeComponent

Retrieves metadata for a version of a component.

Request Syntax

GET /greengrass/v2/components/arn/metadata HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

arn (p. 27)

The ARN of the component version.

Pattern: arn:aws(-cn|-us-gov)?:greengrass:[^:]+:(aws|[0-9]+):components:

[^:]+:versions:[^:]+

Required: Yes

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200

Content-type: application/json {

"arn": "string",

"componentName": "string", "componentVersion": "string", "creationTimestamp": number, "description": "string", "platforms": [

"publisher": "string", "status": {

"componentState": "string", "errors": {

Response Elements

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

arn (p. 27)

The ARN of the component version.

Type: String

Pattern: arn:aws(-cn|-us-gov)?:greengrass:[^:]+:(aws|[0-9]+):components:

[^:]+:versions:[^:]+

componentName (p. 27)

The name of the component.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [a-zA-Z0-9-_.]+

componentVersion (p. 27) The version of the component.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [0-9a-zA-Z-.+]+

creationTimestamp (p. 27)

The time at which the component was created, expressed in ISO 8601 format.

Type: Timestamp description (p. 27)

The description of the component version.

Type: String platforms (p. 27)

The platforms that the component version supports.

Type: Array of ComponentPlatform (p. 96) objects publisher (p. 27)

The publisher of the component version.

Type: String status (p. 27)

The status of the component version in AWS IoT Greengrass V2. This status is different from the status of the component on a core device.

Type: CloudComponentStatus (p. 88) object

Errors

tags (p. 27)

A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the AWS IoT Greengrass V2 Developer Guide.

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: ^(?!aws:)[a-zA-Z+-=._:/]+$

Value Length Constraints: Maximum length of 256.

Errors

For information about the errors that are common to all actions, see Common Errors (p. 135).

AccessDeniedException

You don't have permission to perform the action.

HTTP Status Code: 403 InternalServerException

AWS IoT Greengrass can't process your request right now. Try again later.

HTTP Status Code: 500 ResourceNotFoundException

The requested resource can't be found.

HTTP Status Code: 404 ThrottlingException

Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.

HTTP Status Code: 429 ValidationException

The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

See Also

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

DisassociateServiceRoleFromAccount

DisassociateServiceRoleFromAccount

Disassociates the Greengrass service role from AWS IoT Greengrass for your AWS account in this AWS Region. Without a service role, AWS IoT Greengrass can't verify the identity of client devices or manage core device connectivity information. For more information, see Greengrass service role in the AWS IoT Greengrass Version 2 Developer Guide.

Request Syntax

DELETE /greengrass/servicerole HTTP/1.1

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200

Content-type: application/json { "DisassociatedAt": "string"

}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

DisassociatedAt (p. 31)

The time when the service role was disassociated from AWS IoT Greengrass for your AWS account in this AWS Region.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors (p. 135).

InternalServerException

AWS IoT Greengrass can't process your request right now. Try again later.

HTTP Status Code: 500

See Also

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

GetComponent

GetComponent

Gets the recipe for a version of a component. Core devices can call this operation to identify the artifacts and requirements to install a component.

Request Syntax

GET /greengrass/v2/components/arn?recipeOutputFormat=recipeOutputFormat HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

arn (p. 33)

The ARN of the component version.

Pattern: arn:aws(-cn|-us-gov)?:greengrass:[^:]+:(aws|[0-9]+):components:

[^:]+:versions:[^:]+

Required: Yes

recipeOutputFormat (p. 33) The format of the recipe.

Valid Values: JSON | YAML

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200

Content-type: application/json { "recipe": blob,

"recipeOutputFormat": "string", "tags": {

"string" : "string"

}}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

recipe (p. 33)

The recipe of the component version.

Errors

Type: Base64-encoded binary data object recipeOutputFormat (p. 33)

The format of the recipe.

Type: String

Valid Values: JSON | YAML tags (p. 33)

A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the AWS IoT Greengrass V2 Developer Guide.

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: ^(?!aws:)[a-zA-Z+-=._:/]+$

Value Length Constraints: Maximum length of 256.

Errors

For information about the errors that are common to all actions, see Common Errors (p. 135).

AccessDeniedException

You don't have permission to perform the action.

HTTP Status Code: 403 InternalServerException

AWS IoT Greengrass can't process your request right now. Try again later.

HTTP Status Code: 500 ResourceNotFoundException

The requested resource can't be found.

HTTP Status Code: 404 ThrottlingException

Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.

HTTP Status Code: 429 ValidationException

The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

See Also

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

GetComponentVersionArtifact

GetComponentVersionArtifact

Gets the pre-signed URL to download a public component artifact. Core devices call this operation to identify the URL that they can use to download an artifact to install.

Request Syntax

GET /greengrass/v2/components/arn/artifacts/artifactName+ HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

arn (p. 36)

The ARN of the component version. Specify the ARN of a public component version.

Pattern: arn:aws(-cn|-us-gov)?:greengrass:[^:]+:(aws|[0-9]+):components:

[^:]+:versions:[^:]+

Required: Yes artifactName (p. 36)

The name of the artifact.

You can use the GetComponent operation to download the component recipe, which includes the URI of the artifact. The artifact name is the section of the URI after the scheme. For example, in the artifact URI greengrass:SomeArtifact.zip, the artifact name is SomeArtifact.zip.

Length Constraints: Minimum length of 1.

Required: Yes

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200

Content-type: application/json {

"preSignedUrl": "string"

}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Errors

preSignedUrl (p. 36) The URL of the artifact.

Type: String

Length Constraints: Minimum length of 1.

Errors

For information about the errors that are common to all actions, see Common Errors (p. 135).

AccessDeniedException

You don't have permission to perform the action.

HTTP Status Code: 403 InternalServerException

AWS IoT Greengrass can't process your request right now. Try again later.

HTTP Status Code: 500 ResourceNotFoundException

The requested resource can't be found.

HTTP Status Code: 404 ThrottlingException

Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.

HTTP Status Code: 429 ValidationException

The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

See Also

GetConnectivityInfo

GetConnectivityInfo

Retrieves connectivity information for a Greengrass core device.

Connectivity information includes endpoints and ports where client devices can connect to an MQTT

Connectivity information includes endpoints and ports where client devices can connect to an MQTT

在文檔中 AWS IoT Greengrass (頁 25-75)

相關文件