Skip to content

Commit 1945faf

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5c99c1f of spec repo
1 parent 31dfd5d commit 1945faf

File tree

54 files changed

+527
-206
lines changed

Some content is hidden

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

54 files changed

+527
-206
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9419,23 +9419,32 @@ components:
94199419
description: The set action applied on the scope matching the rule
94209420
properties:
94219421
append:
9422-
description: Whether the value should be appended to the field
9422+
description: Whether the value should be appended to the field.
94239423
type: boolean
9424+
default_value:
9425+
description: The default value of the set action
9426+
type: string
9427+
expression:
9428+
description: The expression of the set action.
9429+
type: string
94249430
field:
94259431
description: The field of the set action
94269432
type: string
9433+
inherited:
9434+
description: Whether the value should be inherited.
9435+
type: boolean
94279436
name:
94289437
description: The name of the set action
94299438
type: string
94309439
scope:
9431-
description: The scope of the set action
9440+
description: The scope of the set action.
94329441
type: string
94339442
size:
9434-
description: The size of the set action
9443+
description: The size of the set action.
94359444
format: int64
94369445
type: integer
94379446
ttl:
9438-
description: The time to live of the set action
9447+
description: The time to live of the set action.
94399448
format: int64
94409449
type: integer
94419450
value:
@@ -9543,8 +9552,11 @@ components:
95439552
properties:
95449553
actions:
95459554
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
9555+
agent_version:
9556+
description: Constrain the rule to specific versions of the Datadog Agent.
9557+
type: string
95469558
blocking:
9547-
description: The blocking policies that the rule belongs to
9559+
description: The blocking policies that the rule belongs to.
95489560
items:
95499561
type: string
95509562
type: array
@@ -9553,25 +9565,25 @@ components:
95539565
example: My Agent rule
95549566
type: string
95559567
disabled:
9556-
description: The disabled policies that the rule belongs to
9568+
description: The disabled policies that the rule belongs to.
95579569
items:
95589570
type: string
95599571
type: array
95609572
enabled:
9561-
description: Whether the Agent rule is enabled
9573+
description: Whether the Agent rule is enabled.
95629574
example: true
95639575
type: boolean
95649576
expression:
95659577
description: The SECL expression of the Agent rule.
95669578
example: exec.file.name == "sh"
95679579
type: string
95689580
filters:
9569-
description: The platforms the Agent rule is supported on
9581+
description: The platforms the Agent rule is supported on.
95709582
items:
95719583
type: string
95729584
type: array
95739585
monitoring:
9574-
description: The monitoring policies that the rule belongs to
9586+
description: The monitoring policies that the rule belongs to.
95759587
items:
95769588
type: string
95779589
type: array
@@ -9580,11 +9592,11 @@ components:
95809592
example: my_agent_rule
95819593
type: string
95829594
policy_id:
9583-
description: The ID of the policy where the Agent rule is saved
9595+
description: The ID of the policy where the Agent rule is saved.
95849596
example: a8c8e364-6556-434d-b798-a4c23de29c0b
95859597
type: string
95869598
product_tags:
9587-
description: The list of product tags associated with the rule
9599+
description: The list of product tags associated with the rule.
95889600
items:
95899601
type: string
95909602
type: array
@@ -9667,6 +9679,9 @@ components:
96679679
properties:
96689680
actions:
96699681
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
9682+
agent_version:
9683+
description: Constrain the rule to specific versions of the Datadog Agent
9684+
type: string
96709685
blocking:
96719686
description: The blocking policies that the rule belongs to
96729687
items:

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+
}

examples/v2/csm-threats/CreateCloudWorkloadSecurityAgentRule.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public static void main(String[] args) {
2525
.expression("""
2626
exec.file.name == "sh"
2727
""")
28+
.agentVersion("> 7.60")
2829
.name("examplecsmthreat"))
2930
.type(CloudWorkloadSecurityAgentRuleType.AGENT_RULE));
3031

