ListJobsCommand

Returns an array of JobListEntry objects of the specified length. Each JobListEntry object contains a job's state, a job's ID, and a value that indicates whether the job is a job part, in the case of export jobs. Calling this API action in one of the US regions will return jobs from the list of all jobs associated with this account in all US regions.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { SnowballClient, ListJobsCommand } from "@aws-sdk/client-snowball"; // ES Modules import
// const { SnowballClient, ListJobsCommand } = require("@aws-sdk/client-snowball"); // CommonJS import
const client = new SnowballClient(config);
const input = { // ListJobsRequest
  MaxResults: Number("int"),
  NextToken: "STRING_VALUE",
};
const command = new ListJobsCommand(input);
const response = await client.send(command);
// { // ListJobsResult
//   JobListEntries: [ // JobListEntryList
//     { // JobListEntry
//       JobId: "STRING_VALUE",
//       JobState: "New" || "PreparingAppliance" || "PreparingShipment" || "InTransitToCustomer" || "WithCustomer" || "InTransitToAWS" || "WithAWSSortingFacility" || "WithAWS" || "InProgress" || "Complete" || "Cancelled" || "Listing" || "Pending",
//       IsMaster: true || false,
//       JobType: "IMPORT" || "EXPORT" || "LOCAL_USE",
//       SnowballType: "STANDARD" || "EDGE" || "EDGE_C" || "EDGE_CG" || "EDGE_S" || "SNC1_HDD" || "SNC1_SSD" || "V3_5C" || "V3_5S" || "RACK_5U_C",
//       CreationDate: new Date("TIMESTAMP"),
//       Description: "STRING_VALUE",
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

Example Usage

 Loading code editor

ListJobsCommand Input

See ListJobsCommandInput for more details

Parameter
Type
Description
MaxResults
number | undefined

The number of JobListEntry objects to return.

NextToken
string | undefined

HTTP requests are stateless. To identify what object comes "next" in the list of JobListEntry objects, you have the option of specifying NextToken as the starting point for your returned list.

ListJobsCommand Output

See ListJobsCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
JobListEntries
JobListEntry[] | undefined

Each JobListEntry object contains a job's state, a job's ID, and a value that indicates whether the job is a job part, in the case of export jobs.

NextToken
string | undefined

HTTP requests are stateless. If you use this automatically generated NextToken value in your next ListJobs call, your returned JobListEntry objects will start from this point in the array.

Throws

Name
Fault
Details
InvalidNextTokenException
client

The NextToken string was altered unexpectedly, and the operation has stopped. Run the operation without changing the NextToken string, and try again.

SnowballServiceException
Base exception class for all service exceptions from Snowball service.