Skip to content

Commit f27e7a0

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Include rule ID in request body of all integration tests (#124)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent d0ca82b commit f27e7a0

11 files changed

+47
-45
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
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": "2024-06-04 15:12:26.486463",
8-
"spec_repo_commit": "60183db6"
7+
"regenerated": "2024-06-05 15:00:51.572997",
8+
"spec_repo_commit": "8e7244ae"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-06-04 15:12:26.504400",
13-
"spec_repo_commit": "60183db6"
12+
"regenerated": "2024-06-05 15:00:51.590876",
13+
"spec_repo_commit": "8e7244ae"
1414
}
1515
}
1616
}

examples/v2_csm-threats_update_cloud_workload_security_agent_rule.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ async fn main() {
1717
.enabled(true)
1818
.expression(r#"exec.file.name == "sh""#.to_string()),
1919
CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
20-
),
20+
)
21+
.id(agent_rule_data_id.clone()),
2122
);
2223
let configuration = datadog::Configuration::new();
2324
let api = CSMThreatsAPI::with_config(configuration);
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-04-23T17:57:50.511Z
1+
2024-05-28T19:38:08.047Z

tests/scenarios/cassettes/v2/csm_threats/Update-a-CSM-Threats-Agent-rule-returns-Bad-Request-response.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"request": {
55
"body": {
6-
"string": "{\"data\":{\"attributes\":{\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"name\":\"testupdateacsmthreatsagentrulereturnsbadrequestresponse1713895070\"},\"type\":\"agent_rule\"}}",
6+
"string": "{\"data\":{\"attributes\":{\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"name\":\"testupdateacsmthreatsagentrulereturnsbadrequestresponse1716925088\"},\"type\":\"agent_rule\"}}",
77
"encoding": null
88
},
99
"headers": {
@@ -19,7 +19,7 @@
1919
},
2020
"response": {
2121
"body": {
22-
"string": "{\"data\":{\"id\":\"rgf-aao-lo8\",\"type\":\"agent_rule\",\"attributes\":{\"category\":\"Process Activity\",\"creationDate\":1713895070561,\"creator\":{\"name\":\"\",\"handle\":\"[email protected]\"},\"defaultRule\":false,\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[\"os == \\\"linux\\\"\"],\"name\":\"testupdateacsmthreatsagentrulereturnsbadrequestresponse1713895070\",\"updateDate\":1713895070561,\"updater\":{\"name\":\"\",\"handle\":\"[email protected]\"}}}}",
22+
"string": "{\"data\":{\"id\":\"0wn-l36-875\",\"type\":\"agent_rule\",\"attributes\":{\"category\":\"Process Activity\",\"creationDate\":1716925088306,\"creator\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"defaultRule\":false,\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[\"os == \\\"linux\\\"\"],\"name\":\"testupdateacsmthreatsagentrulereturnsbadrequestresponse1716925088\",\"updateDate\":1716925088306,\"updater\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}",
2323
"encoding": null
2424
},
2525
"headers": {
@@ -32,12 +32,12 @@
3232
"message": "OK"
3333
}
3434
},
35-
"recorded_at": "Tue, 23 Apr 2024 17:57:50 GMT"
35+
"recorded_at": "Tue, 28 May 2024 19:38:08 GMT"
3636
},
3737
{
3838
"request": {
3939
"body": {
40-
"string": "{\"data\":{\"attributes\":{\"description\":\"Test Agent rule\",\"enabled\":true,\"expression\":\"open.file.path = sh\"},\"id\":\"abc-123-xyz\",\"type\":\"agent_rule\"}}",
40+
"string": "{\"data\":{\"attributes\":{\"description\":\"Test Agent rule\",\"enabled\":true,\"expression\":\"open.file.path = sh\"},\"id\":\"0wn-l36-875\",\"type\":\"agent_rule\"}}",
4141
"encoding": null
4242
},
4343
"headers": {
@@ -49,11 +49,11 @@
4949
]
5050
},
5151
"method": "patch",
52-
"uri": "https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/rgf-aao-lo8"
52+
"uri": "https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/0wn-l36-875"
5353
},
5454
"response": {
5555
"body": {
56-
"string": "{\"errors\":[{\"title\":\"failed to update rule\"}]}\n",
56+
"string": "{\"errors\":[\"input_validation_error(Field 'expression' is invalid: rule `testupdateacsmthreatsagentrulereturnsbadrequestresponse1716925088` error: syntax error `1:18: unexpected token \\\"sh\\\" (expected \\\"~\\\")`)\"]}",
5757
"encoding": null
5858
},
5959
"headers": {
@@ -66,7 +66,7 @@
6666
"message": "Bad Request"
6767
}
6868
},
69-
"recorded_at": "Tue, 23 Apr 2024 17:57:50 GMT"
69+
"recorded_at": "Tue, 28 May 2024 19:38:08 GMT"
7070
},
7171
{
7272
"request": {
@@ -77,7 +77,7 @@
7777
]
7878
},
7979
"method": "delete",
80-
"uri": "https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/rgf-aao-lo8"
80+
"uri": "https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/0wn-l36-875"
8181
},
8282
"response": {
8383
"body": {
@@ -94,7 +94,7 @@
9494
"message": "No Content"
9595
}
9696
},
97-
"recorded_at": "Tue, 23 Apr 2024 17:57:50 GMT"
97+
"recorded_at": "Tue, 28 May 2024 19:38:08 GMT"
9898
}
9999
],
100100
"recorded_with": "VCR 6.0.0"
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-04-23T17:57:52.935Z
1+
2024-05-28T19:38:09.490Z

