Skip to content

Commit 973d911

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 6400722 of spec repo
1 parent 5f14d29 commit 973d911

File tree

58 files changed

+899
-186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+899
-186
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 61 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9338,6 +9338,10 @@ components:
93389338
description: The name of the policy
93399339
example: my_agent_policy
93409340
type: string
9341+
pinned:
9342+
description: Whether the policy is pinned
9343+
example: false
9344+
type: boolean
93419345
policyVersion:
93429346
description: The version of the policy
93439347
example: '1'
@@ -9365,6 +9369,8 @@ components:
93659369
type: integer
93669370
updater:
93679371
$ref: '#/components/schemas/CloudWorkloadSecurityAgentPolicyUpdaterAttributes'
9372+
versions:
9373+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentPolicyVersions'
93689374
type: object
93699375
CloudWorkloadSecurityAgentPolicyCreateAttributes:
93709376
description: Create a new Cloud Workload Security Agent policy
@@ -9511,6 +9517,23 @@ components:
95119517
nullable: true
95129518
type: string
95139519
type: object
9520+
CloudWorkloadSecurityAgentPolicyVersion:
9521+
description: The versions of the policy
9522+
properties:
9523+
Date:
9524+
description: The date and time the version was created
9525+
nullable: true
9526+
type: string
9527+
Name:
9528+
description: The version of the policy
9529+
example: 1.47.0-rc2
9530+
type: string
9531+
type: object
9532+
CloudWorkloadSecurityAgentPolicyVersions:
9533+
description: The versions of the policy
9534+
items:
9535+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentPolicyVersion'
9536+
type: array
95149537
CloudWorkloadSecurityAgentRuleAction:
95159538
description: The action the rule can perform if triggered
95169539
properties:
@@ -9548,23 +9571,32 @@ components:
95489571
description: The set action applied on the scope matching the rule
95499572
properties:
95509573
append:
9551-
description: Whether the value should be appended to the field
9574+
description: Whether the value should be appended to the field.
95529575
type: boolean
9576+
default_value:
9577+
description: The default value of the set action
9578+
type: string
9579+
expression:
9580+
description: The expression of the set action.
9581+
type: string
95539582
field:
95549583
description: The field of the set action
95559584
type: string
9585+
inherited:
9586+
description: Whether the value should be inherited.
9587+
type: boolean
95569588
name:
95579589
description: The name of the set action
95589590
type: string
95599591
scope:
9560-
description: The scope of the set action
9592+
description: The scope of the set action.
95619593
type: string
95629594
size:
9563-
description: The size of the set action
9595+
description: The size of the set action.
95649596
format: int64
95659597
type: integer
95669598
ttl:
9567-
description: The time to live of the set action
9599+
description: The time to live of the set action.
95689600
format: int64
95699601
type: integer
95709602
value:
@@ -9645,6 +9677,10 @@ components:
96459677
items:
96469678
type: string
96479679
type: array
9680+
silent:
9681+
description: Whether the rule is silent.
9682+
example: false
9683+
type: boolean
96489684
updateAuthorUuId:
96499685
description: The ID of the user who updated the rule
96509686
example: e51c9744-d158-11ec-ad23-da7ad0900002
@@ -9672,8 +9708,11 @@ components:
96729708
properties:
96739709
actions:
96749710
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
9711+
agent_version:
9712+
description: Constrain the rule to specific versions of the Datadog Agent.
9713+
type: string
96759714
blocking:
9676-
description: The blocking policies that the rule belongs to
9715+
description: The blocking policies that the rule belongs to.
96779716
items:
96789717
type: string
96799718
type: array
@@ -9682,25 +9721,25 @@ components:
96829721
example: My Agent rule
96839722
type: string
96849723
disabled:
9685-
description: The disabled policies that the rule belongs to
9724+
description: The disabled policies that the rule belongs to.
96869725
items:
96879726
type: string
96889727
type: array
96899728
enabled:
9690-
description: Whether the Agent rule is enabled
9729+
description: Whether the Agent rule is enabled.
96919730
example: true
96929731
type: boolean
96939732
expression:
96949733
description: The SECL expression of the Agent rule.
96959734
example: exec.file.name == "sh"
96969735
type: string
96979736
filters:
9698-
description: The platforms the Agent rule is supported on
9737+
description: The platforms the Agent rule is supported on.
96999738
items:
97009739
type: string
97019740
type: array
97029741
monitoring:
9703-
description: The monitoring policies that the rule belongs to
9742+
description: The monitoring policies that the rule belongs to.
97049743
items:
97059744
type: string
97069745
type: array
@@ -9709,14 +9748,18 @@ components:
97099748
example: my_agent_rule
97109749
type: string
97119750
policy_id:
9712-
description: The ID of the policy where the Agent rule is saved
9751+
description: The ID of the policy where the Agent rule is saved.
97139752
example: a8c8e364-6556-434d-b798-a4c23de29c0b
97149753
type: string
97159754
product_tags:
9716-
description: The list of product tags associated with the rule
9755+
description: The list of product tags associated with the rule.
97179756
items:
97189757
type: string
97199758
type: array
9759+
silent:
9760+
description: Whether the rule is silent.
9761+
example: false
9762+
type: boolean
97209763
required:
97219764
- name
97229765
- expression
@@ -9796,6 +9839,9 @@ components:
97969839
properties:
97979840
actions:
97989841
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
9842+
agent_version:
9843+
description: Constrain the rule to specific versions of the Datadog Agent
9844+
type: string
97999845
blocking:
98009846
description: The blocking policies that the rule belongs to
98019847
items:
@@ -9832,6 +9878,10 @@ components:
98329878
items:
98339879
type: string
98349880
type: array
9881+
silent:
9882+
description: Whether the rule is silent.
9883+
example: false
9884+
type: boolean
98359885
type: object
98369886
CloudWorkloadSecurityAgentRuleUpdateData:
98379887
description: Object for a single Agent rule

