Skip to content

Commit 5ef5dbd

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit add9414 of spec repo
1 parent ea6d5d1 commit 5ef5dbd

5 files changed

Lines changed: 214 additions & 2 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,14 @@ components:
296296
schema:
297297
format: int64
298298
type: integer
299+
CloudInventorySyncConfigID:
300+
description: Unique identifier of the Storage Management configuration.
301+
example: abc123
302+
in: path
303+
name: id
304+
required: true
305+
schema:
306+
type: string
299307
CloudWorkloadSecurityAgentRuleID:
300308
description: "The ID of the Agent rule"
301309
example: 3b5-v82-ns6
@@ -107666,6 +107674,33 @@ paths:
107666107674
operator: OR
107667107675
permissions:
107668107676
- aws_configurations_manage
107677+
/api/v2/cloudinventoryservice/syncconfigs/{id}:
107678+
delete:
107679+
description: |-
107680+
Delete a Storage Management configuration by its unique identifier. This stops inventory file synchronization for the associated cloud account.
107681+
operationId: DeleteSyncConfig
107682+
parameters:
107683+
- $ref: "#/components/parameters/CloudInventorySyncConfigID"
107684+
responses:
107685+
"204":
107686+
description: No Content
107687+
"403":
107688+
$ref: "#/components/responses/ForbiddenResponse"
107689+
"404":
107690+
content:
107691+
application/json:
107692+
schema:
107693+
$ref: "#/components/schemas/JSONAPIErrorResponse"
107694+
description: Not Found
107695+
"429":
107696+
$ref: "#/components/responses/TooManyRequestsResponse"
107697+
summary: Delete a Storage Management configuration
107698+
tags:
107699+
- Storage Management
107700+
"x-permission":
107701+
operator: OR
107702+
permissions:
107703+
- aws_configurations_manage
107669107704
/api/v2/code-coverage/branch/summary:
107670107705
post:
107671107706
description: |-
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Delete a Storage Management configuration returns "No Content" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.StorageManagementApi;
6+
7+
public class Example {
8+
public static void main(String[] args) {
9+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
10+
StorageManagementApi apiInstance = new StorageManagementApi(defaultClient);
11+
12+
try {
13+
apiInstance.deleteSyncConfig("abc123");
14+
} catch (ApiException e) {
15+
System.err.println("Exception when calling StorageManagementApi#deleteSyncConfig");
16+
System.err.println("Status code: " + e.getCode());
17+
System.err.println("Reason: " + e.getResponseBody());
18+
System.err.println("Response headers: " + e.getResponseHeaders());
19+
e.printStackTrace();
20+
}
21+
}
22+
}

src/main/java/com/datadog/api/client/v2/api/StorageManagementApi.java

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,139 @@ public void setApiClient(ApiClient apiClient) {
4444
this.apiClient = apiClient;
4545
}
4646

