diff --git a/.apigentools-info b/.apigentools-info index 011702c985..fa73d1a646 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2023-10-10 13:47:33.127844", - "spec_repo_commit": "afb48804" + "regenerated": "2023-10-11 16:56:08.901697", + "spec_repo_commit": "b9b5e0f4" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2023-10-10 13:47:33.153228", - "spec_repo_commit": "afb48804" + "regenerated": "2023-10-11 16:56:08.921177", + "spec_repo_commit": "b9b5e0f4" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2975fa2f44..14a3a3582a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -3441,6 +3441,279 @@ components: $ref: '#/components/schemas/ConfluentResourceResponseData' type: array type: object + ContainerImage: + description: Container Image object. + properties: + attributes: + $ref: '#/components/schemas/ContainerImageAttributes' + id: + description: Container Image ID. + type: string + type: + $ref: '#/components/schemas/ContainerImageType' + type: object + ContainerImageAttributes: + description: Attributes for a Container Image. + properties: + container_count: + description: Number of containers running the image. + format: int64 + type: integer + image_flavors: + description: 'List of platform-specific images associated with the image + record. + + The list contains more than 1 entry for multi-architecture images.' + items: + $ref: '#/components/schemas/ContainerImageFlavor' + type: array + image_tags: + description: List of image tags associated with the Container Image. + items: + description: An image tag associated with the Container Image. + type: string + type: array + images_built_at: + description: 'List of build times associated with the Container Image. + + The list contains more than 1 entry for multi-architecture images.' + items: + description: Time the platform-specific Container Image was built. + type: string + type: array + name: + description: Name of the Container Image. + type: string + os_architectures: + description: List of Operating System architectures supported by the Container + Image. + items: + description: Operating System architecture supported by the Container + Image. + example: amd64 + type: string + type: array + os_names: + description: List of Operating System names supported by the Container Image. + items: + description: Operating System supported by the Container Image. + example: linux + type: string + type: array + os_versions: + description: List of Operating System versions supported by the Container + Image. + items: + description: Operating System version supported by the Container Image. + type: string + type: array + published_at: + description: Time the image was pushed to the container registry. + type: string + registry: + description: Registry the Container Image was pushed to. + type: string + repo_digest: + description: Digest of the compressed image manifest. + type: string + repository: + description: Repository where the Container Image is stored in. + type: string + short_image: + description: Short version of the Container Image name. + type: string + sizes: + description: 'List of size for each platform-specific image associated with + the image record. + + The list contains more than 1 entry for multi-architecture images.' + items: + description: Size of the platform-specific Container Image. + format: int64 + type: integer + type: array + sources: + description: List of sources where the Container Image was collected from. + items: + description: Source where the Container Image was collected from. + type: string + type: array + tags: + description: List of tags associated with the Container Image. + items: + description: A tag associated with the Container Image. + type: string + type: array + vulnerability_count: + $ref: '#/components/schemas/ContainerImageVulnerabilities' + type: object + ContainerImageFlavor: + description: Container Image breakdown by supported platform. + properties: + built_at: + description: Time the platform-specific Container Image was built. + type: string + os_architecture: + description: Operating System architecture supported by the Container Image. + type: string + os_name: + description: Operating System name supported by the Container Image. + type: string + os_version: + description: Operating System version supported by the Container Image. + type: string + size: + description: Size of the platform-specific Container Image. + format: int64 + type: integer + type: object + ContainerImageGroup: + description: Container Image Group object. + properties: + attributes: + $ref: '#/components/schemas/ContainerImageGroupAttributes' + id: + description: Container Image Group ID. + type: string + relationships: + $ref: '#/components/schemas/ContainerImageGroupRelationships' + type: + $ref: '#/components/schemas/ContainerImageGroupType' + type: object + ContainerImageGroupAttributes: + description: Attributes for a Container Image Group. + properties: + count: + description: Number of Container Images in the group. + format: int64 + type: integer + name: + description: Name of the Container Image group. + type: string + tags: + description: Tags from the group name parsed in key/value format. + type: object + type: object + ContainerImageGroupRelationships: + description: Relationships to Container Images inside a Container Image Group. + properties: + links: + $ref: '#/components/schemas/ContainerImageGroupRelationshipsLinks' + type: object + ContainerImageGroupRelationshipsLinks: + description: Links attributes. + properties: + related: + description: Link to related Container Images. + type: string + type: object + ContainerImageGroupType: + default: container_image_group + description: Type of Container Image Group. + enum: + - container_image_group + example: container_image_group + type: string + x-enum-varnames: + - CONTAINER_IMAGE_GROUP + ContainerImageItem: + description: Possible Container Image models. + oneOf: + - $ref: '#/components/schemas/ContainerImage' + - $ref: '#/components/schemas/ContainerImageGroup' + ContainerImageMeta: + description: Response metadata object. + properties: + pagination: + $ref: '#/components/schemas/ContainerImageMetaPage' + type: object + ContainerImageMetaPage: + description: Paging attributes. + properties: + limit: + description: Number of results returned + format: int32 + maximum: 10000 + minimum: 0 + type: integer + next_cursor: + description: The cursor used to get the next results, if any. + type: string + total: + description: Total number of records that match the query. + format: int64 + type: integer + type: object + ContainerImageType: + default: container_image + description: Type of Container Image. + enum: + - container_image + example: container_image + type: string + x-enum-varnames: + - CONTAINER_IMAGE + ContainerImageVulnerabilities: + description: Vulnerability counts associated with the Container Image. + properties: + asset_id: + description: ID of the Container Image. + type: string + critical: + description: Number of vulnerabilities with CVSS Critical severity. + format: int64 + type: integer + high: + description: Number of vulnerabilities with CVSS High severity. + format: int64 + type: integer + low: + description: Number of vulnerabilities with CVSS Low severity. + format: int64 + type: integer + medium: + description: Number of vulnerabilities with CVSS Medium severity. + format: int64 + type: integer + none: + description: Number of vulnerabilities with CVSS None severity. + format: int64 + type: integer + unknown: + description: Number of vulnerabilities with an unknown CVSS severity. + format: int64 + type: integer + type: object + ContainerImagesResponse: + description: List of Container Images. + properties: + data: + description: Array of Container Image objects. + items: + $ref: '#/components/schemas/ContainerImageItem' + type: array + links: + $ref: '#/components/schemas/ContainerImagesResponseLinks' + meta: + $ref: '#/components/schemas/ContainerImageMeta' + type: object + ContainerImagesResponseLinks: + description: Pagination links. + properties: + first: + description: Link to the first page. + type: string + next: + description: Link to the next page. + type: string + prev: + description: Link to previous page. + nullable: true + type: string + self: + description: Link to current page. + type: string + type: object ContentEncoding: description: HTTP header used to compress the media-type. enum: @@ -19409,6 +19682,86 @@ paths: cursorPath: meta.page.after limitParam: body.page.limit resultsPath: data + /api/v2/container_images: + get: + description: Get all Container Images for your organization. + operationId: ListContainerImages + parameters: + - description: Comma-separated list of tags to filter Container Images by. + example: short_image:redis,status:running + in: query + name: filter[tags] + required: false + schema: + type: string + - description: Comma-separated list of tags to group Container Images by. + example: registry,image_tags + in: query + name: group_by + required: false + schema: + type: string + - description: Attribute to sort Container Images by. + example: container_count + in: query + name: sort + required: false + schema: + type: string + - description: Maximum number of results returned. + in: query + name: page[size] + required: false + schema: + default: 1000 + format: int32 + maximum: 10000 + minimum: 1 + type: integer + - description: 'String to query the next page of results. + + This key is provided with each valid response from the API in `meta.pagination.next_cursor`.' + in: query + name: page[cursor] + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ContainerImagesResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication Error + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Get all Container Images + tags: + - Container Images + x-pagination: + cursorParam: page[cursor] + cursorPath: meta.pagination.next_cursor + limitParam: page[size] + resultsPath: data + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/current_user/application_keys: get: description: List all application keys available for current user @@ -28960,6 +29313,9 @@ tags: - description: Configure your Datadog Confluent Cloud integration directly through the Datadog API. name: Confluent Cloud +- description: The Container Images API allows you to query Container Image data for + your organization. + name: Container Images - description: 'Interact with your dashboard lists through the API to organize, find, and share all of your dashboards with your team and diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index ea14d34bd3..51f468e367 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -57,6 +57,13 @@ confluent\_cloud\_api :members: :show-inheritance: +container\_images\_api +---------------------- + +.. automodule:: datadog_api_client.v2.api.container_images_api + :members: + :show-inheritance: + dashboard\_lists\_api --------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 9bb4a6b33f..5ce5ed8e4b 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -1240,6 +1240,111 @@ confluent\_resources\_response :members: :show-inheritance: +container\_image +---------------- + +.. automodule:: datadog_api_client.v2.model.container_image + :members: + :show-inheritance: + +container\_image\_attributes +---------------------------- + +.. automodule:: datadog_api_client.v2.model.container_image_attributes + :members: + :show-inheritance: + +container\_image\_flavor +------------------------ + +.. automodule:: datadog_api_client.v2.model.container_image_flavor + :members: + :show-inheritance: + +container\_image\_group +----------------------- + +.. automodule:: datadog_api_client.v2.model.container_image_group + :members: + :show-inheritance: + +container\_image\_group\_attributes +----------------------------------- + +.. automodule:: datadog_api_client.v2.model.container_image_group_attributes + :members: + :show-inheritance: + +container\_image\_group\_relationships +-------------------------------------- + +.. automodule:: datadog_api_client.v2.model.container_image_group_relationships + :members: + :show-inheritance: + +container\_image\_group\_relationships\_links +--------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.container_image_group_relationships_links + :members: + :show-inheritance: + +container\_image\_group\_type +----------------------------- + +.. automodule:: datadog_api_client.v2.model.container_image_group_type + :members: + :show-inheritance: + +container\_image\_item +---------------------- + +.. automodule:: datadog_api_client.v2.model.container_image_item + :members: + :show-inheritance: + +container\_image\_meta +---------------------- + +.. automodule:: datadog_api_client.v2.model.container_image_meta + :members: + :show-inheritance: + +container\_image\_meta\_page +---------------------------- + +.. automodule:: datadog_api_client.v2.model.container_image_meta_page + :members: + :show-inheritance: + +container\_image\_type +---------------------- + +.. automodule:: datadog_api_client.v2.model.container_image_type + :members: + :show-inheritance: + +container\_image\_vulnerabilities +--------------------------------- + +.. automodule:: datadog_api_client.v2.model.container_image_vulnerabilities + :members: + :show-inheritance: + +container\_images\_response +--------------------------- + +.. automodule:: datadog_api_client.v2.model.container_images_response + :members: + :show-inheritance: + +container\_images\_response\_links +---------------------------------- + +.. automodule:: datadog_api_client.v2.model.container_images_response_links + :members: + :show-inheritance: + content\_encoding ----------------- diff --git a/examples/v2/container-images/ListContainerImages.py b/examples/v2/container-images/ListContainerImages.py new file mode 100644 index 0000000000..f2afd0a802 --- /dev/null +++ b/examples/v2/container-images/ListContainerImages.py @@ -0,0 +1,14 @@ +""" +Get all Container Images returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.container_images_api import ContainerImagesApi + +configuration = Configuration() +configuration.unstable_operations["list_container_images"] = True +with ApiClient(configuration) as api_client: + api_instance = ContainerImagesApi(api_client) + response = api_instance.list_container_images() + + print(response) diff --git a/examples/v2/container-images/ListContainerImages_3088586393.py b/examples/v2/container-images/ListContainerImages_3088586393.py new file mode 100644 index 0000000000..5eb91e31d6 --- /dev/null +++ b/examples/v2/container-images/ListContainerImages_3088586393.py @@ -0,0 +1,16 @@ +""" +Get all Container Images returns "OK" response with pagination +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.container_images_api import ContainerImagesApi + +configuration = Configuration() +configuration.unstable_operations["list_container_images"] = True +with ApiClient(configuration) as api_client: + api_instance = ContainerImagesApi(api_client) + items = api_instance.list_container_images_with_pagination( + page_size=2, + ) + for item in items: + print(item) diff --git a/examples/v2/container-images/ListContainerImages_3974828736.py b/examples/v2/container-images/ListContainerImages_3974828736.py new file mode 100644 index 0000000000..8ec2a0a24f --- /dev/null +++ b/examples/v2/container-images/ListContainerImages_3974828736.py @@ -0,0 +1,16 @@ +""" +Get all Container Image groups returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.container_images_api import ContainerImagesApi + +configuration = Configuration() +configuration.unstable_operations["list_container_images"] = True +with ApiClient(configuration) as api_client: + api_instance = ContainerImagesApi(api_client) + response = api_instance.list_container_images( + group_by="short_image", + ) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index a3e06201d0..06beb2ca39 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -237,6 +237,7 @@ def __init__( self.unstable_operations = _UnstableOperations( { "v2.create_ci_app_pipeline_event": False, + "v2.list_container_images": False, "v2.list_events": False, "v2.search_events": False, "v2.create_incident": False, diff --git a/src/datadog_api_client/v2/api/container_images_api.py b/src/datadog_api_client/v2/api/container_images_api.py new file mode 100644 index 0000000000..499825edbf --- /dev/null +++ b/src/datadog_api_client/v2/api/container_images_api.py @@ -0,0 +1,176 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +import collections +from typing import Any, Dict, Union + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + set_attribute_from_path, + get_attribute_from_path, + UnsetType, + unset, +) +from datadog_api_client.v2.model.container_images_response import ContainerImagesResponse +from datadog_api_client.v2.model.container_image_item import ContainerImageItem + + +class ContainerImagesApi: + """ + The Container Images API allows you to query Container Image data for your organization. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._list_container_images_endpoint = _Endpoint( + settings={ + "response_type": (ContainerImagesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/container_images", + "operation_id": "list_container_images", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "filter_tags": { + "openapi_types": (str,), + "attribute": "filter[tags]", + "location": "query", + }, + "group_by": { + "openapi_types": (str,), + "attribute": "group_by", + "location": "query", + }, + "sort": { + "openapi_types": (str,), + "attribute": "sort", + "location": "query", + }, + "page_size": { + "validation": { + "inclusive_maximum": 10000, + "inclusive_minimum": 1, + }, + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + "page_cursor": { + "openapi_types": (str,), + "attribute": "page[cursor]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + def list_container_images( + self, + *, + filter_tags: Union[str, UnsetType] = unset, + group_by: Union[str, UnsetType] = unset, + sort: Union[str, UnsetType] = unset, + page_size: Union[int, UnsetType] = unset, + page_cursor: Union[str, UnsetType] = unset, + ) -> ContainerImagesResponse: + """Get all Container Images. + + Get all Container Images for your organization. + + :param filter_tags: Comma-separated list of tags to filter Container Images by. + :type filter_tags: str, optional + :param group_by: Comma-separated list of tags to group Container Images by. + :type group_by: str, optional + :param sort: Attribute to sort Container Images by. + :type sort: str, optional + :param page_size: Maximum number of results returned. + :type page_size: int, optional + :param page_cursor: String to query the next page of results. + This key is provided with each valid response from the API in ``meta.pagination.next_cursor``. + :type page_cursor: str, optional + :rtype: ContainerImagesResponse + """ + kwargs: Dict[str, Any] = {} + if filter_tags is not unset: + kwargs["filter_tags"] = filter_tags + + if group_by is not unset: + kwargs["group_by"] = group_by + + if sort is not unset: + kwargs["sort"] = sort + + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_cursor is not unset: + kwargs["page_cursor"] = page_cursor + + return self._list_container_images_endpoint.call_with_http_info(**kwargs) + + def list_container_images_with_pagination( + self, + *, + filter_tags: Union[str, UnsetType] = unset, + group_by: Union[str, UnsetType] = unset, + sort: Union[str, UnsetType] = unset, + page_size: Union[int, UnsetType] = unset, + page_cursor: Union[str, UnsetType] = unset, + ) -> collections.abc.Iterable[ContainerImageItem]: + """Get all Container Images. + + Provide a paginated version of :meth:`list_container_images`, returning all items. + + :param filter_tags: Comma-separated list of tags to filter Container Images by. + :type filter_tags: str, optional + :param group_by: Comma-separated list of tags to group Container Images by. + :type group_by: str, optional + :param sort: Attribute to sort Container Images by. + :type sort: str, optional + :param page_size: Maximum number of results returned. + :type page_size: int, optional + :param page_cursor: String to query the next page of results. + This key is provided with each valid response from the API in ``meta.pagination.next_cursor``. + :type page_cursor: str, optional + + :return: A generator of paginated results. + :rtype: collections.abc.Iterable[ContainerImageItem] + """ + kwargs: Dict[str, Any] = {} + if filter_tags is not unset: + kwargs["filter_tags"] = filter_tags + + if group_by is not unset: + kwargs["group_by"] = group_by + + if sort is not unset: + kwargs["sort"] = sort + + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_cursor is not unset: + kwargs["page_cursor"] = page_cursor + + local_page_size = get_attribute_from_path(kwargs, "page_size", 1000) + endpoint = self._list_container_images_endpoint + set_attribute_from_path(kwargs, "page_size", local_page_size, endpoint.params_map) + pagination = { + "limit_value": local_page_size, + "results_path": "data", + "cursor_param": "page_cursor", + "cursor_path": "meta.pagination.next_cursor", + "endpoint": endpoint, + "kwargs": kwargs, + } + return endpoint.call_with_http_info_paginated(pagination) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index e6522cb697..d2be2e828d 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -6,6 +6,7 @@ from datadog_api_client.v2.api.cloud_workload_security_api import CloudWorkloadSecurityApi from datadog_api_client.v2.api.cloudflare_integration_api import CloudflareIntegrationApi from datadog_api_client.v2.api.confluent_cloud_api import ConfluentCloudApi +from datadog_api_client.v2.api.container_images_api import ContainerImagesApi from datadog_api_client.v2.api.dashboard_lists_api import DashboardListsApi from datadog_api_client.v2.api.downtimes_api import DowntimesApi from datadog_api_client.v2.api.events_api import EventsApi @@ -49,6 +50,7 @@ "CloudWorkloadSecurityApi", "CloudflareIntegrationApi", "ConfluentCloudApi", + "ContainerImagesApi", "DashboardListsApi", "DowntimesApi", "EventsApi", diff --git a/src/datadog_api_client/v2/model/container_image.py b/src/datadog_api_client/v2/model/container_image.py new file mode 100644 index 0000000000..995f0406a4 --- /dev/null +++ b/src/datadog_api_client/v2/model/container_image.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.container_image_attributes import ContainerImageAttributes + from datadog_api_client.v2.model.container_image_type import ContainerImageType + + +class ContainerImage(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.container_image_attributes import ContainerImageAttributes + from datadog_api_client.v2.model.container_image_type import ContainerImageType + + return { + "attributes": (ContainerImageAttributes,), + "id": (str,), + "type": (ContainerImageType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: Union[ContainerImageAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + type: Union[ContainerImageType, UnsetType] = unset, + **kwargs, + ): + """ + Container Image object. + + :param attributes: Attributes for a Container Image. + :type attributes: ContainerImageAttributes, optional + + :param id: Container Image ID. + :type id: str, optional + + :param type: Type of Container Image. + :type type: ContainerImageType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/container_image_attributes.py b/src/datadog_api_client/v2/model/container_image_attributes.py new file mode 100644 index 0000000000..9238df5058 --- /dev/null +++ b/src/datadog_api_client/v2/model/container_image_attributes.py @@ -0,0 +1,179 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.container_image_flavor import ContainerImageFlavor + from datadog_api_client.v2.model.container_image_vulnerabilities import ContainerImageVulnerabilities + + +class ContainerImageAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.container_image_flavor import ContainerImageFlavor + from datadog_api_client.v2.model.container_image_vulnerabilities import ContainerImageVulnerabilities + + return { + "container_count": (int,), + "image_flavors": ([ContainerImageFlavor],), + "image_tags": ([str],), + "images_built_at": ([str],), + "name": (str,), + "os_architectures": ([str],), + "os_names": ([str],), + "os_versions": ([str],), + "published_at": (str,), + "registry": (str,), + "repo_digest": (str,), + "repository": (str,), + "short_image": (str,), + "sizes": ([int],), + "sources": ([str],), + "tags": ([str],), + "vulnerability_count": (ContainerImageVulnerabilities,), + } + + attribute_map = { + "container_count": "container_count", + "image_flavors": "image_flavors", + "image_tags": "image_tags", + "images_built_at": "images_built_at", + "name": "name", + "os_architectures": "os_architectures", + "os_names": "os_names", + "os_versions": "os_versions", + "published_at": "published_at", + "registry": "registry", + "repo_digest": "repo_digest", + "repository": "repository", + "short_image": "short_image", + "sizes": "sizes", + "sources": "sources", + "tags": "tags", + "vulnerability_count": "vulnerability_count", + } + + def __init__( + self_, + container_count: Union[int, UnsetType] = unset, + image_flavors: Union[List[ContainerImageFlavor], UnsetType] = unset, + image_tags: Union[List[str], UnsetType] = unset, + images_built_at: Union[List[str], UnsetType] = unset, + name: Union[str, UnsetType] = unset, + os_architectures: Union[List[str], UnsetType] = unset, + os_names: Union[List[str], UnsetType] = unset, + os_versions: Union[List[str], UnsetType] = unset, + published_at: Union[str, UnsetType] = unset, + registry: Union[str, UnsetType] = unset, + repo_digest: Union[str, UnsetType] = unset, + repository: Union[str, UnsetType] = unset, + short_image: Union[str, UnsetType] = unset, + sizes: Union[List[int], UnsetType] = unset, + sources: Union[List[str], UnsetType] = unset, + tags: Union[List[str], UnsetType] = unset, + vulnerability_count: Union[ContainerImageVulnerabilities, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for a Container Image. + + :param container_count: Number of containers running the image. + :type container_count: int, optional + + :param image_flavors: List of platform-specific images associated with the image record. + The list contains more than 1 entry for multi-architecture images. + :type image_flavors: [ContainerImageFlavor], optional + + :param image_tags: List of image tags associated with the Container Image. + :type image_tags: [str], optional + + :param images_built_at: List of build times associated with the Container Image. + The list contains more than 1 entry for multi-architecture images. + :type images_built_at: [str], optional + + :param name: Name of the Container Image. + :type name: str, optional + + :param os_architectures: List of Operating System architectures supported by the Container Image. + :type os_architectures: [str], optional + + :param os_names: List of Operating System names supported by the Container Image. + :type os_names: [str], optional + + :param os_versions: List of Operating System versions supported by the Container Image. + :type os_versions: [str], optional + + :param published_at: Time the image was pushed to the container registry. + :type published_at: str, optional + + :param registry: Registry the Container Image was pushed to. + :type registry: str, optional + + :param repo_digest: Digest of the compressed image manifest. + :type repo_digest: str, optional + + :param repository: Repository where the Container Image is stored in. + :type repository: str, optional + + :param short_image: Short version of the Container Image name. + :type short_image: str, optional + + :param sizes: List of size for each platform-specific image associated with the image record. + The list contains more than 1 entry for multi-architecture images. + :type sizes: [int], optional + + :param sources: List of sources where the Container Image was collected from. + :type sources: [str], optional + + :param tags: List of tags associated with the Container Image. + :type tags: [str], optional + + :param vulnerability_count: Vulnerability counts associated with the Container Image. + :type vulnerability_count: ContainerImageVulnerabilities, optional + """ + if container_count is not unset: + kwargs["container_count"] = container_count + if image_flavors is not unset: + kwargs["image_flavors"] = image_flavors + if image_tags is not unset: + kwargs["image_tags"] = image_tags + if images_built_at is not unset: + kwargs["images_built_at"] = images_built_at + if name is not unset: + kwargs["name"] = name + if os_architectures is not unset: + kwargs["os_architectures"] = os_architectures + if os_names is not unset: + kwargs["os_names"] = os_names + if os_versions is not unset: + kwargs["os_versions"] = os_versions + if published_at is not unset: + kwargs["published_at"] = published_at + if registry is not unset: + kwargs["registry"] = registry + if repo_digest is not unset: + kwargs["repo_digest"] = repo_digest + if repository is not unset: + kwargs["repository"] = repository + if short_image is not unset: + kwargs["short_image"] = short_image + if sizes is not unset: + kwargs["sizes"] = sizes + if sources is not unset: + kwargs["sources"] = sources + if tags is not unset: + kwargs["tags"] = tags + if vulnerability_count is not unset: + kwargs["vulnerability_count"] = vulnerability_count + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/container_image_flavor.py b/src/datadog_api_client/v2/model/container_image_flavor.py new file mode 100644 index 0000000000..bd4c6b6dcd --- /dev/null +++ b/src/datadog_api_client/v2/model/container_image_flavor.py @@ -0,0 +1,72 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ContainerImageFlavor(ModelNormal): + @cached_property + def openapi_types(_): + return { + "built_at": (str,), + "os_architecture": (str,), + "os_name": (str,), + "os_version": (str,), + "size": (int,), + } + + attribute_map = { + "built_at": "built_at", + "os_architecture": "os_architecture", + "os_name": "os_name", + "os_version": "os_version", + "size": "size", + } + + def __init__( + self_, + built_at: Union[str, UnsetType] = unset, + os_architecture: Union[str, UnsetType] = unset, + os_name: Union[str, UnsetType] = unset, + os_version: Union[str, UnsetType] = unset, + size: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Container Image breakdown by supported platform. + + :param built_at: Time the platform-specific Container Image was built. + :type built_at: str, optional + + :param os_architecture: Operating System architecture supported by the Container Image. + :type os_architecture: str, optional + + :param os_name: Operating System name supported by the Container Image. + :type os_name: str, optional + + :param os_version: Operating System version supported by the Container Image. + :type os_version: str, optional + + :param size: Size of the platform-specific Container Image. + :type size: int, optional + """ + if built_at is not unset: + kwargs["built_at"] = built_at + if os_architecture is not unset: + kwargs["os_architecture"] = os_architecture + if os_name is not unset: + kwargs["os_name"] = os_name + if os_version is not unset: + kwargs["os_version"] = os_version + if size is not unset: + kwargs["size"] = size + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/container_image_group.py b/src/datadog_api_client/v2/model/container_image_group.py new file mode 100644 index 0000000000..ed9aba50d5 --- /dev/null +++ b/src/datadog_api_client/v2/model/container_image_group.py @@ -0,0 +1,74 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.container_image_group_attributes import ContainerImageGroupAttributes + from datadog_api_client.v2.model.container_image_group_relationships import ContainerImageGroupRelationships + from datadog_api_client.v2.model.container_image_group_type import ContainerImageGroupType + + +class ContainerImageGroup(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.container_image_group_attributes import ContainerImageGroupAttributes + from datadog_api_client.v2.model.container_image_group_relationships import ContainerImageGroupRelationships + from datadog_api_client.v2.model.container_image_group_type import ContainerImageGroupType + + return { + "attributes": (ContainerImageGroupAttributes,), + "id": (str,), + "relationships": (ContainerImageGroupRelationships,), + "type": (ContainerImageGroupType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: Union[ContainerImageGroupAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + relationships: Union[ContainerImageGroupRelationships, UnsetType] = unset, + type: Union[ContainerImageGroupType, UnsetType] = unset, + **kwargs, + ): + """ + Container Image Group object. + + :param attributes: Attributes for a Container Image Group. + :type attributes: ContainerImageGroupAttributes, optional + + :param id: Container Image Group ID. + :type id: str, optional + + :param relationships: Relationships to Container Images inside a Container Image Group. + :type relationships: ContainerImageGroupRelationships, optional + + :param type: Type of Container Image Group. + :type type: ContainerImageGroupType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if relationships is not unset: + kwargs["relationships"] = relationships + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/container_image_group_attributes.py b/src/datadog_api_client/v2/model/container_image_group_attributes.py new file mode 100644 index 0000000000..e668841500 --- /dev/null +++ b/src/datadog_api_client/v2/model/container_image_group_attributes.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ContainerImageGroupAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "count": (int,), + "name": (str,), + "tags": (dict,), + } + + attribute_map = { + "count": "count", + "name": "name", + "tags": "tags", + } + + def __init__( + self_, + count: Union[int, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + tags: Union[dict, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for a Container Image Group. + + :param count: Number of Container Images in the group. + :type count: int, optional + + :param name: Name of the Container Image group. + :type name: str, optional + + :param tags: Tags from the group name parsed in key/value format. + :type tags: dict, optional + """ + if count is not unset: + kwargs["count"] = count + if name is not unset: + kwargs["name"] = name + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/container_image_group_relationships.py b/src/datadog_api_client/v2/model/container_image_group_relationships.py new file mode 100644 index 0000000000..7c028f4218 --- /dev/null +++ b/src/datadog_api_client/v2/model/container_image_group_relationships.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.container_image_group_relationships_links import ( + ContainerImageGroupRelationshipsLinks, + ) + + +class ContainerImageGroupRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.container_image_group_relationships_links import ( + ContainerImageGroupRelationshipsLinks, + ) + + return { + "links": (ContainerImageGroupRelationshipsLinks,), + } + + attribute_map = { + "links": "links", + } + + def __init__(self_, links: Union[ContainerImageGroupRelationshipsLinks, UnsetType] = unset, **kwargs): + """ + Relationships to Container Images inside a Container Image Group. + + :param links: Links attributes. + :type links: ContainerImageGroupRelationshipsLinks, optional + """ + if links is not unset: + kwargs["links"] = links + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/container_image_group_relationships_links.py b/src/datadog_api_client/v2/model/container_image_group_relationships_links.py new file mode 100644 index 0000000000..c858f4a68a --- /dev/null +++ b/src/datadog_api_client/v2/model/container_image_group_relationships_links.py @@ -0,0 +1,36 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ContainerImageGroupRelationshipsLinks(ModelNormal): + @cached_property + def openapi_types(_): + return { + "related": (str,), + } + + attribute_map = { + "related": "related", + } + + def __init__(self_, related: Union[str, UnsetType] = unset, **kwargs): + """ + Links attributes. + + :param related: Link to related Container Images. + :type related: str, optional + """ + if related is not unset: + kwargs["related"] = related + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/container_image_group_type.py b/src/datadog_api_client/v2/model/container_image_group_type.py new file mode 100644 index 0000000000..12ab54ffba --- /dev/null +++ b/src/datadog_api_client/v2/model/container_image_group_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ContainerImageGroupType(ModelSimple): + """ + Type of Container Image Group. + + :param value: If omitted defaults to "container_image_group". Must be one of ["container_image_group"]. + :type value: str + """ + + allowed_values = { + "container_image_group", + } + CONTAINER_IMAGE_GROUP: ClassVar["ContainerImageGroupType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ContainerImageGroupType.CONTAINER_IMAGE_GROUP = ContainerImageGroupType("container_image_group") diff --git a/src/datadog_api_client/v2/model/container_image_item.py b/src/datadog_api_client/v2/model/container_image_item.py new file mode 100644 index 0000000000..f6f28c4f3c --- /dev/null +++ b/src/datadog_api_client/v2/model/container_image_item.py @@ -0,0 +1,49 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class ContainerImageItem(ModelComposed): + def __init__(self, **kwargs): + """ + Possible Container Image models. + + :param attributes: Attributes for a Container Image. + :type attributes: ContainerImageAttributes, optional + + :param id: Container Image ID. + :type id: str, optional + + :param type: Type of Container Image. + :type type: ContainerImageType, optional + + :param relationships: Relationships to Container Images inside a Container Image Group. + :type relationships: ContainerImageGroupRelationships, optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.container_image import ContainerImage + from datadog_api_client.v2.model.container_image_group import ContainerImageGroup + + return { + "oneOf": [ + ContainerImage, + ContainerImageGroup, + ], + } diff --git a/src/datadog_api_client/v2/model/container_image_meta.py b/src/datadog_api_client/v2/model/container_image_meta.py new file mode 100644 index 0000000000..68015ab920 --- /dev/null +++ b/src/datadog_api_client/v2/model/container_image_meta.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.container_image_meta_page import ContainerImageMetaPage + + +class ContainerImageMeta(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.container_image_meta_page import ContainerImageMetaPage + + return { + "pagination": (ContainerImageMetaPage,), + } + + attribute_map = { + "pagination": "pagination", + } + + def __init__(self_, pagination: Union[ContainerImageMetaPage, UnsetType] = unset, **kwargs): + """ + Response metadata object. + + :param pagination: Paging attributes. + :type pagination: ContainerImageMetaPage, optional + """ + if pagination is not unset: + kwargs["pagination"] = pagination + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/container_image_meta_page.py b/src/datadog_api_client/v2/model/container_image_meta_page.py new file mode 100644 index 0000000000..e3c66cc315 --- /dev/null +++ b/src/datadog_api_client/v2/model/container_image_meta_page.py @@ -0,0 +1,63 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ContainerImageMetaPage(ModelNormal): + validations = { + "limit": { + "inclusive_maximum": 10000, + "inclusive_minimum": 0, + }, + } + + @cached_property + def openapi_types(_): + return { + "limit": (int,), + "next_cursor": (str,), + "total": (int,), + } + + attribute_map = { + "limit": "limit", + "next_cursor": "next_cursor", + "total": "total", + } + + def __init__( + self_, + limit: Union[int, UnsetType] = unset, + next_cursor: Union[str, UnsetType] = unset, + total: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Paging attributes. + + :param limit: Number of results returned + :type limit: int, optional + + :param next_cursor: The cursor used to get the next results, if any. + :type next_cursor: str, optional + + :param total: Total number of records that match the query. + :type total: int, optional + """ + if limit is not unset: + kwargs["limit"] = limit + if next_cursor is not unset: + kwargs["next_cursor"] = next_cursor + if total is not unset: + kwargs["total"] = total + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/container_image_type.py b/src/datadog_api_client/v2/model/container_image_type.py new file mode 100644 index 0000000000..e54c8fb26b --- /dev/null +++ b/src/datadog_api_client/v2/model/container_image_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ContainerImageType(ModelSimple): + """ + Type of Container Image. + + :param value: If omitted defaults to "container_image". Must be one of ["container_image"]. + :type value: str + """ + + allowed_values = { + "container_image", + } + CONTAINER_IMAGE: ClassVar["ContainerImageType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ContainerImageType.CONTAINER_IMAGE = ContainerImageType("container_image") diff --git a/src/datadog_api_client/v2/model/container_image_vulnerabilities.py b/src/datadog_api_client/v2/model/container_image_vulnerabilities.py new file mode 100644 index 0000000000..d464f80dd7 --- /dev/null +++ b/src/datadog_api_client/v2/model/container_image_vulnerabilities.py @@ -0,0 +1,88 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ContainerImageVulnerabilities(ModelNormal): + @cached_property + def openapi_types(_): + return { + "asset_id": (str,), + "critical": (int,), + "high": (int,), + "low": (int,), + "medium": (int,), + "none": (int,), + "unknown": (int,), + } + + attribute_map = { + "asset_id": "asset_id", + "critical": "critical", + "high": "high", + "low": "low", + "medium": "medium", + "none": "none", + "unknown": "unknown", + } + + def __init__( + self_, + asset_id: Union[str, UnsetType] = unset, + critical: Union[int, UnsetType] = unset, + high: Union[int, UnsetType] = unset, + low: Union[int, UnsetType] = unset, + medium: Union[int, UnsetType] = unset, + none: Union[int, UnsetType] = unset, + unknown: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Vulnerability counts associated with the Container Image. + + :param asset_id: ID of the Container Image. + :type asset_id: str, optional + + :param critical: Number of vulnerabilities with CVSS Critical severity. + :type critical: int, optional + + :param high: Number of vulnerabilities with CVSS High severity. + :type high: int, optional + + :param low: Number of vulnerabilities with CVSS Low severity. + :type low: int, optional + + :param medium: Number of vulnerabilities with CVSS Medium severity. + :type medium: int, optional + + :param none: Number of vulnerabilities with CVSS None severity. + :type none: int, optional + + :param unknown: Number of vulnerabilities with an unknown CVSS severity. + :type unknown: int, optional + """ + if asset_id is not unset: + kwargs["asset_id"] = asset_id + if critical is not unset: + kwargs["critical"] = critical + if high is not unset: + kwargs["high"] = high + if low is not unset: + kwargs["low"] = low + if medium is not unset: + kwargs["medium"] = medium + if none is not unset: + kwargs["none"] = none + if unknown is not unset: + kwargs["unknown"] = unknown + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/container_images_response.py b/src/datadog_api_client/v2/model/container_images_response.py new file mode 100644 index 0000000000..cc4f02f476 --- /dev/null +++ b/src/datadog_api_client/v2/model/container_images_response.py @@ -0,0 +1,68 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.container_image_item import ContainerImageItem + from datadog_api_client.v2.model.container_images_response_links import ContainerImagesResponseLinks + from datadog_api_client.v2.model.container_image_meta import ContainerImageMeta + from datadog_api_client.v2.model.container_image import ContainerImage + from datadog_api_client.v2.model.container_image_group import ContainerImageGroup + + +class ContainerImagesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.container_image_item import ContainerImageItem + from datadog_api_client.v2.model.container_images_response_links import ContainerImagesResponseLinks + from datadog_api_client.v2.model.container_image_meta import ContainerImageMeta + + return { + "data": ([ContainerImageItem],), + "links": (ContainerImagesResponseLinks,), + "meta": (ContainerImageMeta,), + } + + attribute_map = { + "data": "data", + "links": "links", + "meta": "meta", + } + + def __init__( + self_, + data: Union[List[Union[ContainerImageItem, ContainerImage, ContainerImageGroup]], UnsetType] = unset, + links: Union[ContainerImagesResponseLinks, UnsetType] = unset, + meta: Union[ContainerImageMeta, UnsetType] = unset, + **kwargs, + ): + """ + List of Container Images. + + :param data: Array of Container Image objects. + :type data: [ContainerImageItem], optional + + :param links: Pagination links. + :type links: ContainerImagesResponseLinks, optional + + :param meta: Response metadata object. + :type meta: ContainerImageMeta, optional + """ + if data is not unset: + kwargs["data"] = data + if links is not unset: + kwargs["links"] = links + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/container_images_response_links.py b/src/datadog_api_client/v2/model/container_images_response_links.py new file mode 100644 index 0000000000..b75206e6a2 --- /dev/null +++ b/src/datadog_api_client/v2/model/container_images_response_links.py @@ -0,0 +1,65 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +class ContainerImagesResponseLinks(ModelNormal): + @cached_property + def openapi_types(_): + return { + "first": (str,), + "next": (str,), + "prev": (str, none_type), + "self": (str,), + } + + attribute_map = { + "first": "first", + "next": "next", + "prev": "prev", + "self": "self", + } + + def __init__( + self_, + first: Union[str, UnsetType] = unset, + next: Union[str, UnsetType] = unset, + prev: Union[str, none_type, UnsetType] = unset, + self: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Pagination links. + + :param first: Link to the first page. + :type first: str, optional + + :param next: Link to the next page. + :type next: str, optional + + :param prev: Link to previous page. + :type prev: str, none_type, optional + + :param self: Link to current page. + :type self: str, optional + """ + if first is not unset: + kwargs["first"] = first + if next is not unset: + kwargs["next"] = next + if prev is not unset: + kwargs["prev"] = prev + if self is not unset: + kwargs["self"] = self + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index c65da5fb1e..cc1275f0d4 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -221,6 +221,21 @@ from datadog_api_client.v2.model.confluent_resource_response_data import ConfluentResourceResponseData from datadog_api_client.v2.model.confluent_resource_type import ConfluentResourceType from datadog_api_client.v2.model.confluent_resources_response import ConfluentResourcesResponse +from datadog_api_client.v2.model.container_image import ContainerImage +from datadog_api_client.v2.model.container_image_attributes import ContainerImageAttributes +from datadog_api_client.v2.model.container_image_flavor import ContainerImageFlavor +from datadog_api_client.v2.model.container_image_group import ContainerImageGroup +from datadog_api_client.v2.model.container_image_group_attributes import ContainerImageGroupAttributes +from datadog_api_client.v2.model.container_image_group_relationships import ContainerImageGroupRelationships +from datadog_api_client.v2.model.container_image_group_relationships_links import ContainerImageGroupRelationshipsLinks +from datadog_api_client.v2.model.container_image_group_type import ContainerImageGroupType +from datadog_api_client.v2.model.container_image_item import ContainerImageItem +from datadog_api_client.v2.model.container_image_meta import ContainerImageMeta +from datadog_api_client.v2.model.container_image_meta_page import ContainerImageMetaPage +from datadog_api_client.v2.model.container_image_type import ContainerImageType +from datadog_api_client.v2.model.container_image_vulnerabilities import ContainerImageVulnerabilities +from datadog_api_client.v2.model.container_images_response import ContainerImagesResponse +from datadog_api_client.v2.model.container_images_response_links import ContainerImagesResponseLinks from datadog_api_client.v2.model.content_encoding import ContentEncoding from datadog_api_client.v2.model.cost_by_org import CostByOrg from datadog_api_client.v2.model.cost_by_org_attributes import CostByOrgAttributes @@ -1569,6 +1584,21 @@ "ConfluentResourceResponseData", "ConfluentResourceType", "ConfluentResourcesResponse", + "ContainerImage", + "ContainerImageAttributes", + "ContainerImageFlavor", + "ContainerImageGroup", + "ContainerImageGroupAttributes", + "ContainerImageGroupRelationships", + "ContainerImageGroupRelationshipsLinks", + "ContainerImageGroupType", + "ContainerImageItem", + "ContainerImageMeta", + "ContainerImageMetaPage", + "ContainerImageType", + "ContainerImageVulnerabilities", + "ContainerImagesResponse", + "ContainerImagesResponseLinks", "ContentEncoding", "CostByOrg", "CostByOrgAttributes", diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_container_image_groups_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_all_container_image_groups_returns_ok_response.frozen new file mode 100644 index 0000000000..ccf465aba3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_container_image_groups_returns_ok_response.frozen @@ -0,0 +1 @@ +2023-10-11T09:51:52.011Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_container_image_groups_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_all_container_image_groups_returns_ok_response.yaml new file mode 100644 index 0000000000..98bc734c96 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_container_image_groups_returns_ok_response.yaml @@ -0,0 +1,321 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/container_images?group_by=short_image + response: + body: + string: '{"data": [{"type": "container_image_group", "attributes": {"name": + "test_name", "tags": {"short_image": "test_short_image"}, "count": 641013}, + "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 318935}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=hort_image:worker"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 183916}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 179844}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 179662}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 81059}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 42254}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 22692}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 18684}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 17610}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 16188}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 15532}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 14965}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 14727}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 13803}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 13724}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 12730}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 12702}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 12519}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 12500}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 12441}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 12359}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 11952}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 11949}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 11477}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 11265}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 10888}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 10801}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 10697}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 10576}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 10574}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 10449}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 10110}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9981}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9960}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9947}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9943}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9875}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9870}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9742}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9613}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9450}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9395}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9372}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9371}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9364}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9363}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9344}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9341}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9295}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9270}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9205}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9129}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9059}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 9037}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8951}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8697}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8693}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8587}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8568}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8450}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8385}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8321}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8292}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8263}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8240}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8219}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8218}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8194}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8179}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8156}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 8110}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7938}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7901}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7848}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7785}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7647}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7631}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7573}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7565}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7498}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7402}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7382}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7312}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7298}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7151}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7059}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7045}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7024}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 7021}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 6998}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 6907}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 6862}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 6837}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 6726}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 6697}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 6679}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 6670}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 6618}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}, {"type": "container_image_group", "attributes": + {"name": "test_name", "tags": {"short_image": "test_short_image"}, "count": + 6596}, "relationships": {"container_images": {"links": {"related": "https://api.datadoghq.com/api/v2/container_images?filter[tags]=short_image:image"}, + "data": []}}, "id": "test_id"}], "meta": {"pagination": {"cursor": "", "prev_cursor": + null, "next_cursor": "", "limit": 100, "type": "cursor_limit", "total": 0}}, + "links": {"self": "https://api.datadoghq.com/api/v2/container_images?group_by=short_image", + "last": null, "next": null, "prev": null, "first": "https://api.datadoghq.com/api/v2/container_images?group_by=short_image&page[size]=100"}}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_container_images_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_all_container_images_returns_ok_response.frozen new file mode 100644 index 0000000000..ef89951d92 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_container_images_returns_ok_response.frozen @@ -0,0 +1 @@ +2023-10-11T09:43:43.733Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_container_images_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_all_container_images_returns_ok_response.yaml new file mode 100644 index 0000000000..c45abb8fe2 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_container_images_returns_ok_response.yaml @@ -0,0 +1,35 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/container_images + response: + body: + string: '{"data": [{"type": "container_image", "id": "test_id", "attributes": + {"name": "test_name", "short_image": "test_short_image", "image_tags": ["test_image_tags"], + "registry": "test_registry", "repository": "argo", "repo_digest": "test_repo_digest", + "sizes": [41802389], "published_at": "2021-05-19T19:33:53Z", "tags": ["test_tags"], + "container_count": 0, "os_names": [], "os_versions": [], "os_architectures": + [], "images_built_at": [], "sources": ["aws_ecr"], "image_flavors": []}}, + {"type": "container_image", "id": "test_id", "attributes": {"name": "test_name", + "short_image": "test_short_image", "image_tags": ["test_image_tags"], "registry": + "test_registry", "repository": "argo", "repo_digest": "test_repo_digest", + "sizes": [41808952], "published_at": "2021-05-19T20:09:12Z", "tags": ["test_tags"], + "container_count": 0, "os_names": [], "os_versions": [], "os_architectures": + [], "images_built_at": [], "sources": ["aws_ecr"], "image_flavors": []}}], + "meta": {"pagination": {"cursor": "", "prev_cursor": null, "next_cursor": + "bmFtZTowMTM5MTA3MzM1MTIuZGtyLmVjci51cy1lYXN0LTEuYW1hem9uYXdzLmNvbS9hcmdvfGlkOjAxMzkxMDczMzUxMi5ka3IuZWNyLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tL2FyZ29Ac2hhMjU2OjNlYWJjNzMwY2RiOTBiMWQ1N2QwNTkyNzJkZWQ3OWQ5NzZkNzk1ZTk0NzM0M2Q0NWFjMjA5MGViZjVmY2I2MTk=", + "limit": 2, "type": "cursor_limit", "total": 5252447}}, "links": {"self": + "https://api.datadoghq.com/api/v2/container_images", "last": null, "next": + "https://api.datadoghq.com/api/v2/container_images?page[cursor]=bmFtZTowMTM5MTA3MzM1MTIuZGtyLmVjci51cy1lYXN0LTEuYW1hem9uYXdzLmNvbS9hcmdvfGlkOjAxMzkxMDczMzUxMi5ka3IuZWNyLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tL2FyZ29Ac2hhMjU2OjNlYWJjNzMwY2RiOTBiMWQ1N2QwNTkyNzJkZWQ3OWQ5NzZkNzk1ZTk0NzM0M2Q0NWFjMjA5MGViZjVmY2I2MTk=", + "prev": null, "first": "https://api.datadoghq.com/api/v2/container_images"}}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_container_images_returns_ok_response_with_pagination.frozen b/tests/v2/cassettes/test_scenarios/test_get_all_container_images_returns_ok_response_with_pagination.frozen new file mode 100644 index 0000000000..76bd385247 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_container_images_returns_ok_response_with_pagination.frozen @@ -0,0 +1 @@ +2023-10-11T11:13:13.446Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_container_images_returns_ok_response_with_pagination.yaml b/tests/v2/cassettes/test_scenarios/test_get_all_container_images_returns_ok_response_with_pagination.yaml new file mode 100644 index 0000000000..ee56bbbc90 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_container_images_returns_ok_response_with_pagination.yaml @@ -0,0 +1,62 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/container_images?page%5Bsize%5D=2 + response: + body: + string: '{"data": [{"type": "container_image", "id": "test_id", "attributes": + {"name": "test_name", "short_image": "test_short_image", "image_tags": ["test_image_tags"], + "registry": "test_registry", "repository": "argo", "repo_digest": "test_repo_digest", + "sizes": [41802389], "published_at": "2021-05-19T19:33:53Z", "tags": ["test_tags"], + "container_count": 0, "os_names": [], "os_versions": [], "os_architectures": + [], "images_built_at": [], "sources": ["aws_ecr"], "image_flavors": []}}, + {"type": "container_image", "id": "test_id", "attributes": {"name": "test_name", + "short_image": "test_short_image", "image_tags": ["test_image_tags"], "registry": + "test_registry", "repository": "argo", "repo_digest": "test_repo_digest", + "sizes": [41808952], "published_at": "2021-05-19T20:09:12Z", "tags": ["test_tags"], + "container_count": 0, "os_names": [], "os_versions": [], "os_architectures": + [], "images_built_at": [], "sources": ["aws_ecr"], "image_flavors": []}}], + "meta": {"pagination": {"cursor": "", "prev_cursor": null, "next_cursor": + "bmFtZTowMTM5MTA3MzM1MTIuZGtyLmVjci51cy1lYXN0LTEuYW1hem9uYXdzLmNvbS9hcmdvfGlkOjAxMzkxMDczMzUxMi5ka3IuZWNyLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tL2FyZ29Ac2hhMjU2OjNlYWJjNzMwY2RiOTBiMWQ1N2QwNTkyNzJkZWQ3OWQ5NzZkNzk1ZTk0NzM0M2Q0NWFjMjA5MGViZjVmY2I2MTk=", + "limit": 2, "type": "cursor_limit", "total": 5184864}}, "links": {"self": + "https://api.datadoghq.com/api/v2/container_images?page%5Bsize%5D=2", "last": + null, "next": "https://api.datadoghq.com/api/v2/container_images?page[cursor]=bmFtZTowMTM5MTA3MzM1MTIuZGtyLmVjci51cy1lYXN0LTEuYW1hem9uYXdzLmNvbS9hcmdvfGlkOjAxMzkxMDczMzUxMi5ka3IuZWNyLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tL2FyZ29Ac2hhMjU2OjNlYWJjNzMwY2RiOTBiMWQ1N2QwNTkyNzJkZWQ3OWQ5NzZkNzk1ZTk0NzM0M2Q0NWFjMjA5MGViZjVmY2I2MTk=&page[size]=2", + "prev": null, "first": "https://api.datadoghq.com/api/v2/container_images?page[size]=2"}}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/container_images?page%5Bsize%5D=2&page%5Bcursor%5D=bmFtZTowMTM5MTA3MzM1MTIuZGtyLmVjci51cy1lYXN0LTEuYW1hem9uYXdzLmNvbS9hcmdvfGlkOjAxMzkxMDczMzUxMi5ka3IuZWNyLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tL2FyZ29Ac2hhMjU2OjNlYWJjNzMwY2RiOTBiMWQ1N2QwNTkyNzJkZWQ3OWQ5NzZkNzk1ZTk0NzM0M2Q0NWFjMjA5MGViZjVmY2I2MTk%3D + response: + body: + string: '{"data": [{"type": "container_image", "id": "test_id", "attributes": + {"name": "test_name", "short_image": "test_short_image", "image_tags": ["test_image_tags"], + "registry": "test_registry", "repository": "argo", "repo_digest": "test_repo_digest", + "sizes": [41808952], "published_at": "2021-05-19T19:33:23Z", "tags": ["test_tags"], + "container_count": 0, "os_names": [], "os_versions": [], "os_architectures": + [], "images_built_at": [], "sources": ["aws_ecr"], "image_flavors": []}}], + "meta": {"pagination": {"cursor": "bmFtZTowMTM5MTA3MzM1MTIuZGtyLmVjci51cy1lYXN0LTEuYW1hem9uYXdzLmNvbS9hcmdvfGlkOjAxMzkxMDczMzUxMi5ka3IuZWNyLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tL2FyZ29Ac2hhMjU2OjNlYWJjNzMwY2RiOTBiMWQ1N2QwNTkyNzJkZWQ3OWQ5NzZkNzk1ZTk0NzM0M2Q0NWFjMjA5MGViZjVmY2I2MTk=", + "prev_cursor": null, "next_cursor": "bmFtZTowMTM5MTA3MzM1MTIuZGtyLmVjci51cy1lYXN0LTEuYW1hem9uYXdzLmNvbS9hcmdvfGlkOjAxMzkxMDczMzUxMi5ka3IuZWNyLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tL2FyZ29Ac2hhMjU2OmZmMTUxZWYyNDZkN2I0ZDZiOGZlMzE5MjNiMjk4ZDg0ZThmMjA2MzI3MDFiYmI2ZWQ5N2ZjYzU4YTAxNTBmODA=", + "limit": 2, "type": "cursor_limit", "total": 5185322}}, "links": {"self": + "https://api.datadoghq.com/api/v2/container_images?page%5Bsize%5D=2&page%5Bcursor%5D=bmFtZTowMTM5MTA3MzM1MTIuZGtyLmVjci51cy1lYXN0LTEuYW1hem9uYXdzLmNvbS9hcmdvfGlkOjAxMzkxMDczMzUxMi5ka3IuZWNyLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tL2FyZ29Ac2hhMjU2OjNlYWJjNzMwY2RiOTBiMWQ1N2QwNTkyNzJkZWQ3OWQ5NzZkNzk1ZTk0NzM0M2Q0NWFjMjA5MGViZjVmY2I2MTk%3D", + "last": null, "next": "https://api.datadoghq.com/api/v2/container_images?page[cursor]=bmFtZTowMTM5MTA3MzM1MTIuZGtyLmVjci51cy1lYXN0LTEuYW1hem9uYXdzLmNvbS9hcmdvfGlkOjAxMzkxMDczMzUxMi5ka3IuZWNyLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tL2FyZ29Ac2hhMjU2OmZmMTUxZWYyNDZkN2I0ZDZiOGZlMzE5MjNiMjk4ZDg0ZThmMjA2MzI3MDFiYmI2ZWQ5N2ZjYzU4YTAxNTBmODA=&page[size]=2", + "prev": null, "first": "https://api.datadoghq.com/api/v2/container_images?page[size]=2"}}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/features/container_images.feature b/tests/v2/features/container_images.feature new file mode 100644 index 0000000000..8afb75cf3f --- /dev/null +++ b/tests/v2/features/container_images.feature @@ -0,0 +1,36 @@ +@endpoint(container-images) @endpoint(container-images-v2) +Feature: Container Images + The Container Images API allows you to query Container Image data for your + organization. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "ContainerImages" API + And operation "ListContainerImages" enabled + And new "ListContainerImages" request + + @replay-only @team:DataDog/processes + Scenario: Get all Container Image groups returns "OK" response + Given request contains "group_by" parameter with value "short_image" + When the request is sent + Then the response status is 200 OK + And the response "data[0].attributes.name" is equal to "test_name" + + @generated @skip @team:DataDog/processes + Scenario: Get all Container Images returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @team:DataDog/processes + Scenario: Get all Container Images returns "OK" response + When the request is sent + Then the response status is 200 OK + And the response "data[0].attributes.name" is equal to "test_name" + + @replay-only @skip-validation @team:DataDog/processes @with-pagination + Scenario: Get all Container Images returns "OK" response with pagination + Given request contains "page[size]" parameter with value 2 + When the request with pagination is sent + Then the response status is 200 OK + And the response has 3 items diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index a127541e65..60e785f3bd 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -231,6 +231,12 @@ "type": "safe" } }, + "ListContainerImages": { + "tag": "Container Images", + "undo": { + "type": "safe" + } + }, "ListCurrentUserApplicationKeys": { "tag": "Key Management", "undo": {