Amazon SageMaker Service

2021/06/10 - Amazon SageMaker Service - 6 updated api methods

Changes  Using SageMaker Edge Manager with AWS IoT Greengrass v2 simplifies accessing, maintaining, and deploying models to your devices. You can now create deployable IoT Greengrass components during edge packaging jobs. You can choose to create a device fleet with or without creating an AWS IoT role alias.

CreateDeviceFleet (updated) Link ¶
Changes (request)
{'EnableIotRoleAlias': 'boolean',
 'OutputConfig': {'PresetDeploymentConfig': 'string',
                  'PresetDeploymentType': 'GreengrassV2Component'}}

Creates a device fleet.

See also: AWS API Documentation

Request Syntax

client.create_device_fleet(
    DeviceFleetName='string',
    RoleArn='string',
    Description='string',
    OutputConfig={
        'S3OutputLocation': 'string',
        'KmsKeyId': 'string',
        'PresetDeploymentType': 'GreengrassV2Component',
        'PresetDeploymentConfig': 'string'
    },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    EnableIotRoleAlias=True|False
)
type DeviceFleetName

string

param DeviceFleetName

[REQUIRED]

The name of the fleet that the device belongs to.

type RoleArn

string

param RoleArn

The Amazon Resource Name (ARN) that has access to AWS Internet of Things (IoT).

type Description

string

param Description

A description of the fleet.

type OutputConfig

dict

param OutputConfig

[REQUIRED]

The output configuration for storing sample data collected by the fleet.

  • S3OutputLocation (string) -- [REQUIRED]

    The Amazon Simple Storage (S3) bucker URI.

  • KmsKeyId (string) --

    The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt data on the storage volume after compilation job. If you don't provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3 for your role's account.

  • PresetDeploymentType (string) --

    The deployment type SageMaker Edge Manager will create. Currently only supports AWS IoT Greengrass Version 2 components.

  • PresetDeploymentConfig (string) --

    The configuration used to create deployment artifacts. Specify configuration options with a JSON string. The available configuration options for each type are:

    • ComponentName (optional) - Name of the GreenGrass V2 component. If not specified, the default name generated consists of "SagemakerEdgeManager" and the name of your SageMaker Edge Manager packaging job.

    • ComponentDescription (optional) - Description of the component.

    • ComponentVersion (optional) - The version of the component.

    Note

    AWS IoT Greengrass uses semantic versions for components. Semantic versions follow a*major.minor.patch* number system. For example, version 1.0.0 represents the first major release for a component. For more information, see the semantic version specification .

    • PlatformOS (optional) - The name of the operating system for the platform. Supported platforms include Windows and Linux.

    • PlatformArchitecture (optional) - The processor architecture for the platform. Supported architectures Windows include: Windows32_x86, Windows64_x64. Supported architectures for Linux include: Linux x86_64, Linux ARMV8.

type Tags

list

param Tags

Creates tags for the specified fleet.

  • (dict) --

    A tag object that consists of a key and an optional value, used to manage metadata for Amazon SageMaker AWS resources.

    You can add tags to notebook instances, training jobs, hyperparameter tuning jobs, batch transform jobs, models, labeling jobs, work teams, endpoint configurations, and endpoints. For more information on adding tags to Amazon SageMaker resources, see AddTags .

    For more information on adding metadata to your AWS resources with tagging, see Tagging AWS resources . For advice on best practices for managing AWS resources with tagging, see Tagging Best Practices: Implement an Effective AWS Resource Tagging Strategy .

    • Key (string) -- [REQUIRED]

      The tag key. Tag keys must be unique per resource.

    • Value (string) -- [REQUIRED]

      The tag value.

type EnableIotRoleAlias

boolean

param EnableIotRoleAlias

Whether to create an AWS IoT Role Alias during device fleet creation. The name of the role alias generated will match this pattern: "SageMakerEdge-{DeviceFleetName}".

For example, if your device fleet is called "demo-fleet", the name of the role alias will be "SageMakerEdge-demo-fleet".

returns

None

CreateEdgePackagingJob (updated) Link ¶
Changes (request)
{'OutputConfig': {'PresetDeploymentConfig': 'string',
                  'PresetDeploymentType': 'GreengrassV2Component'}}

Starts a SageMaker Edge Manager model packaging job. Edge Manager will use the model artifacts from the Amazon Simple Storage Service bucket that you specify. After the model has been packaged, Amazon SageMaker saves the resulting artifacts to an S3 bucket that you specify.

See also: AWS API Documentation

Request Syntax

