Skip to content

list_images

list_images(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    creation_time_after: Optional[Timestamp] = None,
    creation_time_before: Optional[Timestamp] = None,
    last_modified_time_after: Optional[Timestamp] = None,
    last_modified_time_before: Optional[Timestamp] = None,
    max_results: Optional[MaxResults] = None,
    name_contains: Optional[ImageNameContains] = None,
    next_token: Optional[NextToken] = None,
    sort_by: Optional[ImageSortBy] = None,
    sort_order: Optional[ImageSortOrder] = None,
) -> ListImagesResponse

Lists the images in your account and their properties. The list can be filtered by creation time or modified time, and whether the image name contains a specified string.

Parameters:

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

    A filter that returns only images created on or after the specified time.

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

    A filter that returns only images created on or before the specified time.

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

    A filter that returns only images modified on or after the specified time.

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

    A filter that returns only images modified on or before the specified time.

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

    The maximum number of images to return in the response. The default value is 10.

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

    A filter that returns only images whose name contains the specified string.

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

    If the previous call to ListImages didn't return the full set of images, the call returns a token for getting the next set of images.

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

    The property used to sort results. The default value is CREATION_TIME.

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

    The sort order. The default value is DESCENDING.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def list_images(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    creation_time_after: Optional[
        "capo_sagemaker.types.timestamp.Timestamp"
    ] = None,
    creation_time_before: Optional[
        "capo_sagemaker.types.timestamp.Timestamp"
    ] = None,
    last_modified_time_after: Optional[
        "capo_sagemaker.types.timestamp.Timestamp"
    ] = None,
    last_modified_time_before: Optional[
        "capo_sagemaker.types.timestamp.Timestamp"
    ] = None,
    max_results: Optional["capo_sagemaker.types.max_results.MaxResults"] = None,
    name_contains: Optional[
        "capo_sagemaker.types.image_name_contains.ImageNameContains"
    ] = None,
    next_token: Optional["capo_sagemaker.types.next_token.NextToken"] = None,
    sort_by: Optional["capo_sagemaker.types.image_sort_by.ImageSortBy"] = None,
    sort_order: Optional[
        "capo_sagemaker.types.image_sort_order.ImageSortOrder"
    ] = None,
) -> "capo_sagemaker.types.list_images_response.ListImagesResponse":
    """<p>Lists the images in your account and their properties. The list can be filtered by creation time or modified time, and whether the image name contains a specified string.</p>

    Args:
        creation_time_after: <p>A filter that returns only images created on or after the specified time.</p>
        creation_time_before: <p>A filter that returns only images created on or before the specified time.</p>
        last_modified_time_after: <p>A filter that returns only images modified on or after the specified time.</p>
        last_modified_time_before: <p>A filter that returns only images modified on or before the specified time.</p>
        max_results: <p>The maximum number of images to return in the response. The default value is 10. </p>
        name_contains: <p>A filter that returns only images whose name contains the specified string.</p>
        next_token: <p>If the previous call to <code>ListImages</code> didn't return the full set of images, the call returns a token for getting the next set of images.</p>
        sort_by: <p>The property used to sort results. The default value is <code>CREATION_TIME</code>.</p>
        sort_order: <p>The sort order. The default value is <code>DESCENDING</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_images_request.ListImagesRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.list_images_response.ListImagesResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.list_images

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListImages")
    )
    input_: capo_sagemaker.types.list_images_request.ListImagesRequest = {}
    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 last_modified_time_after is not None:
        input_["last_modified_time_after"] = last_modified_time_after
    if last_modified_time_before is not None:
        input_["last_modified_time_before"] = last_modified_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