Skip to content

Commit fe71ffa

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 4862f88 of spec repo
1 parent ab419b7 commit fe71ffa

15 files changed

+1304
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16975,6 +16975,89 @@ components:
1697516975
- started_at
1697616976
- finished_at
1697716977
type: object
16978+
DORADeploymentPatchRemediation:
16979+
description: Remediation details for the deployment.
16980+
properties:
16981+
id:
16982+
description: The ID of the remediation action.
16983+
example: eG42zNIkVjM
16984+
type: string
16985+
type:
16986+
$ref: '#/components/schemas/DORADeploymentPatchRemediationType'
16987+
required:
16988+
- id
16989+
- type
16990+
type: object
16991+
DORADeploymentPatchRemediationType:
16992+
description: The type of remediation action taken.
16993+
enum:
16994+
- rollback
16995+
- rollforward
16996+
example: rollback
16997+
type: string
16998+
x-enum-varnames:
16999+
- ROLLBACK
17000+
- ROLLFORWARD
17001+
DORADeploymentPatchRequest:
17002+
description: Request to patch a DORA deployment event.
17003+
example:
17004+
data:
17005+
attributes:
17006+
change_failure: true
17007+
remediation:
17008+
id: eG42zNIkVjM
17009+
type: rollback
17010+
id: z_RwVLi7v4Y
17011+
type: dora_deployment_patch_request
17012+
properties:
17013+
data:
17014+
$ref: '#/components/schemas/DORADeploymentPatchRequestData'
17015+
required:
17016+
- data
17017+
type: object
17018+
DORADeploymentPatchRequestAttributes:
17019+
description: Attributes for patching a DORA deployment event.
17020+
properties:
17021+
change_failure:
17022+
description: Indicates whether the deployment resulted in a change failure.
17023+
example: true
17024+
type: boolean
17025+
remediation:
17026+
$ref: '#/components/schemas/DORADeploymentPatchRemediation'
17027+
type: object
17028+
DORADeploymentPatchRequestData:
17029+
description: The JSON:API data for patching a deployment.
17030+
example:
17031+
attributes:
17032+
change_failure: true
17033+
remediation:
17034+
id: eG42zNIkVjM
17035+
type: rollback
17036+
id: z_RwVLi7v4Y
17037+
type: dora_deployment_patch_request
17038+
properties:
17039+
attributes:
17040+
$ref: '#/components/schemas/DORADeploymentPatchRequestAttributes'
17041+
id:
17042+
description: The ID of the deployment to patch.
17043+
example: z_RwVLi7v4Y
17044+
type: string
17045+
type:
17046+
$ref: '#/components/schemas/DORADeploymentPatchRequestDataType'
17047+
required:
17048+
- type
17049+
- id
17050+
- attributes
17051+
type: object
17052+
DORADeploymentPatchRequestDataType:
17053+
default: dora_deployment_patch_request
17054+
description: JSON:API type for DORA deployment patch request.
17055+
enum:
17056+
- dora_deployment_patch_request
17057+
example: dora_deployment_patch_request
17058+
type: string
17059+
x-enum-varnames:
17060+
- DORA_DEPLOYMENT_PATCH_REQUEST
1697817061
DORADeploymentRequest:
1697917062
description: Request to create a DORA deployment event.
1698017063
properties:
@@ -74157,6 +74240,46 @@ paths:
7415774240
operator: OR
7415874241
permissions:
7415974242
- dora_metrics_read
74243+
patch:
74244+
description: Use this API endpoint to patch a deployment event.
74245+
operationId: PatchDORADeployment
74246+
parameters:
74247+
- description: The ID of the deployment event.
74248+
in: path
74249+
name: deployment_id
74250+
required: true
74251+
schema:
74252+
type: string
74253+
requestBody:
74254+
content:
74255+
application/json:
74256+
schema:
74257+
$ref: '#/components/schemas/DORADeploymentPatchRequest'
74258+
required: true
74259+
responses:
74260+
'202':
74261+
description: Accepted
74262+
'400':
74263+
content:
74264+
application/json:
74265+
schema:
74266+
$ref: '#/components/schemas/JSONAPIErrorResponse'
74267+
description: Bad Request
74268+
'403':
74269+
$ref: '#/components/responses/NotAuthorizedResponse'
74270+
'429':
74271+
$ref: '#/components/responses/TooManyRequestsResponse'
74272+
security:
74273+
- apiKeyAuth: []
74274+
appKeyAuth: []
74275+
summary: Patch a deployment event
74276+
tags:
74277+
- DORA Metrics
74278+
x-codegen-request-body-name: body
74279+
x-permission:
74280+
operator: OR
74281+
permissions:
74282+
- dora_metrics_write
7416074283
/api/v2/dora/failure:
7416174284
post:
7416274285
description: 'Use this API endpoint to provide failure data.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Patch a deployment event returns "Accepted" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.DoraMetricsApi;
6+
import com.datadog.api.client.v2.model.DORADeploymentPatchRemediation;
7+
import com.datadog.api.client.v2.model.DORADeploymentPatchRemediationType;
8+
import com.datadog.api.client.v2.model.DORADeploymentPatchRequest;
9+
import com.datadog.api.client.v2.model.DORADeploymentPatchRequestAttributes;
10+
import com.datadog.api.client.v2.model.DORADeploymentPatchRequestData;
11+
import com.datadog.api.client.v2.model.DORADeploymentPatchRequestDataType;
12+
13+
public class Example {
14+
public static void main(String[] args) {
15+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
16+
DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient);
17+
18+
DORADeploymentPatchRequest body =
19+
new DORADeploymentPatchRequest()
20+
.data(
21+
new DORADeploymentPatchRequestData()
22+
.attributes(
23+
new DORADeploymentPatchRequestAttributes()
24+
.changeFailure(true)
25+
.remediation(
26+
new DORADeploymentPatchRemediation()
27+
.id("eG42zNIkVjM")
28+
.type(DORADeploymentPatchRemediationType.ROLLBACK)))
29+
.id("z_RwVLi7v4Y")
30+
.type(DORADeploymentPatchRequestDataType.DORA_DEPLOYMENT_PATCH_REQUEST));
31+
32+
try {
33+
apiInstance.patchDORADeployment("deployment_id", body);
34+
} catch (ApiException e) {
35+
System.err.println("Exception when calling DoraMetricsApi#patchDORADeployment");
36+
System.err.println("Status code: " + e.getCode());
37+
System.err.println("Reason: " + e.getResponseBody());
38+
System.err.println("Response headers: " + e.getResponseHeaders());
39+
e.printStackTrace();
40+
}
41+
}
42+
}

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

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.datadog.api.client.ApiResponse;
66
import com.datadog.api.client.Pair;
77
import com.datadog.api.client.v2.model.DORADeploymentFetchResponse;
8+
import com.datadog.api.client.v2.model.DORADeploymentPatchRequest;
89
import com.datadog.api.client.v2.model.DORADeploymentRequest;
910
import com.datadog.api.client.v2.model.DORADeploymentResponse;
1011
import com.datadog.api.client.v2.model.DORADeploymentsListResponse;
@@ -1279,4 +1280,162 @@ public CompletableFuture<ApiResponse<DORAFailuresListResponse>> listDORAFailures
12791280
false,
12801281
new GenericType<DORAFailuresListResponse>() {});
12811282
}
1283+
1284+
/**
1285+
* Patch a deployment event.
1286+
*
1287+
* <p>See {@link #patchDORADeploymentWithHttpInfo}.
1288+
*
1289+
* @param deploymentId The ID of the deployment event. (required)
1290+
* @param body (required)
1291+
* @throws ApiException if fails to make API call
1292+
*/
1293+
public void patchDORADeployment(String deploymentId, DORADeploymentPatchRequest body)
1294+
throws ApiException {
1295+
patchDORADeploymentWithHttpInfo(deploymentId, body);
1296+
}
1297+
1298+
/**
1299+
* Patch a deployment event.
1300+
*
1301+
* <p>See {@link #patchDORADeploymentWithHttpInfoAsync}.
1302+
*
1303+
* @param deploymentId The ID of the deployment event. (required)
1304+
* @param body (required)
1305+
* @return CompletableFuture
1306+
*/
1307+
public CompletableFuture<Void> patchDORADeploymentAsync(
1308+
String deploymentId, DORADeploymentPatchRequest body) {
1309+
return patchDORADeploymentWithHttpInfoAsync(deploymentId, body)
1310+
.thenApply(
1311+
response -> {
1312+
return response.getData();
1313+
});
1314+
}
1315+
1316+
/**
1317+
* Use this API endpoint to patch a deployment event.
1318+
*
1319+
* @param deploymentId The ID of the deployment event. (required)
1320+
* @param body (required)
1321+
* @return ApiResponse&lt;Void&gt;
1322+
* @throws ApiException if fails to make API call
1323+
* @http.response.details
1324+
* <table border="1">
1325+
* <caption>Response details</caption>
1326+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
1327+
* <tr><td> 202 </td><td> Accepted </td><td> - </td></tr>
1328+
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
1329+
* <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr>
1330+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
1331+
* </table>
1332+
*/
1333+
public ApiResponse<Void> patchDORADeploymentWithHttpInfo(
1334+
String deploymentId, DORADeploymentPatchRequest body) throws ApiException {
1335+
Object localVarPostBody = body;
1336+
1337+
// verify the required parameter 'deploymentId' is set
1338+
if (deploymentId == null) {
1339+
throw new ApiException(
1340+
400, "Missing the required parameter 'deploymentId' when calling patchDORADeployment");
1341+
}
1342+
1343+
// verify the required parameter 'body' is set
1344+
if (body == null) {
1345+
throw new ApiException(
1346+
400, "Missing the required parameter 'body' when calling patchDORADeployment");
1347+
}
1348+
// create path and map variables
1349+
String localVarPath =
1350+
"/api/v2/dora/deployments/{deployment_id}"
1351+
.replaceAll(
1352+
"\\{" + "deployment_id" + "\\}", apiClient.escapeString(deploymentId.toString()));
1353+
1354+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1355+
1356+
Invocation.Builder builder =
1357+
apiClient.createBuilder(
1358+
"v2.DoraMetricsApi.patchDORADeployment",
1359+
localVarPath,
1360+
new ArrayList<Pair>(),
1361+
localVarHeaderParams,
1362+
new HashMap<String, String>(),
1363+
new String[] {"*/*"},
1364+
new String[] {"apiKeyAuth", "appKeyAuth"});
1365+
return apiClient.invokeAPI(
1366+
"PATCH",
1367+
builder,
1368+
localVarHeaderParams,
1369+
new String[] {"application/json"},
1370+
localVarPostBody,
1371+
new HashMap<String, Object>(),
1372+
false,
1373+
null);
1374+
}
1375+
1376+
/**
1377+
* Patch a deployment event.
1378+
*
1379+
* <p>See {@link #patchDORADeploymentWithHttpInfo}.
1380+
*
1381+
* @param deploymentId The ID of the deployment event. (required)
1382+
* @param body (required)
1383+
* @return CompletableFuture&lt;ApiResponse&lt;Void&gt;&gt;
1384+
*/
1385+
public CompletableFuture<ApiResponse<Void>> patchDORADeploymentWithHttpInfoAsync(
1386+
String deploymentId, DORADeploymentPatchRequest body) {
1387+
Object localVarPostBody = body;
1388+
1389+
// verify the required parameter 'deploymentId' is set
1390+
if (deploymentId == null) {
1391+
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
1392+
result.completeExceptionally(
1393+
new ApiException(
1394+
400,
1395+
"Missing the required parameter 'deploymentId' when calling patchDORADeployment"));
1396+
return result;
1397+
}
1398+
1399+
// verify the required parameter 'body' is set
1400+
if (body == null) {
1401+
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
1402+
result.completeExceptionally(
1403+
new ApiException(
1404+
400, "Missing the required parameter 'body' when calling patchDORADeployment"));
1405+
return result;
1406+
}
1407+
// create path and map variables
1408+
String localVarPath =
1409+
"/api/v2/dora/deployments/{deployment_id}"
1410+
.replaceAll(
1411+
"\\{" + "deployment_id" + "\\}", apiClient.escapeString(deploymentId.toString()));
1412+
1413+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1414+
1415+
Invocation.Builder builder;
1416+
try {
1417+
builder =
1418+
apiClient.createBuilder(
1419+
"v2.DoraMetricsApi.patchDORADeployment",
1420+
localVarPath,
1421+
new ArrayList<Pair>(),
1422+
localVarHeaderParams,
1423+
new HashMap<String, String>(),
1424+
new String[] {"*/*"},
1425+
new String[] {"apiKeyAuth", "appKeyAuth"});
1426+
} catch (ApiException ex) {
1427+
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
1428+
result.completeExceptionally(ex);
1429+
return result;
1430+
}
1431+
return apiClient.invokeAPIAsync(
1432+
"PATCH",
1433+
builder,
1434+
localVarHeaderParams,
1435+
new String[] {"application/json"},
1436+
localVarPostBody,
1437+
new HashMap<String, Object>(),
1438+
false,
1439+
null);
1440+
}
12821441
}

0 commit comments

Comments
 (0)