client.create_edge_packaging_job(
    EdgePackagingJobName='string',
    CompilationJobName='string',
    ModelName='string',
    ModelVersion='string',
    RoleArn='string',
    OutputConfig={
        'S3OutputLocation': 'string',
        'KmsKeyId': 'string',
        'PresetDeploymentType': 'GreengrassV2Component',
        'PresetDeploymentConfig': 'string'
    },
    ResourceKey='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type EdgePackagingJobName

string

param EdgePackagingJobName

[REQUIRED]

The name of the edge packaging job.

type CompilationJobName

string

param CompilationJobName

[REQUIRED]

The name of the SageMaker Neo compilation job that will be used to locate model artifacts for packaging.

type ModelName

string

param ModelName

[REQUIRED]

The name of the model.

type ModelVersion

string

param ModelVersion

[REQUIRED]

The version of the model.

type RoleArn

string

param RoleArn

[REQUIRED]

The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to download and upload the model, and to contact SageMaker Neo.

type OutputConfig

dict

param OutputConfig

[REQUIRED]

Provides information about the output location for the packaged model.

  • S3OutputLocation (string) -- [REQUIRED]

    The Amazon Simple Storage (S3) bucker URI.

  • KmsKeyId (string) --

    The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt data on the storage volume after compilation job. If you don't provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3 for your role's account.

  • PresetDeploymentType (string) --

    The deployment type SageMaker Edge Manager will create. Currently only supports AWS IoT Greengrass Version 2 components.

  • PresetDeploymentConfig (string) --

    The configuration used to create deployment artifacts. Specify configuration options with a JSON string. The available configuration options for each type are:

    • ComponentName (optional) - Name of the GreenGrass V2 component. If not specified, the default name generated consists of "SagemakerEdgeManager" and the name of your SageMaker Edge Manager packaging job.

    • ComponentDescription (optional) - Description of the component.

    • ComponentVersion (optional) - The version of the component.

    Note

    AWS IoT Greengrass uses semantic versions for components. Semantic versions follow a*major.minor.patch* number system. For example, version 1.0.0 represents the first major release for a component. For more information, see the semantic version specification .

    • PlatformOS (optional) - The name of the operating system for the platform. Supported platforms include Windows and Linux.

    • PlatformArchitecture (optional) - The processor architecture for the platform. Supported architectures Windows include: Windows32_x86, Windows64_x64. Supported architectures for Linux include: Linux x86_64, Linux ARMV8.

type ResourceKey

string

param ResourceKey

The CMK to use when encrypting the EBS volume the edge packaging job runs on.

type Tags

list

param Tags

Creates tags for the packaging job.

  • (dict) --

    A tag object that consists of a key and an optional value, used to manage metadata for Amazon SageMaker AWS resources.

    You can add tags to notebook instances, training jobs, hyperparameter tuning jobs, batch transform jobs, models, labeling jobs, work teams, endpoint configurations, and endpoints. For more information on adding tags to Amazon SageMaker resources, see AddTags .

    For more information on adding metadata to your AWS resources with tagging, see Tagging AWS resources . For advice on best practices for managing AWS resources with tagging, see Tagging Best Practices: Implement an Effective AWS Resource Tagging Strategy .

    • Key (string) -- [REQUIRED]

      The tag key. Tag keys must be unique per resource.

    • Value (string) -- [REQUIRED]

      The tag value.

returns

None

DescribeDeviceFleet (updated) Link ¶
Changes (response)
{'OutputConfig': {'PresetDeploymentConfig': 'string',
                  'PresetDeploymentType': 'GreengrassV2Component'}}

A description of the fleet the device belongs to.

See also: AWS API Documentation

Request Syntax

client.describe_device_fleet(
    DeviceFleetName='string'
)
type DeviceFleetName

string

param DeviceFleetName

[REQUIRED]

The name of the fleet.

rtype

dict

returns

Response Syntax

{
    'DeviceFleetName': 'string',
    'DeviceFleetArn': 'string',
    'OutputConfig': {
        'S3OutputLocation': 'string',
        'KmsKeyId': 'string',
        'PresetDeploymentType': 'GreengrassV2Component',
        'PresetDeploymentConfig': 'string'
    },
    'Description': 'string',
    'CreationTime': datetime(2015, 1, 1),
    'LastModifiedTime': datetime(2015, 1, 1),
    'RoleArn': 'string',
    'IotRoleAlias': 'string'
}

Response Structure

  • (dict) --

    • DeviceFleetName (string) --

      The name of the fleet.

    • DeviceFleetArn (string) --

      The The Amazon Resource Name (ARN) of the fleet.

    • OutputConfig (dict) --

      The output configuration for storing sampled data.

      • S3OutputLocation (string) --

        The Amazon Simple Storage (S3) bucker URI.

      • KmsKeyId (string) --

        The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt data on the storage volume after compilation job. If you don't provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3 for your role's account.

      • PresetDeploymentType (string) --

        The deployment type SageMaker Edge Manager will create. Currently only supports AWS IoT Greengrass Version 2 components.

      • PresetDeploymentConfig (string) --

        The configuration used to create deployment artifacts. Specify configuration options with a JSON string. The available configuration options for each type are:

        • ComponentName (optional) - Name of the GreenGrass V2 component. If not specified, the default name generated consists of "SagemakerEdgeManager" and the name of your SageMaker Edge Manager packaging job.

        • ComponentDescription (optional) - Description of the component.

        • ComponentVersion (optional) - The version of the component.

        Note

        AWS IoT Greengrass uses semantic versions for components. Semantic versions follow a*major.minor.patch* number system. For example, version 1.0.0 represents the first major release for a component. For more information, see the semantic version specification .

        • PlatformOS (optional) - The name of the operating system for the platform. Supported platforms include Windows and Linux.

        • PlatformArchitecture (optional) - The processor architecture for the platform. Supported architectures Windows include: Windows32_x86, Windows64_x64. Supported architectures for Linux include: Linux x86_64, Linux ARMV8.

    • Description (string) --

      A description of the fleet.

    • CreationTime (datetime) --

      Timestamp of when the device fleet was created.

    • LastModifiedTime (datetime) --

      Timestamp of when the device fleet was last updated.

    • RoleArn (string) --

      The Amazon Resource Name (ARN) that has access to AWS Internet of Things (IoT).

    • IotRoleAlias (string) --

      The Amazon Resource Name (ARN) alias created in AWS Internet of Things (IoT).

DescribeEdgePackagingJob (updated) Link ¶
Changes (response)
{'OutputConfig': {'PresetDeploymentConfig': 'string',
                  'PresetDeploymentType': 'GreengrassV2Component'},
 'PresetDeploymentOutput': {'Artifact': 'string',
                            'Status': 'COMPLETED | FAILED',
                            'StatusMessage': 'string',
                            'Type': 'GreengrassV2Component'}}

A description of edge packaging jobs.

See also: AWS API Documentation

Request Syntax

client.describe_edge_packaging_job(
    EdgePackagingJobName='string'
)
type EdgePackagingJobName

string

param EdgePackagingJobName

[REQUIRED]

The name of the edge packaging job.

rtype

dict

returns

Response Syntax

{
    'EdgePackagingJobArn': 'string',
    'EdgePackagingJobName': 'string',
    'CompilationJobName': 'string',
    'ModelName': 'string',
    'ModelVersion': 'string',
    'RoleArn': 'string',
    'OutputConfig': {
        'S3OutputLocation': 'string',
        'KmsKeyId': 'string',
        'PresetDeploymentType': 'GreengrassV2Component',
        'PresetDeploymentConfig': 'string'
    },
    'ResourceKey': 'string',
    'EdgePackagingJobStatus': 'STARTING'|'INPROGRESS'|'COMPLETED'|'FAILED'|'STOPPING'|'STOPPED',
    'EdgePackagingJobStatusMessage': 'string',
    'CreationTime': datetime(2015, 1, 1),
    'LastModifiedTime': datetime(2015, 1, 1),
    'ModelArtifact': 'string',
    'ModelSignature': 'string',
    'PresetDeploymentOutput': {
        'Type': 'GreengrassV2Component',
        'Artifact': 'string',
        'Status': 'COMPLETED'|'FAILED',
        'StatusMessage': 'string'
    }
}

Response Structure

  • (dict) --

    • EdgePackagingJobArn (string) --

      The Amazon Resource Name (ARN) of the edge packaging job.

    • EdgePackagingJobName (string) --

      The name of the edge packaging job.

    • CompilationJobName (string) --

      The name of the SageMaker Neo compilation job that is used to locate model artifacts that are being packaged.

    • ModelName (string) --

      The name of the model.

    • ModelVersion (string) --

      The version of the model.

    • RoleArn (string) --

      The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to download and upload the model, and to contact Neo.

    • OutputConfig (dict) --

      The output configuration for the edge packaging job.

      • S3OutputLocation (string) --

        The Amazon Simple Storage (S3) bucker URI.

      • KmsKeyId (string) --

        The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt data on the storage volume after compilation job. If you don't provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3 for your role's account.

      • PresetDeploymentType (string) --

        The deployment type SageMaker Edge Manager will create. Currently only supports AWS IoT Greengrass Version 2 components.

      • PresetDeploymentConfig (string) --

        The configuration used to create deployment artifacts. Specify configuration options with a JSON string. The available configuration options for each type are:

        • ComponentName (optional) - Name of the GreenGrass V2 component. If not specified, the default name generated consists of "SagemakerEdgeManager" and the name of your SageMaker Edge Manager packaging job.

        • ComponentDescription (optional) - Description of the component.

        • ComponentVersion (optional) - The version of the component.

        Note

        AWS IoT Greengrass uses semantic versions for components. Semantic versions follow a*major.minor.patch* number system. For example, version 1.0.0 represents the first major release for a component. For more information, see the semantic version specification .

        • PlatformOS (optional) - The name of the operating system for the platform. Supported platforms include Windows and Linux.

        • PlatformArchitecture (optional) - The processor architecture for the platform. Supported architectures Windows include: Windows32_x86, Windows64_x64. Supported architectures for Linux include: Linux x86_64, Linux ARMV8.

    • ResourceKey (string) --

      The CMK to use when encrypting the EBS volume the job run on.

    • EdgePackagingJobStatus (string) --

      The current status of the packaging job.

    • EdgePackagingJobStatusMessage (string) --

      Returns a message describing the job status and error messages.

    • CreationTime (datetime) --

      The timestamp of when the packaging job was created.

    • LastModifiedTime (datetime) --

      The timestamp of when the job was last updated.

    • ModelArtifact (string) --

      The Amazon Simple Storage (S3) URI where model artifacts ares stored.

    • ModelSignature (string) --

      The signature document of files in the model artifact.

    • PresetDeploymentOutput (dict) --

      The output of a SageMaker Edge Manager deployable resource.

      • Type (string) --

        The deployment type created by SageMaker Edge Manager. Currently only supports AWS IoT Greengrass Version 2 components.

      • Artifact (string) --

        The Amazon Resource Name (ARN) of the generated deployable resource.

      • Status (string) --

        The status of the deployable resource.

      • StatusMessage (string) --

        Returns a message describing the status of the deployed resource.

GetDeviceFleetReport (updated) Link ¶
Changes (response)
{'OutputConfig': {'PresetDeploymentConfig': 'string',
                  'PresetDeploymentType': 'GreengrassV2Component'}}

Describes a fleet.

See also: AWS API Documentation

Request Syntax

client.get_device_fleet_report(
    DeviceFleetName='string'
)
type DeviceFleetName

string

param DeviceFleetName

[REQUIRED]

The name of the fleet.

rtype

dict

returns

Response Syntax

{
    'DeviceFleetArn': 'string',
    'DeviceFleetName': 'string',
    'OutputConfig': {
        'S3OutputLocation': 'string',
        'KmsKeyId': 'string',
        'PresetDeploymentType': 'GreengrassV2Component',
        'PresetDeploymentConfig': 'string'
    },
    'Description': 'string',
    'ReportGenerated': datetime(2015, 1, 1),
    'DeviceStats': {
        'ConnectedDeviceCount': 123,
        'RegisteredDeviceCount': 123
    },
    'AgentVersions': [
        {
            'Version': 'string',
            'AgentCount': 123
        },
    ],
    'ModelStats': [
        {
            'ModelName': 'string',
            'ModelVersion': 'string',
            'OfflineDeviceCount': 123,
            'ConnectedDeviceCount': 123,
            'ActiveDeviceCount': 123,
            'SamplingDeviceCount': 123
        },
    ]
}

Response Structure

  • (dict) --

    • DeviceFleetArn (string) --

      The Amazon Resource Name (ARN) of the device.

    • DeviceFleetName (string) --

      The name of the fleet.

    • OutputConfig (dict) --

      The output configuration for storing sample data collected by the fleet.

      • S3OutputLocation (string) --

        The Amazon Simple Storage (S3) bucker URI.

      • KmsKeyId (string) --

        The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt data on the storage volume after compilation job. If you don't provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3 for your role's account.

      • PresetDeploymentType (string) --

        The deployment type SageMaker Edge Manager will create. Currently only supports AWS IoT Greengrass Version 2 components.

      • PresetDeploymentConfig (string) --

        The configuration used to create deployment artifacts. Specify configuration options with a JSON string. The available configuration options for each type are:

        • ComponentName (optional) - Name of the GreenGrass V2 component. If not specified, the default name generated consists of "SagemakerEdgeManager" and the name of your SageMaker Edge Manager packaging job.

        • ComponentDescription (optional) - Description of the component.

        • ComponentVersion (optional) - The version of the component.

        Note

        AWS IoT Greengrass uses semantic versions for components. Semantic versions follow a*major.minor.patch* number system. For example, version 1.0.0 represents the first major release for a component. For more information, see the semantic version specification .

        • PlatformOS (optional) - The name of the operating system for the platform. Supported platforms include Windows and Linux.

        • PlatformArchitecture (optional) - The processor architecture for the platform. Supported architectures Windows include: Windows32_x86, Windows64_x64. Supported architectures for Linux include: Linux x86_64, Linux ARMV8.

    • Description (string) --

      Description of the fleet.

    • ReportGenerated (datetime) --

      Timestamp of when the report was generated.

    • DeviceStats (dict) --

      Status of devices.

      • ConnectedDeviceCount (integer) --

        The number of devices connected with a heartbeat.

      • RegisteredDeviceCount (integer) --

        The number of registered devices.

    • AgentVersions (list) --

      The versions of Edge Manager agent deployed on the fleet.

      • (dict) --

        Edge Manager agent version.

        • Version (string) --

          Version of the agent.

        • AgentCount (integer) --

          The number of Edge Manager agents.

    • ModelStats (list) --

      Status of model on device.

      • (dict) --

        Status of edge devices with this model.

        • ModelName (string) --

          The name of the model.

        • ModelVersion (string) --

          The model version.

        • OfflineDeviceCount (integer) --

          The number of devices that have this model version and do not have a heart beat.

        • ConnectedDeviceCount (integer) --

          The number of devices that have this model version and have a heart beat.

        • ActiveDeviceCount (integer) --

          The number of devices that have this model version, a heart beat, and are currently running.

        • SamplingDeviceCount (integer) --

          The number of devices with this model version and are producing sample data.

UpdateDeviceFleet (updated) Link ¶
Changes (request)
{'EnableIotRoleAlias': 'boolean',
 'OutputConfig': {'PresetDeploymentConfig': 'string',
                  'PresetDeploymentType': 'GreengrassV2Component'}}

Updates a fleet of devices.

See also: AWS API Documentation

Request Syntax

client.update_device_fleet(
    DeviceFleetName='string',
    RoleArn='string',
    Description='string',
    OutputConfig={
        'S3OutputLocation': 'string',
        'KmsKeyId': 'string',
        'PresetDeploymentType': 'GreengrassV2Component',
        'PresetDeploymentConfig': 'string'
    },
    EnableIotRoleAlias=True|False
)
type DeviceFleetName

string

param DeviceFleetName

[REQUIRED]

The name of the fleet.

type RoleArn

string

param RoleArn

The Amazon Resource Name (ARN) of the device.

type Description

string

param Description

Description of the fleet.

type OutputConfig

dict

param OutputConfig

[REQUIRED]

Output configuration for storing sample data collected by the fleet.

  • S3OutputLocation (string) -- [REQUIRED]

    The Amazon Simple Storage (S3) bucker URI.

  • KmsKeyId (string) --

    The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt data on the storage volume after compilation job. If you don't provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3 for your role's account.

  • PresetDeploymentType (string) --

    The deployment type SageMaker Edge Manager will create. Currently only supports AWS IoT Greengrass Version 2 components.

  • PresetDeploymentConfig (string) --

    The configuration used to create deployment artifacts. Specify configuration options with a JSON string. The available configuration options for each type are:

    • ComponentName (optional) - Name of the GreenGrass V2 component. If not specified, the default name generated consists of "SagemakerEdgeManager" and the name of your SageMaker Edge Manager packaging job.

    • ComponentDescription (optional) - Description of the component.

    • ComponentVersion (optional) - The version of the component.

    Note

    AWS IoT Greengrass uses semantic versions for components. Semantic versions follow a*major.minor.patch* number system. For example, version 1.0.0 represents the first major release for a component. For more information, see the semantic version specification .

    • PlatformOS (optional) - The name of the operating system for the platform. Supported platforms include Windows and Linux.

    • PlatformArchitecture (optional) - The processor architecture for the platform. Supported architectures Windows include: Windows32_x86, Windows64_x64. Supported architectures for Linux include: Linux x86_64, Linux ARMV8.

type EnableIotRoleAlias

boolean

param EnableIotRoleAlias

Whether to create an AWS IoT Role Alias during device fleet creation. The name of the role alias generated will match this pattern: "SageMakerEdge-{DeviceFleetName}".

For example, if your device fleet is called "demo-fleet", the name of the role alias will be "SageMakerEdge-demo-fleet".

returns

None