Skip to content

Commit 9002192

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add componentOf field to Service, Queue, and Datastore V3 Software Catalog definitions (#3003)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 7cd15a7 commit 9002192

7 files changed

Lines changed: 140 additions & 19 deletions

File tree

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-04-02 19:55:32.383429",
8-
"spec_repo_commit": "1cc45c45"
7+
"regenerated": "2025-04-02 20:49:30.283371",
8+
"spec_repo_commit": "9ea284b5"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-04-02 19:55:32.399089",
13-
"spec_repo_commit": "1cc45c45"
12+
"regenerated": "2025-04-02 20:49:30.298853",
13+
"spec_repo_commit": "9ea284b5"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12431,6 +12431,11 @@ components:
1243112431
additionalProperties: false
1243212432
description: The definition of Entity V3 Datastore Spec object.
1243312433
properties:
12434+
componentOf:
12435+
description: A list of components the datastore is a part of
12436+
items:
12437+
type: string
12438+
type: array
1243412439
lifecycle:
1243512440
description: The lifecycle state of the datastore.
1243612441
minLength: 1
@@ -12629,6 +12634,11 @@ components:
1262912634
additionalProperties: false
1263012635
description: The definition of Entity V3 Queue Spec object.
1263112636
properties:
12637+
componentOf:
12638+
description: A list of components the queue is a part of
12639+
items:
12640+
type: string
12641+
type: array
1263212642
lifecycle:
1263312643
description: The lifecycle state of the queue.
1263412644
minLength: 1
@@ -12694,6 +12704,11 @@ components:
1269412704
additionalProperties: false
1269512705
description: The definition of Entity V3 Service Spec object.
1269612706
properties:
12707+
componentOf:
12708+
description: A list of components the service is a part of
12709+
items:
12710+
type: string
12711+
type: array
1269712712
dependsOn:
1269812713
description: A list of components the service depends on.
1269912714
items:

api/datadogV2/model_entity_v3_datastore_spec.go

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010

1111
// EntityV3DatastoreSpec The definition of Entity V3 Datastore Spec object.
1212
type EntityV3DatastoreSpec struct {
13+
// A list of components the datastore is a part of
14+
ComponentOf []string `json:"componentOf,omitempty"`
1315
// The lifecycle state of the datastore.
1416
Lifecycle *string `json:"lifecycle,omitempty"`
1517
// The importance of the datastore.
@@ -37,6 +39,34 @@ func NewEntityV3DatastoreSpecWithDefaults() *EntityV3DatastoreSpec {
3739
return &this
3840
}
3941

42+
// GetComponentOf returns the ComponentOf field value if set, zero value otherwise.
43+
func (o *EntityV3DatastoreSpec) GetComponentOf() []string {
44+
if o == nil || o.ComponentOf == nil {
45+
var ret []string
46+
return ret
47+
}
48+
return o.ComponentOf
49+
}
50+
51+
// GetComponentOfOk returns a tuple with the ComponentOf field value if set, nil otherwise
52+
// and a boolean to check if the value has been set.
53+
func (o *EntityV3DatastoreSpec) GetComponentOfOk() (*[]string, bool) {
54+
if o == nil || o.ComponentOf == nil {
55+
return nil, false
56+
}
57+
return &o.ComponentOf, true
58+
}
59+
60+
// HasComponentOf returns a boolean if a field has been set.
61+
func (o *EntityV3DatastoreSpec) HasComponentOf() bool {
62+
return o != nil && o.ComponentOf != nil
63+
}
64+
65+
// SetComponentOf gets a reference to the given []string and assigns it to the ComponentOf field.
66+
func (o *EntityV3DatastoreSpec) SetComponentOf(v []string) {
67+
o.ComponentOf = v
68+
}
69+
4070
// GetLifecycle returns the Lifecycle field value if set, zero value otherwise.
4171
func (o *EntityV3DatastoreSpec) GetLifecycle() string {
4272
if o == nil || o.Lifecycle == nil {
@@ -127,6 +157,9 @@ func (o EntityV3DatastoreSpec) MarshalJSON() ([]byte, error) {
127157
if o.UnparsedObject != nil {
128158
return datadog.Marshal(o.UnparsedObject)
129159
}
160+
if o.ComponentOf != nil {
161+
toSerialize["componentOf"] = o.ComponentOf
162+
}
130163
if o.Lifecycle != nil {
131164
toSerialize["lifecycle"] = o.Lifecycle
132165
}
@@ -142,13 +175,15 @@ func (o EntityV3DatastoreSpec) MarshalJSON() ([]byte, error) {
142175
// UnmarshalJSON deserializes the given payload.
143176
func (o *EntityV3DatastoreSpec) UnmarshalJSON(bytes []byte) (err error) {
144177
all := struct {
145-
Lifecycle *string `json:"lifecycle,omitempty"`
146-
Tier *string `json:"tier,omitempty"`
147-
Type *string `json:"type,omitempty"`
178+
ComponentOf []string `json:"componentOf,omitempty"`
179+
Lifecycle *string `json:"lifecycle,omitempty"`
180+
Tier *string `json:"tier,omitempty"`
181+
Type *string `json:"type,omitempty"`
148182
}{}
149183
if err = datadog.Unmarshal(bytes, &all); err != nil {
150184
return datadog.Unmarshal(bytes, &o.UnparsedObject)
151185
}
186+
o.ComponentOf = all.ComponentOf
152187
o.Lifecycle = all.Lifecycle
153188
o.Tier = all.Tier
154189
o.Type = all.Type

api/datadogV2/model_entity_v3_queue_spec.go

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010

1111
// EntityV3QueueSpec The definition of Entity V3 Queue Spec object.
1212
type EntityV3QueueSpec struct {
13+
// A list of components the queue is a part of
14+
ComponentOf []string `json:"componentOf,omitempty"`
1315
// The lifecycle state of the queue.
1416
Lifecycle *string `json:"lifecycle,omitempty"`
1517
// The importance of the queue.
@@ -37,6 +39,34 @@ func NewEntityV3QueueSpecWithDefaults() *EntityV3QueueSpec {
3739
return &this
3840
}
3941

42+
// GetComponentOf returns the ComponentOf field value if set, zero value otherwise.
43+
func (o *EntityV3QueueSpec) GetComponentOf() []string {
44+
if o == nil || o.ComponentOf == nil {
45+
var ret []string
46+
return ret
47+
}
48+
return o.ComponentOf
49+
}
50+
51+
// GetComponentOfOk returns a tuple with the ComponentOf field value if set, nil otherwise
52+
// and a boolean to check if the value has been set.
53+
func (o *EntityV3QueueSpec) GetComponentOfOk() (*[]string, bool) {
54+
if o == nil || o.ComponentOf == nil {
55+
return nil, false
56+
}
57+
return &o.ComponentOf, true
58+
}
59+
60+
// HasComponentOf returns a boolean if a field has been set.
61+
func (o *EntityV3QueueSpec) HasComponentOf() bool {
62+
return o != nil && o.ComponentOf != nil
63+
}
64+
65+
// SetComponentOf gets a reference to the given []string and assigns it to the ComponentOf field.
66+
func (o *EntityV3QueueSpec) SetComponentOf(v []string) {
67+
o.ComponentOf = v
68+
}
69+
4070
// GetLifecycle returns the Lifecycle field value if set, zero value otherwise.
4171
func (o *EntityV3QueueSpec) GetLifecycle() string {
4272
if o == nil || o.Lifecycle == nil {
@@ -127,6 +157,9 @@ func (o EntityV3QueueSpec) MarshalJSON() ([]byte, error) {
127157
if o.UnparsedObject != nil {
128158
return datadog.Marshal(o.UnparsedObject)
129159
}
160+
if o.ComponentOf != nil {
161+
toSerialize["componentOf"] = o.ComponentOf
162+
}
130163
if o.Lifecycle != nil {
131164
toSerialize["lifecycle"] = o.Lifecycle
132165
}
@@ -142,13 +175,15 @@ func (o EntityV3QueueSpec) MarshalJSON() ([]byte, error) {
142175
// UnmarshalJSON deserializes the given payload.
143176
func (o *EntityV3QueueSpec) UnmarshalJSON(bytes []byte) (err error) {
144177
all := struct {
145-
Lifecycle *string `json:"lifecycle,omitempty"`
146-
Tier *string `json:"tier,omitempty"`
147-
Type *string `json:"type,omitempty"`
178+
ComponentOf []string `json:"componentOf,omitempty"`
179+
Lifecycle *string `json:"lifecycle,omitempty"`
180+
Tier *string `json:"tier,omitempty"`
181+
Type *string `json:"type,omitempty"`
148182
}{}
149183
if err = datadog.Unmarshal(bytes, &all); err != nil {
150184
return datadog.Unmarshal(bytes, &o.UnparsedObject)
151185
}
186+
o.ComponentOf = all.ComponentOf
152187
o.Lifecycle = all.Lifecycle
153188
o.Tier = all.Tier
154189
o.Type = all.Type

api/datadogV2/model_entity_v3_service_spec.go

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010

1111
// EntityV3ServiceSpec The definition of Entity V3 Service Spec object.
1212
type EntityV3ServiceSpec struct {
13+
// A list of components the service is a part of
14+
ComponentOf []string `json:"componentOf,omitempty"`
1315
// A list of components the service depends on.
1416
DependsOn []string `json:"dependsOn,omitempty"`
1517
// The service's programming language.
@@ -41,6 +43,34 @@ func NewEntityV3ServiceSpecWithDefaults() *EntityV3ServiceSpec {
4143
return &this
4244
}
4345

46+
// GetComponentOf returns the ComponentOf field value if set, zero value otherwise.
47+
func (o *EntityV3ServiceSpec) GetComponentOf() []string {
48+
if o == nil || o.ComponentOf == nil {
49+
var ret []string
50+
return ret
51+
}
52+
return o.ComponentOf
53+
}
54+
55+
// GetComponentOfOk returns a tuple with the ComponentOf field value if set, nil otherwise
56+
// and a boolean to check if the value has been set.
57+
func (o *EntityV3ServiceSpec) GetComponentOfOk() (*[]string, bool) {
58+
if o == nil || o.ComponentOf == nil {
59+
return nil, false
60+
}
61+
return &o.ComponentOf, true
62+
}
63+
64+
// HasComponentOf returns a boolean if a field has been set.
65+
func (o *EntityV3ServiceSpec) HasComponentOf() bool {
66+
return o != nil && o.ComponentOf != nil
67+
}
68+
69+
// SetComponentOf gets a reference to the given []string and assigns it to the ComponentOf field.
70+
func (o *EntityV3ServiceSpec) SetComponentOf(v []string) {
71+
o.ComponentOf = v
72+
}
73+
4474
// GetDependsOn returns the DependsOn field value if set, zero value otherwise.
4575
func (o *EntityV3ServiceSpec) GetDependsOn() []string {
4676
if o == nil || o.DependsOn == nil {
@@ -187,6 +217,9 @@ func (o EntityV3ServiceSpec) MarshalJSON() ([]byte, error) {
187217
if o.UnparsedObject != nil {
188218
return datadog.Marshal(o.UnparsedObject)
189219
}
220+
if o.ComponentOf != nil {
221+
toSerialize["componentOf"] = o.ComponentOf
222+
}
190223
if o.DependsOn != nil {
191224
toSerialize["dependsOn"] = o.DependsOn
192225
}
@@ -208,15 +241,17 @@ func (o EntityV3ServiceSpec) MarshalJSON() ([]byte, error) {
208241
// UnmarshalJSON deserializes the given payload.
209242
func (o *EntityV3ServiceSpec) UnmarshalJSON(bytes []byte) (err error) {
210243
all := struct {
211-
DependsOn []string `json:"dependsOn,omitempty"`
212-
Languages []string `json:"languages,omitempty"`
213-
Lifecycle *string `json:"lifecycle,omitempty"`
214-
Tier *string `json:"tier,omitempty"`
215-
Type *string `json:"type,omitempty"`
244+
ComponentOf []string `json:"componentOf,omitempty"`
245+
DependsOn []string `json:"dependsOn,omitempty"`
246+
Languages []string `json:"languages,omitempty"`
247+
Lifecycle *string `json:"lifecycle,omitempty"`
248+
Tier *string `json:"tier,omitempty"`
249+
Type *string `json:"type,omitempty"`
216250
}{}
217251
if err = datadog.Unmarshal(bytes, &all); err != nil {
218252
return datadog.Unmarshal(bytes, &o.UnparsedObject)
219253
}
254+
o.ComponentOf = all.ComponentOf
220255
o.DependsOn = all.DependsOn
221256
o.Languages = all.Languages
222257
o.Lifecycle = all.Lifecycle

examples/v2/software-catalog/UpsertCatalogEntity.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ func main() {
7474
},
7575
},
7676
Spec: &datadogV2.EntityV3ServiceSpec{
77-
DependsOn: []string{},
78-
Languages: []string{},
77+
ComponentOf: []string{},
78+
DependsOn: []string{},
79+
Languages: []string{},
7980
},
8081
}}}
8182
ctx := datadog.NewDefaultContext(context.Background())

tests/scenarios/features/v2/software_catalog.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ Feature: Software Catalog
1010
@generated @skip @team:DataDog/service-catalog
1111
Scenario: Create or update entities returns "ACCEPTED" response
1212
Given new "UpsertCatalogEntity" request
13-
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": []}}
13+
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": []}}
1414
When the request is sent
1515
Then the response status is 202 ACCEPTED
1616

1717
@generated @skip @team:DataDog/service-catalog
1818
Scenario: Create or update entities returns "Bad Request" response
1919
Given new "UpsertCatalogEntity" request
20-
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": []}}
20+
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": []}}
2121
When the request is sent
2222
Then the response status is 400 Bad Request
2323

0 commit comments

Comments
 (0)