diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 42168cb0f3..095006c0c1 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -51339,6 +51339,49 @@ components: $ref: '#/components/schemas/ServiceDefinitionData' type: array type: object + ServiceList: + properties: + data: + $ref: '#/components/schemas/ServiceListData' + type: object + ServiceListData: + properties: + attributes: + $ref: '#/components/schemas/ServiceListDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/ServiceListDataType' + required: + - type + type: object + ServiceListDataAttributes: + properties: + metadata: + items: + $ref: '#/components/schemas/ServiceListDataAttributesMetadataItems' + type: array + services: + items: + type: string + type: array + type: object + ServiceListDataAttributesMetadataItems: + properties: + isTraced: + type: boolean + isUsm: + type: boolean + type: object + ServiceListDataType: + default: services_list + description: Services list resource type. + enum: + - services_list + example: services_list + type: string + x-enum-varnames: + - SERVICES_LIST ServiceNowBasicAuth: description: The definition of the `ServiceNowBasicAuth` object. properties: @@ -61601,6 +61644,26 @@ paths: permissions: - apm_retention_filter_write - apm_pipelines_write + /api/v2/apm/services: + get: + operationId: GetServiceList + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceList' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_read + summary: Get service list + tags: + - APM /api/v2/app-builder/apps: delete: description: Delete multiple apps in a single request from a list of app IDs. @@ -69334,9 +69397,6 @@ paths: operator: OR permissions: - incident_read - x-unstable: '**Note**: This endpoint is in Preview. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' post: description: Create an impact for an incident. operationId: CreateIncidentImpact @@ -69380,9 +69440,6 @@ paths: operator: OR permissions: - incident_write - x-unstable: '**Note**: This endpoint is in Preview. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents/{incident_id}/impacts/{impact_id}: delete: description: Delete an incident impact. @@ -69413,9 +69470,6 @@ paths: operator: OR permissions: - incident_write - x-unstable: '**Note**: This endpoint is in Preview. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents/{incident_id}/relationships/integrations: get: description: Get all integration metadata for an incident. @@ -88586,6 +88640,9 @@ servers: tags: - description: Configure your API endpoints through the Datadog API. name: API Management +- description: Observe, troubleshoot, and improve cloud-scale applications with all + telemetry in context + name: APM - description: Manage configuration of [APM retention filters](https://app.datadoghq.com/apm/traces/retention-filters) for your organization. You need an API and application key with Admin rights to interact with this endpoint. See [retention filters](https://docs.datadoghq.com/tracing/trace_pipeline/trace_retention/#retention-filters) diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 2bbdab9e35..89ac91c28c 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -32,6 +32,13 @@ datadog\_api\_client.v2.api.api\_management\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.apm\_api module +------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.apm_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.apm\_retention\_filters\_api module --------------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 4560690bfe..41987b325d 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -22551,6 +22551,41 @@ datadog\_api\_client.v2.model.service\_definitions\_list\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.service\_list module +-------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_list + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_list\_data module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_list_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_list\_data\_attributes module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_list_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_list\_data\_attributes\_metadata\_items module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_list_data_attributes_metadata_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_list\_data\_type module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_list_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.service\_now\_basic\_auth module -------------------------------------------------------------- diff --git a/examples/v2/apm/GetServiceList.py b/examples/v2/apm/GetServiceList.py new file mode 100644 index 0000000000..5ce96c49c2 --- /dev/null +++ b/examples/v2/apm/GetServiceList.py @@ -0,0 +1,13 @@ +""" +Get service list returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.apm_api import APMApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = APMApi(api_client) + response = api_instance.get_service_list() + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index f2bc317595..33223cea87 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -307,14 +307,12 @@ def __init__( "v2.update_deployment_gate": False, "v2.update_deployment_rule": False, "v2.create_incident": False, - "v2.create_incident_impact": False, "v2.create_incident_integration": False, "v2.create_incident_notification_rule": False, "v2.create_incident_notification_template": False, "v2.create_incident_todo": False, "v2.create_incident_type": False, "v2.delete_incident": False, - "v2.delete_incident_impact": False, "v2.delete_incident_integration": False, "v2.delete_incident_notification_rule": False, "v2.delete_incident_notification_template": False, @@ -327,7 +325,6 @@ def __init__( "v2.get_incident_todo": False, "v2.get_incident_type": False, "v2.list_incident_attachments": False, - "v2.list_incident_impacts": False, "v2.list_incident_integrations": False, "v2.list_incident_notification_rules": False, "v2.list_incident_notification_templates": False, diff --git a/src/datadog_api_client/v2/api/apm_api.py b/src/datadog_api_client/v2/api/apm_api.py new file mode 100644 index 0000000000..51b073865e --- /dev/null +++ b/src/datadog_api_client/v2/api/apm_api.py @@ -0,0 +1,47 @@ +# 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 Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.v2.model.service_list import ServiceList + + +class APMApi: + """ + Observe, troubleshoot, and improve cloud-scale applications with all telemetry in context + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._get_service_list_endpoint = _Endpoint( + settings={ + "response_type": (ServiceList,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/apm/services", + "operation_id": "get_service_list", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + def get_service_list( + self, + ) -> ServiceList: + """Get service list. + + :rtype: ServiceList + """ + kwargs: Dict[str, Any] = {} + return self._get_service_list_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 60e1a3080b..45c303f79e 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -1,4 +1,5 @@ from datadog_api_client.v2.api.api_management_api import APIManagementApi +from datadog_api_client.v2.api.apm_api import APMApi from datadog_api_client.v2.api.apm_retention_filters_api import APMRetentionFiltersApi from datadog_api_client.v2.api.aws_integration_api import AWSIntegrationApi from datadog_api_client.v2.api.aws_logs_integration_api import AWSLogsIntegrationApi @@ -86,6 +87,7 @@ __all__ = [ "APIManagementApi", + "APMApi", "APMRetentionFiltersApi", "AWSIntegrationApi", "AWSLogsIntegrationApi", diff --git a/src/datadog_api_client/v2/model/service_list.py b/src/datadog_api_client/v2/model/service_list.py new file mode 100644 index 0000000000..ad4860f847 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_list.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.service_list_data import ServiceListData + + +class ServiceList(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_list_data import ServiceListData + + return { + "data": (ServiceListData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[ServiceListData, UnsetType] = unset, **kwargs): + """ + + + :param data: + :type data: ServiceListData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/service_list_data.py b/src/datadog_api_client/v2/model/service_list_data.py new file mode 100644 index 0000000000..666990211f --- /dev/null +++ b/src/datadog_api_client/v2/model/service_list_data.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.service_list_data_attributes import ServiceListDataAttributes + from datadog_api_client.v2.model.service_list_data_type import ServiceListDataType + + +class ServiceListData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_list_data_attributes import ServiceListDataAttributes + from datadog_api_client.v2.model.service_list_data_type import ServiceListDataType + + return { + "attributes": (ServiceListDataAttributes,), + "id": (str,), + "type": (ServiceListDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: ServiceListDataType, + attributes: Union[ServiceListDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attributes: + :type attributes: ServiceListDataAttributes, optional + + :param id: + :type id: str, optional + + :param type: Services list resource type. + :type type: ServiceListDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/service_list_data_attributes.py b/src/datadog_api_client/v2/model/service_list_data_attributes.py new file mode 100644 index 0000000000..5599d6065e --- /dev/null +++ b/src/datadog_api_client/v2/model/service_list_data_attributes.py @@ -0,0 +1,58 @@ +# 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.service_list_data_attributes_metadata_items import ( + ServiceListDataAttributesMetadataItems, + ) + + +class ServiceListDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_list_data_attributes_metadata_items import ( + ServiceListDataAttributesMetadataItems, + ) + + return { + "metadata": ([ServiceListDataAttributesMetadataItems],), + "services": ([str],), + } + + attribute_map = { + "metadata": "metadata", + "services": "services", + } + + def __init__( + self_, + metadata: Union[List[ServiceListDataAttributesMetadataItems], UnsetType] = unset, + services: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + + + :param metadata: + :type metadata: [ServiceListDataAttributesMetadataItems], optional + + :param services: + :type services: [str], optional + """ + if metadata is not unset: + kwargs["metadata"] = metadata + if services is not unset: + kwargs["services"] = services + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/service_list_data_attributes_metadata_items.py b/src/datadog_api_client/v2/model/service_list_data_attributes_metadata_items.py new file mode 100644 index 0000000000..451a56d11a --- /dev/null +++ b/src/datadog_api_client/v2/model/service_list_data_attributes_metadata_items.py @@ -0,0 +1,43 @@ +# 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 ServiceListDataAttributesMetadataItems(ModelNormal): + @cached_property + def openapi_types(_): + return { + "is_traced": (bool,), + "is_usm": (bool,), + } + + attribute_map = { + "is_traced": "isTraced", + "is_usm": "isUsm", + } + + def __init__(self_, is_traced: Union[bool, UnsetType] = unset, is_usm: Union[bool, UnsetType] = unset, **kwargs): + """ + + + :param is_traced: + :type is_traced: bool, optional + + :param is_usm: + :type is_usm: bool, optional + """ + if is_traced is not unset: + kwargs["is_traced"] = is_traced + if is_usm is not unset: + kwargs["is_usm"] = is_usm + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/service_list_data_type.py b/src/datadog_api_client/v2/model/service_list_data_type.py new file mode 100644 index 0000000000..22c3f25e9b --- /dev/null +++ b/src/datadog_api_client/v2/model/service_list_data_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 ServiceListDataType(ModelSimple): + """ + Services list resource type. + + :param value: If omitted defaults to "services_list". Must be one of ["services_list"]. + :type value: str + """ + + allowed_values = { + "services_list", + } + SERVICES_LIST: ClassVar["ServiceListDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ServiceListDataType.SERVICES_LIST = ServiceListDataType("services_list") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 26fa6d24bf..8b5c17916f 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -4528,6 +4528,13 @@ from datadog_api_client.v2.model.service_definition_v2_version import ServiceDefinitionV2Version from datadog_api_client.v2.model.service_definitions_create_request import ServiceDefinitionsCreateRequest from datadog_api_client.v2.model.service_definitions_list_response import ServiceDefinitionsListResponse +from datadog_api_client.v2.model.service_list import ServiceList +from datadog_api_client.v2.model.service_list_data import ServiceListData +from datadog_api_client.v2.model.service_list_data_attributes import ServiceListDataAttributes +from datadog_api_client.v2.model.service_list_data_attributes_metadata_items import ( + ServiceListDataAttributesMetadataItems, +) +from datadog_api_client.v2.model.service_list_data_type import ServiceListDataType from datadog_api_client.v2.model.service_now_basic_auth import ServiceNowBasicAuth from datadog_api_client.v2.model.service_now_basic_auth_type import ServiceNowBasicAuthType from datadog_api_client.v2.model.service_now_basic_auth_update import ServiceNowBasicAuthUpdate @@ -8332,6 +8339,11 @@ "ServiceDefinitionV2Version", "ServiceDefinitionsCreateRequest", "ServiceDefinitionsListResponse", + "ServiceList", + "ServiceListData", + "ServiceListDataAttributes", + "ServiceListDataAttributesMetadataItems", + "ServiceListDataType", "ServiceNowBasicAuth", "ServiceNowBasicAuthType", "ServiceNowBasicAuthUpdate", diff --git a/tests/v2/features/apm.feature b/tests/v2/features/apm.feature new file mode 100644 index 0000000000..e35bd4d475 --- /dev/null +++ b/tests/v2/features/apm.feature @@ -0,0 +1,13 @@ +@endpoint(apm) @endpoint(apm-v2) +Feature: APM + Observe, troubleshoot, and improve cloud-scale applications with all + telemetry in context + + @generated @skip @team:DataDog/apm-aoe + Scenario: Get service list returns "OK" response + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "APM" API + And new "GetServiceList" request + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/incidents.feature b/tests/v2/features/incidents.feature index 74ae965968..12ab3e2f5b 100644 --- a/tests/v2/features/incidents.feature +++ b/tests/v2/features/incidents.feature @@ -806,16 +806,14 @@ Feature: Incidents @generated @skip @team:DataDog/incident-app Scenario: List an incident's impacts returns "Bad Request" response - Given operation "ListIncidentImpacts" enabled - And new "ListIncidentImpacts" request + Given new "ListIncidentImpacts" request And request contains "incident_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/incident-app Scenario: List an incident's impacts returns "Not Found" response - Given operation "ListIncidentImpacts" enabled - And new "ListIncidentImpacts" request + Given new "ListIncidentImpacts" request And request contains "incident_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 8aec373cdd..e0f0b98d0c 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -516,6 +516,12 @@ "type": "idempotent" } }, + "GetServiceList": { + "tag": "APM", + "undo": { + "type": "safe" + } + }, "DeleteApps": { "tag": "App Builder", "undo": {