Skip to content

Commit 2bb0913

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit f907e8e of spec repo
1 parent 4794976 commit 2bb0913

10 files changed

Lines changed: 247 additions & 1857 deletions

File tree

‎.generator/schemas/v2/openapi.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209523,7 +209523,7 @@ paths:
209523209523
description: "The definition of the new Agent policy"
209524209524
required: true
209525209525
responses:
209526-
"200":
209526+
"201":
209527209527
content:
209528209528
"application/json":
209529209529
examples:
@@ -209538,7 +209538,7 @@ paths:
209538209538
type: policy
209539209539
schema:
209540209540
$ref: "#/components/schemas/CloudWorkloadSecurityAgentPolicyResponse"
209541-
description: OK
209541+
description: Created
209542209542
"400":
209543209543
$ref: "#/components/responses/BadRequestResponse"
209544209544
"403":

‎examples/v2/csm-threats/CreateCSMThreatsAgentPolicy.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Create a Workload Protection policy returns "OK" response
1+
// Create a Workload Protection policy returns "Created" response
22

33
import com.datadog.api.client.ApiClient;
44
import com.datadog.api.client.ApiException;
@@ -23,7 +23,7 @@ public static void main(String[] args) {
2323
.attributes(
2424
new CloudWorkloadSecurityAgentPolicyCreateAttributes()
2525
.description("My agent policy")
26-
.enabled(true)
26+
.enabled(false)
2727
.hostTagsLists(
2828
Collections.singletonList(Collections.singletonList("env:test")))
2929
.name("my_agent_policy_2"))

‎examples/v2/csm-threats/UpdateCSMThreatsAgentPolicy.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public static void main(String[] args) {
1616
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
1717
CsmThreatsApi apiInstance = new CsmThreatsApi(defaultClient);
1818

19-
// there is a valid "policy_rc" in the system
20-
String POLICY_DATA_ID = System.getenv("POLICY_DATA_ID");
19+
// there is a valid "policy_rc_disabled" in the system
20+
String POLICY_DISABLED_DATA_ID = System.getenv("POLICY_DISABLED_DATA_ID");
2121

2222
CloudWorkloadSecurityAgentPolicyUpdateRequest body =
2323
new CloudWorkloadSecurityAgentPolicyUpdateRequest()
@@ -26,16 +26,16 @@ public static void main(String[] args) {
2626
.attributes(
2727
new CloudWorkloadSecurityAgentPolicyUpdateAttributes()
2828
.description("Updated agent policy")
29-
.enabled(true)
29+
.enabled(false)
3030
.hostTagsLists(
3131
Collections.singletonList(Collections.singletonList("env:test")))
3232
.name("updated_agent_policy"))
33-
.id(POLICY_DATA_ID)
33+
.id(POLICY_DISABLED_DATA_ID)
3434
.type(CloudWorkloadSecurityAgentPolicyType.POLICY));
3535

3636
try {
3737
CloudWorkloadSecurityAgentPolicyResponse result =
38-
apiInstance.updateCSMThreatsAgentPolicy(POLICY_DATA_ID, body);
38+
apiInstance.updateCSMThreatsAgentPolicy(POLICY_DISABLED_DATA_ID, body);
3939
System.out.println(result);
4040
} catch (ApiException e) {
4141
System.err.println("Exception when calling CsmThreatsApi#updateCSMThreatsAgentPolicy");

‎src/main/java/com/datadog/api/client/v2/api/CsmThreatsApi.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public CloudWorkloadSecurityAgentPolicyResponse createCSMThreatsAgentPolicy(
240240
* <table border="1">
241241
* <caption>Response details</caption>
242242
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
243-
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
243+
* <tr><td> 201 </td><td> Created </td><td> - </td></tr>
244244
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
245245
* <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr>
246246
* <tr><td> 409 </td><td> Conflict </td><td> - </td></tr>

‎src/test/resources/com/datadog/api/client/v2/api/csm_threats.feature‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ Feature: CSM Threats
9292
Then the response status is 409 Conflict
9393

9494
@team:ddoghq/k9-cws-backend
95-
Scenario: Create a Workload Protection policy returns "OK" response
95+
Scenario: Create a Workload Protection policy returns "Created" response
9696
Given new "CreateCSMThreatsAgentPolicy" request
97-
And body with value {"data": {"attributes": {"description": "My agent policy", "enabled": true, "hostTagsLists": [["env:test"]], "name": "my_agent_policy_2"}, "type": "policy"}}
97+
And body with value {"data": {"attributes": {"description": "My agent policy", "enabled": false, "hostTagsLists": [["env:test"]], "name": "my_agent_policy_2"}, "type": "policy"}}
9898
When the request is sent
99-
Then the response status is 200 OK
99+
Then the response status is 201 Created
100100

101101
@replay-only @team:ddoghq/k9-cws-backend
102102
Scenario: Delete a Workload Protection agent rule (US1-FED) returns "Not Found" response
@@ -325,9 +325,9 @@ Feature: CSM Threats
325325

326326
@team:ddoghq/k9-cws-backend
327327
Scenario: Update a Workload Protection policy returns "OK" response
328-
Given there is a valid "policy_rc" in the system
328+
Given there is a valid "policy_rc_disabled" in the system
329329
And new "UpdateCSMThreatsAgentPolicy" request
330-
And request contains "policy_id" parameter from "policy.data.id"
331-
And body with value {"data": {"attributes": {"description": "Updated agent policy", "enabled": true, "hostTagsLists": [["env:test"]], "name": "updated_agent_policy"}, "id": "{{ policy.data.id }}", "type": "policy"}}
330+
And request contains "policy_id" parameter from "policy_disabled.data.id"
331+
And body with value {"data": {"attributes": {"description": "Updated agent policy", "enabled": false, "hostTagsLists": [["env:test"]], "name": "updated_agent_policy"}, "id": "{{ policy_disabled.data.id }}", "type": "policy"}}
332332
When the request is sent
333333
Then the response status is 200 OK

‎src/test/resources/com/datadog/api/client/v2/api/given.json‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,18 @@
13781378
"tag": "CSM Threats",
13791379
"operationId": "CreateCSMThreatsAgentPolicy"
13801380
},
1381+
{
1382+
"parameters": [
1383+
{
1384+
"name": "body",
1385+
"value": "{\n \"data\": {\n \"type\": \"policy\",\n \"attributes\": {\n \"name\": \"{{ unique_lower_alnum }}\",\n \"description\": \"My agent policy\",\n \"hostTags\": [\"env:staging\"],\n \"enabled\": false\n }\n }\n}"
1386+
}
1387+
],
1388+
"step": "there is a valid \"policy_rc_disabled\" in the system",
1389+
"key": "policy_disabled",
1390+
"tag": "CSM Threats",
1391+
"operationId": "CreateCSMThreatsAgentPolicy"
1392+
},
13811393
{
13821394
"parameters": [
13831395
{

‎src/test/resources/generated-test/test-runner-data/manifest.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4553,8 +4553,8 @@
45534553
{
45544554
"feature": "CSM Threats",
45554555
"feature_file": "../../com/datadog/api/client/v2/api/csm_threats.feature",
4556-
"file": "v2/csm-threats/create-a-workload-protection-policy-returns-ok-response.json",
4557-
"scenario": "Create a Workload Protection policy returns \"OK\" response",
4556+
"file": "v2/csm-threats/create-a-workload-protection-policy-returns-created-response.json",
4557+
"scenario": "Create a Workload Protection policy returns \"Created\" response",
45584558
"version": "v2"
45594559
},
45604560
{

src/test/resources/generated-test/test-runner-data/v2/csm-threats/create-a-workload-protection-policy-returns-ok-response.json renamed to src/test/resources/generated-test/test-runner-data/v2/csm-threats/create-a-workload-protection-policy-returns-created-response.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"api": "CSMThreats",
3-
"expected_status": 200,
3+
"expected_status": 201,
44
"feature": "CSM Threats",
5-
"id": "v2/CSM Threats/Create a Workload Protection policy returns \"OK\" response",
5+
"id": "v2/CSM Threats/Create a Workload Protection policy returns \"Created\" response",
66
"operation_id": "CreateCSMThreatsAgentPolicy",
77
"request": {
88
"body": {
@@ -16,7 +16,7 @@
1616
"data": {
1717
"attributes": {
1818
"description": "My agent policy",
19-
"enabled": true,
19+
"enabled": false,
2020
"hostTagsLists": [
2121
[
2222
"env:test"
@@ -34,7 +34,7 @@
3434
"parameters": [],
3535
"path": "/api/v2/remote_config/products/cws/policy"
3636
},
37-
"scenario": "Create a Workload Protection policy returns \"OK\" response",
37+
"scenario": "Create a Workload Protection policy returns \"Created\" response",
3838
"schema_version": 1,
3939
"version": "v2"
4040
}

‎src/test/resources/generated-test/test-runner-data/v2/csm-threats/update-a-workload-protection-policy-returns-ok-response.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
"data": {
1717
"attributes": {
1818
"description": "Updated agent policy",
19-
"enabled": true,
19+
"enabled": false,
2020
"hostTagsLists": [
2121
[
2222
"env:test"
2323
]
2424
],
2525
"name": "updated_agent_policy"
2626
},
27-
"id": "{{ policy.data.id }}",
27+
"id": "{{ policy_disabled.data.id }}",
2828
"type": "policy"
2929
}
3030
}
@@ -44,7 +44,7 @@
4444
"type": "string"
4545
},
4646
"source": {
47-
"path": "policy.data.id",
47+
"path": "policy_disabled.data.id",
4848
"type": "fixture"
4949
},
5050
"style": null

0 commit comments

Comments
 (0)