SageMaker / Client / list_models

list_models#

SageMaker.Client.list_models(**kwargs)#

Lists models created with the CreateModel API.

See also: AWS API Documentation

Request Syntax

response = client.list_models(
    SortBy='Name'|'CreationTime',
    SortOrder='Ascending'|'Descending',
    NextToken='string',
    MaxResults=123,
    NameContains='string',
    CreationTimeBefore=datetime(2015, 1, 1),
    CreationTimeAfter=datetime(2015, 1, 1)
)
Parameters:
  • SortBy (string) – Sorts the list of results. The default is CreationTime.

  • SortOrder (string) – The sort order for results. The default is Descending.

  • NextToken (string) – If the response to a previous ListModels request was truncated, the response includes a NextToken. To retrieve the next set of models, use the token in the next request.

  • MaxResults (integer) – The maximum number of models to return in the response.

  • NameContains (string) – A string in the model name. This filter returns only models whose name contains the specified string.

  • CreationTimeBefore (datetime) – A filter that returns only models created before the specified time (timestamp).

  • CreationTimeAfter (datetime) – A filter that returns only models with a creation time greater than or equal to the specified time (timestamp).

Return type:

dict

Returns:

Response Syntax

{
    'Models': [
        {
            'ModelName': 'string',
            'ModelArn': 'string',
            'CreationTime': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • Models (list) –

      An array of ModelSummary objects, each of which lists a model.

      • (dict) –

        Provides summary information about a model.

        • ModelName (string) –

          The name of the model that you want a summary for.

        • ModelArn (string) –

          The Amazon Resource Name (ARN) of the model.

        • CreationTime (datetime) –

          A timestamp that indicates when the model was created.

    • NextToken (string) –

      If the response is truncated, SageMaker returns this token. To retrieve the next set of models, use it in the subsequent request.