Menu
AWS Greengrass
API Reference

/greengrass/definition/resources

GET

GET /greengrass/definition/resources

Operation ID: ListResourceDefinitions

Retrieves a list of resource definitions.

Produces: application/json

Query Parameters

MaxResults

The maximum number of results to be returned per request.

where used: query; required: false

type: integer

NextToken

The token for the next set of results, or null if there are no additional results.

where used: query; required: false

type: string

CLI

Copy
aws greengrass list-resource-definitions \ [--max-results <value>] \ [--next-token <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

Copy
{ "MaxResults": "integer", "NextToken": "string" }

Responses

200 (ListResourceDefinitionsResponse)

The IDs of all the Greengrass resource definitions in this account.

ListDefinitionsResponse

Copy
{ "Definitions": [ { "Name": "string", "Id": "string", "Arn": "string", "LastUpdatedTimestamp": "string", "CreationTimestamp": "string", "LatestVersion": "string", "LatestVersionArn": "string" } ], "NextToken": "string" }
ListDefinitionsResponse

A list of definitions.

type: object

Definitions

Information about a definition.

type: array

items: DefinitionInformation

DefinitionInformation

Information about a definition.

type: object

Name

The name of the definition.

type: string

Id

The ID of the definition.

type: string

Arn

The ARN of the definition.

type: string

LastUpdatedTimestamp

The time, in milliseconds since the epoch, when the definition was last updated.

type: string

CreationTimestamp

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

type: string

LatestVersion

The latest version of the definition.

type: string

LatestVersionArn

The ARN of the latest version of the definition.

type: string

NextToken

The token for the next set of results, or null if there are no additional results.

type: string

POST

POST /greengrass/definition/resources

Operation ID: CreateResourceDefinition

Creates a resource definition which contains a list of resources to be used in a group. You can create an initial version of the definition by providing a list of resources now, or use CreateResourceDefinitionVersion later.

Produces: application/json

Body Parameters

CreateResourceDefinitionRequestBody

where used: body; required: true

Copy
{ "Name": "string", "InitialVersion": { "Resources": [ { "Id": "string", "Name": "string", "ResourceDataContainer": { "*-- NOTE:": "choose one of the following --*", "LocalDeviceResourceData": { "SourcePath": "string", "GroupOwnerSetting": { "AutoAddGroupOwner": true, "GroupOwner": "string" } }, "LocalVolumeResourceData": { "SourcePath": "string", "DestinationPath": "string", "GroupOwnerSetting": { "AutoAddGroupOwner": true, "GroupOwner": "string" } }, "SageMakerMachineLearningModelResourceData": { "SageMakerJobArn": "string", "DestinationPath": "string" }, "S3MachineLearningModelResourceData": { "S3Uri": "string", "DestinationPath": "string" } } } ] } }
Name

The name of the resource definition.

type: string

InitialVersion

Information about a resource definition version.

type: object

Resources

A list of resources.

type: array

items: Resource

Resource

Information about a resource.

type: object

required: ["Id", "ResourceDataContainer"]

Id

The resource ID, used to refer to a resource in the Lambda function configuration. Max length is 128 characters with pattern [a‑zA‑Z0‑9:_‑]+.

type: string

Name

A descriptive resource name which will be displayed on the AWS Greengrass console. Max length 128 characters with pattern [a‑zA‑Z0‑9:_‑]+.

type: string

ResourceDataContainer

Should contain one of LocalDeviceResourceData, LocalVolumeResourceData, SageMakerMachineLearningModelResourceData or S3MachineLearningModelResourceData.

type: object

NOTE: oneOf

LocalDeviceResourceData

Attributes that define a local device resource.

type: object

SourcePath

The local source path of the resource.

type: string

GroupOwnerSetting

Group owner related settings for local resources.

type: object

AutoAddGroupOwner

If true, AWS Greengrass automatically adds the specified Linux OS group owner of the resource to the Lambda process privileges. Thus the Lambda process will have the file access permissions of the added Linux group.

type: boolean

GroupOwner

Specifies the name of the Linux OS group whose privileges will be 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 /proc or /sys</code.

type: string

DestinationPath

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

type: string

GroupOwnerSetting

Group owner related settings for local resources.

type: object

AutoAddGroupOwner

If true, AWS Greengrass automatically adds the specified Linux OS group owner of the resource to the Lambda process privileges. Thus the Lambda process will have the file access permissions of the added Linux group.

type: boolean

GroupOwner

Specifies the name of the Linux OS group whose privileges will be added to the Lambda process. This field is optional.

type: string

SageMakerMachineLearningModelResourceData

Attributes that define the AWS SageMaker Machine Learning Model Resource.

type: object

SageMakerJobArn

The ARN of an AWS SageMaker training job.

type: string

DestinationPath

Local destination path of the AWS SageMaker Machine Learning resource.

type: string

S3MachineLearningModelResourceData

Attributes that define the S3 Machine Learning Model Resource.

type: object

S3Uri

The URI of an S3 object.

type: string

DestinationPath

Local destination path of the S3 Machine Learning resource.

type: string

Header Parameters

X-Amzn-Client-Token

A client token used to correlate requests and responses.

where used: header; required: false

type: string

CLI

Copy
aws greengrass create-resource-definition \ [--name <value>] \ [--initial-version <value>] \ [--amzn-client-token <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

Copy
{ "Name": "string", "InitialVersion": { "Resources": [ { "Id": "string", "Name": "string", "ResourceDataContainer": { "*-- NOTE:": "choose one of the following --*", "LocalDeviceResourceData": { "SourcePath": "string", "GroupOwnerSetting": { "AutoAddGroupOwner": "boolean", "GroupOwner": "string" } }, "LocalVolumeResourceData": { "SourcePath": "string", "DestinationPath": "string", "GroupOwnerSetting": { "AutoAddGroupOwner": "boolean", "GroupOwner": "string" } }, "SageMakerMachineLearningModelResourceData": { "SageMakerJobArn": "string", "DestinationPath": "string" }, "S3MachineLearningModelResourceData": { "S3Uri": "string", "DestinationPath": "string" } } } ] }, "AmznClientToken": "string" }

Responses

200 (CreateResourceDefinitionResponse)

DefinitionInformation

Copy
{ "Name": "string", "Id": "string", "Arn": "string", "LastUpdatedTimestamp": "string", "CreationTimestamp": "string", "LatestVersion": "string", "LatestVersionArn": "string" }
DefinitionInformation

Information about a definition.

type: object

Name

The name of the definition.

type: string

Id

The ID of the definition.

type: string

Arn

The ARN of the definition.

type: string

LastUpdatedTimestamp

The time, in milliseconds since the epoch, when the definition was last updated.

type: string

CreationTimestamp

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

type: string

LatestVersion

The latest version of the definition.

type: string

LatestVersionArn

The ARN of the latest version of the definition.

type: string

400

invalid request

GeneralError

Copy
{ "Message": "string", "ErrorDetails": [ { "DetailedErrorCode": "string", "DetailedErrorMessage": "string" } ] }
GeneralError

General error information.

type: object

required: ["Message"]

Message

A message containing information about the error.

type: string

ErrorDetails

A list of error details.

type: array

items: ErrorDetail

ErrorDetail

Details about the error.

type: object

DetailedErrorCode

A detailed error code.

type: string

DetailedErrorMessage

A detailed error message.

type: string

On this page: