Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210396,7 +210396,7 @@ paths:
description: "The definition of the new Agent policy"
required: true
responses:
"200":
"201":
content:
"application/json":
examples:
Expand All @@ -210411,7 +210411,7 @@ paths:
type: policy
schema:
$ref: "#/components/schemas/CloudWorkloadSecurityAgentPolicyResponse"
description: OK
description: Created
"400":
$ref: "#/components/responses/BadRequestResponse"
"403":
Expand Down
4 changes: 2 additions & 2 deletions examples/v2/csm-threats/CreateCSMThreatsAgentPolicy.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Create a Workload Protection policy returns "OK" response
// Create a Workload Protection policy returns "Created" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
Expand All @@ -23,7 +23,7 @@ public static void main(String[] args) {
.attributes(
new CloudWorkloadSecurityAgentPolicyCreateAttributes()
.description("My agent policy")
.enabled(true)
.enabled(false)
.hostTagsLists(
Collections.singletonList(Collections.singletonList("env:test")))
.name("my_agent_policy_2"))
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/csm-threats/UpdateCSMThreatsAgentPolicy.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void main(String[] args) {
.attributes(
new CloudWorkloadSecurityAgentPolicyUpdateAttributes()
.description("Updated agent policy")
.enabled(true)
.enabled(false)
.hostTagsLists(
Collections.singletonList(Collections.singletonList("env:test")))
.name("updated_agent_policy"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public CloudWorkloadSecurityAgentPolicyResponse createCSMThreatsAgentPolicy(
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 201 </td><td> Created </td><td> - </td></tr>
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
* <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr>
* <tr><td> 409 </td><td> Conflict </td><td> - </td></tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ Feature: CSM Threats
Then the response status is 409 Conflict

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

@replay-only @team:ddoghq/k9-cws-backend
Scenario: Delete a Workload Protection agent rule (US1-FED) returns "Not Found" response
Expand Down Expand Up @@ -328,6 +328,6 @@ Feature: CSM Threats
Given there is a valid "policy_rc" in the system
And new "UpdateCSMThreatsAgentPolicy" request
And request contains "policy_id" parameter from "policy.data.id"
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"}}
And body with value {"data": {"attributes": {"description": "Updated agent policy", "enabled": false, "hostTagsLists": [["env:test"]], "name": "updated_agent_policy"}, "id": "{{ policy.data.id }}", "type": "policy"}}
When the request is sent
Then the response status is 200 OK
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@
"parameters": [
{
"name": "body",
"value": "{\n \"data\": {\n \"type\": \"policy\",\n \"attributes\": {\n \"name\": \"{{ unique_lower_alnum }}\",\n \"description\": \"My agent policy\",\n \"hostTags\": [\"env:staging\"],\n \"enabled\": true\n }\n }\n}"
"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}"
}
],
"step": "there is a valid \"policy_rc\" in the system",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4574,8 +4574,8 @@
{
"feature": "CSM Threats",
"feature_file": "../../com/datadog/api/client/v2/api/csm_threats.feature",
"file": "v2/csm-threats/create-a-workload-protection-policy-returns-ok-response.json",
"scenario": "Create a Workload Protection policy returns \"OK\" response",
"file": "v2/csm-threats/create-a-workload-protection-policy-returns-created-response.json",
"scenario": "Create a Workload Protection policy returns \"Created\" response",
"version": "v2"
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"api": "CSMThreats",
"expected_status": 200,
"expected_status": 201,
"feature": "CSM Threats",
"id": "v2/CSM Threats/Create a Workload Protection policy returns \"OK\" response",
"id": "v2/CSM Threats/Create a Workload Protection policy returns \"Created\" response",
"operation_id": "CreateCSMThreatsAgentPolicy",
"request": {
"body": {
Expand All @@ -16,7 +16,7 @@
"data": {
"attributes": {
"description": "My agent policy",
"enabled": true,
"enabled": false,
"hostTagsLists": [
[
"env:test"
Expand All @@ -34,7 +34,7 @@
"parameters": [],
"path": "/api/v2/remote_config/products/cws/policy"
},
"scenario": "Create a Workload Protection policy returns \"OK\" response",
"scenario": "Create a Workload Protection policy returns \"Created\" response",
"schema_version": 1,
"version": "v2"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"data": {
"attributes": {
"description": "Updated agent policy",
"enabled": true,
"enabled": false,
"hostTagsLists": [
[
"env:test"
Expand Down
Loading
Loading