tests/scenarios/cassettes/v2/csm_threats/Update-a-Cloud-Workload-Security-Agent-rule-returns-Bad-Request-response.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"request": {
55
"body": {
6-
"string": "{\"data\":{\"attributes\":{\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"name\":\"testupdateacloudworkloadsecurityagentrulereturnsbadrequestresponse1713895072\"},\"type\":\"agent_rule\"}}",
6+
"string": "{\"data\":{\"attributes\":{\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"name\":\"testupdateacloudworkloadsecurityagentrulereturnsbadrequestresponse1716925089\"},\"type\":\"agent_rule\"}}",
77
"encoding": null
88
},
99
"headers": {
@@ -19,7 +19,7 @@
1919
},
2020
"response": {
2121
"body": {
22-
"string": "{\"data\":{\"id\":\"1su-fqy-sjj\",\"attributes\":{\"version\":1,\"name\":\"testupdateacloudworkloadsecurityagentrulereturnsbadrequestresponse1713895072\",\"description\":\"My Agent rule\",\"expression\":\"exec.file.name == \\\"sh\\\"\",\"category\":\"Process Activity\",\"creationAuthorUuId\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"creationDate\":1713895073105,\"updateAuthorUuId\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"updateDate\":1713895073105,\"filters\":[\"os == \\\"linux\\\"\"],\"actions\":[],\"agentConstraint\":\"\",\"enabled\":true,\"defaultRule\":false,\"creator\":{\"name\":null,\"handle\":\"[email protected]\"},\"updater\":{\"name\":null,\"handle\":\"[email protected]\"}},\"type\":\"agent_rule\"}}\n",
22+
"string": "{\"data\":{\"id\":\"qdg-dfm-kku\",\"attributes\":{\"version\":1,\"name\":\"testupdateacloudworkloadsecurityagentrulereturnsbadrequestresponse1716925089\",\"description\":\"My Agent rule\",\"expression\":\"exec.file.name == \\\"sh\\\"\",\"category\":\"Process Activity\",\"creationAuthorUuId\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"creationDate\":1716925089625,\"updateAuthorUuId\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"updateDate\":1716925089625,\"filters\":[\"os == \\\"linux\\\"\"],\"actions\":[],\"agentConstraint\":\"\",\"defaultRule\":false,\"enabled\":true,\"creator\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"updater\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}},\"type\":\"agent_rule\"}}\n",
2323
"encoding": null
2424
},
2525
"headers": {
@@ -32,12 +32,12 @@
3232
"message": "OK"
3333
}
3434
},
35-
"recorded_at": "Tue, 23 Apr 2024 17:57:52 GMT"
35+
"recorded_at": "Tue, 28 May 2024 19:38:09 GMT"
3636
},
3737
{
3838
"request": {
3939
"body": {
40-
"string": "{\"data\":{\"attributes\":{\"description\":\"Test Agent rule\",\"enabled\":true,\"expression\":\"open.file.path = sh\"},\"type\":\"agent_rule\"}}",
40+
"string": "{\"data\":{\"attributes\":{\"description\":\"Test Agent rule\",\"enabled\":true,\"expression\":\"open.file.path = sh\"},\"id\":\"qdg-dfm-kku\",\"type\":\"agent_rule\"}}",
4141
"encoding": null
4242
},
4343
"headers": {
@@ -49,11 +49,11 @@
4949
]
5050
},
5151
"method": "patch",
52-
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/cloud_workload_security/agent_rules/1su-fqy-sjj"
52+
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/cloud_workload_security/agent_rules/qdg-dfm-kku"
5353
},
5454
"response": {
5555
"body": {
56-
"string": "{\"errors\":[\"input_validation_error(Field 'expression' is invalid: rule `testupdateacloudworkloadsecurityagentrulereturnsbadrequestresponse1713895072` error: syntax error `1:18: unexpected token \\\"sh\\\" (expected \\\"~\\\")`)\"]}\n",
56+
"string": "{\"errors\":[\"input_validation_error(Field 'expression' is invalid: rule `testupdateacloudworkloadsecurityagentrulereturnsbadrequestresponse1716925089` error: syntax error `1:18: unexpected token \\\"sh\\\" (expected \\\"~\\\")`)\"]}\n",
5757
"encoding": null
5858
},
5959
"headers": {
@@ -66,7 +66,7 @@
6666
"message": "Bad Request"
6767
}
6868
},
69-
"recorded_at": "Tue, 23 Apr 2024 17:57:52 GMT"
69+
"recorded_at": "Tue, 28 May 2024 19:38:09 GMT"
7070
},
7171
{
7272
"request": {
@@ -77,7 +77,7 @@
7777
]
7878
},
7979
"method": "delete",
80-
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/cloud_workload_security/agent_rules/1su-fqy-sjj"
80+
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/cloud_workload_security/agent_rules/qdg-dfm-kku"
8181
},
8282
"response": {
8383
"body": {
@@ -90,7 +90,7 @@
9090
"message": "No Content"
9191
}
9292
},
93-
"recorded_at": "Tue, 23 Apr 2024 17:57:52 GMT"
93+
"recorded_at": "Tue, 28 May 2024 19:38:09 GMT"
9494
}
9595
],
9696
"recorded_with": "VCR 6.0.0"
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-04-23T17:57:53.479Z
1+
2024-05-28T19:38:10.057Z

