Inspector2 / Client / get_clusters_for_image

get_clusters_for_image

Inspector2.Client.get_clusters_for_image(**kwargs)

Returns a list of clusters and metadata associated with an image.

See also: AWS API Documentation

Request Syntax

response = client.get_clusters_for_image(
    filter={
        'resourceId': 'string'
    },
    maxResults=123,
    nextToken='string'
)
Parameters:
  • filter (dict) –

    [REQUIRED]

    The resource Id for the Amazon ECR image.

    • resourceId (string) – [REQUIRED]

      The resource Id to be used in the filter criteria.

  • maxResults (integer) – The maximum number of results to be returned in a single page of results.

  • nextToken (string) – The pagination token from a previous request used to retrieve the next page of results.

Return type:

dict

Returns:

Response Syntax

{
    'cluster': [
        {
            'clusterArn': 'string',
            'clusterDetails': [
                {
                    'clusterMetadata': {
                        'awsEcsMetadataDetails': {
                            'detailsGroup': 'string',
                            'taskDefinitionArn': 'string'
                        },
                        'awsEksMetadataDetails': {
                            'namespace': 'string',
                            'workloadInfoList': [
                                {
                                    'name': 'string',
                                    'type': 'string'
                                },
                            ]
                        }
                    },
                    'lastInUse': datetime(2015, 1, 1),
                    'runningUnitCount': 123,
                    'stoppedUnitCount': 123
                },
            ]
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • cluster (list) –

      A unit of work inside of a cluster, which can include metadata about the cluster.

      • (dict) –

        Information about the cluster.

        • clusterArn (string) –

          The cluster ARN.

        • clusterDetails (list) –

          Details about the cluster.

          • (dict) –

            Details about the task or pod in the cluster.

            • clusterMetadata (dict) –

              The metadata for a cluster.

              Note

              This is a Tagged Union structure. Only one of the following top level keys will be set: awsEcsMetadataDetails, awsEksMetadataDetails. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

              'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
              
              • awsEcsMetadataDetails (dict) –

                The details for an Amazon ECS cluster in the cluster metadata.

                • detailsGroup (string) –

                  The details group information for a task in a cluster.

                • taskDefinitionArn (string) –

                  The task definition ARN.

              • awsEksMetadataDetails (dict) –

                The details for an Amazon EKS cluster in the cluster metadata.

                • namespace (string) –

                  The namespace for an Amazon EKS cluster.

                • workloadInfoList (list) –

                  The list of workloads.

                  • (dict) –

                    Information about the workload.

                    • name (string) –

                      The name of the workload.

                    • type (string) –

                      The workload type.

            • lastInUse (datetime) –

              The last timestamp when Amazon Inspector recorded the image in use in the task or pod in the cluster.

            • runningUnitCount (integer) –

              The number of tasks or pods where an image was running on the cluster.

            • stoppedUnitCount (integer) –

              The number of tasks or pods where an image was stopped on the cluster in the last 24 hours.

    • nextToken (string) –

      The pagination token from a previous request used to retrieve the next page of results.

Exceptions