ListModelImportJobsCommand

Returns a list of import jobs you've submitted. You can filter the results to return based on one or more criteria. For more information, see Import a customized model  in the Amazon Bedrock User Guide .

Example Syntax

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

import { BedrockClient, ListModelImportJobsCommand } from "@aws-sdk/client-bedrock"; // ES Modules import
// const { BedrockClient, ListModelImportJobsCommand } = require("@aws-sdk/client-bedrock"); // CommonJS import
const client = new BedrockClient(config);
const input = { // ListModelImportJobsRequest
  creationTimeAfter: new Date("TIMESTAMP"),
  creationTimeBefore: new Date("TIMESTAMP"),
  statusEquals: "InProgress" || "Completed" || "Failed",
  nameContains: "STRING_VALUE",
  maxResults: Number("int"),
  nextToken: "STRING_VALUE",
  sortBy: "CreationTime",
  sortOrder: "Ascending" || "Descending",
};
const command = new ListModelImportJobsCommand(input);
const response = await client.send(command);
// { // ListModelImportJobsResponse
//   nextToken: "STRING_VALUE",
//   modelImportJobSummaries: [ // ModelImportJobSummaries
//     { // ModelImportJobSummary
//       jobArn: "STRING_VALUE", // required
//       jobName: "STRING_VALUE", // required
//       status: "InProgress" || "Completed" || "Failed", // required
//       lastModifiedTime: new Date("TIMESTAMP"),
//       creationTime: new Date("TIMESTAMP"), // required
//       endTime: new Date("TIMESTAMP"),
//       importedModelArn: "STRING_VALUE",
//       importedModelName: "STRING_VALUE",
//     },
//   ],
// };

ListModelImportJobsCommand Input

See ListModelImportJobsCommandInput for more details

Parameter
Type
Description
creationTimeAfter
Date | undefined

Return import jobs that were created after the specified time.

creationTimeBefore
Date | undefined

Return import jobs that were created before the specified time.

maxResults
number | undefined

The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

nameContains
string | undefined

Return imported jobs only if the job name contains these characters.

nextToken
string | undefined

If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

sortBy
SortJobsBy | undefined

The field to sort by in the returned list of imported jobs.

sortOrder
SortOrder | undefined

Specifies whether to sort the results in ascending or descending order.

statusEquals
ModelImportJobStatus | undefined

Return imported jobs with the specified status.

ListModelImportJobsCommand Output

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

Import job summaries.

nextToken
string | undefined

If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

Throws

Name
Fault
Details
AccessDeniedException
client

The request is denied because of missing access permissions.

InternalServerException
server

An internal server error occurred. Retry your request.

ThrottlingException
client

The number of requests exceeds the limit. Resubmit your request later.

ValidationException
client

Input validation failed. Check your request parameters and retry the request.

BedrockServiceException
Base exception class for all service exceptions from Bedrock service.