Skip to content

list_algorithms

list_algorithms(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    creation_time_after: Optional[CreationTime] = None,
    creation_time_before: Optional[CreationTime] = None,
    max_results: Optional[MaxResults] = None,
    name_contains: Optional[NameContains] = None,
    next_token: Optional[NextToken] = None,
    sort_by: Optional[AlgorithmSortBy] = None,
    sort_order: Optional[SortOrder] = None,
) -> ListAlgorithmsOutput

Lists the machine learning algorithms that have been created.

Parameters:

  • creation_time_after (Optional[CreationTime], default: None ) –

    A filter that returns only algorithms created after the specified time (timestamp).

  • creation_time_before (Optional[CreationTime], default: None ) –

    A filter that returns only algorithms created before the specified time (timestamp).

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

    The maximum number of algorithms to return in the response.

  • name_contains (Optional[NameContains], default: None ) –

    A string in the algorithm name. This filter returns only algorithms whose name contains the specified string.

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

    If the response to a previous ListAlgorithms request was truncated, the response includes a NextToken. To retrieve the next set of algorithms, use the token in the next request.

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

    The parameter by which to sort the results. The default is CreationTime.

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

    The sort order for the results. The default is Ascending.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def list_algorithms(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    creation_time_after: Optional[
        "capo_sagemaker.types.creation_time.CreationTime"
    ] = None,
    creation_time_before: Optional[
        "capo_sagemaker.types.creation_time.CreationTime"
    ] = None,
    max_results: Optional["capo_sagemaker.types.max_results.MaxResults"] = None,
    name_contains: Optional[
        "capo_sagemaker.types.name_contains.NameContains"
    ] = None,
    next_token: Optional["capo_sagemaker.types.next_token.NextToken"] = None,
    sort_by: Optional[
        "capo_sagemaker.types.algorithm_sort_by.AlgorithmSortBy"
    ] = None,
    sort_order: Optional["capo_sagemaker.types.sort_order.SortOrder"] = None,
) -> "capo_sagemaker.types.list_algorithms_output.ListAlgorithmsOutput":
    """<p>Lists the machine learning algorithms that have been created.</p>

    Args:
        creation_time_after: <p>A filter that returns only algorithms created after the specified time (timestamp).</p>
        creation_time_before: <p>A filter that returns only algorithms created before the specified time (timestamp).</p>
        max_results: <p>The maximum number of algorithms to return in the response.</p>
        name_contains: <p>A string in the algorithm name. This filter returns only algorithms whose name contains the specified string.</p>
        next_token: <p>If the response to a previous <code>ListAlgorithms</code> request was truncated, the response includes a <code>NextToken</code>. To retrieve the next set of algorithms, use the token in the next request.</p>
        sort_by: <p>The parameter by which to sort the results. The default is <code>CreationTime</code>.</p>
        sort_order: <p>The sort order for the results. The default is <code>Ascending</code>.</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_algorithms_input.ListAlgorithmsInput]",
    ) -> OperationResponse[
        "capo_sagemaker.types.list_algorithms_output.ListAlgorithmsOutput"
    ]:
        import capo_sagemaker._operations.sage_maker.list_algorithms

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAlgorithms")
    )
    input_: capo_sagemaker.types.list_algorithms_input.ListAlgorithmsInput = {}
    if creation_time_after is not None:
        input_["creation_time_after"] = creation_time_after
    if creation_time_before is not None:
        input_["creation_time_before"] = creation_time_before
    if max_results is not None:
        input_["max_results"] = max_results
    if name_contains is not None:
        input_["name_contains"] = name_contains
    if next_token is not None:
        input_["next_token"] = next_token
    if sort_by is not None:
        input_["sort_by"] = sort_by
    if sort_order is not None:
        input_["sort_order"] = sort_order

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