• 沒有找到結果。

CreateResourceDefinitionVersion

在文檔中 AWS IoT Greengrass (頁 83-94)

Creates a version of a resource definition that has already been defined.

URI: POST /greengrass/definition/resources/ResourceDefinitionId/versions Produces: application/json

CLI:

aws greengrass create-resource-definition-version \ --resource-definition-id <value> \

[--resources <value>] \

[--amzn-client-token <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{"ResourceDefinitionId": "string",

"Resources": [ {

"Id": "string", "Name": "string",

"ResourceDataContainer": {

"*-- NOTE:": "choose one of the following --*", "LocalDeviceResourceData": {

"SourcePath": "string",

"LocalVolumeResourceData": { "SourcePath": "string",

"SageMakerMachineLearningModelResourceData": { "SageMakerJobArn": "string",

"S3MachineLearningModelResourceData": { "S3Uri": "string",

"DestinationPath": "string",

"OwnerSetting": {

"GroupOwner": "string", "GroupPermission": "ro|rw"

} },

"SecretsManagerSecretResourceData": { "ARN": "string",

"AdditionalStagingLabelsToDownload": [ "string"

ResourceDefinitionId (p. 590) The ID of the resource definition.

where used: path; required: true type: string

CreateResourceDefinitionVersionRequestBody (p. 579) Information about the resource definition version.

where used: body; required: true

{

"Resources": [ { "Id": "string", "Name": "string",

"ResourceDataContainer": {

"*-- NOTE:": "choose one of the following --*", "LocalDeviceResourceData": {

"SourcePath": "string",

"LocalVolumeResourceData": { "SourcePath": "string",

"SageMakerMachineLearningModelResourceData": { "SageMakerJobArn": "string",

"S3MachineLearningModelResourceData": {

"S3Uri": "string",

"DestinationPath": "string", "OwnerSetting": {

"GroupOwner": "string", "GroupPermission": "ro|rw"

} },

"SecretsManagerSecretResourceData": { "ARN": "string",

"AdditionalStagingLabelsToDownload": [ "string"

] } } }] } schema:

ResourceDefinitionVersion

Information about a resource definition version.

type: object Resources

A list of resources.

type: array

items: Resource (p. 673) Resource

Information about a resource.

type: object

required: ["Id", "Name", "ResourceDataContainer"]

Id

The resource ID, used to refer to a resource in the Lambda function configuration. Maximum length is 128 characters with the pattern [a‑zA‑Z0‑9:_‑]+. This must be unique within a Greengrass group.

type: string Name

The descriptive resource name, which is displayed on the AWS IoT Greengrass console. Maximum length is 128 characters with the pattern [a‑zA‑Z0‑9:_‑]+. This must be unique within a Greengrass group.

type: string ResourceDataContainer

A container for resource data. The container takes only one of the following supported resource data types: LocalDeviceResourceData,

LocalVolumeResourceData, SageMakerMachineLearningModelResourceData, S3MachineLearningModelResourceData, SecretsManagerSecretResourceData.

type: object

NOTE: oneOf LocalDeviceResourceData

Attributes that define a local device resource.

type: object SourcePath

The local absolute path of the device resource. The source path for a device resource can refer only to a character device or block device under /dev.

type: string GroupOwnerSetting

Group owner related settings for local resources.

type: object AutoAddGroupOwner

If true, AWS IoT Greengrass adds the specified Linux OS group owner of the resource to the Lambda process privileges. The Lambda process then has the file access permissions of the added Linux group.

type: boolean GroupOwner

The name of the Linux OS group whose privileges are added to the Lambda process. This field is optional.

type: string

LocalVolumeResourceData

Attributes that define a local volume resource.

type: object SourcePath

The local absolute path of the volume resource on the host. The source path for a volume resource type cannot start with /sys.

type: string DestinationPath

The absolute local path of the resource inside the Lambda environment.

type: string GroupOwnerSetting

Group owner related settings for local resources.

type: object AutoAddGroupOwner

If true, AWS IoT Greengrass adds the specified Linux OS group owner of the resource to the Lambda process privileges. The Lambda process then has the file access permissions of the added Linux group.

type: boolean

GroupOwner

The name of the Linux OS group whose privileges are added to the Lambda process. This field is optional.

type: string

SageMakerMachineLearningModelResourceData

Attributes that define an Amazon SageMaker machine learning resource.

type: object SageMakerJobArn

The ARN of the Amazon SageMaker training job that represents the source model.

type: string DestinationPath

The absolute local path of the resource inside the Lambda environment.

type: string OwnerSetting

The owner setting for the downloaded machine learning resource.

type: object

required: ["GroupOwner", "GroupPermission"]

GroupOwner

The group owner of the resource. This is the group ID (GID) of an existing Linux OS group on the system. The group's permissions are added to the Lambda process.

type: string GroupPermission

The permissions that the group owner has to the resource. Valid values are rw (read-write) or ro (read-only).

type: string enum: ["ro", "rw"]

S3MachineLearningModelResourceData

Attributes that define an Amazon S3 machine learning resource.

type: object S3Uri

The URI of the source model in an S3 bucket. The model package must be in tar.gz or .zip format.

type: string DestinationPath

The absolute local path of the resource inside the Lambda environment.

type: string

OwnerSetting

The owner setting for the downloaded machine learning resource.

type: object

required: ["GroupOwner", "GroupPermission"]

GroupOwner

The group owner of the resource. This is the group ID (GID) of an existing Linux OS group on the system. The group's permissions are added to the Lambda process.

type: string GroupPermission

The permissions that the group owner has to the resource. Valid values are rw (read-write) or ro (read-only).

type: string enum: ["ro", "rw"]

SecretsManagerSecretResourceData

Attributes that define a secret resource, which references a secret from AWS Secrets Manager.

AWS IoT Greengrass stores a local, encrypted copy of the secret on the Greengrass core, where it can be securely accessed by connectors and Lambda functions.

type: object ARN

The ARN of the Secrets Manager secret to make available on the core. The value of the secret's latest version (represented by the AWSCURRENT staging label) is included by default.

type: string

AdditionalStagingLabelsToDownload

Optional. The staging labels in addition to AWSCURRENT whose values you want to make available on the core.

type: array

X-Amzn-Client-Token (p. 596)

A client token used to correlate requests and responses.

where used: header; required: false type: string

Responses:

200 (CreateResourceDefinitionVersionResponse) VersionInformation (p. 696)

{

"Arn": "string",

"Id": "string",

"Version": "string",

"CreationTimestamp": "string"

}

VersionInformation

Information about a version.

type: object Arn

The ARN of the version.

type: string Id

The ID of the parent definition that the version is associated with.

type: string Version

The ID of the version.

type: string CreationTimestamp

The time, in milliseconds since the epoch, when the version was created.

type: string 400

Invalid request.

GeneralError (p. 631) {

"Message": "string",

"ErrorDetails": [

{ "DetailedErrorCode": "string", "DetailedErrorMessage": "string"

}] }

GeneralError

General error information.

type: object

required: ["Message"]

Message

A message that contains information about the error.

type: string

ErrorDetails

A list of error details.

type: array

items: ErrorDetail (p. 616) ErrorDetail

Details about the error.

type: object DetailedErrorCode

A detailed error code.

type: string DetailedErrorMessage

A detailed error message.

type: string

CreateSoftwareUpdateJob

Creates a software update for a core or group of cores (specified as an IoT thing group.) Use this to update the OTA agent and the Greengrass core software. It uses the AWS IoT Jobs feature, which provides more commands for managing a Greengrass Core software update job.

URI: POST /greengrass/updates Produces: application/json

CLI:

aws greengrass create-software-update-job \ [--update-targets-architecture <value>] \ [--update-targets <value>] \

[--software-to-update <value>] \ [--s3-url-signer-role <value>] \ [--update-agent-log-level <value>] \

[--update-targets-operating-system <value>] \ [--amzn-client-token <value>] \

[--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{"UpdateTargetsArchitecture": "armv6l|armv7l|x86_64|aarch64",

"UpdateTargets": [ "string"

],

"SoftwareToUpdate": "core|ota_agent",

"S3UrlSignerRole": "string",

"UpdateAgentLogLevel": "NONE|TRACE|DEBUG|VERBOSE|INFO|WARN|ERROR|FATAL",

"UpdateTargetsOperatingSystem": "ubuntu|raspbian|amazon_linux|openwrt",

"AmznClientToken": "string"

}

Parameters:

CreateSoftwareUpdateJobRequestBody (p. 583)

where used: body; required: true

{

"UpdateTargetsArchitecture": "armv6l|armv7l|x86_64|aarch64",

"UpdateTargets": [ "string"

],"SoftwareToUpdate": "core|ota_agent",

"S3UrlSignerRole": "string",

"UpdateAgentLogLevel": "NONE|TRACE|DEBUG|VERBOSE|INFO|WARN|ERROR|FATAL",

"UpdateTargetsOperatingSystem": "ubuntu|raspbian|amazon_linux|openwrt"

} schema:

CreateSoftwareUpdateJobRequest

Request for the CreateSoftwareUpdateJob API.

type: object

required: ["UpdateTargetsArchitecture", "UpdateTargets", "SoftwareToUpdate",

"S3UrlSignerRole", "UpdateTargetsOperatingSystem"]

UpdateTargetsArchitecture

The architecture of the cores that are the targets of an update.

type: string

enum: ["armv6l", "armv7l", "x86_64", "aarch64"]

UpdateTargets

The ARNs of the targets (IoT things or IoT thing groups) that this update is applied to.

type: array SoftwareToUpdate

The piece of software on the Greengrass core that will be updated.

type: string

enum: ["core", "ota_agent"]

S3UrlSignerRole

The IAM role that Greengrass uses to create presigned URLs that point to the update artifact.

type: string UpdateAgentLogLevel

The minimum level of log statements that should be logged by the OTA agent during an update.

type: string

enum: ["NONE", "TRACE", "DEBUG", "VERBOSE", "INFO", "WARN", "ERROR", "FATAL"]

UpdateTargetsOperatingSystem

The operating system of the cores that are the targets of an update.

type: string

enum: ["ubuntu", "raspbian", "amazon_linux", "openwrt"]

X-Amzn-Client-Token (p. 596)

A client token used to correlate requests and responses.

where used: header; required: false type: string

Responses:

200

Success.

CreateSoftwareUpdateJobResponse (p. 611) {

"IotJobId": "string",

"IotJobArn": "string",

"PlatformSoftwareVersion": "string"

}

CreateSoftwareUpdateJobResponse type: object

IotJobId

The IoT job ID that corresponds to this update.

type: string IotJobArn

The IoT job ARN that corresponds to this update.

type: string

PlatformSoftwareVersion

The software version installed on the device or devices after the update.

type: string 400

Invalid request.

GeneralError (p. 631)

{"Message": "string",

"ErrorDetails": [ {

"DetailedErrorCode": "string", "DetailedErrorMessage": "string"

}] }

GeneralError

General error information.

type: object

required: ["Message"]

Message

A message that contains information about the error.

type: string ErrorDetails

A list of error details.

type: array

items: ErrorDetail (p. 616) ErrorDetail

Details about the error.

type: object DetailedErrorCode

A detailed error code.

type: string DetailedErrorMessage

A detailed error message.

type: string 500

Server error.

GeneralError (p. 631)

{"Message": "string",

"ErrorDetails": [

{ "DetailedErrorCode": "string", "DetailedErrorMessage": "string"

}] }

GeneralError

General error information.

type: object

required: ["Message"]

Message

A message that contains information about the error.

type: string ErrorDetails

A list of error details.

type: array

items: ErrorDetail (p. 616) ErrorDetail

Details about the error.

type: object DetailedErrorCode

A detailed error code.

type: string DetailedErrorMessage

A detailed error message.

type: string

在文檔中 AWS IoT Greengrass (頁 83-94)

相關文件