Retrieves the current status and result of a previously submitted training operation. Poll this operation until the status reaches a terminal state (Completed, Failed, or Skipped).
Parameters:
-
training_session_name
(TrainingSessionName)
–
The name of the training session that owns the operation.
-
operation_id
(OperationId)
–
The unique identifier of the operation to retrieve, returned by ExecuteTrainingOperation.
Raises:
-
InternalServerException
–
An internal service error occurred. Retry the request using exponential backoff.
-
ResourceNotFoundException
–
The specified training session or operation does not exist, or the operation does not belong to the specified training session.
-
ThrottlingException
–
The request was throttled. Retry the request after a brief wait using exponential backoff.
-
ValidationException
–
The request is not valid. Check the request syntax and parameters. Examples include invalid sequence numbers, malformed client tokens, missing required fields, or invalid operation configuration.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
Get the result of a training operation
Retrieves the status and result of a training operation submitted with ExecuteTrainingOperation.
>>> await client.get_training_operation_result(training_session_name='my-training-session', operation_id='a1b2c3d4-5678-90ab-cdef-1234567890ab')
Source code in docs_src/capo_sagemakertrainingsessionruntime/_services/async_sage_maker_training_session_runtime.py
| async def get_training_operation_result(
self,
training_session_name: "capo_sagemakertrainingsessionruntime.types.training_session_name.TrainingSessionName",
operation_id: "capo_sagemakertrainingsessionruntime.types.operation_id.OperationId",
*,
config_overrides: Optional[
AsyncSageMakerTrainingSessionRuntimeClientConfig
] = None,
) -> "capo_sagemakertrainingsessionruntime.types.get_training_operation_result_output.GetTrainingOperationResultOutput":
"""<p>Retrieves the current status and result of a previously submitted training operation. Poll this operation until the status reaches a terminal state (Completed, Failed, or Skipped).</p>
Args:
training_session_name: <p>The name of the training session that owns the operation.</p>
operation_id: <p>The unique identifier of the operation to retrieve, returned by <code>ExecuteTrainingOperation</code>.</p>
Raises:
capo_sagemakertrainingsessionruntime.errors.internal_server_exception.InternalServerException: <p>An internal service error occurred. Retry the request using exponential backoff.</p>
capo_sagemakertrainingsessionruntime.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified training session or operation does not exist, or the operation does not belong to the specified training session.</p>
capo_sagemakertrainingsessionruntime.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Retry the request after a brief wait using exponential backoff.</p>
capo_sagemakertrainingsessionruntime.errors.validation_exception.ValidationException: <p>The request is not valid. Check the request syntax and parameters. Examples include invalid sequence numbers, malformed client tokens, missing required fields, or invalid operation configuration.</p>
capo_sagemakertrainingsessionruntime.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Get the result of a training operation
Retrieves the status and result of a training operation submitted with ExecuteTrainingOperation.
>>> await client.get_training_operation_result(training_session_name='my-training-session', operation_id='a1b2c3d4-5678-90ab-cdef-1234567890ab')
"""
async def _handler(
req: "AsyncOperationRequest[capo_sagemakertrainingsessionruntime.types.get_training_operation_result_input.GetTrainingOperationResultInput]",
) -> AsyncOperationResponse[
"capo_sagemakertrainingsessionruntime.types.get_training_operation_result_output.GetTrainingOperationResultOutput"
]:
import capo_sagemakertrainingsessionruntime._operations.lego_router_service.get_training_operation_result
(
output,
http_response,
) = await capo_sagemakertrainingsessionruntime._operations.lego_router_service.get_training_operation_result.async_get_training_operation_result(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetTrainingOperationResult")
)
input_: capo_sagemakertrainingsessionruntime.types.get_training_operation_result_input.GetTrainingOperationResultInput = {
"training_session_name": training_session_name,
"operation_id": operation_id,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|