Skip to content

Commit

Permalink
aws api adding extended and deprecating old resource collection field (
Browse files Browse the repository at this point in the history
…#2260)

Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Apr 10, 2024
1 parent 2440dd9 commit 204f9aa
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 42 deletions.
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": "2024-04-10 17:49:37.258837",
"spec_repo_commit": "bb0f8c92"
"regenerated": "2024-04-10 19:44:53.237097",
"spec_repo_commit": "3fb610b5"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-04-10 17:49:37.277138",
"spec_repo_commit": "bb0f8c92"
"regenerated": "2024-04-10 19:44:53.256577",
"spec_repo_commit": "3fb610b5"
}
}
}
11 changes: 9 additions & 2 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ components:
description: Regions to exclude.
type: string
type: array
extended_resource_collection_enabled:
default: false
description: Whether Datadog collects additional attributes and configuration
information about the resources in your AWS account. Required for `cspm_resource_collection`.
example: true
type: boolean
filter_tags:
description: 'The array of EC2 tags (in the form `key:value`) defines a
filter that Datadog uses when collecting metrics from EC2.
Expand Down Expand Up @@ -128,8 +134,9 @@ components:
type: boolean
resource_collection_enabled:
default: false
description: Whether Datadog collects a standard set of resources from your
AWS account.
deprecated: true
description: Deprecated in favor of 'extended_resource_collection_enabled'.
Whether Datadog collects a standard set of resources from your AWS account.
example: true
type: boolean
role_name:
Expand Down
2 changes: 1 addition & 1 deletion examples/v1/aws-integration/CreateAWSAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public static void main(String[] args) {
.accountSpecificNamespaceRules(Map.ofEntries(Map.entry("auto_scaling", false)))
.cspmResourceCollectionEnabled(true)
.excludedRegions(Arrays.asList("us-east-1", "us-west-2"))
.extendedResourceCollectionEnabled(true)
.filterTags(Collections.singletonList("$KEY:$VALUE"))
.hostTags(Collections.singletonList("$KEY:$VALUE"))
.metricsCollectionEnabled(false)
.resourceCollectionEnabled(true)
.roleName("DatadogAWSIntegrationRole");

try {
Expand Down
1 change: 1 addition & 0 deletions examples/v1/aws-integration/CreateNewAWSExternalID.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public static void main(String[] args) {
Map.ofEntries(Map.entry("auto_scaling", false), Map.entry("opswork", false)))
.cspmResourceCollectionEnabled(true)
.excludedRegions(Arrays.asList("us-east-1", "us-west-2"))
.extendedResourceCollectionEnabled(true)
.filterTags(Collections.singletonList("$KEY:$VALUE"))
.hostTags(Collections.singletonList("$KEY:$VALUE"))
.metricsCollectionEnabled(false)
Expand Down
2 changes: 1 addition & 1 deletion examples/v1/aws-integration/UpdateAWSAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public static void main(String[] args) {
.accountSpecificNamespaceRules(Map.ofEntries(Map.entry("auto_scaling", false)))
.cspmResourceCollectionEnabled(false)
.excludedRegions(Arrays.asList("us-east-1", "us-west-2"))
.extendedResourceCollectionEnabled(true)
.filterTags(Collections.singletonList("$KEY:$VALUE"))
.hostTags(Collections.singletonList("$KEY:$VALUE"))
.metricsCollectionEnabled(true)
.resourceCollectionEnabled(true)
.roleName("DatadogAWSIntegrationRole");

try {
Expand Down
39 changes: 38 additions & 1 deletion src/main/java/com/datadog/api/client/v1/model/AWSAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
AWSAccount.JSON_PROPERTY_ACCOUNT_SPECIFIC_NAMESPACE_RULES,
AWSAccount.JSON_PROPERTY_CSPM_RESOURCE_COLLECTION_ENABLED,
AWSAccount.JSON_PROPERTY_EXCLUDED_REGIONS,
AWSAccount.JSON_PROPERTY_EXTENDED_RESOURCE_COLLECTION_ENABLED,
AWSAccount.JSON_PROPERTY_FILTER_TAGS,
AWSAccount.JSON_PROPERTY_HOST_TAGS,
AWSAccount.JSON_PROPERTY_METRICS_COLLECTION_ENABLED,
Expand Down Expand Up @@ -53,6 +54,10 @@ public class AWSAccount {
public static final String JSON_PROPERTY_EXCLUDED_REGIONS = "excluded_regions";
private List<String> excludedRegions = null;

public static final String JSON_PROPERTY_EXTENDED_RESOURCE_COLLECTION_ENABLED =
"extended_resource_collection_enabled";
private Boolean extendedResourceCollectionEnabled = false;

public static final String JSON_PROPERTY_FILTER_TAGS = "filter_tags";
private List<String> filterTags = null;

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

public AWSAccount extendedResourceCollectionEnabled(Boolean extendedResourceCollectionEnabled) {
this.extendedResourceCollectionEnabled = extendedResourceCollectionEnabled;
return this;
}

/**
* Whether Datadog collects additional attributes and configuration information about the
* resources in your AWS account. Required for <code>cspm_resource_collection</code>.
*
* @return extendedResourceCollectionEnabled
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_EXTENDED_RESOURCE_COLLECTION_ENABLED)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Boolean getExtendedResourceCollectionEnabled() {
return extendedResourceCollectionEnabled;
}

public void setExtendedResourceCollectionEnabled(Boolean extendedResourceCollectionEnabled) {
this.extendedResourceCollectionEnabled = extendedResourceCollectionEnabled;
}

public AWSAccount filterTags(List<String> filterTags) {
this.filterTags = filterTags;
return this;
Expand Down Expand Up @@ -292,17 +319,21 @@ public AWSAccount resourceCollectionEnabled(Boolean resourceCollectionEnabled) {
}

/**
* Whether Datadog collects a standard set of resources from your AWS account.
* Deprecated in favor of 'extended_resource_collection_enabled'. Whether Datadog collects a
* standard set of resources from your AWS account.
*
* @return resourceCollectionEnabled
* @deprecated
*/
@Deprecated
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_RESOURCE_COLLECTION_ENABLED)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Boolean getResourceCollectionEnabled() {
return resourceCollectionEnabled;
}

@Deprecated
public void setResourceCollectionEnabled(Boolean resourceCollectionEnabled) {
this.resourceCollectionEnabled = resourceCollectionEnabled;
}
Expand Down Expand Up @@ -412,6 +443,8 @@ public boolean equals(Object o) {
&& Objects.equals(
this.cspmResourceCollectionEnabled, awsAccount.cspmResourceCollectionEnabled)
&& Objects.equals(this.excludedRegions, awsAccount.excludedRegions)
&& Objects.equals(
this.extendedResourceCollectionEnabled, awsAccount.extendedResourceCollectionEnabled)
&& Objects.equals(this.filterTags, awsAccount.filterTags)
&& Objects.equals(this.hostTags, awsAccount.hostTags)
&& Objects.equals(this.metricsCollectionEnabled, awsAccount.metricsCollectionEnabled)
Expand All @@ -429,6 +462,7 @@ public int hashCode() {
accountSpecificNamespaceRules,
cspmResourceCollectionEnabled,
excludedRegions,
extendedResourceCollectionEnabled,
filterTags,
hostTags,
metricsCollectionEnabled,
Expand All @@ -451,6 +485,9 @@ public String toString() {
.append(toIndentedString(cspmResourceCollectionEnabled))
.append("\n");
sb.append(" excludedRegions: ").append(toIndentedString(excludedRegions)).append("\n");
sb.append(" extendedResourceCollectionEnabled: ")
.append(toIndentedString(extendedResourceCollectionEnabled))
.append("\n");
sb.append(" filterTags: ").append(toIndentedString(filterTags)).append("\n");
sb.append(" hostTags: ").append(toIndentedString(hostTags)).append("\n");
sb.append(" metricsCollectionEnabled: ")
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023-11-13T14:17:01.291Z
2024-04-05T18:30:30.891Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"httpRequest": {
"body": {
"type": "JSON",
"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\"}"
"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\"}"
},
"headers": {},
"method": "POST",
Expand All @@ -12,7 +12,7 @@
"secure": true
},
"httpResponse": {
"body": "{\"external_id\":\"9668e281c0ef4cc8be01710ef7a0ae4c\"}\n",
"body": "{\"external_id\":\"acb8f6b8a844443dbb726d07dcb1a870\"}\n",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -27,13 +27,13 @@
"timeToLive": {
"unlimited": true
},
"id": "b345fb9c-3709-3389-14a9-210da4d600fd"
"id": "f3b49bb6-ccbe-c0a4-a8c8-d5f34460e5c8"
},
{
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"account_id\":\"169988502100\",\"role_name\":\"DatadogAWSIntegrationRole\"}"
"json": "{\"account_id\":\"171234183000\",\"role_name\":\"DatadogAWSIntegrationRole\"}"
},
"headers": {},
"method": "DELETE",
Expand All @@ -57,6 +57,6 @@
"timeToLive": {
"unlimited": true
},
"id": "f88366bd-5b70-614a-86ac-275fdf744321"
"id": "3da73460-b8b0-6d11-64ef-7bc5d9a1e0c5"
}
]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023-11-21T19:25:15.118Z
2024-04-05T18:30:32.594Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"httpRequest": {
"body": {
"type": "JSON",
"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\"}"
"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\"}"
},
"headers": {},
"method": "POST",
Expand All @@ -12,7 +12,7 @@
"secure": true
},
"httpResponse": {
"body": "{\"external_id\":\"77c77ead62584b0fa1bb6a9fe7d2fa28\"}\n",
"body": "{\"external_id\":\"6aa1bf95e5dc4c9985593e94169bd2f6\"}\n",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -27,13 +27,13 @@
"timeToLive": {
"unlimited": true
},
"id": "bb29ad65-cdff-ba55-4124-05b976907dc1"
"id": "348e74c6-1f4b-79b1-b6f7-9b18b6b7b72c"
},
{
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"account_id\":\"170059471500\",\"role_name\":\"DatadogAWSIntegrationRole\"}"
"json": "{\"account_id\":\"171234183200\",\"role_name\":\"DatadogAWSIntegrationRole\"}"
},
"headers": {},
"method": "DELETE",
Expand All @@ -57,13 +57,13 @@
"timeToLive": {
"unlimited": true
},
"id": "c922634d-c5c2-ad19-83b0-cbb0aad81180"
"id": "d9510755-9fb9-1e0e-2661-820fc7c24618"
},
{
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"account_id\":\"170059471500\",\"role_name\":\"DatadogAWSIntegrationRole\"}"
"json": "{\"account_id\":\"171234183200\",\"role_name\":\"DatadogAWSIntegrationRole\"}"
},
"headers": {},
"method": "DELETE",
Expand All @@ -72,7 +72,7 @@
"secure": true
},
"httpResponse": {
"body": "{\"errors\":[\"AWS account 170059471500 does not exist in integration\"]}",
"body": "{\"errors\":[\"AWS account 171234183200 does not exist in integration\"]}",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -87,6 +87,6 @@
"timeToLive": {
"unlimited": true
},
"id": "c922634d-c5c2-ad19-83b0-cbb0aad81181"
"id": "d9510755-9fb9-1e0e-2661-820fc7c24619"
}
]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023-11-23T18:16:16.323Z
2024-04-05T18:30:34.377Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"account_id\":\"170076337600\",\"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\"}"
"json": "{\"account_id\":\"171234183400\",\"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\"}"
},
"headers": {},
"method": "POST",
Expand All @@ -12,7 +12,7 @@
"secure": true
},
"httpResponse": {
"body": "{\"external_id\":\"c7298c166e774bf1bd1bc0419e68f1a0\"}\n",
"body": "{\"external_id\":\"c8ceedec95fc472fb6156f3104d425c9\"}\n",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -27,20 +27,20 @@
"timeToLive": {
"unlimited": true
},
"id": "e683ecb6-97b4-2ae8-2b13-f186c3db794e"
"id": "7e45d349-dc2c-7cf2-254a-c96981cb3b8c"
},
{
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"account_id\":\"170076337600\",\"account_specific_namespace_rules\":{\"auto_scaling\":false},\"cspm_resource_collection_enabled\":false,\"excluded_regions\":[\"us-east-1\",\"us-west-2\"],\"filter_tags\":[\"$KEY:$VALUE\"],\"host_tags\":[\"$KEY:$VALUE\"],\"metrics_collection_enabled\":true,\"resource_collection_enabled\":true,\"role_name\":\"DatadogAWSIntegrationRole\"}"
"json": "{\"account_id\":\"171234183400\",\"account_specific_namespace_rules\":{\"auto_scaling\":false},\"cspm_resource_collection_enabled\":false,\"excluded_regions\":[\"us-east-1\",\"us-west-2\"],\"extended_resource_collection_enabled\":true,\"filter_tags\":[\"$KEY:$VALUE\"],\"host_tags\":[\"$KEY:$VALUE\"],\"metrics_collection_enabled\":true,\"role_name\":\"DatadogAWSIntegrationRole\"}"
},
"headers": {},
"method": "PUT",
"path": "/api/v1/integration/aws",
"queryStringParameters": {
"account_id": [
"170076337600"
"171234183400"
],
"role_name": [
"DatadogAWSIntegrationRole"
Expand All @@ -65,13 +65,13 @@
"timeToLive": {
"unlimited": true
},
"id": "b9ef0917-9713-7f87-8c60-3a564f800395"
"id": "1e790ee1-b187-95ef-17d0-95b586ba7c7f"
},
{
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"account_id\":\"170076337600\",\"role_name\":\"DatadogAWSIntegrationRole\"}"
"json": "{\"account_id\":\"171234183400\",\"role_name\":\"DatadogAWSIntegrationRole\"}"
},
"headers": {},
"method": "DELETE",
Expand All @@ -95,6 +95,6 @@
"timeToLive": {
"unlimited": true
},
"id": "9979a2c4-58fd-639b-7988-df76fa0025d7"
"id": "60b4327d-82df-8e63-aaef-a6cbf2a229d8"
}
]
Loading

0 comments on commit 204f9aa

Please sign in to comment.