Skip to content

Commit 2396c68

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit b6151f30 of spec repo (#3147)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 1a578a0 commit 2396c68

14 files changed

Lines changed: 98 additions & 54 deletions

.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": "2025-06-17 18:22:00.647030",
8-
"spec_repo_commit": "b1a1c000"
7+
"regenerated": "2025-06-18 09:42:18.735692",
8+
"spec_repo_commit": "b6151f30"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-17 18:22:00.662709",
13-
"spec_repo_commit": "b1a1c000"
12+
"regenerated": "2025-06-18 09:42:18.752679",
13+
"spec_repo_commit": "b6151f30"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7540,13 +7540,19 @@ components:
75407540
description: SECL expression used to target the container to apply the action
75417541
on
75427542
type: string
7543+
hash:
7544+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionHash'
75437545
kill:
75447546
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleKill'
75457547
metadata:
75467548
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionMetadata'
75477549
set:
75487550
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionSet'
75497551
type: object
7552+
CloudWorkloadSecurityAgentRuleActionHash:
7553+
additionalProperties: {}
7554+
description: An empty object indicating the hash action
7555+
type: object
75507556
CloudWorkloadSecurityAgentRuleActionMetadata:
75517557
description: The metadata action applied on the scope matching the rule
75527558
properties:

api/datadogV2/model_cloud_workload_security_agent_rule_action.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212
type CloudWorkloadSecurityAgentRuleAction struct {
1313
// SECL expression used to target the container to apply the action on
1414
Filter *string `json:"filter,omitempty"`
15+
// An empty object indicating the hash action
16+
Hash map[string]interface{} `json:"hash,omitempty"`
1517
// Kill system call applied on the container matching the rule
1618
Kill *CloudWorkloadSecurityAgentRuleKill `json:"kill,omitempty"`
1719
// The metadata action applied on the scope matching the rule
@@ -68,6 +70,34 @@ func (o *CloudWorkloadSecurityAgentRuleAction) SetFilter(v string) {
6870
o.Filter = &v
6971
}
7072

73+
// GetHash returns the Hash field value if set, zero value otherwise.
74+
func (o *CloudWorkloadSecurityAgentRuleAction) GetHash() map[string]interface{} {
75+
if o == nil || o.Hash == nil {
76+
var ret map[string]interface{}
77+
return ret
78+
}
79+
return o.Hash
80+
}
81+
82+
// GetHashOk returns a tuple with the Hash field value if set, nil otherwise
83+
// and a boolean to check if the value has been set.
84+
func (o *CloudWorkloadSecurityAgentRuleAction) GetHashOk() (*map[string]interface{}, bool) {
85+
if o == nil || o.Hash == nil {
86+
return nil, false
87+
}
88+
return &o.Hash, true
89+
}
90+
91+
// HasHash returns a boolean if a field has been set.
92+
func (o *CloudWorkloadSecurityAgentRuleAction) HasHash() bool {
93+
return o != nil && o.Hash != nil
94+
}
95+
96+
// SetHash gets a reference to the given map[string]interface{} and assigns it to the Hash field.
97+
func (o *CloudWorkloadSecurityAgentRuleAction) SetHash(v map[string]interface{}) {
98+
o.Hash = v
99+
}
100+
71101
// GetKill returns the Kill field value if set, zero value otherwise.
72102
func (o *CloudWorkloadSecurityAgentRuleAction) GetKill() CloudWorkloadSecurityAgentRuleKill {
73103
if o == nil || o.Kill == nil {
@@ -161,6 +191,9 @@ func (o CloudWorkloadSecurityAgentRuleAction) MarshalJSON() ([]byte, error) {
161191
if o.Filter != nil {
162192
toSerialize["filter"] = o.Filter
163193
}
194+
if o.Hash != nil {
195+
toSerialize["hash"] = o.Hash
196+
}
164197
if o.Kill != nil {
165198
toSerialize["kill"] = o.Kill
166199
}
@@ -181,6 +214,7 @@ func (o CloudWorkloadSecurityAgentRuleAction) MarshalJSON() ([]byte, error) {
181214
func (o *CloudWorkloadSecurityAgentRuleAction) UnmarshalJSON(bytes []byte) (err error) {
182215
all := struct {
183216
Filter *string `json:"filter,omitempty"`
217+
Hash map[string]interface{} `json:"hash,omitempty"`
184218
Kill *CloudWorkloadSecurityAgentRuleKill `json:"kill,omitempty"`
185219
Metadata *CloudWorkloadSecurityAgentRuleActionMetadata `json:"metadata,omitempty"`
186220
Set *CloudWorkloadSecurityAgentRuleActionSet `json:"set,omitempty"`
@@ -190,13 +224,14 @@ func (o *CloudWorkloadSecurityAgentRuleAction) UnmarshalJSON(bytes []byte) (err
190224
}
191225
additionalProperties := make(map[string]interface{})
192226
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
193-
datadog.DeleteKeys(additionalProperties, &[]string{"filter", "kill", "metadata", "set"})
227+
datadog.DeleteKeys(additionalProperties, &[]string{"filter", "hash", "kill", "metadata", "set"})
194228
} else {
195229
return err
196230
}
197231

198232
hasInvalidField := false
199233
o.Filter = all.Filter
234+
o.Hash = all.Hash
200235
if all.Kill != nil && all.Kill.UnparsedObject != nil && o.UnparsedObject == nil {
201236
hasInvalidField = true
202237
}

examples/v2/csm-threats/CreateCSMThreatsAgentRule_1295653933.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ func main() {
3434
Scope: datadog.PtrString("process"),
3535
},
3636
},
37+
{
38+
Hash: map[string]interface{}{},
39+
},
3740
},
3841
},
3942
Type: datadogV2.CLOUDWORKLOADSECURITYAGENTRULETYPE_AGENT_RULE,
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-05-27T10:24:57.049Z
1+
2025-06-13T15:16:58.034Z

tests/scenarios/cassettes/TestScenarios/v2/Feature_CSM_Threats/Scenario_Create_a_Workload_Protection_agent_rule_with_set_action_returns_OK_response.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: |
4-
{"data":{"attributes":{"description":"My agent policy","enabled":true,"hostTags":["env:staging"],"name":"testcreateaworkloadprotectionagentrulewithsetactionreturnsokresponse1748341497"},"type":"policy"}}
4+
{"data":{"attributes":{"description":"My agent policy","enabled":true,"hostTags":["env:staging"],"name":"testcreateaworkloadprotectionagentrulewithsetactionreturnsokresponse1749827818"},"type":"policy"}}
55
form: {}
66
headers:
77
Accept:
@@ -12,8 +12,8 @@ interactions:
1212
method: POST
1313
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/policy
1414
response:
15-
body: '{"data":{"id":"qyj-iza-vbu","type":"policy","attributes":{"blockingRulesCount":0,"datadogManaged":false,"description":"My
16-
agent policy","disabledRulesCount":1,"enabled":true,"hostTags":["env:staging"],"monitoringRulesCount":225,"name":"testcreateaworkloadprotectionagentrulewithsetactionreturnsokresponse1748341497","policyVersion":"1","priority":1000000011,"ruleCount":226,"updateDate":1748341497346,"updater":{"name":"frog","handle":"frog@datadoghq.com"}}}}'
15+
body: '{"data":{"id":"alt-4q4-baa","type":"policy","attributes":{"blockingRulesCount":0,"datadogManaged":false,"description":"My
16+
agent policy","disabledRulesCount":1,"enabled":true,"hostTags":["env:staging"],"monitoringRulesCount":225,"name":"testcreateaworkloadprotectionagentrulewithsetactionreturnsokresponse1749827818","policyVersion":"1","priority":1000000013,"ruleCount":226,"updateDate":1749827818428,"updater":{"name":"frog","handle":"frog@datadoghq.com"}}}}'
1717
code: 200
1818
duration: 0ms
1919
headers:
@@ -22,7 +22,7 @@ interactions:
2222
status: 200 OK
2323
- request:
2424
body: |
25-
{"data":{"attributes":{"actions":[{"set":{"name":"test_set","scope":"process","value":"test_value"}}],"description":"My Agent rule with set action","enabled":true,"expression":"exec.file.name == \"sh\"","filters":[],"name":"testcreateaworkloadprotectionagentrulewithsetactionreturnsokresponse1748341497","policy_id":"qyj-iza-vbu","product_tags":[]},"type":"agent_rule"}}
25+
{"data":{"attributes":{"actions":[{"set":{"name":"test_set","scope":"process","value":"test_value"}},{"hash":{}}],"description":"My Agent rule with set action","enabled":true,"expression":"exec.file.name == \"sh\"","filters":[],"name":"testcreateaworkloadprotectionagentrulewithsetactionreturnsokresponse1749827818","policy_id":"alt-4q4-baa","product_tags":[]},"type":"agent_rule"}}
2626
form: {}
2727
headers:
2828
Accept:
@@ -33,10 +33,10 @@ interactions:
3333
method: POST
3434
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules
3535
response:
36-
body: '{"data":{"id":"zux-bp8-zov","type":"agent_rule","attributes":{"actions":[{"set":{"name":"test_set","value":"test_value","scope":"process"},"disabled":false}],"category":"Process
37-
Activity","creationDate":1748341498175,"creator":{"name":"frog","handle":"frog@datadoghq.com"},"defaultRule":false,"description":"My
36+
body: '{"data":{"id":"ps3-64e-shx","type":"agent_rule","attributes":{"actions":[{"set":{"name":"test_set","value":"test_value","scope":"process"},"disabled":false},{"hash":{},"disabled":false}],"category":"Process
37+
Activity","creationDate":1749827819065,"creator":{"name":"frog","handle":"frog@datadoghq.com"},"defaultRule":false,"description":"My
3838
Agent rule with set action","enabled":true,"expression":"exec.file.name == \"sh\"","filters":["os
39-
== \"linux\""],"monitoring":["qyj-iza-vbu"],"name":"testcreateaworkloadprotectionagentrulewithsetactionreturnsokresponse1748341497","product_tags":[],"updateDate":1748341498175,"updater":{"name":"frog","handle":"frog@datadoghq.com"}}}}'
39+
== \"linux\""],"monitoring":["alt-4q4-baa"],"name":"testcreateaworkloadprotectionagentrulewithsetactionreturnsokresponse1749827818","product_tags":[],"updateDate":1749827819065,"updater":{"name":"frog","handle":"frog@datadoghq.com"}}}}'
4040
code: 200
4141
duration: 0ms
4242
headers:
@@ -51,7 +51,7 @@ interactions:
5151
- '*/*'
5252
id: 2
5353
method: DELETE
54-
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/zux-bp8-zov
54+
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/ps3-64e-shx
5555
response:
5656
body: ''
5757
code: 204
@@ -68,7 +68,7 @@ interactions:
6868
- '*/*'
6969
id: 3
7070
method: DELETE
71-
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/policy/qyj-iza-vbu
71+
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/policy/alt-4q4-baa
7272
response:
7373
body: ''
7474
code: 204
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-05-27T10:25:02.351Z
1+
2025-06-13T15:16:43.100Z

