Skip to content

describe_training_job async

describe_training_job(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    training_job_name: Optional[TrainingJobName] = None,
) -> DescribeTrainingJobResponse

Returns information about a training job.

Some of the attributes below only appear if the training job successfully starts. If the training job fails, TrainingJobStatus is Failed and, depending on the FailureReason, attributes like TrainingStartTime, TrainingTimeInSeconds, TrainingEndTime, and BillableTimeInSeconds may not be present in the response.

Parameters:

Raises:

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def describe_training_job(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    training_job_name: Optional[
        "capo_sagemaker.types.training_job_name.TrainingJobName"
    ] = None,
) -> "capo_sagemaker.types.describe_training_job_response.DescribeTrainingJobResponse":
    """<p>Returns information about a training job. </p> <p>Some of the attributes below only appear if the training job successfully starts. If the training job fails, <code>TrainingJobStatus</code> is <code>Failed</code> and, depending on the <code>FailureReason</code>, attributes like <code>TrainingStartTime</code>, <code>TrainingTimeInSeconds</code>, <code>TrainingEndTime</code>, and <code>BillableTimeInSeconds</code> may not be present in the response.</p>

    Args:
        training_job_name: <p>The name of the training job.</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.describe_training_job_request.DescribeTrainingJobRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.describe_training_job_response.DescribeTrainingJobResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.describe_training_job

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeTrainingJob")
    )
    input_: capo_sagemaker.types.describe_training_job_request.DescribeTrainingJobRequest = {}
    if training_job_name is not None:
        input_["training_job_name"] = training_job_name

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