Updates the routing targets of an inference router. The routing targets that you specify replace all of the router's existing routing targets. To change one routing target, call DescribeInferenceRouter, edit the routing targets, and send all of them.
The update is applied in full or not at all, and each request uses either the previous configuration or the new one. Updates typically take effect within about 2 minutes.
If the router is being created, updated, or deleted, or another request changes it at the same time, you get a ConflictException. Describe the router, and then send your update again.
Parameters:
-
inference_router_name
(Optional[InferenceRouterName], default:
None
)
–
The name of the inference router to update.
-
routing_targets
(Optional[RoutingTargetList], default:
None
)
–
The complete list of routing targets for the inference router. To remove the last routing target, delete the router.
Raises:
-
ConflictException
–
There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.
-
ResourceLimitExceeded
–
You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.
-
ResourceNotFound
–
Resource being access is not found.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
| async def update_inference_router(
self,
*,
config_overrides: Optional[AsyncSageMakerClientConfig] = None,
inference_router_name: Optional[
"capo_sagemaker.types.inference_router_name.InferenceRouterName"
] = None,
routing_targets: Optional[
"capo_sagemaker.types.routing_target_list.RoutingTargetList"
] = None,
) -> "capo_sagemaker.types.update_inference_router_output.UpdateInferenceRouterOutput":
"""<p>Updates the routing targets of an inference router. The routing targets that you specify replace all of the router's existing routing targets. To change one routing target, call <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeInferenceRouter.html">DescribeInferenceRouter</a>, edit the routing targets, and send all of them.</p> <p>The update is applied in full or not at all, and each request uses either the previous configuration or the new one. Updates typically take effect within about 2 minutes.</p> <p>If the router is being created, updated, or deleted, or another request changes it at the same time, you get a <code>ConflictException</code>. Describe the router, and then send your update again.</p>
Args:
inference_router_name: <p>The name of the inference router to update.</p>
routing_targets: <p>The complete list of routing targets for the inference router. To remove the last routing target, delete the router.</p>
Raises:
capo_sagemaker.errors.conflict_exception.ConflictException: <p>There was a conflict when you attempted to modify a SageMaker entity such as an <code>Experiment</code> or <code>Artifact</code>.</p>
capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_sagemaker.types.update_inference_router_input.UpdateInferenceRouterInput]",
) -> AsyncOperationResponse[
"capo_sagemaker.types.update_inference_router_output.UpdateInferenceRouterOutput"
]:
import capo_sagemaker._operations.sage_maker.update_inference_router
(
output,
http_response,
) = await capo_sagemaker._operations.sage_maker.update_inference_router.async_update_inference_router(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateInferenceRouter")
)
input_: capo_sagemaker.types.update_inference_router_input.UpdateInferenceRouterInput = {}
if inference_router_name is not None:
input_["inference_router_name"] = inference_router_name
if routing_targets is not None:
input_["routing_targets"] = routing_targets
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|