Skip to content

Commit 6a00bb8

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Regenerate client from commit b892dbfc of spec repo (#2742)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 86a883b commit 6a00bb8

File tree

6 files changed

+223
-4
lines changed

6 files changed

+223
-4
lines changed

.apigentools-info

+4-4
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": "2025-03-06 18:30:07.423746",
8-
"spec_repo_commit": "fb234cde"
7+
"regenerated": "2025-03-06 19:05:52.226828",
8+
"spec_repo_commit": "b892dbfc"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-03-06 18:30:07.439256",
13-
"spec_repo_commit": "fb234cde"
12+
"regenerated": "2025-03-06 19:05:52.242572",
13+
"spec_repo_commit": "b892dbfc"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

+41
Original file line numberDiff line numberDiff line change
@@ -28758,6 +28758,47 @@ paths:
2875828758
permissions:
2875928759
- logs_modify_indexes
2876028760
/api/v1/logs/config/indexes/{name}:
28761+
delete:
28762+
description: 'Delete an existing index from your organization. Index deletions
28763+
are permanent and cannot be reverted.
28764+
28765+
You cannot recreate an index with the same name as deleted ones.'
28766+
operationId: DeleteLogsIndex
28767+
parameters:
28768+
- description: Name of the log index.
28769+
in: path
28770+
name: name
28771+
required: true
28772+
schema:
28773+
type: string
28774+
responses:
28775+
'200':
28776+
content:
28777+
application/json:
28778+
schema:
28779+
$ref: '#/components/schemas/LogsIndex'
28780+
description: OK
28781+
'403':
28782+
content:
28783+
application/json:
28784+
schema:
28785+
$ref: '#/components/schemas/APIErrorResponse'
28786+
description: Forbidden
28787+
'404':
28788+
content:
28789+
application/json:
28790+
schema:
28791+
$ref: '#/components/schemas/LogsAPIErrorResponse'
28792+
description: Not Found
28793+
'429':
28794+
$ref: '#/components/responses/TooManyRequestsResponse'
28795+
summary: Delete an index
28796+
tags:
28797+
- Logs Indexes
28798+
x-permission:
28799+
operator: OR
28800+
permissions:
28801+
- logs_modify_indexes
2876128802
get:
2876228803
description: Get one log index from your organization. This endpoint takes no
2876328804
JSON arguments.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Delete an index returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v1.api.LogsIndexesApi;
6+
import com.datadog.api.client.v1.model.LogsIndex;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
LogsIndexesApi apiInstance = new LogsIndexesApi(defaultClient);
12+
13+
try {
14+
LogsIndex result = apiInstance.deleteLogsIndex("name");
15+
System.out.println(result);
16+
} catch (ApiException e) {
17+
System.err.println("Exception when calling LogsIndexesApi#deleteLogsIndex");
18+
System.err.println("Status code: " + e.getCode());
19+
System.err.println("Reason: " + e.getResponseBody());
20+
System.err.println("Response headers: " + e.getResponseHeaders());
21+
e.printStackTrace();
22+
}
23+
}
24+
}

src/main/java/com/datadog/api/client/v1/api/LogsIndexesApi.java

+134
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,140 @@ public CompletableFuture<ApiResponse<LogsIndex>> createLogsIndexWithHttpInfoAsyn
177177
new GenericType<LogsIndex>() {});
178178
}
179179

