Skip to content

describe_training_job

describe_training_job(
    *,
    config_overrides: Optional[SageMakerClientConfig] = 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/sage_maker.py
def describe_training_job(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = 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.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.describe_training_job_request.DescribeTrainingJobRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.describe_training_job_response.DescribeTrainingJobResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.describe_training_job

        output, http_response = (
            capo_sagemaker._operations.sage_maker.describe_training_job.describe_training_job(
                req.options, req.input
            )
        )
        return OperationResponse(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 = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output