Skip to content

Commit 204f9aa

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
aws api adding extended and deprecating old resource collection field (#2260)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 2440dd9 commit 204f9aa

14 files changed

+87
-42
lines changed

.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": "2024-04-10 17:49:37.258837",
8-
"spec_repo_commit": "bb0f8c92"
7+
"regenerated": "2024-04-10 19:44:53.237097",
8+
"spec_repo_commit": "3fb610b5"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-04-10 17:49:37.277138",
13-
"spec_repo_commit": "bb0f8c92"
12+
"regenerated": "2024-04-10 19:44:53.256577",
13+
"spec_repo_commit": "3fb610b5"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ components:
9090
description: Regions to exclude.
9191
type: string
9292
type: array
93+
extended_resource_collection_enabled:
94+
default: false
95+
description: Whether Datadog collects additional attributes and configuration
96+
information about the resources in your AWS account. Required for `cspm_resource_collection`.
97+
example: true
98+
type: boolean
9399
filter_tags:
94100
description: 'The array of EC2 tags (in the form `key:value`) defines a
95101
filter that Datadog uses when collecting metrics from EC2.
@@ -128,8 +134,9 @@ components:
128134
type: boolean
129135
resource_collection_enabled:
130136
default: false
131-
description: Whether Datadog collects a standard set of resources from your
132-
AWS account.
137+
deprecated: true
138+
description: Deprecated in favor of 'extended_resource_collection_enabled'.
139+
Whether Datadog collects a standard set of resources from your AWS account.
133140
example: true
134141
type: boolean
135142
role_name:

examples/v1/aws-integration/CreateAWSAccount.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ public static void main(String[] args) {
2020
.accountSpecificNamespaceRules(Map.ofEntries(Map.entry("auto_scaling", false)))
2121
.cspmResourceCollectionEnabled(true)
2222
.excludedRegions(Arrays.asList("us-east-1", "us-west-2"))
23+
.extendedResourceCollectionEnabled(true)
2324
.filterTags(Collections.singletonList("$KEY:$VALUE"))
2425
.hostTags(Collections.singletonList("$KEY:$VALUE"))
2526
.metricsCollectionEnabled(false)
26-
.resourceCollectionEnabled(true)
2727
.roleName("DatadogAWSIntegrationRole");
2828

2929
try {

examples/v1/aws-integration/CreateNewAWSExternalID.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public static void main(String[] args) {
2121
Map.ofEntries(Map.entry("auto_scaling", false), Map.entry("opswork", false)))
2222
.cspmResourceCollectionEnabled(true)
2323
.excludedRegions(Arrays.asList("us-east-1", "us-west-2"))
24+
.extendedResourceCollectionEnabled(true)
2425
.filterTags(Collections.singletonList("$KEY:$VALUE"))
2526
.hostTags(Collections.singletonList("$KEY:$VALUE"))
2627
.metricsCollectionEnabled(false)

examples/v1/aws-integration/UpdateAWSAccount.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ public static void main(String[] args) {
2020
.accountSpecificNamespaceRules(Map.ofEntries(Map.entry("auto_scaling", false)))
2121
.cspmResourceCollectionEnabled(false)
2222
.excludedRegions(Arrays.asList("us-east-1", "us-west-2"))
23+
.extendedResourceCollectionEnabled(true)
2324
.filterTags(Collections.singletonList("$KEY:$VALUE"))
2425
.hostTags(Collections.singletonList("$KEY:$VALUE"))
2526
.metricsCollectionEnabled(true)
26-
.resourceCollectionEnabled(true)
2727
.roleName("DatadogAWSIntegrationRole");
2828

2929
try {

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

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
AWSAccount.JSON_PROPERTY_ACCOUNT_SPECIFIC_NAMESPACE_RULES,
2626
AWSAccount.JSON_PROPERTY_CSPM_RESOURCE_COLLECTION_ENABLED,
2727
AWSAccount.JSON_PROPERTY_EXCLUDED_REGIONS,
28+
AWSAccount.JSON_PROPERTY_EXTENDED_RESOURCE_COLLECTION_ENABLED,
2829
AWSAccount.JSON_PROPERTY_FILTER_TAGS,
2930
AWSAccount.JSON_PROPERTY_HOST_TAGS,
3031
AWSAccount.JSON_PROPERTY_METRICS_COLLECTION_ENABLED,
@@ -53,6 +54,10 @@ public class AWSAccount {
5354
public static final String JSON_PROPERTY_EXCLUDED_REGIONS = "excluded_regions";
5455
private List<String> excludedRegions = null;
5556

57+
public static final String JSON_PROPERTY_EXTENDED_RESOURCE_COLLECTION_ENABLED =
58+
"extended_resource_collection_enabled";
59+
private Boolean extendedResourceCollectionEnabled = false;
60+
5661
public static final String JSON_PROPERTY_FILTER_TAGS = "filter_tags";
5762
private List<String> filterTags = null;
5863

@@ -201,6 +206,28 @@ public void setExcludedRegions(List<String> excludedRegions) {
201206
this.excludedRegions = excludedRegions;
202207
}
203208

209+
public AWSAccount extendedResourceCollectionEnabled(Boolean extendedResourceCollectionEnabled) {
210+
this.extendedResourceCollectionEnabled = extendedResourceCollectionEnabled;
211+
return this;
212+
}
213+
214+
/**
215+
* Whether Datadog collects additional attributes and configuration information about the
216+
* resources in your AWS account. Required for <code>cspm_resource_collection</code>.
217+
*
218+
* @return extendedResourceCollectionEnabled
219+
*/
220+
@jakarta.annotation.Nullable
221+
@JsonProperty(JSON_PROPERTY_EXTENDED_RESOURCE_COLLECTION_ENABLED)
222+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
223+
public Boolean getExtendedResourceCollectionEnabled() {
224+
return extendedResourceCollectionEnabled;
225+
}
226+
227+
public void setExtendedResourceCollectionEnabled(Boolean extendedResourceCollectionEnabled) {
228+
this.extendedResourceCollectionEnabled = extendedResourceCollectionEnabled;
229+
}
230+
204231
public AWSAccount filterTags(List<String> filterTags) {
205232
this.filterTags = filterTags;
206233
return this;
@@ -292,17 +319,21 @@ public AWSAccount resourceCollectionEnabled(Boolean resourceCollectionEnabled) {
292319
}
293320

294321
/**
295-
* Whether Datadog collects a standard set of resources from your AWS account.
322+
* Deprecated in favor of 'extended_resource_collection_enabled'. Whether Datadog collects a
323+
* standard set of resources from your AWS account.
296324
*
297325
* @return resourceCollectionEnabled
326+
* @deprecated
298327
*/
328+
@Deprecated
299329
@jakarta.annotation.Nullable
300330
@JsonProperty(JSON_PROPERTY_RESOURCE_COLLECTION_ENABLED)
301331
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
302332
public Boolean getResourceCollectionEnabled() {
303333
return resourceCollectionEnabled;
304334
}
305335

336+
@Deprecated
306337
public void setResourceCollectionEnabled(Boolean resourceCollectionEnabled) {
307338
this.resourceCollectionEnabled = resourceCollectionEnabled;
308339
}
@@ -412,6 +443,8 @@ public boolean equals(Object o) {
412443
&& Objects.equals(
413444
this.cspmResourceCollectionEnabled, awsAccount.cspmResourceCollectionEnabled)
414445
&& Objects.equals(this.excludedRegions, awsAccount.excludedRegions)
446+
&& Objects.equals(
447+
this.extendedResourceCollectionEnabled, awsAccount.extendedResourceCollectionEnabled)
415448
&& Objects.equals(this.filterTags, awsAccount.filterTags)
416449
&& Objects.equals(this.hostTags, awsAccount.hostTags)
417450
&& Objects.equals(this.metricsCollectionEnabled, awsAccount.metricsCollectionEnabled)
@@ -429,6 +462,7 @@ public int hashCode() {
429462
accountSpecificNamespaceRules,
430463
cspmResourceCollectionEnabled,
431464
excludedRegions,
465+
extendedResourceCollectionEnabled,
432466
filterTags,
433467
hostTags,
434468
metricsCollectionEnabled,
@@ -451,6 +485,9 @@ public String toString() {
451485
.append(toIndentedString(cspmResourceCollectionEnabled))
452486
.append("\n");
453487
sb.append(" excludedRegions: ").append(toIndentedString(excludedRegions)).append("\n");
488+
sb.append(" extendedResourceCollectionEnabled: ")
489+
.append(toIndentedString(extendedResourceCollectionEnabled))
490+
.append("\n");
454491
sb.append(" filterTags: ").append(toIndentedString(filterTags)).append("\n");
455492
sb.append(" hostTags: ").append(toIndentedString(hostTags)).append("\n");
456493
sb.append(" metricsCollectionEnabled: ")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023-11-13T14:17:01.291Z
1+
2024-04-05T18:30:30.891Z

src/test/resources/cassettes/features/v1/Create_an_AWS_integration_returns_OK_response.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"httpRequest": {
44
"body": {
55
"type": "JSON",
6-
"json": "{\"account_id\":\"169988502100\",\"account_specific_namespace_rules\":{\"auto_scaling\":false},\"cspm_resource_collection_enabled\":true,\"excluded_regions\":[\"us-east-1\",\"us-west-2\"],\"filter_tags\":[\"$KEY:$VALUE\"],\"host_tags\":[\"$KEY:$VALUE\"],\"metrics_collection_enabled\":false,\"resource_collection_enabled\":true,\"role_name\":\"DatadogAWSIntegrationRole\"}"
6+
"json": "{\"account_id\":\"171234183000\",\"account_specific_namespace_rules\":{\"auto_scaling\":false},\"cspm_resource_collection_enabled\":true,\"excluded_regions\":[\"us-east-1\",\"us-west-2\"],\"extended_resource_collection_enabled\":true,\"filter_tags\":[\"$KEY:$VALUE\"],\"host_tags\":[\"$KEY:$VALUE\"],\"metrics_collection_enabled\":false,\"role_name\":\"DatadogAWSIntegrationRole\"}"
77
},
88
"headers": {},
99
"method": "POST",
@@ -12,7 +12,7 @@
1212
"secure": true
1313
},
1414
"httpResponse": {
15-
"body": "{\"external_id\":\"9668e281c0ef4cc8be01710ef7a0ae4c\"}\n",
15+
"body": "{\"external_id\":\"acb8f6b8a844443dbb726d07dcb1a870\"}\n",
1616
"headers": {
1717
"Content-Type": [
1818
"application/json"
@@ -27,13 +27,13 @@
2727
"timeToLive": {
2828
"unlimited": true
2929
},
30-
"id": "b345fb9c-3709-3389-14a9-210da4d600fd"
30+
"id": "f3b49bb6-ccbe-c0a4-a8c8-d5f34460e5c8"
3131
},
3232
{
3333
"httpRequest": {
3434
"body": {
3535
"type": "JSON",
36-
"json": "{\"account_id\":\"169988502100\",\"role_name\":\"DatadogAWSIntegrationRole\"}"
36+
"json": "{\"account_id\":\"171234183000\",\"role_name\":\"DatadogAWSIntegrationRole\"}"
3737
},
3838
"headers": {},
3939
"method": "DELETE",
@@ -57,6 +57,6 @@
5757
"timeToLive": {
5858
"unlimited": true
5959
},
60-
"id": "f88366bd-5b70-614a-86ac-275fdf744321"
60+
"id": "3da73460-b8b0-6d11-64ef-7bc5d9a1e0c5"
6161
}
6262
]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023-11-21T19:25:15.118Z
1+
2024-04-05T18:30:32.594Z

src/test/resources/cassettes/features/v1/Delete_an_AWS_integration_returns_OK_response.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"httpRequest": {
44
"body": {
55
"type": "JSON",
6-
"json": "{\"account_id\":\"170059471500\",\"account_specific_namespace_rules\":{\"auto_scaling\":false},\"cspm_resource_collection_enabled\":true,\"excluded_regions\":[\"us-east-1\",\"us-west-2\"],\"filter_tags\":[\"$KEY:$VALUE\"],\"host_tags\":[\"$KEY:$VALUE\"],\"metrics_collection_enabled\":false,\"resource_collection_enabled\":true,\"role_name\":\"DatadogAWSIntegrationRole\"}"
6+
"json": "{\"account_id\":\"171234183200\",\"account_specific_namespace_rules\":{\"auto_scaling\":false},\"cspm_resource_collection_enabled\":true,\"excluded_regions\":[\"us-east-1\",\"us-west-2\"],\"extended_resource_collection_enabled\":true,\"filter_tags\":[\"$KEY:$VALUE\"],\"host_tags\":[\"$KEY:$VALUE\"],\"metrics_collection_enabled\":false,\"role_name\":\"DatadogAWSIntegrationRole\"}"
77
},
88
"headers": {},
99
"method": "POST",
@@ -12,7 +12,7 @@
1212
"secure": true
1313
},
1414
"httpResponse": {
15-
"body": "{\"external_id\":\"77c77ead62584b0fa1bb6a9fe7d2fa28\"}\n",
15+
"body": "{\"external_id\":\"6aa1bf95e5dc4c9985593e94169bd2f6\"}\n",
1616
"headers": {
1717
"Content-Type": [
1818
"application/json"
@@ -27,13 +27,13 @@
2727
"timeToLive": {
2828
"unlimited": true
2929
},
30-
"id": "bb29ad65-cdff-ba55-4124-05b976907dc1"
30+
"id": "348e74c6-1f4b-79b1-b6f7-9b18b6b7b72c"
3131
},
3232
{
3333
"httpRequest": {
3434
"body": {
3535
"type": "JSON",
36-
"json": "{\"account_id\":\"170059471500\",\"role_name\":\"DatadogAWSIntegrationRole\"}"
36+
"json": "{\"account_id\":\"171234183200\",\"role_name\":\"DatadogAWSIntegrationRole\"}"
3737
},
3838
"headers": {},
3939
"method": "DELETE",
@@ -57,13 +57,13 @@
5757
"timeToLive": {
5858
"unlimited": true
5959
},
60-
"id": "c922634d-c5c2-ad19-83b0-cbb0aad81180"
60+
"id": "d9510755-9fb9-1e0e-2661-820fc7c24618"
6161
},
6262
{
6363
"httpRequest": {
6464
"body": {
6565
"type": "JSON",
66-
"json": "{\"account_id\":\"170059471500\",\"role_name\":\"DatadogAWSIntegrationRole\"}"
66+
"json": "{\"account_id\":\"171234183200\",\"role_name\":\"DatadogAWSIntegrationRole\"}"
6767
},
6868
"headers": {},
6969
"method": "DELETE",
@@ -72,7 +72,7 @@
7272
"secure": true
7373
},
7474
"httpResponse": {
75-
"body": "{\"errors\":[\"AWS account 170059471500 does not exist in integration\"]}",
75+
"body": "{\"errors\":[\"AWS account 171234183200 does not exist in integration\"]}",
7676
"headers": {
7777
"Content-Type": [
7878
"application/json"
@@ -87,6 +87,6 @@
8787
"timeToLive": {
8888
"unlimited": true
8989
},
90-
"id": "c922634d-c5c2-ad19-83b0-cbb0aad81181"
90+
"id": "d9510755-9fb9-1e0e-2661-820fc7c24619"
9191
}
9292
]

0 commit comments

Comments
 (0)