UpdateEndpointWeightsAndCapacities
Source:
src/AWS/SageMaker/UpdateEndpointWeightsAndCapacities.ts
Runtime binding for sagemaker:UpdateEndpointWeightsAndCapacities — shift
traffic between an endpoint’s production variants (or resize one variant)
without redeploying.
Bind this operation to an Endpoint inside a function runtime to get a
callable that automatically injects the endpoint name. Only applies to
instance-based variants (serverless variants have no weights/capacities);
the endpoint transitions through Updating back to InService.
Shifting Traffic
Section titled “Shifting Traffic”// initconst updateWeights = yield* AWS.SageMaker.UpdateEndpointWeightsAndCapacities(endpoint);
// runtimeyield* updateWeights({ DesiredWeightsAndCapacities: [ { VariantName: "Blue", DesiredWeight: 9 }, { VariantName: "Green", DesiredWeight: 1 }, ],});