tests/scenarios/cassettes/TestScenarios/v2/Feature_CSM_Threats/Scenario_Delete_a_Workload_Protection_agent_rule_returns_OK_response.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: |
4-
{"data":{"attributes":{"description":"My agent policy","enabled":true,"hostTags":["env:staging"],"name":"testdeleteaworkloadprotectionagentrulereturnsokresponse1748341502"},"type":"policy"}}
4+
{"data":{"attributes":{"description":"My agent policy","enabled":true,"hostTags":["env:staging"],"name":"testdeleteaworkloadprotectionagentrulereturnsokresponse1749827803"},"type":"policy"}}
55
form: {}
66
headers:
77
Accept:
@@ -12,8 +12,8 @@ interactions:
1212
method: POST
1313
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/policy
1414
response:
15-
body: '{"data":{"id":"ney-zeu-tex","type":"policy","attributes":{"blockingRulesCount":0,"datadogManaged":false,"description":"My
16-
agent policy","disabledRulesCount":1,"enabled":true,"hostTags":["env:staging"],"monitoringRulesCount":225,"name":"testdeleteaworkloadprotectionagentrulereturnsokresponse1748341502","policyVersion":"1","priority":1000000011,"ruleCount":226,"updateDate":1748341502642,"updater":{"name":"frog","handle":"frog@datadoghq.com"}}}}'
15+
body: '{"data":{"id":"tn0-tjy-vwh","type":"policy","attributes":{"blockingRulesCount":0,"datadogManaged":false,"description":"My
16+
agent policy","disabledRulesCount":1,"enabled":true,"hostTags":["env:staging"],"monitoringRulesCount":225,"name":"testdeleteaworkloadprotectionagentrulereturnsokresponse1749827803","policyVersion":"1","priority":1000000013,"ruleCount":226,"updateDate":1749827803539,"updater":{"name":"frog","handle":"frog@datadoghq.com"}}}}'
1717
code: 200
1818
duration: 0ms
1919
headers:
@@ -22,7 +22,7 @@ interactions:
2222
status: 200 OK
2323
- request:
2424
body: |
25-
{"data":{"attributes":{"actions":[{"set":{"name":"test_set","scope":"process","value":"test_value"}}],"description":"My Agent rule","enabled":true,"expression":"exec.file.name == \"sh\"","name":"testdeleteaworkloadprotectionagentrulereturnsokresponse1748341502","policy_id":"ney-zeu-tex","product_tags":["security:attack","technique:T1059"]},"type":"agent_rule"}}
25+
{"data":{"attributes":{"actions":[{"set":{"name":"test_set","scope":"process","value":"test_value"}},{"hash":{}}],"description":"My Agent rule","enabled":true,"expression":"exec.file.name == \"sh\"","name":"testdeleteaworkloadprotectionagentrulereturnsokresponse1749827803","policy_id":"tn0-tjy-vwh","product_tags":["security:attack","technique:T1059"]},"type":"agent_rule"}}
2626
form: {}
2727
headers:
2828
Accept:
@@ -33,10 +33,10 @@ interactions:
3333
method: POST
3434
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules
3535
response:
36-
body: '{"data":{"id":"gys-bzk-zs4","type":"agent_rule","attributes":{"actions":[{"set":{"name":"test_set","value":"test_value","scope":"process"},"disabled":false}],"category":"Process
37-
Activity","creationDate":1748341503254,"creator":{"name":"frog","handle":"frog@datadoghq.com"},"defaultRule":false,"description":"My
36+
body: '{"data":{"id":"hm0-n7p-hq7","type":"agent_rule","attributes":{"actions":[{"set":{"name":"test_set","value":"test_value","scope":"process"},"disabled":false},{"hash":{},"disabled":false}],"category":"Process
37+
Activity","creationDate":1749827804150,"creator":{"name":"frog","handle":"frog@datadoghq.com"},"defaultRule":false,"description":"My
3838
Agent rule","enabled":true,"expression":"exec.file.name == \"sh\"","filters":["os
39-
== \"linux\""],"monitoring":["ney-zeu-tex"],"name":"testdeleteaworkloadprotectionagentrulereturnsokresponse1748341502","product_tags":["security:attack","technique:T1059"],"updateDate":1748341503254,"updater":{"name":"frog","handle":"frog@datadoghq.com"}}}}'
39+
== \"linux\""],"monitoring":["tn0-tjy-vwh"],"name":"testdeleteaworkloadprotectionagentrulereturnsokresponse1749827803","product_tags":["security:attack","technique:T1059"],"updateDate":1749827804150,"updater":{"name":"frog","handle":"frog@datadoghq.com"}}}}'
4040
code: 200
4141
duration: 0ms
4242
headers:
@@ -51,7 +51,7 @@ interactions:
5151
- '*/*'
5252
id: 2
5353
method: DELETE
54-
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/gys-bzk-zs4?policy_id=ney-zeu-tex
54+
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/hm0-n7p-hq7?policy_id=tn0-tjy-vwh
5555
response:
5656
body: ''
5757
code: 204
@@ -68,7 +68,7 @@ interactions:
6868
- '*/*'
6969
id: 3
7070
method: DELETE
71-
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/gys-bzk-zs4
71+
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/hm0-n7p-hq7
7272
response:
7373
body: '{"errors":[{"title":"failed to delete rule"}]}
7474
@@ -87,7 +87,7 @@ interactions:
8787
- '*/*'
8888
id: 4
8989
method: DELETE
90-
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/policy/ney-zeu-tex
90+
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/policy/tn0-tjy-vwh
9191
response:
9292
body: ''
9393
code: 204
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-05-27T10:25:11.236Z
1+
2025-06-13T15:16:09.321Z

0 commit comments

Comments
 (0)