imagebuilder / Client / list_images

list_images#

imagebuilder.Client.list_images(**kwargs)#

Returns the list of images that you have access to. Newly created images can take up to two minutes to appear in the ListImages API Results.

See also: AWS API Documentation

Request Syntax

response = client.list_images(
    owner='Self'|'Shared'|'Amazon'|'ThirdParty',
    filters=[
        {
            'name': 'string',
            'values': [
                'string',
            ]
        },
    ],
    byName=True|False,
    maxResults=123,
    nextToken='string',
    includeDeprecated=True|False
)
Parameters:
  • owner (string) – The owner defines which images you want to list. By default, this request will only show images owned by your account. You can use this field to specify if you want to view images owned by yourself, by Amazon, or those images that have been shared with you by other customers.

  • filters (list) –

    Use the following filters to streamline results:

    • name

    • osVersion

    • platform

    • type

    • version

    • (dict) –

      A filter name and value pair that is used to return a more specific list of results from a list operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs.

      • name (string) –

        The name of the filter. Filter names are case-sensitive.

      • values (list) –

        The filter values. Filter values are case-sensitive.

        • (string) –

  • byName (boolean) – Requests a list of images with a specific recipe name.

  • maxResults (integer) – The maximum items to return in a request.

  • nextToken (string) – A token to specify where to start paginating. This is the nextToken from a previously truncated response.

  • includeDeprecated (boolean) – Includes deprecated images in the response list.

Return type:

dict

Returns:

Response Syntax

{
    'requestId': 'string',
    'imageVersionList': [
        {
            'arn': 'string',
            'name': 'string',
            'type': 'AMI'|'DOCKER',
            'version': 'string',
            'platform': 'Windows'|'Linux'|'macOS',
            'osVersion': 'string',
            'owner': 'string',
            'dateCreated': 'string',
            'buildType': 'USER_INITIATED'|'SCHEDULED'|'IMPORT',
            'imageSource': 'AMAZON_MANAGED'|'AWS_MARKETPLACE'|'IMPORTED'|'CUSTOM'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • requestId (string) –

      The request ID that uniquely identifies this request.

    • imageVersionList (list) –

      The list of image semantic versions.

      Note

      The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can assign values for the first three, and can filter on all of them.

      Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the most recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be wildcards.

      • (dict) –

        The defining characteristics of a specific version of an Image Builder image.

        • arn (string) –

          The Amazon Resource Name (ARN) of a specific version of an Image Builder image.

          Note

          Semantic versioning is included in each object’s Amazon Resource Name (ARN), at the level that applies to that object as follows:

          • Versionless ARNs and Name ARNs do not include specific values in any of the nodes. The nodes are either left off entirely, or they are specified as wildcards, for example: x.x.x.

          • Version ARNs have only the first three nodes: <major>.<minor>.<patch>

          • Build version ARNs have all four nodes, and point to a specific build for a specific version of an object.

        • name (string) –

          The name of this specific version of an Image Builder image.

        • type (string) –

          Specifies whether this image produces an AMI or a container image.

        • version (string) –

          Details for a specific version of an Image Builder image. This version follows the semantic version syntax.

          Note

          The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can assign values for the first three, and can filter on all of them.

          Assignment: For the first three nodes you can assign any positive integer value, including zero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the fourth node.

          Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as 2021.01.01.

          Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the most recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be wildcards.

        • platform (string) –

          The operating system platform of the image version, for example “Windows” or “Linux”.

        • osVersion (string) –

          The operating system version of the Amazon EC2 build instance. For example, Amazon Linux 2, Ubuntu 18, or Microsoft Windows Server 2019.

        • owner (string) –

          The owner of the image version.

        • dateCreated (string) –

          The date on which this specific version of the Image Builder image was created.

        • buildType (string) –

          Indicates the type of build that created this image. The build can be initiated in the following ways:

          • USER_INITIATED – A manual pipeline build request.

          • SCHEDULED – A pipeline build initiated by a cron expression in the Image Builder pipeline, or from EventBridge.

          • IMPORT – A VM import created the image to use as the base image for the recipe.

        • imageSource (string) –

          The origin of the base image that Image Builder used to build this image.

    • nextToken (string) –

      The next token used for paginated responses. When this field isn’t empty, there are additional elements that the service hasn’t included in this request. Use this token with the next request to retrieve additional objects.

Exceptions

  • imagebuilder.Client.exceptions.ServiceException

  • imagebuilder.Client.exceptions.ClientException

  • imagebuilder.Client.exceptions.ServiceUnavailableException

  • imagebuilder.Client.exceptions.InvalidRequestException

  • imagebuilder.Client.exceptions.InvalidPaginationTokenException

  • imagebuilder.Client.exceptions.ForbiddenException

  • imagebuilder.Client.exceptions.CallRateLimitExceededException