Skip to content

Commit 9abe619

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update v1 and v2 GCP API specs to support monitored_resource_configs (#3121)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent abbd0e5 commit 9abe619

File tree

10 files changed

+725
-24
lines changed

10 files changed

+725
-24
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3288,15 +3288,19 @@ components:
32883288
example: https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL
32893289
type: string
32903290
cloud_run_revision_filters:
3291-
description: 'Limit the Cloud Run revisions that are pulled into Datadog
3292-
by using tags.
3291+
deprecated: true
3292+
description: 'List of filters to limit the Cloud Run revisions that are
3293+
pulled into Datadog by using tags.
32933294

32943295
Only Cloud Run revision resources that apply to specified filters are
3295-
imported into Datadog.'
3296+
imported into Datadog.
3297+
3298+
**Note:** This field is deprecated. Instead, use `monitored_resource_configs`
3299+
with `type=cloud_run_revision`'
32963300
example:
32973301
- $KEY:$VALUE
32983302
items:
3299-
description: Cloud Run Filters
3303+
description: Cloud Run revision filters
33003304
type: string
33013305
type: array
33023306
errors:
@@ -3309,11 +3313,16 @@ components:
33093313
type: string
33103314
type: array
33113315
host_filters:
3312-
description: 'Limit the GCE instances that are pulled into Datadog by using
3313-
tags.
3316+
deprecated: true
3317+
description: 'A comma-separated list of filters to limit the VM instances
3318+
that are pulled into Datadog by using tags.
33143319

3315-
Only hosts that match one of the defined tags are imported into Datadog.'
3316-
example: key:value,filter:example
3320+
Only VM instance resources that apply to specified filters are imported
3321+
into Datadog.
3322+
3323+
**Note:** This field is deprecated. Instead, use `monitored_resource_configs`
3324+
with `type=gce_instance`'
3325+
example: $KEY1:$VALUE1,$KEY2:$VALUE2
33173326
type: string
33183327
is_cspm_enabled:
33193328
description: 'When enabled, Datadog will activate the Cloud Security Monitoring
@@ -3334,6 +3343,15 @@ components:
33343343
account.'
33353344
example: true
33363345
type: boolean
3346+
monitored_resource_configs:
3347+
description: Configurations for GCP monitored resources.
3348+
example:
3349+
- filters:
3350+
- $KEY:$VALUE
3351+
type: gce_instance
3352+
items:
3353+
$ref: '#/components/schemas/GCPMonitoredResourceConfig'
3354+
type: array
33373355
private_key:
33383356
description: Your private key name found in your JSON service account key.
33393357
example: private_key
@@ -3366,6 +3384,37 @@ components:
33663384
items:
33673385
$ref: '#/components/schemas/GCPAccount'
33683386
type: array
3387+
GCPMonitoredResourceConfig:
3388+
description: Configuration for a GCP monitored resource.
3389+
properties:
3390+
filters:
3391+
description: 'List of filters to limit the monitored resources that are
3392+
pulled into Datadog by using tags.
3393+
3394+
Only monitored resources that apply to specified filters are imported
3395+
into Datadog.'
3396+
example:
3397+
- $KEY:$VALUE
3398+
items:
3399+
description: A monitored resource filter
3400+
type: string
3401+
type: array
3402+
type:
3403+
$ref: '#/components/schemas/GCPMonitoredResourceConfigType'
3404+
type: object
3405+
GCPMonitoredResourceConfigType:
3406+
description: The GCP monitored resource type. Only a subset of resource types
3407+
are supported.
3408+
enum:
3409+
- cloud_function
3410+
- cloud_run_revision
3411+
- gce_instance
3412+
example: gce_instance
3413+
type: string
3414+
x-enum-varnames:
3415+
- CLOUD_FUNCTION
3416+
- CLOUD_RUN_REVISION
3417+
- GCE_INSTANCE
33693418
GeomapWidgetDefinition:
33703419
description: This visualization displays a series of values by country on a
33713420
world map.

.generator/schemas/v2/openapi.yaml

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17694,6 +17694,37 @@ components:
1769417694
example: aiplatform
1769517695
type: string
1769617696
type: object
17697+
GCPMonitoredResourceConfig:
17698+
description: Configuration for a GCP monitored resource.
17699+
properties:
17700+
filters:
17701+
description: 'List of filters to limit the monitored resources that are
17702+
pulled into Datadog by using tags.
17703+
17704+
Only monitored resources that apply to specified filters are imported
17705+
into Datadog.'
17706+
example:
17707+
- $KEY:$VALUE
17708+
items:
17709+
description: A monitored resource filter
17710+
type: string
17711+
type: array
17712+
type:
17713+
$ref: '#/components/schemas/GCPMonitoredResourceConfigType'
17714+
type: object
17715+
GCPMonitoredResourceConfigType:
17716+
description: The GCP monitored resource type. Only a subset of resource types
17717+
are supported.
17718+
enum:
17719+
- cloud_function
17720+
- cloud_run_revision
17721+
- gce_instance
17722+
example: gce_instance
17723+
type: string
17724+
x-enum-varnames:
17725+
- CLOUD_FUNCTION
17726+
- CLOUD_RUN_REVISION
17727+
- GCE_INSTANCE
1769717728
GCPSTSDelegateAccount:
1769817729
description: Datadog principal service account info.
1769917730
properties:
@@ -17761,21 +17792,35 @@ components:
1776117792
1776217793
type: string
1776317794
cloud_run_revision_filters:
17795+
deprecated: true
1776417796
description: 'List of filters to limit the Cloud Run revisions that are
1776517797
pulled into Datadog by using tags.
1776617798

1776717799
Only Cloud Run revision resources that apply to specified filters are
17768-
imported into Datadog.'
17800+
imported into Datadog.
17801+
17802+
**Note:** This field is deprecated. Instead, use `monitored_resource_configs`
17803+
with `type=cloud_run_revision`'
1776917804
example:
1777017805
- $KEY:$VALUE
1777117806
items:
17772-
description: Cloud Run Filters
17807+
description: Cloud Run revision filters
1777317808
type: string
1777417809
type: array
1777517810
host_filters:
17776-
description: Your Host Filters.
17811+
deprecated: true
17812+
description: 'List of filters to limit the VM instances that are pulled
17813+
into Datadog by using tags.
17814+
17815+
Only VM instance resources that apply to specified filters are imported
17816+
into Datadog.
17817+
17818+
**Note:** This field is deprecated. Instead, use `monitored_resource_configs`
17819+
with `type=gce_instance`'
17820+
example:
17821+
- $KEY:$VALUE
1777717822
items:
17778-
description: Host Filters
17823+
description: VM instance filters
1777917824
type: string
1778017825
type: array
1778117826
is_cspm_enabled:
@@ -17811,6 +17856,15 @@ components:
1781117856
items:
1781217857
$ref: '#/components/schemas/GCPMetricNamespaceConfig'
1781317858
type: array
17859+
monitored_resource_configs:
17860+
description: Configurations for GCP monitored resources.
17861+
example:
17862+
- filters:
17863+
- $KEY:$VALUE
17864+
type: gce_instance
17865+
items:
17866+
$ref: '#/components/schemas/GCPMonitoredResourceConfig'
17867+
type: array
1781417868
resource_collection_enabled:
1781517869
description: When enabled, Datadog scans for all resources in your GCP environment.
1781617870
type: boolean

src/main/java/com/datadog/api/client/v1/model/GCPAccount.java

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
GCPAccount.JSON_PROPERTY_IS_CSPM_ENABLED,
3333
GCPAccount.JSON_PROPERTY_IS_RESOURCE_CHANGE_COLLECTION_ENABLED,
3434
GCPAccount.JSON_PROPERTY_IS_SECURITY_COMMAND_CENTER_ENABLED,
35+
GCPAccount.JSON_PROPERTY_MONITORED_RESOURCE_CONFIGS,
3536
GCPAccount.JSON_PROPERTY_PRIVATE_KEY,
3637
GCPAccount.JSON_PROPERTY_PRIVATE_KEY_ID,
3738
GCPAccount.JSON_PROPERTY_PROJECT_ID,
@@ -83,6 +84,10 @@ public class GCPAccount {
8384
"is_security_command_center_enabled";
8485
private Boolean isSecurityCommandCenterEnabled = false;
8586

87+
public static final String JSON_PROPERTY_MONITORED_RESOURCE_CONFIGS =
88+
"monitored_resource_configs";
89+
private List<GCPMonitoredResourceConfig> monitoredResourceConfigs = null;
90+
8691
public static final String JSON_PROPERTY_PRIVATE_KEY = "private_key";
8792
private String privateKey;
8893

@@ -243,18 +248,23 @@ public GCPAccount addCloudRunRevisionFiltersItem(String cloudRunRevisionFiltersI
243248
}
244249

245250
/**
246-
* Limit the Cloud Run revisions that are pulled into Datadog by using tags. Only Cloud Run
247-
* revision resources that apply to specified filters are imported into Datadog.
251+
* List of filters to limit the Cloud Run revisions that are pulled into Datadog by using tags.
252+
* Only Cloud Run revision resources that apply to specified filters are imported into Datadog.
253+
* <strong>Note:</strong> This field is deprecated. Instead, use <code>monitored_resource_configs
254+
* </code> with <code>type=cloud_run_revision</code>
248255
*
249256
* @return cloudRunRevisionFilters
257+
* @deprecated
250258
*/
259+
@Deprecated
251260
@jakarta.annotation.Nullable
252261
@JsonProperty(JSON_PROPERTY_CLOUD_RUN_REVISION_FILTERS)
253262
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
254263
public List<String> getCloudRunRevisionFilters() {
255264
return cloudRunRevisionFilters;
256265
}
257266

267+
@Deprecated
258268
public void setCloudRunRevisionFilters(List<String> cloudRunRevisionFilters) {
259269
this.cloudRunRevisionFilters = cloudRunRevisionFilters;
260270
}
@@ -294,18 +304,23 @@ public GCPAccount hostFilters(String hostFilters) {
294304
}
295305

296306
/**
297-
* Limit the GCE instances that are pulled into Datadog by using tags. Only hosts that match one
298-
* of the defined tags are imported into Datadog.
307+
* A comma-separated list of filters to limit the VM instances that are pulled into Datadog by
308+
* using tags. Only VM instance resources that apply to specified filters are imported into
309+
* Datadog. <strong>Note:</strong> This field is deprecated. Instead, use <code>
310+
* monitored_resource_configs</code> with <code>type=gce_instance</code>
299311
*
300312
* @return hostFilters
313+
* @deprecated
301314
*/
315+
@Deprecated
302316
@jakarta.annotation.Nullable
303317
@JsonProperty(JSON_PROPERTY_HOST_FILTERS)
304318
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
305319
public String getHostFilters() {
306320
return hostFilters;
307321
}
308322

323+
@Deprecated
309324
public void setHostFilters(String hostFilters) {
310325
this.hostFilters = hostFilters;
311326
}
@@ -375,6 +390,42 @@ public void setIsSecurityCommandCenterEnabled(Boolean isSecurityCommandCenterEna
375390
this.isSecurityCommandCenterEnabled = isSecurityCommandCenterEnabled;
376391
}
377392

393+
public GCPAccount monitoredResourceConfigs(
394+
List<GCPMonitoredResourceConfig> monitoredResourceConfigs) {
395+
this.monitoredResourceConfigs = monitoredResourceConfigs;
396+
for (GCPMonitoredResourceConfig item : monitoredResourceConfigs) {
397+
this.unparsed |= item.unparsed;
398+
}
399+
return this;
400+
}
401+
402+
public GCPAccount addMonitoredResourceConfigsItem(
403+
GCPMonitoredResourceConfig monitoredResourceConfigsItem) {
404+
if (this.monitoredResourceConfigs == null) {
405+
this.monitoredResourceConfigs = new ArrayList<>();
406+
}
407+
this.monitoredResourceConfigs.add(monitoredResourceConfigsItem);
408+
this.unparsed |= monitoredResourceConfigsItem.unparsed;
409+
return this;
410+
}
411+
412+
/**
413+
* Configurations for GCP monitored resources.
414+
*
415+
* @return monitoredResourceConfigs
416+
*/
417+
@jakarta.annotation.Nullable
418+
@JsonProperty(JSON_PROPERTY_MONITORED_RESOURCE_CONFIGS)
419+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
420+
public List<GCPMonitoredResourceConfig> getMonitoredResourceConfigs() {
421+
return monitoredResourceConfigs;
422+
}
423+
424+
public void setMonitoredResourceConfigs(
425+
List<GCPMonitoredResourceConfig> monitoredResourceConfigs) {
426+
this.monitoredResourceConfigs = monitoredResourceConfigs;
427+
}
428+
378429
public GCPAccount privateKey(String privateKey) {
379430
this.privateKey = privateKey;
380431
return this;
@@ -571,6 +622,7 @@ public boolean equals(Object o) {
571622
this.isResourceChangeCollectionEnabled, gcpAccount.isResourceChangeCollectionEnabled)
572623
&& Objects.equals(
573624
this.isSecurityCommandCenterEnabled, gcpAccount.isSecurityCommandCenterEnabled)
625+
&& Objects.equals(this.monitoredResourceConfigs, gcpAccount.monitoredResourceConfigs)
574626
&& Objects.equals(this.privateKey, gcpAccount.privateKey)
575627
&& Objects.equals(this.privateKeyId, gcpAccount.privateKeyId)
576628
&& Objects.equals(this.projectId, gcpAccount.projectId)
@@ -595,6 +647,7 @@ public int hashCode() {
595647
isCspmEnabled,
596648
isResourceChangeCollectionEnabled,
597649
isSecurityCommandCenterEnabled,
650+
monitoredResourceConfigs,
598651
privateKey,
599652
privateKeyId,
600653
projectId,
@@ -628,6 +681,9 @@ public String toString() {
628681
sb.append(" isSecurityCommandCenterEnabled: ")
629682
.append(toIndentedString(isSecurityCommandCenterEnabled))
630683
.append("\n");
684+
sb.append(" monitoredResourceConfigs: ")
685+
.append(toIndentedString(monitoredResourceConfigs))
686+
.append("\n");
631687
sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n");
632688
sb.append(" privateKeyId: ").append(toIndentedString(privateKeyId)).append("\n");
633689
sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n");

0 commit comments

Comments
 (0)