updateEndpointWeightsAndCapacities method
Updates variant weight of one or more variants associated with an existing
endpoint, or capacity of one variant associated with an existing endpoint.
When it receives the request, SageMaker sets the endpoint status to
Updating. After updating the endpoint, it sets the status to
InService. To check the status of an endpoint, use the DescribeEndpoint
API.
May throw ResourceLimitExceeded.
Parameter desiredWeightsAndCapacities :
An object that provides new capacity and weight values for a variant.
Parameter endpointName :
The name of an existing SageMaker endpoint.
Implementation
Future<UpdateEndpointWeightsAndCapacitiesOutput>
updateEndpointWeightsAndCapacities({
required List<DesiredWeightAndCapacity> desiredWeightsAndCapacities,
required String endpointName,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'SageMaker.UpdateEndpointWeightsAndCapacities'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DesiredWeightsAndCapacities': desiredWeightsAndCapacities,
'EndpointName': endpointName,
},
);
return UpdateEndpointWeightsAndCapacitiesOutput.fromJson(jsonResponse.body);
}