AWS Snow Device Management

2021/08/11 - AWS Snow Device Management - 13 new api methods

Changes  AWS Snow Family customers can remotely monitor and operate their connected AWS Snowcone devices.

ListDevices (new) Link ¶

Returns a list of all devices on your Amazon Web Services account that have Amazon Web Services Snow Device Management enabled in the Amazon Web Services Region where the command is run.

See also: AWS API Documentation

Request Syntax

client.list_devices(
    jobId='string',
    maxResults=123,
    nextToken='string'
)
type jobId

string

param jobId

The ID of the job used to order the device.

type maxResults

integer

param maxResults

The maximum number of devices to list per page.

type nextToken

string

param nextToken

A pagination token to continue to the next page of results.

rtype

dict

returns

Response Syntax

{
    'devices': [
        {
            'associatedWithJob': 'string',
            'managedDeviceArn': 'string',
            'managedDeviceId': 'string',
            'tags': {
                'string': 'string'
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • devices (list) --

      A list of device structures that contain information about the device.

      • (dict) --

        Identifying information about the device.

        • associatedWithJob (string) --

          The ID of the job used to order the device.

        • managedDeviceArn (string) --

          The Amazon Resource Name (ARN) of the device.

        • managedDeviceId (string) --

          The ID of the device.

        • tags (dict) --

          Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.

          • (string) --

            • (string) --

    • nextToken (string) --

      A pagination token to continue to the next page of devices.

ListTasks (new) Link ¶

Returns a list of tasks that can be filtered by state.

See also: AWS API Documentation

Request Syntax

client.list_tasks(
    maxResults=123,
    nextToken='string',
    state='IN_PROGRESS'|'CANCELED'|'COMPLETED'
)
type maxResults

integer

param maxResults

The maximum number of tasks per page.

type nextToken

string

param nextToken

A pagination token to continue to the next page of tasks.

type state

string

param state

A structure used to filter the list of tasks.

rtype

dict

returns

Response Syntax

{
    'nextToken': 'string',
    'tasks': [
        {
            'state': 'IN_PROGRESS'|'CANCELED'|'COMPLETED',
            'tags': {
                'string': 'string'
            },
            'taskArn': 'string',
            'taskId': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      A pagination token to continue to the next page of tasks.

    • tasks (list) --

      A list of task structures containing details about each task.

      • (dict) --

        Information about the task assigned to one or many devices.

        • state (string) --

          The state of the task assigned to one or many devices.

        • tags (dict) --

          Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.

          • (string) --

            • (string) --

        • taskArn (string) --

          The Amazon Resource Name (ARN) of the task.

        • taskId (string) --

          The task ID.

TagResource (new) Link ¶

Adds or replaces tags on a device or task.

See also: AWS API Documentation

Request Syntax

client.tag_resource(
    resourceArn='string',
    tags={
        'string': 'string'
    }
)
type resourceArn

string

param resourceArn

[REQUIRED]

The Amazon Resource Name (ARN) of the device or task.

type tags

dict

param tags

[REQUIRED]

Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.

  • (string) --

    • (string) --

returns

None

CancelTask (new) Link ¶

Sends a cancel request for a specified task. You can cancel a task only if it's still in a QUEUED state. Tasks that are already running can't be cancelled.

Note

A task might still run if it's processed from the queue before the CancelTask operation changes the task's state.

See also: AWS API Documentation

Request Syntax

client.cancel_task(
    taskId='string'
)
type taskId

string

param taskId

[REQUIRED]

The ID of the task that you are attempting to cancel. You can retrieve a task ID by using the ListTasks operation.

rtype

dict

returns

Response Syntax

{
    'taskId': 'string'
}

Response Structure

  • (dict) --

    • taskId (string) --

      The ID of the task that you are attempting to cancel.

DescribeExecution (new) Link ¶

Checks the status of a remote task running on one or more target devices.

See also: AWS API Documentation

Request Syntax

client.describe_execution(
    managedDeviceId='string',
    taskId='string'
)
type managedDeviceId

string

param managedDeviceId

[REQUIRED]

The ID of the managed device.

type taskId

string

param taskId

[REQUIRED]

The ID of the task that the action is describing.

rtype

dict

returns

Response Syntax

{
    'executionId': 'string',
    'lastUpdatedAt': datetime(2015, 1, 1),
    'managedDeviceId': 'string',
    'startedAt': datetime(2015, 1, 1),
    'state': 'QUEUED'|'IN_PROGRESS'|'CANCELED'|'FAILED'|'SUCCEEDED'|'REJECTED'|'TIMED_OUT',
    'taskId': 'string'
}

Response Structure

  • (dict) --

    • executionId (string) --

      The ID of the execution.

    • lastUpdatedAt (datetime) --

      When the status of the execution was last updated.

    • managedDeviceId (string) --

      The ID of the managed device that the task is being executed on.

    • startedAt (datetime) --

      When the execution began.

    • state (string) --

      The current state of the execution.

    • taskId (string) --

      The ID of the task being executed on the device.

DescribeTask (new) Link ¶

Checks the metadata for a given task on a device.

See also: AWS API Documentation

Request Syntax

client.describe_task(
    taskId='string'
)
type taskId

string

param taskId

[REQUIRED]

The ID of the task to be described.

rtype

dict

returns

Response Syntax

{
    'completedAt': datetime(2015, 1, 1),
    'createdAt': datetime(2015, 1, 1),
    'description': 'string',
    'lastUpdatedAt': datetime(2015, 1, 1),
    'state': 'IN_PROGRESS'|'CANCELED'|'COMPLETED',
    'tags': {
        'string': 'string'
    },
    'targets': [
        'string',
    ],
    'taskArn': 'string',
    'taskId': 'string'
}

Response Structure

  • (dict) --

    • completedAt (datetime) --

      When the task was completed.

    • createdAt (datetime) --

      When the CreateTask operation was called.

    • description (string) --

      The description provided of the task and managed devices.

    • lastUpdatedAt (datetime) --

      When the state of the task was last updated.

    • state (string) --

      The current state of the task.

    • tags (dict) --

      Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.

      • (string) --

        • (string) --

    • targets (list) --

      The managed devices that the task was sent to.

      • (string) --

    • taskArn (string) --

      The Amazon Resource Name (ARN) of the task.

    • taskId (string) --

      The ID of the task.

DescribeDeviceEc2Instances (new) Link ¶

Checks the current state of the Amazon EC2 instances. The output is similar to describeDevice , but the results are sourced from the device cache in the Amazon Web Services Cloud and include a subset of the available fields.

See also: AWS API Documentation

Request Syntax

client.describe_device_ec2_instances(
    instanceIds=[
        'string',
    ],
    managedDeviceId='string'
)
type instanceIds

list

param instanceIds

[REQUIRED]

A list of instance IDs associated with the managed device.

  • (string) --

type managedDeviceId

string

param managedDeviceId

[REQUIRED]

The ID of the managed device.

rtype

dict

returns

Response Syntax

{
    'instances': [
        {
            'instance': {
                'amiLaunchIndex': 123,
                'blockDeviceMappings': [
                    {
                        'deviceName': 'string',
                        'ebs': {
                            'attachTime': datetime(2015, 1, 1),
                            'deleteOnTermination': True|False,
                            'status': 'ATTACHING'|'ATTACHED'|'DETACHING'|'DETACHED',
                            'volumeId': 'string'
                        }
                    },
                ],
                'cpuOptions': {
                    'coreCount': 123,
                    'threadsPerCore': 123
                },
                'createdAt': datetime(2015, 1, 1),
                'imageId': 'string',
                'instanceId': 'string',
                'instanceType': 'string',
                'privateIpAddress': 'string',
                'publicIpAddress': 'string',
                'rootDeviceName': 'string',
                'securityGroups': [
                    {
                        'groupId': 'string',
                        'groupName': 'string'
                    },
                ],
                'state': {
                    'code': 123,
                    'name': 'PENDING'|'RUNNING'|'SHUTTING_DOWN'|'TERMINATED'|'STOPPING'|'STOPPED'
                },
                'updatedAt': datetime(2015, 1, 1)
            },
            'lastUpdatedAt': datetime(2015, 1, 1)
        },
    ]
}

Response Structure

  • (dict) --

    • instances (list) --

      A list of structures containing information about each instance.

      • (dict) --

        The details about the instance.

        • instance (dict) --

          A structure containing details about the instance.

          • amiLaunchIndex (integer) --

            The Amazon Machine Image (AMI) launch index, which you can use to find this instance in the launch group.

          • blockDeviceMappings (list) --

            Any block device mapping entries for the instance.

            • (dict) --

              The description of a block device mapping.

              • deviceName (string) --

                The block device name.

              • ebs (dict) --

                The parameters used to automatically set up Amazon Elastic Block Store (Amazon EBS) volumes when the instance is launched.

                • attachTime (datetime) --

                  When the attachment was initiated.

                • deleteOnTermination (boolean) --

                  A value that indicates whether the volume is deleted on instance termination.

                • status (string) --

                  The attachment state.

                • volumeId (string) --

                  The ID of the Amazon EBS volume.

          • cpuOptions (dict) --

            The CPU options for the instance.

            • coreCount (integer) --

              The number of cores that the CPU can use.

            • threadsPerCore (integer) --

              The number of threads per core in the CPU.

          • createdAt (datetime) --

            When the instance was created.

          • imageId (string) --

            The ID of the AMI used to launch the instance.

          • instanceId (string) --

            The ID of the instance.

          • instanceType (string) --

            The instance type.

          • privateIpAddress (string) --

            The private IPv4 address assigned to the instance.

          • publicIpAddress (string) --

            The public IPv4 address assigned to the instance.

          • rootDeviceName (string) --

            The device name of the root device volume (for example, /dev/sda1 ).

          • securityGroups (list) --

            The security groups for the instance.

            • (dict) --

              Information about the device's security group.

              • groupId (string) --

                The security group ID.

              • groupName (string) --

                The security group name.

          • state (dict) --

            The description of the current state of an instance.

            • code (integer) --

              The state of the instance as a 16-bit unsigned integer.

              The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.

              The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.

              The valid values for the instance state code are all in the range of the low byte. These values are:

              • 0 : pending

              • 16 : running

              • 32 : shutting-down

              • 48 : terminated

              • 64 : stopping

              • 80 : stopped

              You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.

            • name (string) --

              The current state of the instance.

          • updatedAt (datetime) --

            When the instance was last updated.

        • lastUpdatedAt (datetime) --

          When the instance summary was last updated.

ListDeviceResources (new) Link ¶

Returns a list of the Amazon Web Services resources available for a device. Currently, Amazon EC2 instances are the only supported resource type.

See also: AWS API Documentation

Request Syntax

client.list_device_resources(
    managedDeviceId='string',
    maxResults=123,
    nextToken='string',
    type='string'
)
type managedDeviceId

string

param managedDeviceId

[REQUIRED]

The ID of the managed device that you are listing the resources of.

type maxResults

integer

param maxResults

The maximum number of resources per page.

type nextToken

string

param nextToken

A pagination token to continue to the next page of results.

type type

string

param type

A structure used to filter the results by type of resource.

rtype

dict

returns

Response Syntax

{
    'nextToken': 'string',
    'resources': [
        {
            'arn': 'string',
            'id': 'string',
            'resourceType': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      A pagination token to continue to the next page of results.

    • resources (list) --

      A structure defining the resource's type, Amazon Resource Name (ARN), and ID.

      • (dict) --

        A summary of a resource available on the device.

        • arn (string) --

          The Amazon Resource Name (ARN) of the resource.

        • id (string) --

          The ID of the resource.

        • resourceType (string) --

          The resource type.

ListTagsForResource (new) Link ¶

Returns a list of tags for a managed device or task.

See also: AWS API Documentation

Request Syntax

client.list_tags_for_resource(
    resourceArn='string'
)
type resourceArn

string

param resourceArn

[REQUIRED]

The Amazon Resource Name (ARN) of the device or task.

rtype

dict

returns

Response Syntax

{
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    • tags (dict) --

      The list of tags for the device or task.

      • (string) --

        • (string) --

ListExecutions (new) Link ¶

Returns the status of tasks for one or more target devices.

See also: AWS API Documentation

Request Syntax

client.list_executions(
    maxResults=123,
    nextToken='string',
    state='QUEUED'|'IN_PROGRESS'|'CANCELED'|'FAILED'|'SUCCEEDED'|'REJECTED'|'TIMED_OUT',
    taskId='string'
)
type maxResults

integer

param maxResults

The maximum number of tasks to list per page.

type nextToken

string

param nextToken

A pagination token to continue to the next page of tasks.

type state

string

param state

A structure used to filter the tasks by their current state.

type taskId

string

param taskId

[REQUIRED]

The ID of the task.

rtype

dict

returns

Response Syntax

{
    'executions': [
        {
            'executionId': 'string',
            'managedDeviceId': 'string',
            'state': 'QUEUED'|'IN_PROGRESS'|'CANCELED'|'FAILED'|'SUCCEEDED'|'REJECTED'|'TIMED_OUT',
            'taskId': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • executions (list) --

      A list of executions. Each execution contains the task ID, the device that the task is executing on, the execution ID, and the status of the execution.

      • (dict) --

        The summary of a task execution on a specified device.

        • executionId (string) --

          The ID of the execution.

        • managedDeviceId (string) --

          The ID of the managed device that the task is being executed on.

        • state (string) --

          The state of the execution.

        • taskId (string) --

          The ID of the task.

    • nextToken (string) --

      A pagination token to continue to the next page of executions.

DescribeDevice (new) Link ¶

Checks device-specific information, such as the device type, software version, IP addresses, and lock status.

See also: AWS API Documentation

Request Syntax

client.describe_device(
    managedDeviceId='string'
)
type managedDeviceId

string

param managedDeviceId

[REQUIRED]

The ID of the device that you are checking the information of.

rtype

dict

returns

Response Syntax

{
    'associatedWithJob': 'string',
    'deviceCapacities': [
        {
            'available': 123,
            'name': 'string',
            'total': 123,
            'unit': 'string',
            'used': 123
        },
    ],
    'deviceState': 'UNLOCKED'|'LOCKED'|'UNLOCKING',
    'deviceType': 'string',
    'lastReachedOutAt': datetime(2015, 1, 1),
    'lastUpdatedAt': datetime(2015, 1, 1),
    'managedDeviceArn': 'string',
    'managedDeviceId': 'string',
    'physicalNetworkInterfaces': [
        {
            'defaultGateway': 'string',
            'ipAddress': 'string',
            'ipAddressAssignment': 'DHCP'|'STATIC',
            'macAddress': 'string',
            'netmask': 'string',
            'physicalConnectorType': 'RJ45'|'SFP_PLUS'|'QSFP'|'RJ45_2'|'WIFI',
            'physicalNetworkInterfaceId': 'string'
        },
    ],
    'software': {
        'installState': 'string',
        'installedVersion': 'string',
        'installingVersion': 'string'
    },
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    • associatedWithJob (string) --

      The ID of the job used when ordering the device.

    • deviceCapacities (list) --

      The hardware specifications of the device.

      • (dict) --

        The physical capacity of the Amazon Web Services Snow Family device.

        • available (integer) --

          The amount of capacity available for use on the device.

        • name (string) --

          The name of the type of capacity, such as memory.

        • total (integer) --

          The total capacity on the device.

        • unit (string) --

          The unit of measure for the type of capacity.

        • used (integer) --

          The amount of capacity used on the device.

    • deviceState (string) --

      The current state of the device.

    • deviceType (string) --

      The type of Amazon Web Services Snow Family device.

    • lastReachedOutAt (datetime) --

      When the device last contacted the Amazon Web Services Cloud. Indicates that the device is online.

    • lastUpdatedAt (datetime) --

      When the device last pushed an update to the Amazon Web Services Cloud. Indicates when the device cache was refreshed.

    • managedDeviceArn (string) --

      The Amazon Resource Name (ARN) of the device.

    • managedDeviceId (string) --

      The ID of the device that you checked the information for.

    • physicalNetworkInterfaces (list) --

      The network interfaces available on the device.

      • (dict) --

        The details about the physical network interface for the device.

        • defaultGateway (string) --

          The default gateway of the device.

        • ipAddress (string) --

          The IP address of the device.

        • ipAddressAssignment (string) --

          A value that describes whether the IP address is dynamic or persistent.

        • macAddress (string) --

          The MAC address of the device.

        • netmask (string) --

          The netmask used to divide the IP address into subnets.

        • physicalConnectorType (string) --

          The physical connector type.

        • physicalNetworkInterfaceId (string) --

          The physical network interface ID.

    • software (dict) --

      The software installed on the device.

      • installState (string) --

        The state of the software that is installed or that is being installed on the device.

      • installedVersion (string) --

        The version of the software currently installed on the device.

      • installingVersion (string) --

        The version of the software being installed on the device.

    • tags (dict) --

      Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.

      • (string) --

        • (string) --

UntagResource (new) Link ¶

Removes a tag from a device or task.

See also: AWS API Documentation

Request Syntax

client.untag_resource(
    resourceArn='string',
    tagKeys=[
        'string',
    ]
)
type resourceArn

string

param resourceArn

[REQUIRED]

The Amazon Resource Name (ARN) of the device or task.

type tagKeys

list

param tagKeys

[REQUIRED]

Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.

  • (string) --

returns

None

CreateTask (new) Link ¶

Instructs one or more devices to start a task, such as unlocking or rebooting.

See also: AWS API Documentation

Request Syntax

client.create_task(
    clientToken='string',
    command={
        'reboot': {}
        ,
        'unlock': {}

    },
    description='string',
    tags={
        'string': 'string'
    },
    targets=[
        'string',
    ]
)
type clientToken

string

param clientToken

A token ensuring that the action is called only once with the specified details.

This field is autopopulated if not provided.

type command

dict

param command

[REQUIRED]

The task to be performed. Only one task is executed on a device at a time.

Note

This is a Tagged Union structure. Only one of the following top level keys can be set: reboot, unlock.

  • reboot (dict) --

    Reboots the device.

  • unlock (dict) --

    Unlocks the device.

type description

string

param description

A description of the task and its targets.

type tags

dict

param tags

Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.

  • (string) --

    • (string) --

type targets

list

param targets

[REQUIRED]

A list of managed device IDs.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'taskArn': 'string',
    'taskId': 'string'
}

Response Structure

  • (dict) --

    • taskArn (string) --

      The Amazon Resource Name (ARN) of the task that you created.

    • taskId (string) --

      The ID of the task that you created.