src/main/java/com/datadog/api/client/v2/model/CloudWorkloadSecurityAgentRuleActionSet.java

Lines changed: 97 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
/** The set action applied on the scope matching the rule */
2020
@JsonPropertyOrder({
2121
CloudWorkloadSecurityAgentRuleActionSet.JSON_PROPERTY_APPEND,
22+
CloudWorkloadSecurityAgentRuleActionSet.JSON_PROPERTY_DEFAULT_VALUE,
23+
CloudWorkloadSecurityAgentRuleActionSet.JSON_PROPERTY_EXPRESSION,
2224
CloudWorkloadSecurityAgentRuleActionSet.JSON_PROPERTY_FIELD,
25+
CloudWorkloadSecurityAgentRuleActionSet.JSON_PROPERTY_INHERITED,
2326
CloudWorkloadSecurityAgentRuleActionSet.JSON_PROPERTY_NAME,
2427
CloudWorkloadSecurityAgentRuleActionSet.JSON_PROPERTY_SCOPE,
2528
CloudWorkloadSecurityAgentRuleActionSet.JSON_PROPERTY_SIZE,
@@ -33,9 +36,18 @@ public class CloudWorkloadSecurityAgentRuleActionSet {
3336
public static final String JSON_PROPERTY_APPEND = "append";
3437
private Boolean append;
3538

39+
public static final String JSON_PROPERTY_DEFAULT_VALUE = "default_value";
40+
private String defaultValue;
41+
42+
public static final String JSON_PROPERTY_EXPRESSION = "expression";
43+
private String expression;
44+
3645
public static final String JSON_PROPERTY_FIELD = "field";
3746
private String field;
3847

48+
public static final String JSON_PROPERTY_INHERITED = "inherited";
49+
private Boolean inherited;
50+
3951
public static final String JSON_PROPERTY_NAME = "name";
4052
private String name;
4153

@@ -57,7 +69,7 @@ public CloudWorkloadSecurityAgentRuleActionSet append(Boolean append) {
5769
}
5870

5971
/**
60-
* Whether the value should be appended to the field
72+
* Whether the value should be appended to the field.
6173
*
6274
* @return append
6375
*/
@@ -72,6 +84,48 @@ public void setAppend(Boolean append) {
7284
this.append = append;
7385
}
7486

87+
public CloudWorkloadSecurityAgentRuleActionSet defaultValue(String defaultValue) {
88+
this.defaultValue = defaultValue;
89+
return this;
90+
}
91+
92+
/**
93+
* The default value of the set action
94+
*
95+
* @return defaultValue
96+
*/
97+
@jakarta.annotation.Nullable
98+
@JsonProperty(JSON_PROPERTY_DEFAULT_VALUE)
99+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
100+
public String getDefaultValue() {
101+
return defaultValue;
102+
}
103+
104+
public void setDefaultValue(String defaultValue) {
105+
this.defaultValue = defaultValue;
106+
}
107+
108+
public CloudWorkloadSecurityAgentRuleActionSet expression(String expression) {
109+
this.expression = expression;
110+
return this;
111+
}
112+
113+
/**
114+
* The expression of the set action.
115+
*
116+
* @return expression
117+
*/
118+
@jakarta.annotation.Nullable
119+
@JsonProperty(JSON_PROPERTY_EXPRESSION)
120+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
121+
public String getExpression() {
122+
return expression;
123+
}
124+
125+
public void setExpression(String expression) {
126+
this.expression = expression;
127+
}
128+
75129
public CloudWorkloadSecurityAgentRuleActionSet field(String field) {
76130
this.field = field;
77131
return this;
@@ -93,6 +147,27 @@ public void setField(String field) {
93147
this.field = field;
94148
}
95149

150+
public CloudWorkloadSecurityAgentRuleActionSet inherited(Boolean inherited) {
151+
this.inherited = inherited;
152+
return this;
153+
}
154+
155+
/**
156+
* Whether the value should be inherited.
157+
*
158+
* @return inherited
159+
*/
160+
@jakarta.annotation.Nullable
161+
@JsonProperty(JSON_PROPERTY_INHERITED)
162+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
163+
public Boolean getInherited() {
164+
return inherited;
165+
}
166+
167+
public void setInherited(Boolean inherited) {
168+
this.inherited = inherited;
169+
}
170+
96171
public CloudWorkloadSecurityAgentRuleActionSet name(String name) {
97172
this.name = name;
98173
return this;
@@ -120,7 +195,7 @@ public CloudWorkloadSecurityAgentRuleActionSet scope(String scope) {
120195
}
121196

122197
/**
123-
* The scope of the set action
198+
* The scope of the set action.
124199
*
125200
* @return scope
126201
*/
@@ -141,7 +216,7 @@ public CloudWorkloadSecurityAgentRuleActionSet size(Long size) {
141216
}
142217

143218
/**
144-
* The size of the set action
219+
* The size of the set action.
145220
*
146221
* @return size
147222
*/
@@ -162,7 +237,7 @@ public CloudWorkloadSecurityAgentRuleActionSet ttl(Long ttl) {
162237
}
163238

164239
/**
165-
* The time to live of the set action
240+
* The time to live of the set action.
166241
*
167242
* @return ttl
168243
*/
@@ -256,7 +331,10 @@ public boolean equals(Object o) {
256331
CloudWorkloadSecurityAgentRuleActionSet cloudWorkloadSecurityAgentRuleActionSet =
257332
(CloudWorkloadSecurityAgentRuleActionSet) o;
258333
return Objects.equals(this.append, cloudWorkloadSecurityAgentRuleActionSet.append)
334+
&& Objects.equals(this.defaultValue, cloudWorkloadSecurityAgentRuleActionSet.defaultValue)
335+
&& Objects.equals(this.expression, cloudWorkloadSecurityAgentRuleActionSet.expression)
259336
&& Objects.equals(this.field, cloudWorkloadSecurityAgentRuleActionSet.field)
337+
&& Objects.equals(this.inherited, cloudWorkloadSecurityAgentRuleActionSet.inherited)
260338
&& Objects.equals(this.name, cloudWorkloadSecurityAgentRuleActionSet.name)
261339
&& Objects.equals(this.scope, cloudWorkloadSecurityAgentRuleActionSet.scope)
262340
&& Objects.equals(this.size, cloudWorkloadSecurityAgentRuleActionSet.size)
@@ -269,15 +347,29 @@ public boolean equals(Object o) {
269347

270348
@Override
271349
public int hashCode() {
272-
return Objects.hash(append, field, name, scope, size, ttl, value, additionalProperties);
350+
return Objects.hash(
351+
append,
352+
defaultValue,
353+
expression,
354+
field,
355+
inherited,
356+
name,
357+
scope,
358+
size,
359+
ttl,
360+
value,
361+
additionalProperties);
273362
}
274363

275364
@Override
276365
public String toString() {
277366
StringBuilder sb = new StringBuilder();
278367
sb.append("class CloudWorkloadSecurityAgentRuleActionSet {\n");
279368
sb.append(" append: ").append(toIndentedString(append)).append("\n");
369+
sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n");
370+
sb.append(" expression: ").append(toIndentedString(expression)).append("\n");
280371
sb.append(" field: ").append(toIndentedString(field)).append("\n");
372+
sb.append(" inherited: ").append(toIndentedString(inherited)).append("\n");
281373
sb.append(" name: ").append(toIndentedString(name)).append("\n");
282374
sb.append(" scope: ").append(toIndentedString(scope)).append("\n");
283375
sb.append(" size: ").append(toIndentedString(size)).append("\n");

0 commit comments

Comments
 (0)