Using the Job Management API
The job management API (JMAPI) provides programmatic access to the same functionality available in the Amazon Snow Family Management Console. This enables you to automate job functionality. By using the JMAPI, you can see the job status, create jobs, download the manifest file, unlock code, and view job completion reports. Because the calls are made through the API, you can integrate these calls into a custom application or web front end.
Common Uses of JMAPI
-
Automating ordering of Snowcone devices
-
Downloading the manifest file
-
Downloading the unlock file
-
Listing out the current Snowcone jobs
-
Downloading the Snowcone job completion report
JMAPI Required Strings
When placing an order through the job management API, you use the following required parameters, which are shown with examples.
--job-type --resources --address-id --region --role-arn --kms-key-arn --shipping-option --device-type --description
JMAPI Endpoints
API Endpoint
To make calls to each endpoint, the format is
snowballEdge.
. Following
are some examples to help you understand the breakdown of the endpoint. region
.amazonaws.com
Region | Endpoint |
---|---|
US East (N. Virginia) | snowball.us-east-1.amazonaws.com |
US West (Oregon) | snowball.us-west-2.amazonaws.com |
JMAPI CLI Commands
Job Management CLI
The following are the CLI calls that you can make against the job management API.
Command | Example |
---|---|
Listing Jobs | aws snowball list-jobs |
Describe Job | aws snowball describe-job --job-id |
Describe Address | aws snowball describe-address --address-id |
Create Address | aws snowball create-address --cli-input-json file://create-address.json |
Create Job | aws snowball create-job --cli-input-json file://create-job.json |
Cancel Job | aws snowball cancel-job --job-id |
Examples
The following are examples of commands using the job management API.
KMS JSON Example
The following JSON example is a properly formatted JSON file for using the Amazon KMS policy file.
{ "KeyMetadata": { "Origin": "AWS_KMS", "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab", "Description": "", "KeyManager": "CUSTOMER", "Enabled": true, "KeyUsage": "ENCRYPT_DECRYPT", "KeyState": "Enabled", "CreationDate": 1502910355.475, "Arn": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", "AWSAccountId": "111122223333" } }
Create Address Example
The following examples show you how you would format the command to create your address and what the response is when it is successful.
aws snowball create-address --address "Name=Bob,Company=AWS,Street1=1234 Fake St.,City=All,StateOrProvince=Any,Country=US,PostalCode=12345,PhoneNumber=1234567890"
Example Output
{ "AddressId": "ADID3be640c8-1111-1111-1111-917f201ffa42" }
Create Job Example
The following command shows you an example command for running the create-job
command.
aws snowball create-job --job-type
IMPORT
--resourcesfile://path/to/resources.json
--address-idADID3be640c8-1111-1111-1111-917f201ffa42
--regionus-east-1
--role-arnarn:aws:iam::123456789123:role/example_role
--kms-key-arnarn:aws:kms:us-west-2:000000000000:key/Example
--snowball-capacity-preferenceT14
--device-configurationfile://path/to/configuration.json
--shipping-optionSECOND_DAY
--snowball-typeSNC1_SSD
The above create-job
command will create an import job in us-east-1
region with a SNC1_SSD type snowcone device having T14 capacity preference with a
SECOND_DAY shipping option.