tests/scenarios/cassettes/v2/csm_threats/Update-a-Cloud-Workload-Security-Agent-rule-returns-Not-Found-response.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"request": {
55
"body": {
6-
"string": "{\"data\":{\"attributes\":{\"description\":\"Test Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\"},\"type\":\"agent_rule\"}}",
6+
"string": "{\"data\":{\"attributes\":{\"description\":\"Test Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\"},\"id\":\"abc-123-xyz\",\"type\":\"agent_rule\"}}",
77
"encoding": null
88
},
99
"headers": {
@@ -32,7 +32,7 @@
3232
"message": "Not Found"
3333
}
3434
},
35-
"recorded_at": "Tue, 23 Apr 2024 17:57:53 GMT"
35+
"recorded_at": "Tue, 28 May 2024 19:38:10 GMT"
3636
}
3737
],
3838
"recorded_with": "VCR 6.0.0"
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-04-23T17:57:53.638Z
1+
2024-05-28T19:38:10.219Z

tests/scenarios/cassettes/v2/csm_threats/Update-a-Cloud-Workload-Security-Agent-rule-returns-OK-response.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"request": {
55
"body": {
6-
"string": "{\"data\":{\"attributes\":{\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"name\":\"testupdateacloudworkloadsecurityagentrulereturnsokresponse1713895073\"},\"type\":\"agent_rule\"}}",
6+
"string": "{\"data\":{\"attributes\":{\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"name\":\"testupdateacloudworkloadsecurityagentrulereturnsokresponse1716925090\"},\"type\":\"agent_rule\"}}",
77
"encoding": null
88
},
99
"headers": {
@@ -19,7 +19,7 @@
1919
},
2020
"response": {
2121
"body": {
22-
"string": "{\"data\":{\"id\":\"sir-mer-toj\",\"attributes\":{\"version\":1,\"name\":\"testupdateacloudworkloadsecurityagentrulereturnsokresponse1713895073\",\"description\":\"My Agent rule\",\"expression\":\"exec.file.name == \\\"sh\\\"\",\"category\":\"Process Activity\",\"creationAuthorUuId\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"creationDate\":1713895073761,\"updateAuthorUuId\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"updateDate\":1713895073761,\"filters\":[\"os == \\\"linux\\\"\"],\"actions\":[],\"agentConstraint\":\"\",\"enabled\":true,\"defaultRule\":false,\"creator\":{\"name\":null,\"handle\":\"[email protected]\"},\"updater\":{\"name\":null,\"handle\":\"[email protected]\"}},\"type\":\"agent_rule\"}}\n",
22+
"string": "{\"data\":{\"id\":\"wmz-xld-san\",\"attributes\":{\"version\":1,\"name\":\"testupdateacloudworkloadsecurityagentrulereturnsokresponse1716925090\",\"description\":\"My Agent rule\",\"expression\":\"exec.file.name == \\\"sh\\\"\",\"category\":\"Process Activity\",\"creationAuthorUuId\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"creationDate\":1716925090332,\"updateAuthorUuId\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"updateDate\":1716925090332,\"filters\":[\"os == \\\"linux\\\"\"],\"actions\":[],\"agentConstraint\":\"\",\"enabled\":true,\"defaultRule\":false,\"creator\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"updater\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}},\"type\":\"agent_rule\"}}\n",
2323
"encoding": null
2424
},
2525
"headers": {
@@ -32,12 +32,12 @@
3232
"message": "OK"
3333
}
3434
},
35-
"recorded_at": "Tue, 23 Apr 2024 17:57:53 GMT"
35+
"recorded_at": "Tue, 28 May 2024 19:38:10 GMT"
3636
},
3737
{
3838
"request": {
3939
"body": {
40-
"string": "{\"data\":{\"attributes\":{\"description\":\"Test Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\"},\"type\":\"agent_rule\"}}",
40+
"string": "{\"data\":{\"attributes\":{\"description\":\"Test Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\"},\"id\":\"wmz-xld-san\",\"type\":\"agent_rule\"}}",
4141
"encoding": null
4242
},
4343
"headers": {
@@ -49,11 +49,11 @@
4949
]
5050
},
5151
"method": "patch",
52-
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/cloud_workload_security/agent_rules/sir-mer-toj"
52+
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/cloud_workload_security/agent_rules/wmz-xld-san"
5353
},
5454
"response": {
5555
"body": {
56-
"string": "{\"data\":{\"id\":\"sir-mer-toj\",\"attributes\":{\"version\":2,\"name\":\"testupdateacloudworkloadsecurityagentrulereturnsokresponse1713895073\",\"description\":\"Test Agent rule\",\"expression\":\"exec.file.name == \\\"sh\\\"\",\"category\":\"Process Activity\",\"creationAuthorUuId\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"creationDate\":1713895073761,\"updateAuthorUuId\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"updateDate\":1713895073928,\"filters\":[\"os == \\\"linux\\\"\"],\"actions\":[],\"agentConstraint\":\"\",\"enabled\":true,\"defaultRule\":false,\"creator\":{\"name\":null,\"handle\":\"[email protected]\"},\"updater\":{\"name\":null,\"handle\":\"[email protected]\"}},\"type\":\"agent_rule\"}}\n",
56+
"string": "{\"data\":{\"id\":\"wmz-xld-san\",\"attributes\":{\"version\":2,\"name\":\"testupdateacloudworkloadsecurityagentrulereturnsokresponse1716925090\",\"description\":\"Test Agent rule\",\"expression\":\"exec.file.name == \\\"sh\\\"\",\"category\":\"Process Activity\",\"creationAuthorUuId\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"creationDate\":1716925090332,\"updateAuthorUuId\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"updateDate\":1716925090525,\"filters\":[\"os == \\\"linux\\\"\"],\"actions\":[],\"agentConstraint\":\"\",\"enabled\":true,\"defaultRule\":false,\"creator\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"updater\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}},\"type\":\"agent_rule\"}}\n",
5757
"encoding": null
5858
},
5959
"headers": {
@@ -66,7 +66,7 @@
6666
"message": "OK"
6767
}
6868
},
69-
"recorded_at": "Tue, 23 Apr 2024 17:57:53 GMT"
69+
"recorded_at": "Tue, 28 May 2024 19:38:10 GMT"
7070
},
7171
{
7272
"request": {
@@ -77,7 +77,7 @@
7777
]
7878
},
7979
"method": "delete",
80-
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/cloud_workload_security/agent_rules/sir-mer-toj"
80+
"uri": "https://api.datadoghq.com/api/v2/security_monitoring/cloud_workload_security/agent_rules/wmz-xld-san"
8181
},
8282
"response": {
8383
"body": {
@@ -90,7 +90,7 @@
9090
"message": "No Content"
9191
}
9292
},
93-
"recorded_at": "Tue, 23 Apr 2024 17:57:53 GMT"
93+
"recorded_at": "Tue, 28 May 2024 19:38:10 GMT"
9494
}
9595
],
9696
"recorded_with": "VCR 6.0.0"

0 commit comments

Comments
 (0)