AWS Greengrass

2018/10/31 - AWS Greengrass - 5 new 5 updated api methods

Changes  Greengrass APIs now support bulk deployment operations, and APIs that list definition versions now support pagination.

ListBulkDeployments (new) Link ¶

Returns a list of bulk deployments.

See also: AWS API Documentation

Request Syntax

client.list_bulk_deployments(
    MaxResults='string',
    NextToken='string'
)
type MaxResults

string

param MaxResults

The maximum number of results to be returned per request.

type NextToken

string

param NextToken

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

rtype

dict

returns

Response Syntax

{
    'BulkDeployments': [
        {
            'BulkDeploymentArn': 'string',
            'BulkDeploymentId': 'string',
            'CreatedAt': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) -- Success. The response body contains the list of bulk deployments.

    • BulkDeployments (list) -- A list of bulk deployments.

      • (dict) -- Information about a bulk deployment.

        • BulkDeploymentArn (string) -- The ARN of the bulk deployment.

        • BulkDeploymentId (string) -- The ID of the bulk deployment.

        • CreatedAt (string) -- The time, in ISO format, when the deployment was created.

    • NextToken (string) -- The token for the next set of results, or ''null'' if there are no additional results.

ListBulkDeploymentDetailedReports (new) Link ¶

Gets a paginated list of the deployments that have been started in a bulk deployment operation, and their current deployment status.

See also: AWS API Documentation

Request Syntax

client.list_bulk_deployment_detailed_reports(
    BulkDeploymentId='string',
    MaxResults='string',
    NextToken='string'
)
type BulkDeploymentId

string

param BulkDeploymentId

[REQUIRED] The ID of the bulk deployment.

type MaxResults

string

param MaxResults

The maximum number of results to be returned per request.

type NextToken

string

param NextToken

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

rtype

dict

returns

Response Syntax

{
    'Deployments': [
        {
            'CreatedAt': 'string',
            'DeploymentArn': 'string',
            'DeploymentId': 'string',
            'DeploymentStatus': 'string',
            'DeploymentType': 'NewDeployment'|'Redeployment'|'ResetDeployment'|'ForceResetDeployment',
            'ErrorDetails': [
                {
                    'DetailedErrorCode': 'string',
                    'DetailedErrorMessage': 'string'
                },
            ],
            'ErrorMessage': 'string',
            'GroupArn': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) -- Success. The response body contains the list of deployments for the given group.

    • Deployments (list) -- A list of the individual group deployments in the bulk deployment operation.

      • (dict) -- Information about an individual group deployment in a bulk deployment operation.

        • CreatedAt (string) -- The time, in ISO format, when the deployment was created.

        • DeploymentArn (string) -- The ARN of the group deployment.

        • DeploymentId (string) -- The ID of the group deployment.

        • DeploymentStatus (string) -- The current status of the group deployment: ''Pending'', ''InProgress'', ''Success'', or ''Failure''.

        • DeploymentType (string) -- The type of the deployment.

        • ErrorDetails (list) -- Details about the error.

          • (dict) -- Details about the error.

            • DetailedErrorCode (string) -- A detailed error code.

            • DetailedErrorMessage (string) -- A detailed error message.

        • ErrorMessage (string) -- The error message for a failed deployment

        • GroupArn (string) -- The ARN of the Greengrass group.

    • NextToken (string) -- The token for the next set of results, or ''null'' if there are no additional results.

StopBulkDeployment (new) Link ¶

Stops the execution of a bulk deployment. This action returns a status of ''Stopping'' until the deployment is stopped. You cannot start a new bulk deployment while a previous deployment is in the ''Stopping'' state. This action doesn't rollback completed deployments or cancel pending deployments.

See also: AWS API Documentation

Request Syntax

client.stop_bulk_deployment(
    BulkDeploymentId='string'
)
type BulkDeploymentId

string

param BulkDeploymentId

[REQUIRED] The ID of the bulk deployment.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) -- Success. The bulk deployment is being stopped.

GetBulkDeploymentStatus (new) Link ¶

Returns the status of a bulk deployment.

See also: AWS API Documentation

Request Syntax

client.get_bulk_deployment_status(
    BulkDeploymentId='string'
)
type BulkDeploymentId

string

param BulkDeploymentId

[REQUIRED] The ID of the bulk deployment.

rtype

dict

returns

Response Syntax

{
    'BulkDeploymentMetrics': {
        'InvalidInputRecords': 123,
        'RecordsProcessed': 123,
        'RetryAttempts': 123
    },
    'BulkDeploymentStatus': 'Initializing'|'Running'|'Completed'|'Stopping'|'Stopped'|'Failed',
    'CreatedAt': 'string',
    'ErrorDetails': [
        {
            'DetailedErrorCode': 'string',
            'DetailedErrorMessage': 'string'
        },
    ],
    'ErrorMessage': 'string'
}

Response Structure

  • (dict) -- Success. The response body contains the status of the bulk deployment.

    • BulkDeploymentMetrics (dict) -- Relevant metrics on input records processed during bulk deployment.

      • InvalidInputRecords (integer) -- The total number of records that returned a non-retryable error. For example, this can occur if a group record from the input file uses an invalid format or specifies a nonexistent group version, or if the execution role doesn't grant permission to deploy a group or group version.

      • RecordsProcessed (integer) -- The total number of group records from the input file that have been processed so far, or attempted.

      • RetryAttempts (integer) -- The total number of deployment attempts that returned a retryable error. For example, a retry is triggered if the attempt to deploy a group returns a throttling error. ''StartBulkDeployment'' retries a group deployment up to five times.

    • BulkDeploymentStatus (string) -- The status of the bulk deployment.

    • CreatedAt (string) -- The time, in ISO format, when the deployment was created.

    • ErrorDetails (list) -- Error details

      • (dict) -- Details about the error.

        • DetailedErrorCode (string) -- A detailed error code.

        • DetailedErrorMessage (string) -- A detailed error message.

    • ErrorMessage (string) -- Error message

StartBulkDeployment (new) Link ¶

Deploys multiple groups in one operation. This action starts the bulk deployment of a specified set of group versions. Each group version deployment will be triggered with an adaptive rate that has a fixed upper limit. We recommend that you include an ''X-Amzn-Client-Token'' token in every ''StartBulkDeployment'' request. These requests are idempotent with respect to the token and the request parameters.

See also: AWS API Documentation

Request Syntax

client.start_bulk_deployment(
    AmznClientToken='string',
    ExecutionRoleArn='string',
    InputFileUri='string'
)
type AmznClientToken

string

param AmznClientToken

A client token used to correlate requests and responses.

type ExecutionRoleArn

string

param ExecutionRoleArn

The ARN of the execution role to associate with the bulk deployment operation. This IAM role must allow the ''greengrass:CreateDeployment'' action for all group versions that are listed in the input file. This IAM role must have access to the S3 bucket containing the input file.

type InputFileUri

string

param InputFileUri

The URI of the input file contained in the S3 bucket. The execution role must have ''getObject'' permissions on this bucket to access the input file. The input file is a JSON-serialized, line delimited file with UTF-8 encoding that provides a list of group and version IDs and the deployment type. This file must be less than 100MB. Currently, Greengrass; supports only ''NewDeployment'' deployment types.

rtype

dict

returns

Response Syntax

{
    'BulkDeploymentArn': 'string',
    'BulkDeploymentId': 'string'
}

Response Structure

  • (dict) -- success

    • BulkDeploymentArn (string) -- The ARN of the bulk deployment.

    • BulkDeploymentId (string) -- The ID of the bulk deployment.

GetCoreDefinitionVersion (updated) Link ¶
Changes (response)
{'NextToken': 'string'}

Retrieves information about a core definition version.

See also: AWS API Documentation

Request Syntax

client.get_core_definition_version(
    CoreDefinitionId='string',
    CoreDefinitionVersionId='string'
)
type CoreDefinitionId

string

param CoreDefinitionId

[REQUIRED] The ID of the core definition.

type CoreDefinitionVersionId

string

param CoreDefinitionVersionId

[REQUIRED] The ID of the core definition version.

rtype

dict

returns

Response Syntax

{
    'Arn': 'string',
    'CreationTimestamp': 'string',
    'Definition': {
        'Cores': [
            {
                'CertificateArn': 'string',
                'Id': 'string',
                'SyncShadow': True|False,
                'ThingArn': 'string'
            },
        ]
    },
    'Id': 'string',
    'NextToken': 'string',
    'Version': 'string'
}

Response Structure

  • (dict) -- success

    • Arn (string) -- The ARN of the core definition version.

    • CreationTimestamp (string) -- The time, in milliseconds since the epoch, when the core definition version was created.

    • Definition (dict) -- Information about the core definition version.

      • Cores (list) -- A list of cores in the core definition version.

        • (dict) -- Information about a core.

          • CertificateArn (string) -- The ARN of the certificate associated with the core.

          • Id (string) -- A descriptive or arbitrary ID for the core. This value must be unique within the core definition version. Max length is 128 characters with pattern ''[a‑zA‑Z0‑9:_‑]+''.

          • SyncShadow (boolean) -- If true, the core's local shadow is automatically synced with the cloud.

          • ThingArn (string) -- The ARN of the thing which is the core.

    • Id (string) -- The ID of the core definition version.

    • NextToken (string) -- The token for the next set of results, or ''null'' if there are no additional results.

    • Version (string) -- The version of the core definition version.

GetDeviceDefinitionVersion (updated) Link ¶
Changes (both)
{'NextToken': 'string'}

Retrieves information about a device definition version.

See also: AWS API Documentation

Request Syntax

client.get_device_definition_version(
    DeviceDefinitionId='string',
    DeviceDefinitionVersionId='string',
    NextToken='string'
)
type DeviceDefinitionId

string

param DeviceDefinitionId

[REQUIRED] The ID of the device definition.

type DeviceDefinitionVersionId

string

param DeviceDefinitionVersionId

[REQUIRED] The ID of the device definition version.

type NextToken

string

param NextToken

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

rtype

dict

returns

Response Syntax

{
    'Arn': 'string',
    'CreationTimestamp': 'string',
    'Definition': {
        'Devices': [
            {
                'CertificateArn': 'string',
                'Id': 'string',
                'SyncShadow': True|False,
                'ThingArn': 'string'
            },
        ]
    },
    'Id': 'string',
    'NextToken': 'string',
    'Version': 'string'
}

Response Structure

  • (dict) --

    • Arn (string) -- The ARN of the device definition version.

    • CreationTimestamp (string) -- The time, in milliseconds since the epoch, when the device definition version was created.

    • Definition (dict) -- Information about the device definition version.

      • Devices (list) -- A list of devices in the definition version.

        • (dict) -- Information about a device.

          • CertificateArn (string) -- The ARN of the certificate associated with the device.

          • Id (string) -- A descriptive or arbitrary ID for the device. This value must be unique within the device definition version. Max length is 128 characters with pattern ''[a‑zA‑Z0‑9:_‑]+''.

          • SyncShadow (boolean) -- If true, the device's local shadow will be automatically synced with the cloud.

          • ThingArn (string) -- The thing ARN of the device.

    • Id (string) -- The ID of the device definition version.

    • NextToken (string) -- The token for the next set of results, or ''null'' if there are no additional results.

    • Version (string) -- The version of the device definition version.

GetFunctionDefinitionVersion (updated) Link ¶
Changes (both)
{'NextToken': 'string'}

Retrieves information about a Lambda function definition version, including which Lambda functions are included in the version and their configurations.

See also: AWS API Documentation

Request Syntax

client.get_function_definition_version(
    FunctionDefinitionId='string',
    FunctionDefinitionVersionId='string',
    NextToken='string'
)
type FunctionDefinitionId

string

param FunctionDefinitionId

[REQUIRED] The ID of the Lambda function definition.

type FunctionDefinitionVersionId

string

param FunctionDefinitionVersionId

[REQUIRED] The ID of the function definition version.

type NextToken

string

param NextToken

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

rtype

dict

returns

Response Syntax

{
    'Arn': 'string',
    'CreationTimestamp': 'string',
    'Definition': {
        'Functions': [
            {
                'FunctionArn': 'string',
                'FunctionConfiguration': {
                    'EncodingType': 'binary'|'json',
                    'Environment': {
                        'AccessSysfs': True|False,
                        'ResourceAccessPolicies': [
                            {
                                'Permission': 'ro'|'rw',
                                'ResourceId': 'string'
                            },
                        ],
                        'Variables': {
                            'string': 'string'
                        }
                    },
                    'ExecArgs': 'string',
                    'Executable': 'string',
                    'MemorySize': 123,
                    'Pinned': True|False,
                    'Timeout': 123
                },
                'Id': 'string'
            },
        ]
    },
    'Id': 'string',
    'NextToken': 'string',
    'Version': 'string'
}

Response Structure

  • (dict) -- success

    • Arn (string) -- The ARN of the function definition version.

    • CreationTimestamp (string) -- The time, in milliseconds since the epoch, when the function definition version was created.

    • Definition (dict) -- Information on the definition.

      • Functions (list) -- A list of Lambda functions in this function definition version.

        • (dict) -- Information about a Lambda function.

          • FunctionArn (string) -- The ARN of the Lambda function.

          • FunctionConfiguration (dict) -- The configuration of the Lambda function.

            • EncodingType (string) -- The expected encoding type of the input payload for the function. The default is ''json''.

            • Environment (dict) -- The environment configuration of the function.

              • AccessSysfs (boolean) -- If true, the Lambda function is allowed to access the host's /sys folder. Use this when the Lambda function needs to read device information from /sys.

              • ResourceAccessPolicies (list) -- A list of the resources, with their permissions, to which the Lambda function will be granted access. A Lambda function can have at most 10 resources.

                • (dict) -- A policy used by the function to access a resource.

                  • Permission (string) -- The permissions that the Lambda function has to the resource. Can be one of ''rw'' (read/write) or ''ro'' (read-only).

                  • ResourceId (string) -- The ID of the resource. (This ID is assigned to the resource when you create the resource definiton.)

              • Variables (dict) -- Environment variables for the Lambda function's configuration.

                • (string) --

                  • (string) --

            • ExecArgs (string) -- The execution arguments.

            • Executable (string) -- The name of the function executable.

            • MemorySize (integer) -- The memory size, in KB, which the function requires.

            • Pinned (boolean) -- True if the function is pinned. Pinned means the function is long-lived and starts when the core starts.

            • Timeout (integer) -- The allowed function execution time, after which Lambda should terminate the function. This timeout still applies to pinned lambdas for each request.

          • Id (string) -- A descriptive or arbitrary ID for the function. This value must be unique within the function definition version. Max length is 128 characters with pattern ''[a‑zA‑Z0‑9:_‑]+''.

    • Id (string) -- The ID of the function definition version.

    • NextToken (string) -- The token for the next set of results, or ''null'' if there are no additional results.

    • Version (string) -- The version of the function definition version.

GetLoggerDefinitionVersion (updated) Link ¶
Changes (request)
{'NextToken': 'string'}

Retrieves information about a logger definition version.

See also: AWS API Documentation

Request Syntax

client.get_logger_definition_version(
    LoggerDefinitionId='string',
    LoggerDefinitionVersionId='string',
    NextToken='string'
)
type LoggerDefinitionId

string

param LoggerDefinitionId

[REQUIRED] The ID of the logger definition.

type LoggerDefinitionVersionId

string

param LoggerDefinitionVersionId

[REQUIRED] The ID of the logger definition version.

type NextToken

string

param NextToken

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

rtype

dict

returns

Response Syntax

{
    'Arn': 'string',
    'CreationTimestamp': 'string',
    'Definition': {
        'Loggers': [
            {
                'Component': 'GreengrassSystem'|'Lambda',
                'Id': 'string',
                'Level': 'DEBUG'|'INFO'|'WARN'|'ERROR'|'FATAL',
                'Space': 123,
                'Type': 'FileSystem'|'AWSCloudWatch'
            },
        ]
    },
    'Id': 'string',
    'Version': 'string'
}

Response Structure

  • (dict) -- success

    • Arn (string) -- The ARN of the logger definition version.

    • CreationTimestamp (string) -- The time, in milliseconds since the epoch, when the logger definition version was created.

    • Definition (dict) -- Information about the logger definition version.

      • Loggers (list) -- A list of loggers.

        • (dict) -- Information about a logger

          • Component (string) -- The component that will be subject to logging.

          • Id (string) -- A descriptive or arbitrary ID for the logger. This value must be unique within the logger definition version. Max length is 128 characters with pattern ''[a‑zA‑Z0‑9:_‑]+''.

          • Level (string) -- The level of the logs.

          • Space (integer) -- The amount of file space, in KB, to use if the local file system is used for logging purposes.

          • Type (string) -- The type of log output which will be used.

    • Id (string) -- The ID of the logger definition version.

    • Version (string) -- The version of the logger definition version.

GetSubscriptionDefinitionVersion (updated) Link ¶
Changes (both)
{'NextToken': 'string'}

Retrieves information about a subscription definition version.

See also: AWS API Documentation

Request Syntax

client.get_subscription_definition_version(
    NextToken='string',
    SubscriptionDefinitionId='string',
    SubscriptionDefinitionVersionId='string'
)
type NextToken

string

param NextToken

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

type SubscriptionDefinitionId

string

param SubscriptionDefinitionId

[REQUIRED] The ID of the subscription definition.

type SubscriptionDefinitionVersionId

string

param SubscriptionDefinitionVersionId

[REQUIRED] The ID of the subscription definition version.

rtype

dict

returns

Response Syntax

{
    'Arn': 'string',
    'CreationTimestamp': 'string',
    'Definition': {
        'Subscriptions': [
            {
                'Id': 'string',
                'Source': 'string',
                'Subject': 'string',
                'Target': 'string'
            },
        ]
    },
    'Id': 'string',
    'NextToken': 'string',
    'Version': 'string'
}

Response Structure

  • (dict) --

    • Arn (string) -- The ARN of the subscription definition version.

    • CreationTimestamp (string) -- The time, in milliseconds since the epoch, when the subscription definition version was created.

    • Definition (dict) -- Information about the subscription definition version.

      • Subscriptions (list) -- A list of subscriptions.

        • (dict) -- Information about a subscription.

          • Id (string) -- A descriptive or arbitrary ID for the subscription. This value must be unique within the subscription definition version. Max length is 128 characters with pattern ''[a‑zA‑Z0‑9:_‑]+''.

          • Source (string) -- The source of the subscription. Can be a thing ARN, a Lambda function ARN, 'cloud' (which represents the IoT cloud), or 'GGShadowService'.

          • Subject (string) -- The subject of the message.

          • Target (string) -- Where the message is sent to. Can be a thing ARN, a Lambda function ARN, 'cloud' (which represents the IoT cloud), or 'GGShadowService'.

    • Id (string) -- The ID of the subscription definition version.

    • NextToken (string) -- The token for the next set of results, or ''null'' if there are no additional results.

    • Version (string) -- The version of the subscription definition version.