47+
/**
48+
* Delete a Storage Management configuration.
49+
*
50+
* <p>See {@link #deleteSyncConfigWithHttpInfo}.
51+
*
52+
* @param id Unique identifier of the Storage Management configuration. (required)
53+
* @throws ApiException if fails to make API call
54+
*/
55+
public void deleteSyncConfig(String id) throws ApiException {
56+
deleteSyncConfigWithHttpInfo(id);
57+
}
58+
59+
/**
60+
* Delete a Storage Management configuration.
61+
*
62+
* <p>See {@link #deleteSyncConfigWithHttpInfoAsync}.
63+
*
64+
* @param id Unique identifier of the Storage Management configuration. (required)
65+
* @return CompletableFuture
66+
*/
67+
public CompletableFuture<Void> deleteSyncConfigAsync(String id) {
68+
return deleteSyncConfigWithHttpInfoAsync(id)
69+
.thenApply(
70+
response -> {
71+
return response.getData();
72+
});
73+
}
74+
75+
/**
76+
* Delete a Storage Management configuration by its unique identifier. This stops inventory file
77+
* synchronization for the associated cloud account.
78+
*
79+
* @param id Unique identifier of the Storage Management configuration. (required)
80+
* @return ApiResponse&lt;Void&gt;
81+
* @throws ApiException if fails to make API call
82+
* @http.response.details
83+
* <table border="1">
84+
* <caption>Response details</caption>
85+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
86+
* <tr><td> 204 </td><td> No Content </td><td> - </td></tr>
87+
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
88+
* <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
89+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
90+
* </table>
91+
*/
92+
public ApiResponse<Void> deleteSyncConfigWithHttpInfo(String id) throws ApiException {
93+
Object localVarPostBody = null;
94+
95+
// verify the required parameter 'id' is set
96+
if (id == null) {
97+
throw new ApiException(
98+
400, "Missing the required parameter 'id' when calling deleteSyncConfig");
99+
}
100+
// create path and map variables
101+
String localVarPath =
102+
"/api/v2/cloudinventoryservice/syncconfigs/{id}"
103+
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
104+
105+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
106+
107+
Invocation.Builder builder =
108+
apiClient.createBuilder(
109+
"v2.StorageManagementApi.deleteSyncConfig",
110+
localVarPath,
111+
new ArrayList<Pair>(),
112+
localVarHeaderParams,
113+
new HashMap<String, String>(),
114+
new String[] {"*/*"},
115+
new String[] {"apiKeyAuth", "appKeyAuth"});
116+
return apiClient.invokeAPI(
117+
"DELETE",
118+
builder,
119+
localVarHeaderParams,
120+
new String[] {},
121+
localVarPostBody,
122+
new HashMap<String, Object>(),
123+
false,
124+
null);
125+
}
126+
127+
/**
128+
* Delete a Storage Management configuration.
129+
*
130+
* <p>See {@link #deleteSyncConfigWithHttpInfo}.
131+
*
132+
* @param id Unique identifier of the Storage Management configuration. (required)
133+
* @return CompletableFuture&lt;ApiResponse&lt;Void&gt;&gt;
134+
*/
135+
public CompletableFuture<ApiResponse<Void>> deleteSyncConfigWithHttpInfoAsync(String id) {
136+
Object localVarPostBody = null;
137+
138+
// verify the required parameter 'id' is set
139+
if (id == null) {
140+
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
141+
result.completeExceptionally(
142+
new ApiException(
143+
400, "Missing the required parameter 'id' when calling deleteSyncConfig"));
144+
return result;
145+
}
146+
// create path and map variables
147+
String localVarPath =
148+
"/api/v2/cloudinventoryservice/syncconfigs/{id}"
149+
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
150+
151+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
152+
153+
Invocation.Builder builder;
154+
try {
155+
builder =
156+
apiClient.createBuilder(
157+
"v2.StorageManagementApi.deleteSyncConfig",
158+
localVarPath,
159+
new ArrayList<Pair>(),
160+
localVarHeaderParams,
161+
new HashMap<String, String>(),
162+
new String[] {"*/*"},
163+
new String[] {"apiKeyAuth", "appKeyAuth"});
164+
} catch (ApiException ex) {
165+
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
166+
result.completeExceptionally(ex);
167+
return result;
168+
}
169+
return apiClient.invokeAPIAsync(
170+
"DELETE",
171+
builder,
172+
localVarHeaderParams,
173+
new String[] {},
174+
localVarPostBody,
175+
new HashMap<String, Object>(),
176+
false,
177+
null);
178+
}
179+
47180
/**
48181
* Enable Storage Management for a bucket.
49182
*

src/test/resources/com/datadog/api/client/v2/api/storage_management.feature

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,31 @@ Feature: Storage Management
88
Given a valid "apiKeyAuth" key in the system
99
And a valid "appKeyAuth" key in the system
1010
And an instance of "StorageManagement" API
11-
And new "UpsertSyncConfig" request
12-
And body with value {"data": {"attributes": {"aws": {"aws_account_id": "123456789012", "destination_bucket_name": "my-inventory-bucket", "destination_bucket_region": "us-east-1", "destination_prefix": "logs/"}, "azure": {"client_id": "11111111-1111-1111-1111-111111111111", "container": "inventory-container", "resource_group": "my-resource-group", "storage_account": "mystorageaccount", "subscription_id": "33333333-3333-3333-3333-333333333333", "tenant_id": "22222222-2222-2222-2222-222222222222"}, "gcp": {"destination_bucket_name": "my-inventory-reports", "project_id": "my-gcp-project", "service_account_email": "reader@my-gcp-project.iam.gserviceaccount.com", "source_bucket_name": "my-monitored-bucket"}}, "id": "aws", "type": "cloud_provider"}}
11+
12+
@generated @skip @team:DataDog/storage-management
13+
Scenario: Delete a Storage Management configuration returns "No Content" response
14+
Given new "DeleteSyncConfig" request
15+
And request contains "id" parameter from "REPLACE.ME"
16+
When the request is sent
17+
Then the response status is 204 No Content
18+
19+
@generated @skip @team:DataDog/storage-management
20+
Scenario: Delete a Storage Management configuration returns "Not Found" response
21+
Given new "DeleteSyncConfig" request
22+
And request contains "id" parameter from "REPLACE.ME"
23+
When the request is sent
24+
Then the response status is 404 Not Found
1325

1426
@generated @skip @team:DataDog/storage-management
1527
Scenario: Enable Storage Management for a bucket returns "Bad Request" response
28+
Given new "UpsertSyncConfig" request
29+
And body with value {"data": {"attributes": {"aws": {"aws_account_id": "123456789012", "destination_bucket_name": "my-inventory-bucket", "destination_bucket_region": "us-east-1", "destination_prefix": "logs/"}, "azure": {"client_id": "11111111-1111-1111-1111-111111111111", "container": "inventory-container", "resource_group": "my-resource-group", "storage_account": "mystorageaccount", "subscription_id": "33333333-3333-3333-3333-333333333333", "tenant_id": "22222222-2222-2222-2222-222222222222"}, "gcp": {"destination_bucket_name": "my-inventory-reports", "project_id": "my-gcp-project", "service_account_email": "reader@my-gcp-project.iam.gserviceaccount.com", "source_bucket_name": "my-monitored-bucket"}}, "id": "aws", "type": "cloud_provider"}}
1630
When the request is sent
1731
Then the response status is 400 Bad Request
1832

1933
@generated @skip @team:DataDog/storage-management
2034
Scenario: Enable Storage Management for a bucket returns "OK" response
35+
Given new "UpsertSyncConfig" request
36+
And body with value {"data": {"attributes": {"aws": {"aws_account_id": "123456789012", "destination_bucket_name": "my-inventory-bucket", "destination_bucket_region": "us-east-1", "destination_prefix": "logs/"}, "azure": {"client_id": "11111111-1111-1111-1111-111111111111", "container": "inventory-container", "resource_group": "my-resource-group", "storage_account": "mystorageaccount", "subscription_id": "33333333-3333-3333-3333-333333333333", "tenant_id": "22222222-2222-2222-2222-222222222222"}, "gcp": {"destination_bucket_name": "my-inventory-reports", "project_id": "my-gcp-project", "service_account_email": "reader@my-gcp-project.iam.gserviceaccount.com", "source_bucket_name": "my-monitored-bucket"}}, "id": "aws", "type": "cloud_provider"}}
2137
When the request is sent
2238
Then the response status is 200 OK

src/test/resources/com/datadog/api/client/v2/api/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,6 +1561,12 @@
15611561
"type": "idempotent"
15621562
}
15631563
},
1564+
"DeleteSyncConfig": {
1565+
"tag": "Storage Management",
1566+
"undo": {
1567+
"type": "idempotent"
1568+
}
1569+
},
15641570
"GetCodeCoverageBranchSummary": {
15651571
"tag": "Code Coverage",
15661572
"undo": {

0 commit comments

Comments
 (0)