Skip to content

Commit 1d66514

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add cross_org_uuids to v2 query endpoints (#4040)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent c969ccf commit 1d66514

13 files changed

Lines changed: 483 additions & 31 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4231,6 +4231,8 @@ components:
42314231
description: >-
42324232
A query for APM dependency statistics between services, such as call latency and error rates.
42334233
properties:
4234+
cross_org_uuids:
4235+
$ref: "#/components/schemas/CrossOrgUuids"
42344236
data_source:
42354237
$ref: "#/components/schemas/ApmDependencyStatsDataSource"
42364238
env:
@@ -4289,6 +4291,8 @@ components:
42894291
description: >-
42904292
A query for APM trace metrics such as hits, errors, and latency percentiles, aggregated across services.
42914293
properties:
4294+
cross_org_uuids:
4295+
$ref: "#/components/schemas/CrossOrgUuids"
42924296
data_source:
42934297
$ref: "#/components/schemas/ApmMetricsDataSource"
42944298
group_by:
@@ -4439,6 +4443,8 @@ components:
44394443
description: >-
44404444
A query for APM resource statistics such as latency, error rate, and hit count, grouped by resource name.
44414445
properties:
4446+
cross_org_uuids:
4447+
$ref: "#/components/schemas/CrossOrgUuids"
44424448
data_source:
44434449
$ref: "#/components/schemas/ApmResourceStatsDataSource"
44444450
env:
@@ -15258,6 +15264,8 @@ components:
1525815264
properties:
1525915265
aggregator:
1526015266
$ref: "#/components/schemas/MetricsAggregator"
15267+
cross_org_uuids:
15268+
$ref: "#/components/schemas/CrossOrgUuids"
1526115269
data_source:
1526215270
$ref: "#/components/schemas/ContainerDataSource"
1526315271
is_normalized_cpu:
@@ -15295,6 +15303,8 @@ components:
1529515303
ContainerTimeseriesQuery:
1529615304
description: A query for container-level metrics such as CPU and memory usage.
1529715305
properties:
15306+
cross_org_uuids:
15307+
$ref: "#/components/schemas/CrossOrgUuids"
1529815308
data_source:
1529915309
$ref: "#/components/schemas/ContainerDataSource"
1530015310
is_normalized_cpu:
@@ -18122,6 +18132,14 @@ components:
1812218132
nullable: true
1812318133
type: string
1812418134
type: object
18135+
CrossOrgUuids:
18136+
description: >-
18137+
Organization UUIDs to query when using [cross-organization visibility](/account_management/org_settings/cross_org_visibility/). Limited to one organization UUID.
18138+
items:
18139+
description: An organization UUID.
18140+
type: string
18141+
maxItems: 1
18142+
type: array
1812518143
CsmAgentData:
1812618144
description: Single Agent Data.
1812718145
properties:
@@ -26178,6 +26196,8 @@ components:
2617826196
properties:
2617926197
compute:
2618026198
$ref: "#/components/schemas/EventsCompute"
26199+
cross_org_uuids:
26200+
$ref: "#/components/schemas/CrossOrgUuids"
2618126201
data_source:
2618226202
$ref: "#/components/schemas/EventsDataSource"
2618326203
group_by:
@@ -26231,6 +26251,8 @@ components:
2623126251
properties:
2623226252
compute:
2623326253
$ref: "#/components/schemas/EventsCompute"
26254+
cross_org_uuids:
26255+
$ref: "#/components/schemas/CrossOrgUuids"
2623426256
data_source:
2623526257
$ref: "#/components/schemas/EventsDataSource"
2623626258
group_by:
@@ -44141,6 +44163,8 @@ components:
4414144163
properties:
4414244164
aggregator:
4414344165
$ref: "#/components/schemas/MetricsAggregator"
44166+
cross_org_uuids:
44167+
$ref: "#/components/schemas/CrossOrgUuids"
4414444168
data_source:
4414544169
$ref: "#/components/schemas/MetricsDataSource"
4414644170
name:
@@ -44158,6 +44182,8 @@ components:
4415844182
MetricsTimeseriesQuery:
4415944183
description: A query against Datadog custom metrics or Cloud Cost data sources.
4416044184
properties:
44185+
cross_org_uuids:
44186+
$ref: "#/components/schemas/CrossOrgUuids"
4416144187
data_source:
4416244188
$ref: "#/components/schemas/MetricsDataSource"
4416344189
name:
@@ -55272,6 +55298,8 @@ components:
5527255298
properties:
5527355299
aggregator:
5527455300
$ref: "#/components/schemas/MetricsAggregator"
55301+
cross_org_uuids:
55302+
$ref: "#/components/schemas/CrossOrgUuids"
5527555303
data_source:
5527655304
$ref: "#/components/schemas/ProcessDataSource"
5527755305
is_normalized_cpu:
@@ -55395,6 +55423,8 @@ components:
5539555423
ProcessTimeseriesQuery:
5539655424
description: A query for host-level process metrics such as CPU and memory usage.
5539755425
properties:
55426+
cross_org_uuids:
55427+
$ref: "#/components/schemas/CrossOrgUuids"
5539855428
data_source:
5539955429
$ref: "#/components/schemas/ProcessDataSource"
5540055430
is_normalized_cpu:
@@ -69802,6 +69832,8 @@ components:
6980269832
description: Additional filters applied to the SLO query.
6980369833
example: "host:host_a,env:prod"
6980469834
type: string
69835+
cross_org_uuids:
69836+
$ref: "#/components/schemas/CrossOrgUuids"
6980569837
data_source:
6980669838
$ref: "#/components/schemas/SloDataSource"
6980769839
group_mode:

api/datadogV2/model_apm_dependency_stats_query.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212

1313
// ApmDependencyStatsQuery A query for APM dependency statistics between services, such as call latency and error rates.
1414
type ApmDependencyStatsQuery struct {
15+
// Organization UUIDs to query when using [cross-organization visibility](/account_management/org_settings/cross_org_visibility/). Limited to one organization UUID.
16+
CrossOrgUuids []string `json:"cross_org_uuids,omitempty"`
1517
// A data source for APM dependency statistics queries.
1618
DataSource ApmDependencyStatsDataSource `json:"data_source"`
1719
// The environment to query.
@@ -63,6 +65,34 @@ func NewApmDependencyStatsQueryWithDefaults() *ApmDependencyStatsQuery {
6365
return &this
6466
}
6567

68+
// GetCrossOrgUuids returns the CrossOrgUuids field value if set, zero value otherwise.
69+
func (o *ApmDependencyStatsQuery) GetCrossOrgUuids() []string {
70+
if o == nil || o.CrossOrgUuids == nil {
71+
var ret []string
72+
return ret
73+
}
74+
return o.CrossOrgUuids
75+
}
76+
77+
// GetCrossOrgUuidsOk returns a tuple with the CrossOrgUuids field value if set, nil otherwise
78+
// and a boolean to check if the value has been set.
79+
func (o *ApmDependencyStatsQuery) GetCrossOrgUuidsOk() (*[]string, bool) {
80+
if o == nil || o.CrossOrgUuids == nil {
81+
return nil, false
82+
}
83+
return &o.CrossOrgUuids, true
84+
}
85+
86+
// HasCrossOrgUuids returns a boolean if a field has been set.
87+
func (o *ApmDependencyStatsQuery) HasCrossOrgUuids() bool {
88+
return o != nil && o.CrossOrgUuids != nil
89+
}
90+
91+
// SetCrossOrgUuids gets a reference to the given []string and assigns it to the CrossOrgUuids field.
92+
func (o *ApmDependencyStatsQuery) SetCrossOrgUuids(v []string) {
93+
o.CrossOrgUuids = v
94+
}
95+
6696
// GetDataSource returns the DataSource field value.
6797
func (o *ApmDependencyStatsQuery) GetDataSource() ApmDependencyStatsDataSource {
6898
if o == nil {
@@ -314,6 +344,9 @@ func (o ApmDependencyStatsQuery) MarshalJSON() ([]byte, error) {
314344
if o.UnparsedObject != nil {
315345
return datadog.Marshal(o.UnparsedObject)
316346
}
347+
if o.CrossOrgUuids != nil {
348+
toSerialize["cross_org_uuids"] = o.CrossOrgUuids
349+
}
317350
toSerialize["data_source"] = o.DataSource
318351
toSerialize["env"] = o.Env
319352
if o.IsUpstream != nil {
@@ -340,6 +373,7 @@ func (o ApmDependencyStatsQuery) MarshalJSON() ([]byte, error) {
340373
// UnmarshalJSON deserializes the given payload.
341374
func (o *ApmDependencyStatsQuery) UnmarshalJSON(bytes []byte) (err error) {
342375
all := struct {
376+
CrossOrgUuids []string `json:"cross_org_uuids,omitempty"`
343377
DataSource *ApmDependencyStatsDataSource `json:"data_source"`
344378
Env *string `json:"env"`
345379
IsUpstream *bool `json:"is_upstream,omitempty"`
@@ -377,12 +411,13 @@ func (o *ApmDependencyStatsQuery) UnmarshalJSON(bytes []byte) (err error) {
377411
}
378412
additionalProperties := make(map[string]interface{})
379413
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
380-
datadog.DeleteKeys(additionalProperties, &[]string{"data_source", "env", "is_upstream", "name", "operation_name", "primary_tag_name", "primary_tag_value", "resource_name", "service", "stat"})
414+
datadog.DeleteKeys(additionalProperties, &[]string{"cross_org_uuids", "data_source", "env", "is_upstream", "name", "operation_name", "primary_tag_name", "primary_tag_value", "resource_name", "service", "stat"})
381415
} else {
382416
return err
383417
}
384418

385419
hasInvalidField := false
420+
o.CrossOrgUuids = all.CrossOrgUuids
386421
if !all.DataSource.IsValid() {
387422
hasInvalidField = true
388423
} else {

api/datadogV2/model_apm_metrics_query.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212

1313
// ApmMetricsQuery A query for APM trace metrics such as hits, errors, and latency percentiles, aggregated across services.
1414
type ApmMetricsQuery struct {
15+
// Organization UUIDs to query when using [cross-organization visibility](/account_management/org_settings/cross_org_visibility/). Limited to one organization UUID.
16+
CrossOrgUuids []string `json:"cross_org_uuids,omitempty"`
1517
// A data source for APM metrics queries.
1618
DataSource ApmMetricsDataSource `json:"data_source"`
1719
// Optional fields to group the query results by.
@@ -63,6 +65,34 @@ func NewApmMetricsQueryWithDefaults() *ApmMetricsQuery {
6365
return &this
6466
}
6567

68+
// GetCrossOrgUuids returns the CrossOrgUuids field value if set, zero value otherwise.
69+
func (o *ApmMetricsQuery) GetCrossOrgUuids() []string {
70+
if o == nil || o.CrossOrgUuids == nil {
71+
var ret []string
72+
return ret
73+
}
74+
return o.CrossOrgUuids
75+
}
76+
77+
// GetCrossOrgUuidsOk returns a tuple with the CrossOrgUuids field value if set, nil otherwise
78+
// and a boolean to check if the value has been set.
79+
func (o *ApmMetricsQuery) GetCrossOrgUuidsOk() (*[]string, bool) {
80+
if o == nil || o.CrossOrgUuids == nil {
81+
return nil, false
82+
}
83+
return &o.CrossOrgUuids, true
84+
}
85+
86+
// HasCrossOrgUuids returns a boolean if a field has been set.
87+
func (o *ApmMetricsQuery) HasCrossOrgUuids() bool {
88+
return o != nil && o.CrossOrgUuids != nil
89+
}
90+
91+
// SetCrossOrgUuids gets a reference to the given []string and assigns it to the CrossOrgUuids field.
92+
func (o *ApmMetricsQuery) SetCrossOrgUuids(v []string) {
93+
o.CrossOrgUuids = v
94+
}
95+
6696
// GetDataSource returns the DataSource field value.
6797
func (o *ApmMetricsQuery) GetDataSource() ApmMetricsDataSource {
6898
if o == nil {
@@ -390,6 +420,9 @@ func (o ApmMetricsQuery) MarshalJSON() ([]byte, error) {
390420
if o.UnparsedObject != nil {
391421
return datadog.Marshal(o.UnparsedObject)
392422
}
423+
if o.CrossOrgUuids != nil {
424+
toSerialize["cross_org_uuids"] = o.CrossOrgUuids
425+
}
393426
toSerialize["data_source"] = o.DataSource
394427
if o.GroupBy != nil {
395428
toSerialize["group_by"] = o.GroupBy
@@ -430,6 +463,7 @@ func (o ApmMetricsQuery) MarshalJSON() ([]byte, error) {
430463
// UnmarshalJSON deserializes the given payload.
431464
func (o *ApmMetricsQuery) UnmarshalJSON(bytes []byte) (err error) {
432465
all := struct {
466+
CrossOrgUuids []string `json:"cross_org_uuids,omitempty"`
433467
DataSource *ApmMetricsDataSource `json:"data_source"`
434468
GroupBy []string `json:"group_by,omitempty"`
435469
Name *string `json:"name"`
@@ -457,12 +491,13 @@ func (o *ApmMetricsQuery) UnmarshalJSON(bytes []byte) (err error) {
457491
}
458492
additionalProperties := make(map[string]interface{})
459493
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
460-
datadog.DeleteKeys(additionalProperties, &[]string{"data_source", "group_by", "name", "operation_mode", "operation_name", "peer_tags", "query_filter", "resource_hash", "resource_name", "service", "span_kind", "stat"})
494+
datadog.DeleteKeys(additionalProperties, &[]string{"cross_org_uuids", "data_source", "group_by", "name", "operation_mode", "operation_name", "peer_tags", "query_filter", "resource_hash", "resource_name", "service", "span_kind", "stat"})
461495
} else {
462496
return err
463497
}
464498

465499
hasInvalidField := false
500+
o.CrossOrgUuids = all.CrossOrgUuids
466501
if !all.DataSource.IsValid() {
467502
hasInvalidField = true
468503
} else {

api/datadogV2/model_apm_resource_stats_query.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212

1313
// ApmResourceStatsQuery A query for APM resource statistics such as latency, error rate, and hit count, grouped by resource name.
1414
type ApmResourceStatsQuery struct {
15+
// Organization UUIDs to query when using [cross-organization visibility](/account_management/org_settings/cross_org_visibility/). Limited to one organization UUID.
16+
CrossOrgUuids []string `json:"cross_org_uuids,omitempty"`
1517
// A data source for APM resource statistics queries.
1618
DataSource ApmResourceStatsDataSource `json:"data_source"`
1719
// The environment to query.
@@ -61,6 +63,34 @@ func NewApmResourceStatsQueryWithDefaults() *ApmResourceStatsQuery {
6163
return &this
6264
}
6365

66+
// GetCrossOrgUuids returns the CrossOrgUuids field value if set, zero value otherwise.
67+
func (o *ApmResourceStatsQuery) GetCrossOrgUuids() []string {
68+
if o == nil || o.CrossOrgUuids == nil {
69+
var ret []string
70+
return ret
71+
}
72+
return o.CrossOrgUuids
73+
}
74+
75+
// GetCrossOrgUuidsOk returns a tuple with the CrossOrgUuids field value if set, nil otherwise
76+
// and a boolean to check if the value has been set.
77+
func (o *ApmResourceStatsQuery) GetCrossOrgUuidsOk() (*[]string, bool) {
78+
if o == nil || o.CrossOrgUuids == nil {
79+
return nil, false
80+
}
81+
return &o.CrossOrgUuids, true
82+
}
83+
84+
// HasCrossOrgUuids returns a boolean if a field has been set.
85+
func (o *ApmResourceStatsQuery) HasCrossOrgUuids() bool {
86+
return o != nil && o.CrossOrgUuids != nil
87+
}
88+
89+
// SetCrossOrgUuids gets a reference to the given []string and assigns it to the CrossOrgUuids field.
90+
func (o *ApmResourceStatsQuery) SetCrossOrgUuids(v []string) {
91+
o.CrossOrgUuids = v
92+
}
93+
6494
// GetDataSource returns the DataSource field value.
6595
func (o *ApmResourceStatsQuery) GetDataSource() ApmResourceStatsDataSource {
6696
if o == nil {
@@ -322,6 +352,9 @@ func (o ApmResourceStatsQuery) MarshalJSON() ([]byte, error) {
322352
if o.UnparsedObject != nil {
323353
return datadog.Marshal(o.UnparsedObject)
324354
}
355+
if o.CrossOrgUuids != nil {
356+
toSerialize["cross_org_uuids"] = o.CrossOrgUuids
357+
}
325358
toSerialize["data_source"] = o.DataSource
326359
toSerialize["env"] = o.Env
327360
if o.GroupBy != nil {
@@ -352,6 +385,7 @@ func (o ApmResourceStatsQuery) MarshalJSON() ([]byte, error) {
352385
// UnmarshalJSON deserializes the given payload.
353386
func (o *ApmResourceStatsQuery) UnmarshalJSON(bytes []byte) (err error) {
354387
all := struct {
388+
CrossOrgUuids []string `json:"cross_org_uuids,omitempty"`
355389
DataSource *ApmResourceStatsDataSource `json:"data_source"`
356390
Env *string `json:"env"`
357391
GroupBy []string `json:"group_by,omitempty"`
@@ -383,12 +417,13 @@ func (o *ApmResourceStatsQuery) UnmarshalJSON(bytes []byte) (err error) {
383417
}
384418
additionalProperties := make(map[string]interface{})
385419
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
386-
datadog.DeleteKeys(additionalProperties, &[]string{"data_source", "env", "group_by", "name", "operation_name", "primary_tag_name", "primary_tag_value", "resource_name", "service", "stat"})
420+
datadog.DeleteKeys(additionalProperties, &[]string{"cross_org_uuids", "data_source", "env", "group_by", "name", "operation_name", "primary_tag_name", "primary_tag_value", "resource_name", "service", "stat"})
387421
} else {
388422
return err
389423
}
390424

391425
hasInvalidField := false
426+
o.CrossOrgUuids = all.CrossOrgUuids
392427
if !all.DataSource.IsValid() {
393428
hasInvalidField = true
394429
} else {

0 commit comments

Comments
 (0)