Skip to content

extend_training_plan async

extend_training_plan(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    training_plan_extension_offering_id: Optional[
        TrainingPlanExtensionOfferingId
    ] = None,
) -> ExtendTrainingPlanResponse

Extends an existing training plan by purchasing an extension offering. This allows you to add additional compute capacity time to your training plan without creating a new plan or reconfiguring your workloads.

To find available extension offerings, use the SearchTrainingPlanOfferings API with the TrainingPlanArn parameter.

To view the history of extensions for a training plan, use the DescribeTrainingPlanExtensionHistory API.

Parameters:

  • training_plan_extension_offering_id (Optional[TrainingPlanExtensionOfferingId], default: None ) –

    The unique identifier of the extension offering to purchase. You can retrieve this ID from the TrainingPlanExtensionOfferings in the response of the SearchTrainingPlanOfferings API.

Raises:

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def extend_training_plan(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    training_plan_extension_offering_id: Optional[
        "capo_sagemaker.types.training_plan_extension_offering_id.TrainingPlanExtensionOfferingId"
    ] = None,
) -> (
    "capo_sagemaker.types.extend_training_plan_response.ExtendTrainingPlanResponse"
):
    """<p>Extends an existing training plan by purchasing an extension offering. This allows you to add additional compute capacity time to your training plan without creating a new plan or reconfiguring your workloads.</p> <p>To find available extension offerings, use the <code> <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_SearchTrainingPlanOfferings.html">SearchTrainingPlanOfferings</a> </code> API with the <code>TrainingPlanArn</code> parameter.</p> <p>To view the history of extensions for a training plan, use the <code> <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeTrainingPlanExtensionHistory.html">DescribeTrainingPlanExtensionHistory</a> </code> API.</p>

    Args:
        training_plan_extension_offering_id: <p>The unique identifier of the extension offering to purchase. You can retrieve this ID from the <code>TrainingPlanExtensionOfferings</code> in the response of the <code>SearchTrainingPlanOfferings</code> API.</p>

    Raises:
        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.extend_training_plan_request.ExtendTrainingPlanRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.extend_training_plan_response.ExtendTrainingPlanResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.extend_training_plan

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.extend_training_plan.async_extend_training_plan(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ExtendTrainingPlan")
    )
    input_: capo_sagemaker.types.extend_training_plan_request.ExtendTrainingPlanRequest = {}
    if training_plan_extension_offering_id is not None:
        input_["training_plan_extension_offering_id"] = (
            training_plan_extension_offering_id
        )

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output