Skip to content

list_training_plans

list_training_plans(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    start_time_after: Optional[Timestamp] = None,
    start_time_before: Optional[Timestamp] = None,
    sort_by: Optional[TrainingPlanSortBy] = None,
    sort_order: Optional[TrainingPlanSortOrder] = None,
    filters: Optional[TrainingPlanFilters] = None,
) -> ListTrainingPlansResponse

Retrieves a list of training plans for the current account.

Parameters:

  • next_token (Optional[NextToken], default: None ) –

    A token to continue pagination if more results are available.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return in the response.

  • start_time_after (Optional[Timestamp], default: None ) –

    Filter to list only training plans with an actual start time after this date.

  • start_time_before (Optional[Timestamp], default: None ) –

    Filter to list only training plans with an actual start time before this date.

  • sort_by (Optional[TrainingPlanSortBy], default: None ) –

    The training plan field to sort the results by (e.g., StartTime, Status).

  • sort_order (Optional[TrainingPlanSortOrder], default: None ) –

    The order to sort the results (Ascending or Descending).

  • filters (Optional[TrainingPlanFilters], default: None ) –

    Additional filters to apply to the list of training plans.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def list_training_plans(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    next_token: Optional["capo_sagemaker.types.next_token.NextToken"] = None,
    max_results: Optional["capo_sagemaker.types.max_results.MaxResults"] = None,
    start_time_after: Optional["capo_sagemaker.types.timestamp.Timestamp"] = None,
    start_time_before: Optional["capo_sagemaker.types.timestamp.Timestamp"] = None,
    sort_by: Optional[
        "capo_sagemaker.types.training_plan_sort_by.TrainingPlanSortBy"
    ] = None,
    sort_order: Optional[
        "capo_sagemaker.types.training_plan_sort_order.TrainingPlanSortOrder"
    ] = None,
    filters: Optional[
        "capo_sagemaker.types.training_plan_filters.TrainingPlanFilters"
    ] = None,
) -> "capo_sagemaker.types.list_training_plans_response.ListTrainingPlansResponse":
    """<p>Retrieves a list of training plans for the current account. </p>

    Args:
        next_token: <p>A token to continue pagination if more results are available.</p>
        max_results: <p>The maximum number of results to return in the response.</p>
        start_time_after: <p>Filter to list only training plans with an actual start time after this date.</p>
        start_time_before: <p>Filter to list only training plans with an actual start time before this date.</p>
        sort_by: <p>The training plan field to sort the results by (e.g., StartTime, Status).</p>
        sort_order: <p>The order to sort the results (Ascending or Descending).</p>
        filters: <p>Additional filters to apply to the list of training plans.</p>

    Raises:
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.list_training_plans_request.ListTrainingPlansRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.list_training_plans_response.ListTrainingPlansResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.list_training_plans

        output, http_response = (
            capo_sagemaker._operations.sage_maker.list_training_plans.list_training_plans(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListTrainingPlans")
    )
    input_: capo_sagemaker.types.list_training_plans_request.ListTrainingPlansRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if start_time_after is not None:
        input_["start_time_after"] = start_time_after
    if start_time_before is not None:
        input_["start_time_before"] = start_time_before
    if sort_by is not None:
        input_["sort_by"] = sort_by
    if sort_order is not None:
        input_["sort_order"] = sort_order
    if filters is not None:
        input_["filters"] = filters

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output