- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ListModelsCommand
Lists the versions of a model in an Amazon Lookout for Vision project.
The ListModels
operation is eventually consistent. Recent calls to CreateModel
might take a while to appear in the response from ListProjects
.
This operation requires permissions to perform the lookoutvision:ListModels
operation.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { LookoutVisionClient, ListModelsCommand } from "@aws-sdk/client-lookoutvision"; // ES Modules import
// const { LookoutVisionClient, ListModelsCommand } = require("@aws-sdk/client-lookoutvision"); // CommonJS import
const client = new LookoutVisionClient(config);
const input = { // ListModelsRequest
ProjectName: "STRING_VALUE", // required
NextToken: "STRING_VALUE",
MaxResults: Number("int"),
};
const command = new ListModelsCommand(input);
const response = await client.send(command);
// { // ListModelsResponse
// Models: [ // ModelMetadataList
// { // ModelMetadata
// CreationTimestamp: new Date("TIMESTAMP"),
// ModelVersion: "STRING_VALUE",
// ModelArn: "STRING_VALUE",
// Description: "STRING_VALUE",
// Status: "TRAINING" || "TRAINED" || "TRAINING_FAILED" || "STARTING_HOSTING" || "HOSTED" || "HOSTING_FAILED" || "STOPPING_HOSTING" || "SYSTEM_UPDATING" || "DELETING",
// StatusMessage: "STRING_VALUE",
// Performance: { // ModelPerformance
// F1Score: Number("float"),
// Recall: Number("float"),
// Precision: Number("float"),
// },
// },
// ],
// NextToken: "STRING_VALUE",
// };
ListModelsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
ProjectName Required | string | undefined | The name of the project that contains the model versions that you want to list. |
MaxResults | number | undefined | The maximum number of results to return per paginated call. The largest value you can specify is 100. If you specify a value greater than 100, a ValidationException error occurs. The default value is 100. |
NextToken | string | undefined | If the previous response was incomplete (because there is more data to retrieve), Amazon Lookout for Vision returns a pagination token in the response. You can use this pagination token to retrieve the next set of models. |
ListModelsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Models | ModelMetadata[] | undefined | A list of model versions in the specified project. |
NextToken | string | undefined | If the response is truncated, Amazon Lookout for Vision returns this token that you can use in the subsequent request to retrieve the next set of models. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You are not authorized to perform the action. |
ConflictException | client | The update or deletion of a resource caused an inconsistent state. |
InternalServerException | server | Amazon Lookout for Vision experienced a service issue. Try your call again. |
ResourceNotFoundException | client | The resource could not be found. |
ThrottlingException | client | Amazon Lookout for Vision is temporarily unable to process the request. Try your call again. |
ValidationException | client | An input validation error occured. For example, invalid characters in a project name, or if a pagination token is invalid. |
LookoutVisionServiceException | Base exception class for all service exceptions from LookoutVision service. |