Using the Job Management API - AWS Snowcone User Guide

Using the Job Management API

The job management API (JMAPI) provides programmatic access to the same functionality available in the AWS 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.region.amazonaws.com. Following are some examples to help you understand the breakdown of the endpoint.

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 [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 [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 AWS 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 --resources file://path/to/resources.json --address-id ADID3be640c8-1111-1111-1111-917f201ffa42 --region us-east-1 --role-arn arn:aws:iam::123456789123:role/example_role --kms-key-arn arn:aws:kms:us-west-2:000000000000:key/Example --snowball-capacity-preference T14 --device-configuration file://path/to/configuration.json --shipping-option SECOND_DAY --snowball-type SNC1_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.