Skip to content

Add componentOf field to Service, Queue, and Datastore V3 Software Catalog definitions #2478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-04-02 19:55:46.210367",
"spec_repo_commit": "1cc45c45"
"regenerated": "2025-04-02 20:49:30.532904",
"spec_repo_commit": "9ea284b5"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-04-02 19:55:46.224947",
"spec_repo_commit": "1cc45c45"
"regenerated": "2025-04-02 20:49:30.587165",
"spec_repo_commit": "9ea284b5"
}
}
}
15 changes: 15 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12431,6 +12431,11 @@ components:
additionalProperties: false
description: The definition of Entity V3 Datastore Spec object.
properties:
componentOf:
description: A list of components the datastore is a part of
items:
type: string
type: array
lifecycle:
description: The lifecycle state of the datastore.
minLength: 1
Expand Down Expand Up @@ -12629,6 +12634,11 @@ components:
additionalProperties: false
description: The definition of Entity V3 Queue Spec object.
properties:
componentOf:
description: A list of components the queue is a part of
items:
type: string
type: array
lifecycle:
description: The lifecycle state of the queue.
minLength: 1
Expand Down Expand Up @@ -12694,6 +12704,11 @@ components:
additionalProperties: false
description: The definition of Entity V3 Service Spec object.
properties:
componentOf:
description: A list of components the service is a part of
items:
type: string
type: array
dependsOn:
description: A list of components the service depends on.
items:
Expand Down
1 change: 1 addition & 0 deletions examples/v2/software-catalog/UpsertCatalogEntity.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
],
),
spec=EntityV3ServiceSpec(
component_of=[],
depends_on=[],
languages=[],
),
Expand Down
10 changes: 9 additions & 1 deletion src/datadog_api_client/v2/model/entity_v3_datastore_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Union
from typing import List, Union

from datadog_api_client.model_utils import (
ModelNormal,
Expand All @@ -30,19 +30,22 @@ def additional_properties_type(_):
@cached_property
def openapi_types(_):
return {
"component_of": ([str],),
"lifecycle": (str,),
"tier": (str,),
"type": (str,),
}

attribute_map = {
"component_of": "componentOf",
"lifecycle": "lifecycle",
"tier": "tier",
"type": "type",
}

def __init__(
self_,
component_of: Union[List[str], UnsetType] = unset,
lifecycle: Union[str, UnsetType] = unset,
tier: Union[str, UnsetType] = unset,
type: Union[str, UnsetType] = unset,
Expand All @@ -51,6 +54,9 @@ def __init__(
"""
The definition of Entity V3 Datastore Spec object.

:param component_of: A list of components the datastore is a part of
:type component_of: [str], optional

:param lifecycle: The lifecycle state of the datastore.
:type lifecycle: str, optional

Expand All @@ -60,6 +66,8 @@ def __init__(
:param type: The type of datastore.
:type type: str, optional
"""
if component_of is not unset:
kwargs["component_of"] = component_of
if lifecycle is not unset:
kwargs["lifecycle"] = lifecycle
if tier is not unset:
Expand Down
10 changes: 9 additions & 1 deletion src/datadog_api_client/v2/model/entity_v3_queue_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Union
from typing import List, Union

from datadog_api_client.model_utils import (
ModelNormal,
Expand All @@ -30,19 +30,22 @@ def additional_properties_type(_):
@cached_property
def openapi_types(_):
return {
"component_of": ([str],),
"lifecycle": (str,),
"tier": (str,),
"type": (str,),
}

attribute_map = {
"component_of": "componentOf",
"lifecycle": "lifecycle",
"tier": "tier",
"type": "type",
}

def __init__(
self_,
component_of: Union[List[str], UnsetType] = unset,
lifecycle: Union[str, UnsetType] = unset,
tier: Union[str, UnsetType] = unset,
type: Union[str, UnsetType] = unset,
Expand All @@ -51,6 +54,9 @@ def __init__(
"""
The definition of Entity V3 Queue Spec object.

:param component_of: A list of components the queue is a part of
:type component_of: [str], optional

:param lifecycle: The lifecycle state of the queue.
:type lifecycle: str, optional

Expand All @@ -60,6 +66,8 @@ def __init__(
:param type: The type of queue.
:type type: str, optional
"""
if component_of is not unset:
kwargs["component_of"] = component_of
if lifecycle is not unset:
kwargs["lifecycle"] = lifecycle
if tier is not unset:
Expand Down
8 changes: 8 additions & 0 deletions src/datadog_api_client/v2/model/entity_v3_service_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def additional_properties_type(_):
@cached_property
def openapi_types(_):
return {
"component_of": ([str],),
"depends_on": ([str],),
"languages": ([str],),
"lifecycle": (str,),
Expand All @@ -38,6 +39,7 @@ def openapi_types(_):
}

attribute_map = {
"component_of": "componentOf",
"depends_on": "dependsOn",
"languages": "languages",
"lifecycle": "lifecycle",
Expand All @@ -47,6 +49,7 @@ def openapi_types(_):

def __init__(
self_,
component_of: Union[List[str], UnsetType] = unset,
depends_on: Union[List[str], UnsetType] = unset,
languages: Union[List[str], UnsetType] = unset,
lifecycle: Union[str, UnsetType] = unset,
Expand All @@ -57,6 +60,9 @@ def __init__(
"""
The definition of Entity V3 Service Spec object.

:param component_of: A list of components the service is a part of
:type component_of: [str], optional

:param depends_on: A list of components the service depends on.
:type depends_on: [str], optional

Expand All @@ -72,6 +78,8 @@ def __init__(
:param type: The type of service.
:type type: str, optional
"""
if component_of is not unset:
kwargs["component_of"] = component_of
if depends_on is not unset:
kwargs["depends_on"] = depends_on
if languages is not unset:
Expand Down
4 changes: 2 additions & 2 deletions tests/v2/features/software_catalog.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Feature: Software Catalog
@generated @skip @team:DataDog/service-catalog
Scenario: Create or update entities returns "ACCEPTED" response
Given new "UpsertCatalogEntity" request
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": {"dependsOn": [], "languages": []}}
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 202 ACCEPTED

@generated @skip @team:DataDog/service-catalog
Scenario: Create or update entities returns "Bad Request" response
Given new "UpsertCatalogEntity" request
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": {"dependsOn": [], "languages": []}}
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

Expand Down