180+
/**
181+
* Delete an index.
182+
*
183+
* <p>See {@link #deleteLogsIndexWithHttpInfo}.
184+
*
185+
* @param name Name of the log index. (required)
186+
* @return LogsIndex
187+
* @throws ApiException if fails to make API call
188+
*/
189+
public LogsIndex deleteLogsIndex(String name) throws ApiException {
190+
return deleteLogsIndexWithHttpInfo(name).getData();
191+
}
192+
193+
/**
194+
* Delete an index.
195+
*
196+
* <p>See {@link #deleteLogsIndexWithHttpInfoAsync}.
197+
*
198+
* @param name Name of the log index. (required)
199+
* @return CompletableFuture&lt;LogsIndex&gt;
200+
*/
201+
public CompletableFuture<LogsIndex> deleteLogsIndexAsync(String name) {
202+
return deleteLogsIndexWithHttpInfoAsync(name)
203+
.thenApply(
204+
response -> {
205+
return response.getData();
206+
});
207+
}
208+
209+
/**
210+
* Delete an existing index from your organization. Index deletions are permanent and cannot be
211+
* reverted. You cannot recreate an index with the same name as deleted ones.
212+
*
213+
* @param name Name of the log index. (required)
214+
* @return ApiResponse&lt;LogsIndex&gt;
215+
* @throws ApiException if fails to make API call
216+
* @http.response.details
217+
* <table border="1">
218+
* <caption>Response details</caption>
219+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
220+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
221+
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
222+
* <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
223+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
224+
* </table>
225+
*/
226+
public ApiResponse<LogsIndex> deleteLogsIndexWithHttpInfo(String name) throws ApiException {
227+
Object localVarPostBody = null;
228+
229+
// verify the required parameter 'name' is set
230+
if (name == null) {
231+
throw new ApiException(
232+
400, "Missing the required parameter 'name' when calling deleteLogsIndex");
233+
}
234+
// create path and map variables
235+
String localVarPath =
236+
"/api/v1/logs/config/indexes/{name}"
237+
.replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString()));
238+
239+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
240+
241+
Invocation.Builder builder =
242+
apiClient.createBuilder(
243+
"v1.LogsIndexesApi.deleteLogsIndex",
244+
localVarPath,
245+
new ArrayList<Pair>(),
246+
localVarHeaderParams,
247+
new HashMap<String, String>(),
248+
new String[] {"application/json"},
249+
new String[] {"apiKeyAuth", "appKeyAuth"});
250+
return apiClient.invokeAPI(
251+
"DELETE",
252+
builder,
253+
localVarHeaderParams,
254+
new String[] {},
255+
localVarPostBody,
256+
new HashMap<String, Object>(),
257+
false,
258+
new GenericType<LogsIndex>() {});
259+
}
260+
261+
/**
262+
* Delete an index.
263+
*
264+
* <p>See {@link #deleteLogsIndexWithHttpInfo}.
265+
*
266+
* @param name Name of the log index. (required)
267+
* @return CompletableFuture&lt;ApiResponse&lt;LogsIndex&gt;&gt;
268+
*/
269+
public CompletableFuture<ApiResponse<LogsIndex>> deleteLogsIndexWithHttpInfoAsync(String name) {
270+
Object localVarPostBody = null;
271+
272+
// verify the required parameter 'name' is set
273+
if (name == null) {
274+
CompletableFuture<ApiResponse<LogsIndex>> result = new CompletableFuture<>();
275+
result.completeExceptionally(
276+
new ApiException(
277+
400, "Missing the required parameter 'name' when calling deleteLogsIndex"));
278+
return result;
279+
}
280+
// create path and map variables
281+
String localVarPath =
282+
"/api/v1/logs/config/indexes/{name}"
283+
.replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString()));
284+
285+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
286+
287+
Invocation.Builder builder;
288+
try {
289+
builder =
290+
apiClient.createBuilder(
291+
"v1.LogsIndexesApi.deleteLogsIndex",
292+
localVarPath,
293+
new ArrayList<Pair>(),
294+
localVarHeaderParams,
295+
new HashMap<String, String>(),
296+
new String[] {"application/json"},
297+
new String[] {"apiKeyAuth", "appKeyAuth"});
298+
} catch (ApiException ex) {
299+
CompletableFuture<ApiResponse<LogsIndex>> result = new CompletableFuture<>();
300+
result.completeExceptionally(ex);
301+
return result;
302+
}
303+
return apiClient.invokeAPIAsync(
304+
"DELETE",
305+
builder,
306+
localVarHeaderParams,
307+
new String[] {},
308+
localVarPostBody,
309+
new HashMap<String, Object>(),
310+
false,
311+
new GenericType<LogsIndex>() {});
312+
}
313+
180314
/**
181315
* Get an index.
182316
*

src/test/resources/com/datadog/api/client/v1/api/logs_indexes.feature

+14
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ Feature: Logs Indexes
2222
When the request is sent
2323
Then the response status is 200 OK
2424

25+
@generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core
26+
Scenario: Delete an index returns "Not Found" response
27+
Given new "DeleteLogsIndex" request
28+
And request contains "name" parameter from "REPLACE.ME"
29+
When the request is sent
30+
Then the response status is 404 Not Found
31+
32+
@generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core
33+
Scenario: Delete an index returns "OK" response
34+
Given new "DeleteLogsIndex" request
35+
And request contains "name" parameter from "REPLACE.ME"
36+
When the request is sent
37+
Then the response status is 200 OK
38+
2539
@generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core
2640
Scenario: Get all indexes returns "OK" response
2741
Given new "ListLogIndexes" request

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

+6
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,12 @@
694694
"type": "unsafe"
695695
}
696696
},
697+
"DeleteLogsIndex": {
698+
"tag": "Logs Indexes",
699+
"undo": {
700+
"type": "idempotent"
701+
}
702+
},
697703
"GetLogsIndex": {
698704
"tag": "Logs Indexes",
699705
"undo": {

0 commit comments

Comments
 (0)