Table of Contents
A low-level client representing AWS Import/Export:
client = session.create_client('importexport')
These are the available methods:
Check if an operation can be paginated.
This operation cancels a specified job. Only the job owner can cancel it. The operation fails if the job has already started or is complete.
See also: AWS API Documentation
Request Syntax
response = client.cancel_job(
JobId='string',
APIVersion='string'
)
dict
Response Syntax
{
'Success': True|False
}
Response Structure
Exceptions
This operation initiates the process of scheduling an upload or download of your data. You include in the request a manifest that describes the data transfer specifics. The response to the request includes a job ID, which you can use in other operations, a signature that you use to identify your storage device, and the address where you should ship your storage device.
See also: AWS API Documentation
Request Syntax
response = client.create_job(
JobType='Import'|'Export',
Manifest='string',
ManifestAddendum='string',
ValidateOnly=True|False,
APIVersion='string'
)
dict
Response Syntax
{
'JobId': 'string',
'JobType': 'Import'|'Export',
'Signature': 'string',
'SignatureFileContents': 'string',
'WarningMessage': 'string',
'ArtifactList': [
{
'Description': 'string',
'URL': 'string'
},
]
}
Response Structure
Exceptions
Generate a presigned url given a client, its method, and arguments
The presigned url
Create a paginator for an operation.
This operation generates a pre-paid UPS shipping label that you will use to ship your device to AWS for processing.
See also: AWS API Documentation
Request Syntax
response = client.get_shipping_label(
jobIds=[
'string',
],
name='string',
company='string',
phoneNumber='string',
country='string',
stateOrProvince='string',
city='string',
postalCode='string',
street1='string',
street2='string',
street3='string',
APIVersion='string'
)
[REQUIRED]
dict
Response Syntax
{
'ShippingLabelURL': 'string',
'Warning': 'string'
}
Response Structure
Exceptions
This operation returns information about a job, including where the job is in the processing pipeline, the status of the results, and the signature value associated with the job. You can only return information about jobs you own.
See also: AWS API Documentation
Request Syntax
response = client.get_status(
JobId='string',
APIVersion='string'
)
dict
Response Syntax
{
'JobId': 'string',
'JobType': 'Import'|'Export',
'LocationCode': 'string',
'LocationMessage': 'string',
'ProgressCode': 'string',
'ProgressMessage': 'string',
'Carrier': 'string',
'TrackingNumber': 'string',
'LogBucket': 'string',
'LogKey': 'string',
'ErrorCount': 123,
'Signature': 'string',
'SignatureFileContents': 'string',
'CurrentManifest': 'string',
'CreationDate': datetime(2015, 1, 1),
'ArtifactList': [
{
'Description': 'string',
'URL': 'string'
},
]
}
Response Structure
Exceptions
Returns an object that can wait for some condition.
This operation returns the jobs associated with the requester. AWS Import/Export lists the jobs in reverse chronological order based on the date of creation. For example if Job Test1 was created 2009Dec30 and Test2 was created 2010Feb05, the ListJobs operation would return Test2 followed by Test1.
See also: AWS API Documentation
Request Syntax
response = client.list_jobs(
MaxJobs=123,
Marker='string',
APIVersion='string'
)
dict
Response Syntax
{
'Jobs': [
{
'JobId': 'string',
'CreationDate': datetime(2015, 1, 1),
'IsCanceled': True|False,
'JobType': 'Import'|'Export'
},
],
'IsTruncated': True|False
}
Response Structure
Exceptions
You use this operation to change the parameters specified in the original manifest file by supplying a new manifest file. The manifest file attached to this request replaces the original manifest file. You can only use the operation after a CreateJob request but before the data transfer starts and you can only use it on jobs you own.
See also: AWS API Documentation
Request Syntax
response = client.update_job(
JobId='string',
Manifest='string',
JobType='Import'|'Export',
ValidateOnly=True|False,
APIVersion='string'
)
dict
Response Syntax
{
'Success': True|False,
'WarningMessage': 'string',
'ArtifactList': [
{
'Description': 'string',
'URL': 'string'
},
]
}
Response Structure
Exceptions
Client exceptions are available on a client instance via the exceptions property. For more detailed instructions and examples on the exact usage of client exceptions, see the error handling user guide.
The available client exceptions are:
The account specified does not have the appropriate bucket permissions.
Example
try:
...
except client.exceptions.BucketPermissionException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
The specified job ID has been canceled and is no longer valid.
Example
try:
...
except client.exceptions.CanceledJobIdException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
Each account can create only a certain number of jobs per day. If you need to create more than this, please contact awsimportexport@amazon.com to explain your particular use case.
Example
try:
...
except client.exceptions.CreateJobQuotaExceededException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
Indicates that the specified job has expired out of the system.
Example
try:
...
except client.exceptions.ExpiredJobIdException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
The AWS Access Key ID specified in the request did not match the manifest's accessKeyId value. The manifest and the request authentication must use the same AWS Access Key ID.
Example
try:
...
except client.exceptions.InvalidAccessKeyIdException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
The address specified in the manifest is invalid.
Example
try:
...
except client.exceptions.InvalidAddressException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
One or more customs parameters was invalid. Please correct and resubmit.
Example
try:
...
except client.exceptions.InvalidCustomsException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
File system specified in export manifest is invalid.
Example
try:
...
except client.exceptions.InvalidFileSystemException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
The JOBID was missing, not found, or not associated with the AWS account.
Example
try:
...
except client.exceptions.InvalidJobIdException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
One or more manifest fields was invalid. Please correct and resubmit.
Example
try:
...
except client.exceptions.InvalidManifestFieldException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
One or more parameters had an invalid value.
Example
try:
...
except client.exceptions.InvalidParameterException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
The client tool version is invalid.
Example
try:
...
except client.exceptions.InvalidVersionException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
Your manifest is not well-formed.
Example
try:
...
except client.exceptions.MalformedManifestException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
One or more required customs parameters was missing from the manifest.
Example
try:
...
except client.exceptions.MissingCustomsException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
One or more required fields were missing from the manifest file. Please correct and resubmit.
Example
try:
...
except client.exceptions.MissingManifestFieldException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
One or more required parameters was missing from the request.
Example
try:
...
except client.exceptions.MissingParameterException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
Your manifest file contained buckets from multiple regions. A job is restricted to buckets from one region. Please correct and resubmit.
Example
try:
...
except client.exceptions.MultipleRegionsException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
The specified bucket does not exist. Create the specified bucket or change the manifest's bucket, exportBucket, or logBucket field to a bucket that the account, as specified by the manifest's Access Key ID, has write permissions to.
Example
try:
...
except client.exceptions.NoSuchBucketException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
AWS Import/Export cannot cancel the job
Example
try:
...
except client.exceptions.UnableToCancelJobIdException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
AWS Import/Export cannot update the job
Example
try:
...
except client.exceptions.UnableToUpdateJobIdException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
The available paginators are:
paginator = client.get_paginator('list_jobs')
Creates an iterator that will paginate through responses from ImportExport.Client.list_jobs().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
APIVersion='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
{
'Jobs': [
{
'JobId': 'string',
'CreationDate': datetime(2015, 1, 1),
'IsCanceled': True|False,
'JobType': 'Import'|'Export'
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) -- Output structure for the ListJobs operation.
Jobs (list) -- A list container for Jobs returned by the ListJobs operation.
IsTruncated (boolean) -- Indicates whether the list of jobs was truncated. If true, then call ListJobs again using the last JobId element as the marker.
NextToken (string) --
A token to resume pagination.