From d126c9402a8dd19d38e63914a573977142e910ee Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 2 Feb 2026 10:51:19 +0000 Subject: [PATCH] Regenerate client from commit 4458d0d of spec repo --- .generator/schemas/v2/openapi.yaml | 405 ++++++++++++++++++ docs/datadog_api_client.v2.model.rst | 77 ++++ .../AcceptRecommendedEntities.py | 102 +++++ .../ConvertCatalogEntities.py | 97 +++++ .../DeclineRecommendedEntities.py | 19 + .../v2/software-catalog/GetIDPConfigValue.py | 16 + .../TriggerRecommendedEntities.py | 14 + .../software-catalog/UpsertIDPConfigValue.py | 28 ++ src/datadog_api_client/configuration.py | 6 + .../v2/api/software_catalog_api.py | 258 ++++++++++- .../accept_recommended_entities_response.py | 42 ++ .../v2/model/entity_schema_version.py | 44 ++ .../v2/model/idp_config_attributes.py | 40 ++ .../v2/model/idp_config_data.py | 54 +++ .../v2/model/idp_config_request.py | 40 ++ .../v2/model/idp_config_request_attributes.py | 40 ++ .../v2/model/idp_config_request_data.py | 48 +++ .../v2/model/idp_config_response.py | 40 ++ .../v2/model/idp_config_type.py | 35 ++ .../v2/model/idp_config_value_item.py | 17 + .../v2/model/recommended_entity_id.py | 33 ++ .../model/recommended_entity_with_schema.py | 56 +++ src/datadog_api_client/v2/models/__init__.py | 24 ++ tests/v2/features/software_catalog.feature | 106 +++++ tests/v2/features/undo.json | 36 ++ 25 files changed, 1676 insertions(+), 1 deletion(-) create mode 100644 examples/v2/software-catalog/AcceptRecommendedEntities.py create mode 100644 examples/v2/software-catalog/ConvertCatalogEntities.py create mode 100644 examples/v2/software-catalog/DeclineRecommendedEntities.py create mode 100644 examples/v2/software-catalog/GetIDPConfigValue.py create mode 100644 examples/v2/software-catalog/TriggerRecommendedEntities.py create mode 100644 examples/v2/software-catalog/UpsertIDPConfigValue.py create mode 100644 src/datadog_api_client/v2/model/accept_recommended_entities_response.py create mode 100644 src/datadog_api_client/v2/model/entity_schema_version.py create mode 100644 src/datadog_api_client/v2/model/idp_config_attributes.py create mode 100644 src/datadog_api_client/v2/model/idp_config_data.py create mode 100644 src/datadog_api_client/v2/model/idp_config_request.py create mode 100644 src/datadog_api_client/v2/model/idp_config_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/idp_config_request_data.py create mode 100644 src/datadog_api_client/v2/model/idp_config_response.py create mode 100644 src/datadog_api_client/v2/model/idp_config_type.py create mode 100644 src/datadog_api_client/v2/model/idp_config_value_item.py create mode 100644 src/datadog_api_client/v2/model/recommended_entity_id.py create mode 100644 src/datadog_api_client/v2/model/recommended_entity_with_schema.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b58b6fe70e..16329bae52 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -2540,6 +2540,23 @@ components: xray_services: $ref: '#/components/schemas/XRayServicesList' type: object + AcceptRecommendedEntitiesRequest: + description: Request to accept recommended entities. + items: + $ref: '#/components/schemas/RecommendedEntityWithSchema' + type: array + AcceptRecommendedEntitiesResponse: + description: Response after accepting recommended entities. + properties: + data: + description: Array of accepted entity data. + items: + $ref: '#/components/schemas/AcceptRecommendedEntityItem' + type: array + type: object + AcceptRecommendedEntityItem: + description: Accepted entity item. + type: object AccountFilteringConfig: description: The account filtering configuration. properties: @@ -13075,6 +13092,10 @@ components: - IDENTITY - GZIP - DEFLATE + ConvertCatalogEntityResponse: + description: Response containing converted entities. + example: "apiVersion: v3\nkind: service\nmetadata:\n name: myservice" + type: string ConvertJobResultsToSignalsAttributes: description: Attributes for converting threat hunting job results to signals. properties: @@ -18696,6 +18717,11 @@ components: example: 1722439510282 format: int64 type: integer + DeclineRecommendedEntitiesRequest: + description: Request to decline recommended entities. + items: + $ref: '#/components/schemas/RecommendedEntityID' + type: array Degradation: properties: data: @@ -20877,6 +20903,20 @@ components: format: int64 type: integer type: object + EntitySchemaVersion: + description: Entity schema version for conversion. + enum: + - v2 + - v2.1 + - v2.2 + - v3 + example: v3 + type: string + x-enum-varnames: + - V2 + - V2_1 + - V2_2 + - V3 EntityToIncidents: description: Entity to incidents relationship. properties: @@ -27892,6 +27932,89 @@ components: description: The ID of a notification rule. example: aaa-bbb-ccc type: string + IDPConfigAttributes: + description: IDP configuration attributes. + properties: + value: + description: Configuration value (can be object, array, or primitive). + example: + - displayName: My Dashboard + id: dashboard-1 + items: + $ref: '#/components/schemas/IDPConfigValueItem' + type: array + required: + - value + type: object + IDPConfigData: + description: IDP configuration data. + properties: + attributes: + $ref: '#/components/schemas/IDPConfigAttributes' + id: + description: Configuration identifier. + example: idp_pinned_dashboards + type: string + type: + $ref: '#/components/schemas/IDPConfigType' + required: + - id + - type + - attributes + type: object + IDPConfigRequest: + description: Request to set IDP configuration value. + properties: + data: + $ref: '#/components/schemas/IDPConfigRequestData' + required: + - data + type: object + IDPConfigRequestAttributes: + description: IDP configuration request attributes. + properties: + value: + description: Configuration value to set (can be object, array, or primitive). + example: + - displayName: My Dashboard + id: dashboard-1 + items: + $ref: '#/components/schemas/IDPConfigValueItem' + type: array + required: + - value + type: object + IDPConfigRequestData: + description: IDP configuration request data. + properties: + attributes: + $ref: '#/components/schemas/IDPConfigRequestAttributes' + type: + $ref: '#/components/schemas/IDPConfigType' + required: + - type + - attributes + type: object + IDPConfigResponse: + description: Response containing IDP configuration value. + properties: + data: + $ref: '#/components/schemas/IDPConfigData' + required: + - data + type: object + IDPConfigType: + description: Resource type. + enum: + - idp_config + example: idp_config + type: string + x-enum-varnames: + - IDP_CONFIG + IDPConfigValueItem: + additionalProperties: {} + description: An item in the IDP configuration value array. + type: object IPAllowlistAttributes: description: Attributes of the IP allowlist. properties: @@ -46969,6 +47092,29 @@ components: type: string x-enum-varnames: - RECOMMENDATION + RecommendedEntityID: + description: A recommended entity identifier. + properties: + id: + description: Unique identifier for the recommended entity. + example: 123abcdef + type: string + required: + - id + type: object + RecommendedEntityWithSchema: + description: A recommended entity with its schema definition. + properties: + id: + description: Unique identifier for the recommended entity. + example: 123abc456def + type: string + schema: + $ref: '#/components/schemas/EntityV3' + required: + - id + - schema + type: object ReferenceTableCreateSourceType: description: The source type for creating reference table data. Only these source types can be created through this API. @@ -71332,6 +71478,53 @@ paths: tags: - Software Catalog x-codegen-request-body-name: body + /api/v2/catalog/entity/convert: + post: + description: Convert entities from one schema version to another in Software + Catalog. + operationId: ConvertCatalogEntities + parameters: + - description: The target schema version to convert entities to. + in: query + name: target_version + required: true + schema: + $ref: '#/components/schemas/EntitySchemaVersion' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpsertCatalogEntityRequest' + description: Entity YAML or JSON to convert. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConvertCatalogEntityResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_read + summary: Convert entities between schema versions + tags: + - Software Catalog + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/catalog/entity/preview: post: operationId: PreviewCatalogEntities @@ -71476,6 +71669,121 @@ paths: summary: Delete a single kind tags: - Software Catalog + /api/v2/catalog/recommended_entity/bulk_accept: + post: + description: Accept multiple recommended entities in Software Catalog in a single + request. + operationId: AcceptRecommendedEntities + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcceptRecommendedEntitiesRequest' + description: List of recommended entities to accept with their schemas. + required: true + responses: + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/AcceptRecommendedEntitiesResponse' + description: Accepted + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + summary: Accept recommended entities in bulk + tags: + - Software Catalog + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/catalog/recommended_entity/bulk_decline: + post: + description: Decline multiple recommended entities in Software Catalog in a + single request. + operationId: DeclineRecommendedEntities + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeclineRecommendedEntitiesRequest' + description: List of recommended entity IDs to decline. + required: true + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + summary: Decline recommended entities in bulk + tags: + - Software Catalog + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/catalog/recommended_entity/trigger: + post: + description: Trigger the discovery of recommended entities in Software Catalog. + operationId: TriggerRecommendedEntities + requestBody: + content: + application/json: + schema: + type: object + description: Optional request body for triggering recommended entity discovery. + required: false + responses: + '202': + content: + application/json: + schema: + type: object + description: Accepted + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + summary: Trigger recommended entity discovery + tags: + - Software Catalog + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/catalog/relation: get: description: Get a list of entity relations from Software Catalog. @@ -76298,6 +76606,103 @@ paths: x-unstable: '**Note**: This endpoint is in public beta and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/idp/config/{config_name}: + get: + description: Get a configuration value for the Internal Developer Portal (IDP). + operationId: GetIDPConfigValue + parameters: + - description: The configuration key to retrieve. + in: path + name: config_name + required: true + schema: + example: idp_pinned_dashboards + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IDPConfigResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_read + summary: Get Internal Developer Portal configuration + tags: + - Software Catalog + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create or update a configuration value for the Internal Developer + Portal (IDP). + operationId: UpsertIDPConfigValue + parameters: + - description: The configuration key to create or update. + in: path + name: config_name + required: true + schema: + example: idp_pinned_dashboards + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IDPConfigRequest' + description: Configuration value to set. + required: true + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + summary: Create or update IDP configuration + tags: + - Software Catalog + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents: get: description: Get all incidents for the user's organization. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 538d5aa411..03de6a50ad 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -4,6 +4,13 @@ datadog\_api\_client.v2.model package Submodules ---------- +datadog\_api\_client.v2.model.accept\_recommended\_entities\_response module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.accept_recommended_entities_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.account\_filtering\_config module --------------------------------------------------------------- @@ -11827,6 +11834,62 @@ datadog\_api\_client.v2.model.httpci\_app\_errors module :members: :show-inheritance: +datadog\_api\_client.v2.model.idp\_config\_attributes module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.idp_config_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.idp\_config\_data module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.idp_config_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.idp\_config\_request module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.idp_config_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.idp\_config\_request\_attributes module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.idp_config_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.idp\_config\_request\_data module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.idp_config_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.idp\_config\_response module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.idp_config_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.idp\_config\_type module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.idp_config_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.idp\_config\_value\_item module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.idp_config_value_item + :members: + :show-inheritance: + datadog\_api\_client.v2.model.idp\_metadata\_form\_data module -------------------------------------------------------------- @@ -20136,6 +20199,20 @@ datadog\_api\_client.v2.model.recommendation\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.recommended\_entity\_id module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.recommended_entity_id + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.recommended\_entity\_with\_schema module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.recommended_entity_with_schema + :members: + :show-inheritance: + datadog\_api\_client.v2.model.reference\_table\_create\_source\_type module --------------------------------------------------------------------------- diff --git a/examples/v2/software-catalog/AcceptRecommendedEntities.py b/examples/v2/software-catalog/AcceptRecommendedEntities.py new file mode 100644 index 0000000000..9edc096629 --- /dev/null +++ b/examples/v2/software-catalog/AcceptRecommendedEntities.py @@ -0,0 +1,102 @@ +""" +Accept recommended entities in bulk returns "Accepted" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.software_catalog_api import SoftwareCatalogApi +from datadog_api_client.v2.model.entity_v3_api_version import EntityV3APIVersion +from datadog_api_client.v2.model.entity_v3_datadog_code_location_item import EntityV3DatadogCodeLocationItem +from datadog_api_client.v2.model.entity_v3_datadog_event_item import EntityV3DatadogEventItem +from datadog_api_client.v2.model.entity_v3_datadog_integration_opsgenie import EntityV3DatadogIntegrationOpsgenie +from datadog_api_client.v2.model.entity_v3_datadog_integration_pagerduty import EntityV3DatadogIntegrationPagerduty +from datadog_api_client.v2.model.entity_v3_datadog_log_item import EntityV3DatadogLogItem +from datadog_api_client.v2.model.entity_v3_datadog_performance import EntityV3DatadogPerformance +from datadog_api_client.v2.model.entity_v3_datadog_pipelines import EntityV3DatadogPipelines +from datadog_api_client.v2.model.entity_v3_integrations import EntityV3Integrations +from datadog_api_client.v2.model.entity_v3_metadata import EntityV3Metadata +from datadog_api_client.v2.model.entity_v3_metadata_additional_owners_items import EntityV3MetadataAdditionalOwnersItems +from datadog_api_client.v2.model.entity_v3_metadata_contacts_items import EntityV3MetadataContactsItems +from datadog_api_client.v2.model.entity_v3_metadata_links_items import EntityV3MetadataLinksItems +from datadog_api_client.v2.model.entity_v3_service import EntityV3Service +from datadog_api_client.v2.model.entity_v3_service_datadog import EntityV3ServiceDatadog +from datadog_api_client.v2.model.entity_v3_service_kind import EntityV3ServiceKind +from datadog_api_client.v2.model.entity_v3_service_spec import EntityV3ServiceSpec +from datadog_api_client.v2.model.recommended_entity_with_schema import RecommendedEntityWithSchema + +body = [ + RecommendedEntityWithSchema( + id="123abc456def", + schema=EntityV3Service( + api_version=EntityV3APIVersion.V3, + datadog=EntityV3ServiceDatadog( + code_locations=[ + EntityV3DatadogCodeLocationItem( + paths=[], + ), + ], + events=[ + EntityV3DatadogEventItem(), + ], + logs=[ + EntityV3DatadogLogItem(), + ], + performance_data=EntityV3DatadogPerformance( + tags=[], + ), + pipelines=EntityV3DatadogPipelines( + fingerprints=[], + ), + ), + integrations=EntityV3Integrations( + opsgenie=EntityV3DatadogIntegrationOpsgenie( + service_url="https://www.opsgenie.com/service/shopping-cart", + ), + pagerduty=EntityV3DatadogIntegrationPagerduty( + service_url="https://www.pagerduty.com/service-directory/Pshopping-cart", + ), + ), + kind=EntityV3ServiceKind.SERVICE, + metadata=EntityV3Metadata( + additional_owners=[ + EntityV3MetadataAdditionalOwnersItems( + name="", + ), + ], + contacts=[ + EntityV3MetadataContactsItems( + contact="https://slack/", + type="slack", + ), + ], + id="4b163705-23c0-4573-b2fb-f6cea2163fcb", + inherit_from="application:default/myapp", + links=[ + EntityV3MetadataLinksItems( + name="mylink", + type="link", + url="https://mylink", + ), + ], + name="myService", + namespace="default", + tags=[ + "this:tag", + "that:tag", + ], + ), + spec=EntityV3ServiceSpec( + component_of=[], + depends_on=[], + languages=[], + ), + ), + ), +] + +configuration = Configuration() +configuration.unstable_operations["accept_recommended_entities"] = True +with ApiClient(configuration) as api_client: + api_instance = SoftwareCatalogApi(api_client) + response = api_instance.accept_recommended_entities(body=body) + + print(response) diff --git a/examples/v2/software-catalog/ConvertCatalogEntities.py b/examples/v2/software-catalog/ConvertCatalogEntities.py new file mode 100644 index 0000000000..dc7e019723 --- /dev/null +++ b/examples/v2/software-catalog/ConvertCatalogEntities.py @@ -0,0 +1,97 @@ +""" +Convert entities between schema versions returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.software_catalog_api import SoftwareCatalogApi +from datadog_api_client.v2.model.entity_schema_version import EntitySchemaVersion +from datadog_api_client.v2.model.entity_v3_api_version import EntityV3APIVersion +from datadog_api_client.v2.model.entity_v3_datadog_code_location_item import EntityV3DatadogCodeLocationItem +from datadog_api_client.v2.model.entity_v3_datadog_event_item import EntityV3DatadogEventItem +from datadog_api_client.v2.model.entity_v3_datadog_integration_opsgenie import EntityV3DatadogIntegrationOpsgenie +from datadog_api_client.v2.model.entity_v3_datadog_integration_pagerduty import EntityV3DatadogIntegrationPagerduty +from datadog_api_client.v2.model.entity_v3_datadog_log_item import EntityV3DatadogLogItem +from datadog_api_client.v2.model.entity_v3_datadog_performance import EntityV3DatadogPerformance +from datadog_api_client.v2.model.entity_v3_datadog_pipelines import EntityV3DatadogPipelines +from datadog_api_client.v2.model.entity_v3_integrations import EntityV3Integrations +from datadog_api_client.v2.model.entity_v3_metadata import EntityV3Metadata +from datadog_api_client.v2.model.entity_v3_metadata_additional_owners_items import EntityV3MetadataAdditionalOwnersItems +from datadog_api_client.v2.model.entity_v3_metadata_contacts_items import EntityV3MetadataContactsItems +from datadog_api_client.v2.model.entity_v3_metadata_links_items import EntityV3MetadataLinksItems +from datadog_api_client.v2.model.entity_v3_service import EntityV3Service +from datadog_api_client.v2.model.entity_v3_service_datadog import EntityV3ServiceDatadog +from datadog_api_client.v2.model.entity_v3_service_kind import EntityV3ServiceKind +from datadog_api_client.v2.model.entity_v3_service_spec import EntityV3ServiceSpec + +body = EntityV3Service( + api_version=EntityV3APIVersion.V3, + datadog=EntityV3ServiceDatadog( + code_locations=[ + EntityV3DatadogCodeLocationItem( + paths=[], + ), + ], + events=[ + EntityV3DatadogEventItem(), + ], + logs=[ + EntityV3DatadogLogItem(), + ], + performance_data=EntityV3DatadogPerformance( + tags=[], + ), + pipelines=EntityV3DatadogPipelines( + fingerprints=[], + ), + ), + integrations=EntityV3Integrations( + opsgenie=EntityV3DatadogIntegrationOpsgenie( + service_url="https://www.opsgenie.com/service/shopping-cart", + ), + pagerduty=EntityV3DatadogIntegrationPagerduty( + service_url="https://www.pagerduty.com/service-directory/Pshopping-cart", + ), + ), + kind=EntityV3ServiceKind.SERVICE, + metadata=EntityV3Metadata( + additional_owners=[ + EntityV3MetadataAdditionalOwnersItems( + name="", + ), + ], + contacts=[ + EntityV3MetadataContactsItems( + contact="https://slack/", + type="slack", + ), + ], + id="4b163705-23c0-4573-b2fb-f6cea2163fcb", + inherit_from="application:default/myapp", + links=[ + EntityV3MetadataLinksItems( + name="mylink", + type="link", + url="https://mylink", + ), + ], + name="myService", + namespace="default", + tags=[ + "this:tag", + "that:tag", + ], + ), + spec=EntityV3ServiceSpec( + component_of=[], + depends_on=[], + languages=[], + ), +) + +configuration = Configuration() +configuration.unstable_operations["convert_catalog_entities"] = True +with ApiClient(configuration) as api_client: + api_instance = SoftwareCatalogApi(api_client) + response = api_instance.convert_catalog_entities(target_version=EntitySchemaVersion.V3, body=body) + + print(response) diff --git a/examples/v2/software-catalog/DeclineRecommendedEntities.py b/examples/v2/software-catalog/DeclineRecommendedEntities.py new file mode 100644 index 0000000000..983cfeb1ff --- /dev/null +++ b/examples/v2/software-catalog/DeclineRecommendedEntities.py @@ -0,0 +1,19 @@ +""" +Decline recommended entities in bulk returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.software_catalog_api import SoftwareCatalogApi +from datadog_api_client.v2.model.recommended_entity_id import RecommendedEntityID + +body = [ + RecommendedEntityID( + id="123abcdef", + ), +] + +configuration = Configuration() +configuration.unstable_operations["decline_recommended_entities"] = True +with ApiClient(configuration) as api_client: + api_instance = SoftwareCatalogApi(api_client) + api_instance.decline_recommended_entities(body=body) diff --git a/examples/v2/software-catalog/GetIDPConfigValue.py b/examples/v2/software-catalog/GetIDPConfigValue.py new file mode 100644 index 0000000000..e92d84a878 --- /dev/null +++ b/examples/v2/software-catalog/GetIDPConfigValue.py @@ -0,0 +1,16 @@ +""" +Get Internal Developer Portal configuration returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.software_catalog_api import SoftwareCatalogApi + +configuration = Configuration() +configuration.unstable_operations["get_idp_config_value"] = True +with ApiClient(configuration) as api_client: + api_instance = SoftwareCatalogApi(api_client) + response = api_instance.get_idp_config_value( + config_name="idp_pinned_dashboards", + ) + + print(response) diff --git a/examples/v2/software-catalog/TriggerRecommendedEntities.py b/examples/v2/software-catalog/TriggerRecommendedEntities.py new file mode 100644 index 0000000000..c701546522 --- /dev/null +++ b/examples/v2/software-catalog/TriggerRecommendedEntities.py @@ -0,0 +1,14 @@ +""" +Trigger recommended entity discovery returns "Accepted" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.software_catalog_api import SoftwareCatalogApi + +configuration = Configuration() +configuration.unstable_operations["trigger_recommended_entities"] = True +with ApiClient(configuration) as api_client: + api_instance = SoftwareCatalogApi(api_client) + response = api_instance.trigger_recommended_entities() + + print(response) diff --git a/examples/v2/software-catalog/UpsertIDPConfigValue.py b/examples/v2/software-catalog/UpsertIDPConfigValue.py new file mode 100644 index 0000000000..e8c570f192 --- /dev/null +++ b/examples/v2/software-catalog/UpsertIDPConfigValue.py @@ -0,0 +1,28 @@ +""" +Create or update IDP configuration returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.software_catalog_api import SoftwareCatalogApi +from datadog_api_client.v2.model.idp_config_request import IDPConfigRequest +from datadog_api_client.v2.model.idp_config_request_attributes import IDPConfigRequestAttributes +from datadog_api_client.v2.model.idp_config_request_data import IDPConfigRequestData +from datadog_api_client.v2.model.idp_config_type import IDPConfigType +from datadog_api_client.v2.model.idp_config_value_item import IDPConfigValueItem + +body = IDPConfigRequest( + data=IDPConfigRequestData( + attributes=IDPConfigRequestAttributes( + value=[ + IDPConfigValueItem([("displayName", "My Dashboard"), ("id", "dashboard-1")]), + ], + ), + type=IDPConfigType.IDP_CONFIG, + ), +) + +configuration = Configuration() +configuration.unstable_operations["upsert_idp_config_value"] = True +with ApiClient(configuration) as api_client: + api_instance = SoftwareCatalogApi(api_client) + api_instance.upsert_idp_config_value(config_name="idp_pinned_dashboards", body=body) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 02c6e7a9be..a8e5e29087 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -266,6 +266,12 @@ def __init__( "v2.get_open_api": False, "v2.list_apis": False, "v2.update_open_api": False, + "v2.accept_recommended_entities": False, + "v2.convert_catalog_entities": False, + "v2.decline_recommended_entities": False, + "v2.get_idp_config_value": False, + "v2.trigger_recommended_entities": False, + "v2.upsert_idp_config_value": False, "v2.cancel_threat_hunting_job": False, "v2.convert_job_result_to_signal": False, "v2.delete_threat_hunting_job": False, diff --git a/src/datadog_api_client/v2/api/software_catalog_api.py b/src/datadog_api_client/v2/api/software_catalog_api.py index 16113c7bba..c2e561c482 100644 --- a/src/datadog_api_client/v2/api/software_catalog_api.py +++ b/src/datadog_api_client/v2/api/software_catalog_api.py @@ -4,7 +4,7 @@ from __future__ import annotations import collections -from typing import Any, Dict, Union +from typing import Any, Dict, List, Union from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration @@ -21,15 +21,21 @@ from datadog_api_client.v2.model.upsert_catalog_entity_response import UpsertCatalogEntityResponse from datadog_api_client.v2.model.upsert_catalog_entity_request import UpsertCatalogEntityRequest from datadog_api_client.v2.model.entity_v3 import EntityV3 +from datadog_api_client.v2.model.entity_schema_version import EntitySchemaVersion from datadog_api_client.v2.model.entity_response_array import EntityResponseArray from datadog_api_client.v2.model.list_kind_catalog_response import ListKindCatalogResponse from datadog_api_client.v2.model.kind_data import KindData from datadog_api_client.v2.model.upsert_catalog_kind_response import UpsertCatalogKindResponse from datadog_api_client.v2.model.upsert_catalog_kind_request import UpsertCatalogKindRequest from datadog_api_client.v2.model.kind_obj import KindObj +from datadog_api_client.v2.model.accept_recommended_entities_response import AcceptRecommendedEntitiesResponse +from datadog_api_client.v2.model.recommended_entity_with_schema import RecommendedEntityWithSchema +from datadog_api_client.v2.model.recommended_entity_id import RecommendedEntityID from datadog_api_client.v2.model.list_relation_catalog_response import ListRelationCatalogResponse from datadog_api_client.v2.model.relation_include_type import RelationIncludeType from datadog_api_client.v2.model.relation_response import RelationResponse +from datadog_api_client.v2.model.idp_config_response import IDPConfigResponse +from datadog_api_client.v2.model.idp_config_request import IDPConfigRequest class SoftwareCatalogApi: @@ -42,6 +48,74 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client + self._accept_recommended_entities_endpoint = _Endpoint( + settings={ + "response_type": (AcceptRecommendedEntitiesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/catalog/recommended_entity/bulk_accept", + "operation_id": "accept_recommended_entities", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": ([RecommendedEntityWithSchema],), + "location": "body", + "collection_format": "multi", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._convert_catalog_entities_endpoint = _Endpoint( + settings={ + "response_type": (str,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/catalog/entity/convert", + "operation_id": "convert_catalog_entities", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "target_version": { + "required": True, + "openapi_types": (EntitySchemaVersion,), + "attribute": "target_version", + "location": "query", + }, + "body": { + "required": True, + "openapi_types": (UpsertCatalogEntityRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._decline_recommended_entities_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/catalog/recommended_entity/bulk_decline", + "operation_id": "decline_recommended_entities", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": ([RecommendedEntityID],), + "location": "body", + "collection_format": "multi", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._delete_catalog_entity_endpoint = _Endpoint( settings={ "response_type": None, @@ -88,6 +162,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_idp_config_value_endpoint = _Endpoint( + settings={ + "response_type": (IDPConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/idp/config/{config_name}", + "operation_id": "get_idp_config_value", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "config_name": { + "required": True, + "openapi_types": (str,), + "attribute": "config_name", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_catalog_entity_endpoint = _Endpoint( settings={ "response_type": (ListEntityCatalogResponse,), @@ -265,6 +362,25 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._trigger_recommended_entities_endpoint = _Endpoint( + settings={ + "response_type": (dict,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/catalog/recommended_entity/trigger", + "operation_id": "trigger_recommended_entities", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "openapi_types": (dict,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._upsert_catalog_entity_endpoint = _Endpoint( settings={ "response_type": (UpsertCatalogEntityResponse,), @@ -305,6 +421,88 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._upsert_idp_config_value_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/idp/config/{config_name}", + "operation_id": "upsert_idp_config_value", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "config_name": { + "required": True, + "openapi_types": (str,), + "attribute": "config_name", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (IDPConfigRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def accept_recommended_entities( + self, + body: List[RecommendedEntityWithSchema], + ) -> AcceptRecommendedEntitiesResponse: + """Accept recommended entities in bulk. + + Accept multiple recommended entities in Software Catalog in a single request. + + :param body: List of recommended entities to accept with their schemas. + :type body: [RecommendedEntityWithSchema] + :rtype: AcceptRecommendedEntitiesResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._accept_recommended_entities_endpoint.call_with_http_info(**kwargs) + + def convert_catalog_entities( + self, + target_version: EntitySchemaVersion, + body: Union[UpsertCatalogEntityRequest, EntityV3, str], + ) -> str: + """Convert entities between schema versions. + + Convert entities from one schema version to another in Software Catalog. + + :param target_version: The target schema version to convert entities to. + :type target_version: EntitySchemaVersion + :param body: Entity YAML or JSON to convert. + :type body: UpsertCatalogEntityRequest + :rtype: str + """ + kwargs: Dict[str, Any] = {} + kwargs["target_version"] = target_version + + kwargs["body"] = body + + return self._convert_catalog_entities_endpoint.call_with_http_info(**kwargs) + + def decline_recommended_entities( + self, + body: List[RecommendedEntityID], + ) -> None: + """Decline recommended entities in bulk. + + Decline multiple recommended entities in Software Catalog in a single request. + + :param body: List of recommended entity IDs to decline. + :type body: [RecommendedEntityID] + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._decline_recommended_entities_endpoint.call_with_http_info(**kwargs) + def delete_catalog_entity( self, entity_id: str, @@ -339,6 +537,23 @@ def delete_catalog_kind( return self._delete_catalog_kind_endpoint.call_with_http_info(**kwargs) + def get_idp_config_value( + self, + config_name: str, + ) -> IDPConfigResponse: + """Get Internal Developer Portal configuration. + + Get a configuration value for the Internal Developer Portal (IDP). + + :param config_name: The configuration key to retrieve. + :type config_name: str + :rtype: IDPConfigResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["config_name"] = config_name + + return self._get_idp_config_value_endpoint.call_with_http_info(**kwargs) + def list_catalog_entity( self, *, @@ -727,6 +942,25 @@ def preview_catalog_entities( kwargs: Dict[str, Any] = {} return self._preview_catalog_entities_endpoint.call_with_http_info(**kwargs) + def trigger_recommended_entities( + self, + *, + body: Union[dict, UnsetType] = unset, + ) -> dict: + """Trigger recommended entity discovery. + + Trigger the discovery of recommended entities in Software Catalog. + + :param body: Optional request body for triggering recommended entity discovery. + :type body: dict, optional + :rtype: dict + """ + kwargs: Dict[str, Any] = {} + if body is not unset: + kwargs["body"] = body + + return self._trigger_recommended_entities_endpoint.call_with_http_info(**kwargs) + def upsert_catalog_entity( self, body: Union[UpsertCatalogEntityRequest, EntityV3, str], @@ -760,3 +994,25 @@ def upsert_catalog_kind( kwargs["body"] = body return self._upsert_catalog_kind_endpoint.call_with_http_info(**kwargs) + + def upsert_idp_config_value( + self, + config_name: str, + body: IDPConfigRequest, + ) -> None: + """Create or update IDP configuration. + + Create or update a configuration value for the Internal Developer Portal (IDP). + + :param config_name: The configuration key to create or update. + :type config_name: str + :param body: Configuration value to set. + :type body: IDPConfigRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["config_name"] = config_name + + kwargs["body"] = body + + return self._upsert_idp_config_value_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/model/accept_recommended_entities_response.py b/src/datadog_api_client/v2/model/accept_recommended_entities_response.py new file mode 100644 index 0000000000..3bea77a1cd --- /dev/null +++ b/src/datadog_api_client/v2/model/accept_recommended_entities_response.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 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.accept_recommended_entity_item import AcceptRecommendedEntityItem + + +class AcceptRecommendedEntitiesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.accept_recommended_entity_item import AcceptRecommendedEntityItem + + return { + "data": ([AcceptRecommendedEntityItem],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[List[AcceptRecommendedEntityItem], UnsetType] = unset, **kwargs): + """ + Response after accepting recommended entities. + + :param data: Array of accepted entity data. + :type data: [AcceptRecommendedEntityItem], optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/entity_schema_version.py b/src/datadog_api_client/v2/model/entity_schema_version.py new file mode 100644 index 0000000000..d211670184 --- /dev/null +++ b/src/datadog_api_client/v2/model/entity_schema_version.py @@ -0,0 +1,44 @@ +# 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 EntitySchemaVersion(ModelSimple): + """ + Entity schema version for conversion. + + :param value: Must be one of ["v2", "v2.1", "v2.2", "v3"]. + :type value: str + """ + + allowed_values = { + "v2", + "v2.1", + "v2.2", + "v3", + } + V2: ClassVar["EntitySchemaVersion"] + V2_1: ClassVar["EntitySchemaVersion"] + V2_2: ClassVar["EntitySchemaVersion"] + V3: ClassVar["EntitySchemaVersion"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +EntitySchemaVersion.V2 = EntitySchemaVersion("v2") +EntitySchemaVersion.V2_1 = EntitySchemaVersion("v2.1") +EntitySchemaVersion.V2_2 = EntitySchemaVersion("v2.2") +EntitySchemaVersion.V3 = EntitySchemaVersion("v3") diff --git a/src/datadog_api_client/v2/model/idp_config_attributes.py b/src/datadog_api_client/v2/model/idp_config_attributes.py new file mode 100644 index 0000000000..c3d64a7ea6 --- /dev/null +++ b/src/datadog_api_client/v2/model/idp_config_attributes.py @@ -0,0 +1,40 @@ +# 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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.idp_config_value_item import IDPConfigValueItem + + +class IDPConfigAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.idp_config_value_item import IDPConfigValueItem + + return { + "value": ([IDPConfigValueItem],), + } + + attribute_map = { + "value": "value", + } + + def __init__(self_, value: List[IDPConfigValueItem], **kwargs): + """ + IDP configuration attributes. + + :param value: Configuration value (can be object, array, or primitive). + :type value: [IDPConfigValueItem] + """ + super().__init__(kwargs) + + self_.value = value diff --git a/src/datadog_api_client/v2/model/idp_config_data.py b/src/datadog_api_client/v2/model/idp_config_data.py new file mode 100644 index 0000000000..2e6272f2f2 --- /dev/null +++ b/src/datadog_api_client/v2/model/idp_config_data.py @@ -0,0 +1,54 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.idp_config_attributes import IDPConfigAttributes + from datadog_api_client.v2.model.idp_config_type import IDPConfigType + + +class IDPConfigData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.idp_config_attributes import IDPConfigAttributes + from datadog_api_client.v2.model.idp_config_type import IDPConfigType + + return { + "attributes": (IDPConfigAttributes,), + "id": (str,), + "type": (IDPConfigType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: IDPConfigAttributes, id: str, type: IDPConfigType, **kwargs): + """ + IDP configuration data. + + :param attributes: IDP configuration attributes. + :type attributes: IDPConfigAttributes + + :param id: Configuration identifier. + :type id: str + + :param type: Resource type. + :type type: IDPConfigType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/idp_config_request.py b/src/datadog_api_client/v2/model/idp_config_request.py new file mode 100644 index 0000000000..ddd7627b6a --- /dev/null +++ b/src/datadog_api_client/v2/model/idp_config_request.py @@ -0,0 +1,40 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.idp_config_request_data import IDPConfigRequestData + + +class IDPConfigRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.idp_config_request_data import IDPConfigRequestData + + return { + "data": (IDPConfigRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IDPConfigRequestData, **kwargs): + """ + Request to set IDP configuration value. + + :param data: IDP configuration request data. + :type data: IDPConfigRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/idp_config_request_attributes.py b/src/datadog_api_client/v2/model/idp_config_request_attributes.py new file mode 100644 index 0000000000..b48d14e630 --- /dev/null +++ b/src/datadog_api_client/v2/model/idp_config_request_attributes.py @@ -0,0 +1,40 @@ +# 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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.idp_config_value_item import IDPConfigValueItem + + +class IDPConfigRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.idp_config_value_item import IDPConfigValueItem + + return { + "value": ([IDPConfigValueItem],), + } + + attribute_map = { + "value": "value", + } + + def __init__(self_, value: List[IDPConfigValueItem], **kwargs): + """ + IDP configuration request attributes. + + :param value: Configuration value to set (can be object, array, or primitive). + :type value: [IDPConfigValueItem] + """ + super().__init__(kwargs) + + self_.value = value diff --git a/src/datadog_api_client/v2/model/idp_config_request_data.py b/src/datadog_api_client/v2/model/idp_config_request_data.py new file mode 100644 index 0000000000..766bae7f66 --- /dev/null +++ b/src/datadog_api_client/v2/model/idp_config_request_data.py @@ -0,0 +1,48 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.idp_config_request_attributes import IDPConfigRequestAttributes + from datadog_api_client.v2.model.idp_config_type import IDPConfigType + + +class IDPConfigRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.idp_config_request_attributes import IDPConfigRequestAttributes + from datadog_api_client.v2.model.idp_config_type import IDPConfigType + + return { + "attributes": (IDPConfigRequestAttributes,), + "type": (IDPConfigType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: IDPConfigRequestAttributes, type: IDPConfigType, **kwargs): + """ + IDP configuration request data. + + :param attributes: IDP configuration request attributes. + :type attributes: IDPConfigRequestAttributes + + :param type: Resource type. + :type type: IDPConfigType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/idp_config_response.py b/src/datadog_api_client/v2/model/idp_config_response.py new file mode 100644 index 0000000000..5c808c4ca8 --- /dev/null +++ b/src/datadog_api_client/v2/model/idp_config_response.py @@ -0,0 +1,40 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.idp_config_data import IDPConfigData + + +class IDPConfigResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.idp_config_data import IDPConfigData + + return { + "data": (IDPConfigData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IDPConfigData, **kwargs): + """ + Response containing IDP configuration value. + + :param data: IDP configuration data. + :type data: IDPConfigData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/idp_config_type.py b/src/datadog_api_client/v2/model/idp_config_type.py new file mode 100644 index 0000000000..4c48b2133d --- /dev/null +++ b/src/datadog_api_client/v2/model/idp_config_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 IDPConfigType(ModelSimple): + """ + Resource type. + + :param value: If omitted defaults to "idp_config". Must be one of ["idp_config"]. + :type value: str + """ + + allowed_values = { + "idp_config", + } + IDP_CONFIG: ClassVar["IDPConfigType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IDPConfigType.IDP_CONFIG = IDPConfigType("idp_config") diff --git a/src/datadog_api_client/v2/model/idp_config_value_item.py b/src/datadog_api_client/v2/model/idp_config_value_item.py new file mode 100644 index 0000000000..e9f9318d43 --- /dev/null +++ b/src/datadog_api_client/v2/model/idp_config_value_item.py @@ -0,0 +1,17 @@ +# 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 ( + ModelNormal, +) + + +class IDPConfigValueItem(ModelNormal): + def __init__(self_, **kwargs): + """ + An item in the IDP configuration value array. + """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/recommended_entity_id.py b/src/datadog_api_client/v2/model/recommended_entity_id.py new file mode 100644 index 0000000000..66c4111deb --- /dev/null +++ b/src/datadog_api_client/v2/model/recommended_entity_id.py @@ -0,0 +1,33 @@ +# 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 ( + ModelNormal, + cached_property, +) + + +class RecommendedEntityID(ModelNormal): + @cached_property + def openapi_types(_): + return { + "id": (str,), + } + + attribute_map = { + "id": "id", + } + + def __init__(self_, id: str, **kwargs): + """ + A recommended entity identifier. + + :param id: Unique identifier for the recommended entity. + :type id: str + """ + super().__init__(kwargs) + + self_.id = id diff --git a/src/datadog_api_client/v2/model/recommended_entity_with_schema.py b/src/datadog_api_client/v2/model/recommended_entity_with_schema.py new file mode 100644 index 0000000000..1243b189a0 --- /dev/null +++ b/src/datadog_api_client/v2/model/recommended_entity_with_schema.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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.entity_v3 import EntityV3 + from datadog_api_client.v2.model.entity_v3_service import EntityV3Service + from datadog_api_client.v2.model.entity_v3_datastore import EntityV3Datastore + from datadog_api_client.v2.model.entity_v3_queue import EntityV3Queue + from datadog_api_client.v2.model.entity_v3_system import EntityV3System + from datadog_api_client.v2.model.entity_v3_api import EntityV3API + + +class RecommendedEntityWithSchema(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.entity_v3 import EntityV3 + + return { + "id": (str,), + "schema": (EntityV3,), + } + + attribute_map = { + "id": "id", + "schema": "schema", + } + + def __init__( + self_, + id: str, + schema: Union[EntityV3, EntityV3Service, EntityV3Datastore, EntityV3Queue, EntityV3System, EntityV3API], + **kwargs, + ): + """ + A recommended entity with its schema definition. + + :param id: Unique identifier for the recommended entity. + :type id: str + + :param schema: Entity schema v3. + :type schema: EntityV3 + """ + super().__init__(kwargs) + + self_.id = id + self_.schema = schema diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 7587d2f4e0..890e1c0da1 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -100,6 +100,7 @@ from datadog_api_client.v2.model.aws_regions_include_only import AWSRegionsIncludeOnly from datadog_api_client.v2.model.aws_resources_config import AWSResourcesConfig from datadog_api_client.v2.model.aws_traces_config import AWSTracesConfig +from datadog_api_client.v2.model.accept_recommended_entities_response import AcceptRecommendedEntitiesResponse from datadog_api_client.v2.model.account_filtering_config import AccountFilteringConfig from datadog_api_client.v2.model.action_connection_attributes import ActionConnectionAttributes from datadog_api_client.v2.model.action_connection_attributes_update import ActionConnectionAttributesUpdate @@ -1730,6 +1731,7 @@ ) from datadog_api_client.v2.model.entity_response_included_schema_type import EntityResponseIncludedSchemaType from datadog_api_client.v2.model.entity_response_meta import EntityResponseMeta +from datadog_api_client.v2.model.entity_schema_version import EntitySchemaVersion from datadog_api_client.v2.model.entity_to_incidents import EntityToIncidents from datadog_api_client.v2.model.entity_to_oncalls import EntityToOncalls from datadog_api_client.v2.model.entity_to_raw_schema import EntityToRawSchema @@ -2258,6 +2260,14 @@ from datadog_api_client.v2.model.hourly_usage_pagination import HourlyUsagePagination from datadog_api_client.v2.model.hourly_usage_response import HourlyUsageResponse from datadog_api_client.v2.model.hourly_usage_type import HourlyUsageType +from datadog_api_client.v2.model.idp_config_attributes import IDPConfigAttributes +from datadog_api_client.v2.model.idp_config_data import IDPConfigData +from datadog_api_client.v2.model.idp_config_request import IDPConfigRequest +from datadog_api_client.v2.model.idp_config_request_attributes import IDPConfigRequestAttributes +from datadog_api_client.v2.model.idp_config_request_data import IDPConfigRequestData +from datadog_api_client.v2.model.idp_config_response import IDPConfigResponse +from datadog_api_client.v2.model.idp_config_type import IDPConfigType +from datadog_api_client.v2.model.idp_config_value_item import IDPConfigValueItem from datadog_api_client.v2.model.ip_allowlist_attributes import IPAllowlistAttributes from datadog_api_client.v2.model.ip_allowlist_data import IPAllowlistData from datadog_api_client.v2.model.ip_allowlist_entry import IPAllowlistEntry @@ -4156,6 +4166,8 @@ from datadog_api_client.v2.model.recommendation_data import RecommendationData from datadog_api_client.v2.model.recommendation_document import RecommendationDocument from datadog_api_client.v2.model.recommendation_type import RecommendationType +from datadog_api_client.v2.model.recommended_entity_id import RecommendedEntityID +from datadog_api_client.v2.model.recommended_entity_with_schema import RecommendedEntityWithSchema from datadog_api_client.v2.model.reference_table_create_source_type import ReferenceTableCreateSourceType from datadog_api_client.v2.model.reference_table_schema_field_type import ReferenceTableSchemaFieldType from datadog_api_client.v2.model.reference_table_sort_type import ReferenceTableSortType @@ -5942,6 +5954,7 @@ "AWSRegionsIncludeOnly", "AWSResourcesConfig", "AWSTracesConfig", + "AcceptRecommendedEntitiesResponse", "AccountFilteringConfig", "ActionConnectionAttributes", "ActionConnectionAttributesUpdate", @@ -7094,6 +7107,7 @@ "EntityResponseIncludedSchemaAttributes", "EntityResponseIncludedSchemaType", "EntityResponseMeta", + "EntitySchemaVersion", "EntityToIncidents", "EntityToOncalls", "EntityToRawSchema", @@ -7546,6 +7560,14 @@ "HourlyUsagePagination", "HourlyUsageResponse", "HourlyUsageType", + "IDPConfigAttributes", + "IDPConfigData", + "IDPConfigRequest", + "IDPConfigRequestAttributes", + "IDPConfigRequestData", + "IDPConfigResponse", + "IDPConfigType", + "IDPConfigValueItem", "IPAllowlistAttributes", "IPAllowlistData", "IPAllowlistEntry", @@ -8786,6 +8808,8 @@ "RecommendationData", "RecommendationDocument", "RecommendationType", + "RecommendedEntityID", + "RecommendedEntityWithSchema", "ReferenceTableCreateSourceType", "ReferenceTableSchemaFieldType", "ReferenceTableSortType", diff --git a/tests/v2/features/software_catalog.feature b/tests/v2/features/software_catalog.feature index 34e9f95314..91785e9a42 100644 --- a/tests/v2/features/software_catalog.feature +++ b/tests/v2/features/software_catalog.feature @@ -7,6 +7,58 @@ Feature: Software Catalog And a valid "appKeyAuth" key in the system And an instance of "SoftwareCatalog" API + @generated @skip @team:DataDog/service-catalog + Scenario: Accept recommended entities in bulk returns "Accepted" response + Given operation "AcceptRecommendedEntities" enabled + And new "AcceptRecommendedEntities" request + And body with value [{"id": "123abc456def", "schema": {"apiVersion": "v3", "datadog": {"codeLocations": [{"paths": []}], "events": [{}], "logs": [{}], "performanceData": {"tags": []}, "pipelines": {"fingerprints": []}}, "integrations": {"opsgenie": {"serviceURL": "https://www.opsgenie.com/service/shopping-cart"}, "pagerduty": {"serviceURL": "https://www.pagerduty.com/service-directory/Pshopping-cart"}}, "kind": "service", "metadata": {"additionalOwners": [{"name": ""}], "contacts": [{"contact": "https://slack/", "type": "slack"}], "id": "4b163705-23c0-4573-b2fb-f6cea2163fcb", "inheritFrom": "application:default/myapp", "links": [{"name": "mylink", "type": "link", "url": "https://mylink"}], "name": "myService", "namespace": "default", "tags": ["this:tag", "that:tag"]}, "spec": {"componentOf": [], "dependsOn": [], "languages": []}}}] + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/service-catalog + Scenario: Accept recommended entities in bulk returns "Bad Request" response + Given operation "AcceptRecommendedEntities" enabled + And new "AcceptRecommendedEntities" request + And body with value [{"id": "123abc456def", "schema": {"apiVersion": "v3", "datadog": {"codeLocations": [{"paths": []}], "events": [{}], "logs": [{}], "performanceData": {"tags": []}, "pipelines": {"fingerprints": []}}, "integrations": {"opsgenie": {"serviceURL": "https://www.opsgenie.com/service/shopping-cart"}, "pagerduty": {"serviceURL": "https://www.pagerduty.com/service-directory/Pshopping-cart"}}, "kind": "service", "metadata": {"additionalOwners": [{"name": ""}], "contacts": [{"contact": "https://slack/", "type": "slack"}], "id": "4b163705-23c0-4573-b2fb-f6cea2163fcb", "inheritFrom": "application:default/myapp", "links": [{"name": "mylink", "type": "link", "url": "https://mylink"}], "name": "myService", "namespace": "default", "tags": ["this:tag", "that:tag"]}, "spec": {"componentOf": [], "dependsOn": [], "languages": []}}}] + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Convert entities between schema versions returns "Bad Request" response + Given operation "ConvertCatalogEntities" enabled + And new "ConvertCatalogEntities" request + And request contains "target_version" parameter from "REPLACE.ME" + And body with value {"apiVersion": "v3", "datadog": {"codeLocations": [{"paths": []}], "events": [{}], "logs": [{}], "performanceData": {"tags": []}, "pipelines": {"fingerprints": []}}, "integrations": {"opsgenie": {"serviceURL": "https://www.opsgenie.com/service/shopping-cart"}, "pagerduty": {"serviceURL": "https://www.pagerduty.com/service-directory/Pshopping-cart"}}, "kind": "service", "metadata": {"additionalOwners": [{"name": ""}], "contacts": [{"contact": "https://slack/", "type": "slack"}], "id": "4b163705-23c0-4573-b2fb-f6cea2163fcb", "inheritFrom": "application:default/myapp", "links": [{"name": "mylink", "type": "link", "url": "https://mylink"}], "name": "myService", "namespace": "default", "tags": ["this:tag", "that:tag"]}, "spec": {"componentOf": [], "dependsOn": [], "languages": []}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Convert entities between schema versions returns "OK" response + Given operation "ConvertCatalogEntities" enabled + And new "ConvertCatalogEntities" request + And request contains "target_version" parameter from "REPLACE.ME" + And body with value {"apiVersion": "v3", "datadog": {"codeLocations": [{"paths": []}], "events": [{}], "logs": [{}], "performanceData": {"tags": []}, "pipelines": {"fingerprints": []}}, "integrations": {"opsgenie": {"serviceURL": "https://www.opsgenie.com/service/shopping-cart"}, "pagerduty": {"serviceURL": "https://www.pagerduty.com/service-directory/Pshopping-cart"}}, "kind": "service", "metadata": {"additionalOwners": [{"name": ""}], "contacts": [{"contact": "https://slack/", "type": "slack"}], "id": "4b163705-23c0-4573-b2fb-f6cea2163fcb", "inheritFrom": "application:default/myapp", "links": [{"name": "mylink", "type": "link", "url": "https://mylink"}], "name": "myService", "namespace": "default", "tags": ["this:tag", "that:tag"]}, "spec": {"componentOf": [], "dependsOn": [], "languages": []}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/service-catalog + Scenario: Create or update IDP configuration returns "Bad Request" response + Given operation "UpsertIDPConfigValue" enabled + And new "UpsertIDPConfigValue" request + And request contains "config_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"value": [{"displayName": "My Dashboard", "id": "dashboard-1"}]}, "type": "idp_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Create or update IDP configuration returns "No Content" response + Given operation "UpsertIDPConfigValue" enabled + And new "UpsertIDPConfigValue" request + And request contains "config_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"value": [{"displayName": "My Dashboard", "id": "dashboard-1"}]}, "type": "idp_config"}} + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/service-catalog Scenario: Create or update entities returns "ACCEPTED" response Given new "UpsertCatalogEntity" request @@ -52,6 +104,22 @@ Feature: Software Catalog And the response "data[0].attributes.kind" is equal to "service" And the response "data[0].attributes.name" is equal to "service-{{ unique_lower_alnum }}" + @generated @skip @team:DataDog/service-catalog + Scenario: Decline recommended entities in bulk returns "Bad Request" response + Given operation "DeclineRecommendedEntities" enabled + And new "DeclineRecommendedEntities" request + And body with value [{"id": "123abcdef"}] + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Decline recommended entities in bulk returns "No Content" response + Given operation "DeclineRecommendedEntities" enabled + And new "DeclineRecommendedEntities" request + And body with value [{"id": "123abcdef"}] + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/service-catalog Scenario: Delete a single entity returns "Bad Request" response Given new "DeleteCatalogEntity" request @@ -102,6 +170,30 @@ Feature: Software Catalog Then the response status is 404 Not Found And the response "errors[0]" is equal to "Not Found" + @generated @skip @team:DataDog/service-catalog + Scenario: Get Internal Developer Portal configuration returns "Bad Request" response + Given operation "GetIDPConfigValue" enabled + And new "GetIDPConfigValue" request + And request contains "config_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Get Internal Developer Portal configuration returns "Not Found" response + Given operation "GetIDPConfigValue" enabled + And new "GetIDPConfigValue" request + And request contains "config_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/service-catalog + Scenario: Get Internal Developer Portal configuration returns "OK" response + Given operation "GetIDPConfigValue" enabled + And new "GetIDPConfigValue" request + And request contains "config_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/service-catalog Scenario: Get a list of entities returns "OK" response Given new "ListCatalogEntity" request @@ -150,3 +242,17 @@ Feature: Software Catalog Given new "PreviewCatalogEntities" request When the request is sent Then the response status is 202 Accepted + + @generated @skip @team:DataDog/service-catalog + Scenario: Trigger recommended entity discovery returns "Accepted" response + Given operation "TriggerRecommendedEntities" enabled + And new "TriggerRecommendedEntities" request + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/service-catalog + Scenario: Trigger recommended entity discovery returns "Bad Request" response + Given operation "TriggerRecommendedEntities" enabled + And new "TriggerRecommendedEntities" request + When the request is sent + Then the response status is 400 Bad Request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index c0ec7dbe41..ab04e3867f 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -879,6 +879,12 @@ "type": "unsafe" } }, + "ConvertCatalogEntities": { + "tag": "Software Catalog", + "undo": { + "type": "safe" + } + }, "PreviewCatalogEntities": { "tag": "Software Catalog", "undo": { @@ -916,6 +922,24 @@ "type": "idempotent" } }, + "AcceptRecommendedEntities": { + "tag": "Software Catalog", + "undo": { + "type": "unsafe" + } + }, + "DeclineRecommendedEntities": { + "tag": "Software Catalog", + "undo": { + "type": "unsafe" + } + }, + "TriggerRecommendedEntities": { + "tag": "Software Catalog", + "undo": { + "type": "safe" + } + }, "ListCatalogRelation": { "tag": "Software Catalog", "undo": { @@ -1630,6 +1654,18 @@ "type": "unsafe" } }, + "GetIDPConfigValue": { + "tag": "Software Catalog", + "undo": { + "type": "safe" + } + }, + "UpsertIDPConfigValue": { + "tag": "Software Catalog", + "undo": { + "type": "unsafe" + } + }, "ListIncidents": { "tag": "Incidents", "undo": {