Table of Contents
A low-level client representing AWS Snow Device Management
Amazon Web Services Snow Device Management documentation.
import boto3
client = boto3.client('snow-device-management')
These are the available methods:
Check if an operation can be paginated.
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
response = client.cancel_task(
taskId='string'
)
[REQUIRED]
The ID of the task that you are attempting to cancel. You can retrieve a task ID by using the ListTasks operation.
{
'taskId': 'string'
}
Response Structure
The ID of the task that you are attempting to cancel.
Exceptions
Instructs one or more devices to start a task, such as unlocking or rebooting.
See also: AWS API Documentation
Request Syntax
response = client.create_task(
clientToken='string',
command={
'reboot': {}
,
'unlock': {}
},
description='string',
tags={
'string': 'string'
},
targets=[
'string',
]
)
A token ensuring that the action is called only once with the specified details.
This field is autopopulated if not provided.
[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.
Reboots the device.
Unlocks the device.
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.
[REQUIRED]
A list of managed device IDs.
dict
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.
Exceptions
Checks device-specific information, such as the device type, software version, IP addresses, and lock status.
See also: AWS API Documentation
Request Syntax
response = client.describe_device(
managedDeviceId='string'
)
[REQUIRED]
The ID of the device that you are checking the information of.
{
'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
The ID of the job used when ordering the device.
The hardware specifications of the device.
The physical capacity of the Amazon Web Services Snow Family device.
The amount of capacity available for use on the device.
The name of the type of capacity, such as memory.
The total capacity on the device.
The unit of measure for the type of capacity.
The amount of capacity used on the device.
The current state of the device.
The type of Amazon Web Services Snow Family device.
When the device last contacted the Amazon Web Services Cloud. Indicates that the device is online.
When the device last pushed an update to the Amazon Web Services Cloud. Indicates when the device cache was refreshed.
The Amazon Resource Name (ARN) of the device.
The ID of the device that you checked the information for.
The network interfaces available on the device.
The details about the physical network interface for the device.
The default gateway of the device.
The IP address of the device.
A value that describes whether the IP address is dynamic or persistent.
The MAC address of the device.
The netmask used to divide the IP address into subnets.
The physical connector type.
The physical network interface ID.
The software installed on the device.
The state of the software that is installed or that is being installed on the device.
The version of the software currently installed on the device.
The version of the software being installed on the device.
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.
Exceptions
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
response = client.describe_device_ec2_instances(
instanceIds=[
'string',
],
managedDeviceId='string'
)
[REQUIRED]
A list of instance IDs associated with the managed device.
[REQUIRED]
The ID of the managed device.
dict
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:
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.
Exceptions
Checks the status of a remote task running on one or more target devices.
See also: AWS API Documentation
Request Syntax
response = client.describe_execution(
managedDeviceId='string',
taskId='string'
)
[REQUIRED]
The ID of the managed device.
[REQUIRED]
The ID of the task that the action is describing.
dict
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.
Exceptions
Checks the metadata for a given task on a device.
See also: AWS API Documentation
Request Syntax
response = client.describe_task(
taskId='string'
)
[REQUIRED]
The ID of the task to be described.
{
'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
When the task was completed.
When the CreateTask operation was called.
The description provided of the task and managed devices.
When the state of the task was last updated.
The current state of the task.
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.
The managed devices that the task was sent to.
The Amazon Resource Name (ARN) of the task.
The ID of the task.
Exceptions
Create a paginator for an operation.
Returns an object that can wait for some condition.
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
response = client.list_device_resources(
managedDeviceId='string',
maxResults=123,
nextToken='string',
type='string'
)
[REQUIRED]
The ID of the managed device that you are listing the resources of.
dict
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.
Exceptions
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
response = client.list_devices(
jobId='string',
maxResults=123,
nextToken='string'
)
dict
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.
nextToken (string) --
A pagination token to continue to the next page of devices.
Exceptions
Returns the status of tasks for one or more target devices.
See also: AWS API Documentation
Request Syntax
response = client.list_executions(
maxResults=123,
nextToken='string',
state='QUEUED'|'IN_PROGRESS'|'CANCELED'|'FAILED'|'SUCCEEDED'|'REJECTED'|'TIMED_OUT',
taskId='string'
)
[REQUIRED]
The ID of the task.
dict
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.
Exceptions
Returns a list of tags for a managed device or task.
See also: AWS API Documentation
Request Syntax
response = client.list_tags_for_resource(
resourceArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the device or task.
{
'tags': {
'string': 'string'
}
}
Response Structure
The list of tags for the device or task.
Exceptions
Returns a list of tasks that can be filtered by state.
See also: AWS API Documentation
Request Syntax
response = client.list_tasks(
maxResults=123,
nextToken='string',
state='IN_PROGRESS'|'CANCELED'|'COMPLETED'
)
dict
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.
taskArn (string) --
The Amazon Resource Name (ARN) of the task.
taskId (string) --
The task ID.
Exceptions
Adds or replaces tags on a device or task.
See also: AWS API Documentation
Request Syntax
response = client.tag_resource(
resourceArn='string',
tags={
'string': 'string'
}
)
[REQUIRED]
The Amazon Resource Name (ARN) of the device or task.
[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.
None
Exceptions
Removes a tag from a device or task.
See also: AWS API Documentation
Request Syntax
response = client.untag_resource(
resourceArn='string',
tagKeys=[
'string',
]
)
[REQUIRED]
The Amazon Resource Name (ARN) of the device or task.
[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.
None
Exceptions
The available paginators are:
paginator = client.get_paginator('list_device_resources')
Creates an iterator that will paginate through responses from SnowDeviceManagement.Client.list_device_resources().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
managedDeviceId='string',
type='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The ID of the managed device that you are listing the resources of.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'resources': [
{
'arn': 'string',
'id': 'string',
'resourceType': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
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.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_devices')
Creates an iterator that will paginate through responses from SnowDeviceManagement.Client.list_devices().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
jobId='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
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.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_executions')
Creates an iterator that will paginate through responses from SnowDeviceManagement.Client.list_executions().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
state='QUEUED'|'IN_PROGRESS'|'CANCELED'|'FAILED'|'SUCCEEDED'|'REJECTED'|'TIMED_OUT',
taskId='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The ID of the task.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
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 token to resume pagination.
paginator = client.get_paginator('list_tasks')
Creates an iterator that will paginate through responses from SnowDeviceManagement.Client.list_tasks().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
state='IN_PROGRESS'|'CANCELED'|'COMPLETED',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'tasks': [
{
'state': 'IN_PROGRESS'|'CANCELED'|'COMPLETED',
'tags': {
'string': 'string'
},
'taskArn': 'string',
'taskId': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
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.
taskArn (string) --
The Amazon Resource Name (ARN) of the task.
taskId (string) --
The task ID.
NextToken (string) --
A token to resume pagination.