StopModelCommand

Stops the hosting of a running model. The operation might take a while to complete. To check the current status, call DescribeModel.

After the model hosting stops, the Status of the model is TRAINED.

This operation requires permissions to perform the lookoutvision:StopModel operation.

Example Syntax

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

import { LookoutVisionClient, StopModelCommand } from "@aws-sdk/client-lookoutvision"; // ES Modules import
// const { LookoutVisionClient, StopModelCommand } = require("@aws-sdk/client-lookoutvision"); // CommonJS import
const client = new LookoutVisionClient(config);
const input = { // StopModelRequest
  ProjectName: "STRING_VALUE", // required
  ModelVersion: "STRING_VALUE", // required
  ClientToken: "STRING_VALUE",
};
const command = new StopModelCommand(input);
const response = await client.send(command);
// { // StopModelResponse
//   Status: "STARTING_HOSTING" || "HOSTED" || "HOSTING_FAILED" || "STOPPING_HOSTING" || "SYSTEM_UPDATING",
// };

StopModelCommand Input

See StopModelCommandInput for more details

Parameter
Type
Description
ModelVersion
Required
string | undefined

The version of the model that you want to stop.

ProjectName
Required
string | undefined

The name of the project that contains the model that you want to stop.

ClientToken
string | undefined

ClientToken is an idempotency token that ensures a call to StopModel completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from StopModel. In this case, safely retry your call to StopModel by using the same ClientToken parameter value.

If you don't supply a value for ClientToken, the AWS SDK you are using inserts a value for you. This prevents retries after a network error from making multiple stop requests. You'll need to provide your own value for other use cases.

An error occurs if the other input parameters are not the same as in the first request. Using a different value for ClientToken is considered a new call to StopModel. An idempotency token is active for 8 hours.

StopModelCommand Output

See StopModelCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Status
ModelHostingStatus | undefined

The status of the model.

Throws

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.