examples/v2/csm-threats/CreateCSMThreatsAgentRule.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public static void main(String[] args) {
2828
.expression("""
2929
exec.file.name == "sh"
3030
""")
31+
.agentVersion("> 7.60")
3132
.name("examplecsmthreat")
3233
.policyId(POLICY_DATA_ID))
3334
.type(CloudWorkloadSecurityAgentRuleType.AGENT_RULE));

examples/v2/csm-threats/CreateCSMThreatsAgentRule_1295653933.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public static void main(String[] args) {
4141
new CloudWorkloadSecurityAgentRuleActionSet()
4242
.name("test_set")
4343
.value("test_value")
44-
.scope("process")),
44+
.scope("process")
45+
.inherited(true)),
4546
new CloudWorkloadSecurityAgentRuleAction()
4647
.hash(Map.ofEntries()))))
4748
.type(CloudWorkloadSecurityAgentRuleType.AGENT_RULE));
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Create a Workload Protection agent rule with set action with expression returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.CsmThreatsApi;
6+
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleAction;
7+
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleActionSet;
8+
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleCreateAttributes;
9+
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleCreateData;
10+
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleCreateRequest;
11+
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleResponse;
12+
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleType;
13+
import java.util.Collections;
14+
15+
public class Example {
16+
public static void main(String[] args) {
17+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
18+
CsmThreatsApi apiInstance = new CsmThreatsApi(defaultClient);
19+
20+
// there is a valid "policy_rc" in the system
21+
String POLICY_DATA_ID = System.getenv("POLICY_DATA_ID");
22+
23+
CloudWorkloadSecurityAgentRuleCreateRequest body =
24+
new CloudWorkloadSecurityAgentRuleCreateRequest()
25+
.data(
26+
new CloudWorkloadSecurityAgentRuleCreateData()
27+
.attributes(
28+
new CloudWorkloadSecurityAgentRuleCreateAttributes()
29+
.description("My Agent rule with set action with expression")
30+
.enabled(true)
31+
.expression("""
32+
exec.file.name == "sh"
33+
""")
34+
.name("examplecsmthreat")
35+
.policyId(POLICY_DATA_ID)
36+
.actions(
37+
Collections.singletonList(
38+
new CloudWorkloadSecurityAgentRuleAction()
39+
.set(
40+
new CloudWorkloadSecurityAgentRuleActionSet()
41+
.name("test_set")
42+
.expression("open.file.path")
43+
.defaultValue("/dev/null")
44+
.scope("process")))))
45+
.type(CloudWorkloadSecurityAgentRuleType.AGENT_RULE));
46+
47+
try {
48+
CloudWorkloadSecurityAgentRuleResponse result = apiInstance.createCSMThreatsAgentRule(body);
49+
System.out.println(result);
50+
} catch (ApiException e) {
51+
System.err.println("Exception when calling CsmThreatsApi#createCSMThreatsAgentRule");
52+
System.err.println("Status code: " + e.getCode());
53+
System.err.println("Reason: " + e.getResponseBody());
54+
System.err.println("Response headers: " + e.getResponseHeaders());
55+
e.printStackTrace();
56+
}
57+
}
58+
}

0 commit comments

Comments
 (0)