Skip to content

Commit 238cf89

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 67cbeafb of spec repo
1 parent b2de361 commit 238cf89

File tree

68 files changed

+1526
-203
lines changed

Some content is hidden

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

68 files changed

+1526
-203
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": "2025-05-16 13:56:33.962104",
8-
"spec_repo_commit": "dac51bc6"
7+
"regenerated": "2025-05-16 15:14:08.260178",
8+
"spec_repo_commit": "67cbeafb"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-16 13:56:34.055440",
13-
"spec_repo_commit": "dac51bc6"
12+
"regenerated": "2025-05-16 15:14:08.275917",
13+
"spec_repo_commit": "67cbeafb"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7318,6 +7318,8 @@ components:
73187318
CloudWorkloadSecurityAgentPolicyCreateAttributes:
73197319
description: Create a new Cloud Workload Security Agent policy
73207320
properties:
7321+
actions:
7322+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
73217323
description:
73227324
description: The description of the policy
73237325
example: My agent policy
@@ -7399,6 +7401,8 @@ components:
73997401
CloudWorkloadSecurityAgentPolicyUpdateAttributes:
74007402
description: Update an existing Cloud Workload Security Agent policy
74017403
properties:
7404+
actions:
7405+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
74027406
description:
74037407
description: The description of the policy
74047408
example: My agent policy
@@ -7469,6 +7473,50 @@ components:
74697473
type: string
74707474
kill:
74717475
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleKill'
7476+
metadata:
7477+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionMetadata'
7478+
set:
7479+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionSet'
7480+
type: object
7481+
CloudWorkloadSecurityAgentRuleActionMetadata:
7482+
description: The metadata action applied on the scope matching the rule
7483+
properties:
7484+
image_tag:
7485+
description: The image tag of the metadata action
7486+
type: string
7487+
service:
7488+
description: The service of the metadata action
7489+
type: string
7490+
short_image:
7491+
description: The short image of the metadata action
7492+
type: string
7493+
type: object
7494+
CloudWorkloadSecurityAgentRuleActionSet:
7495+
description: The set action applied on the scope matching the rule
7496+
properties:
7497+
append:
7498+
description: Whether the value should be appended to the field
7499+
type: boolean
7500+
field:
7501+
description: The field of the set action
7502+
type: string
7503+
name:
7504+
description: The name of the set action
7505+
type: string
7506+
scope:
7507+
description: The scope of the set action
7508+
type: string
7509+
size:
7510+
description: The size of the set action
7511+
format: int64
7512+
type: integer
7513+
ttl:
7514+
description: The time to live of the set action
7515+
format: int64
7516+
type: integer
7517+
value:
7518+
description: The value of the set action
7519+
type: string
74727520
type: object
74737521
CloudWorkloadSecurityAgentRuleActions:
74747522
description: The array of actions the rule can perform if triggered
@@ -7484,6 +7532,11 @@ components:
74847532
agentConstraint:
74857533
description: The version of the Agent
74867534
type: string
7535+
blocking:
7536+
description: The blocking policies that the rule belongs to
7537+
items:
7538+
type: string
7539+
type: array
74877540
category:
74887541
description: The category of the Agent rule
74897542
example: Process Activity
@@ -7507,6 +7560,11 @@ components:
75077560
description: The description of the Agent rule
75087561
example: My Agent rule
75097562
type: string
7563+
disabled:
7564+
description: The disabled policies that the rule belongs to
7565+
items:
7566+
type: string
7567+
type: array
75107568
enabled:
75117569
description: Whether the Agent rule is enabled
75127570
example: true
@@ -7520,6 +7578,11 @@ components:
75207578
items:
75217579
type: string
75227580
type: array
7581+
monitoring:
7582+
description: The monitoring policies that the rule belongs to
7583+
items:
7584+
type: string
7585+
type: array
75237586
name:
75247587
description: The name of the Agent rule
75257588
example: my_agent_rule
@@ -7554,10 +7617,22 @@ components:
75547617
CloudWorkloadSecurityAgentRuleCreateAttributes:
75557618
description: Create a new Cloud Workload Security Agent rule.
75567619
properties:
7620+
actions:
7621+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
7622+
blocking:
7623+
description: The blocking policies that the rule belongs to
7624+
items:
7625+
type: string
7626+
type: array
75577627
description:
75587628
description: The description of the Agent rule.
75597629
example: My Agent rule
75607630
type: string
7631+
disabled:
7632+
description: The disabled policies that the rule belongs to
7633+
items:
7634+
type: string
7635+
type: array
75617636
enabled:
75627637
description: Whether the Agent rule is enabled
75637638
example: true
@@ -7571,6 +7646,11 @@ components:
75717646
items:
75727647
type: string
75737648
type: array
7649+
monitoring:
7650+
description: The monitoring policies that the rule belongs to
7651+
items:
7652+
type: string
7653+
type: array
75747654
name:
75757655
description: The name of the Agent rule.
75767656
example: my_agent_rule
@@ -7661,10 +7741,20 @@ components:
76617741
CloudWorkloadSecurityAgentRuleUpdateAttributes:
76627742
description: Update an existing Cloud Workload Security Agent rule
76637743
properties:
7744+
blocking:
7745+
description: The blocking policies that the rule belongs to
7746+
items:
7747+
type: string
7748+
type: array
76647749
description:
76657750
description: The description of the Agent rule
76667751
example: My Agent rule
76677752
type: string
7753+
disabled:
7754+
description: The disabled policies that the rule belongs to
7755+
items:
7756+
type: string
7757+
type: array
76687758
enabled:
76697759
description: Whether the Agent rule is enabled
76707760
example: true
@@ -7673,6 +7763,11 @@ components:
76737763
description: The SECL expression of the Agent rule
76747764
example: exec.file.name == "sh"
76757765
type: string
7766+
monitoring:
7767+
description: The monitoring policies that the rule belongs to
7768+
items:
7769+
type: string
7770+
type: array
76767771
policy_id:
76777772
description: The ID of the policy where the Agent rule is saved
76787773
example: a8c8e364-6556-434d-b798-a4c23de29c0b
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Create a CSM Threats Agent rule with set action 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")
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+
.value("test_value")
43+
.scope("process")))))
44+
.type(CloudWorkloadSecurityAgentRuleType.AGENT_RULE));
45+
46+
try {
47+
CloudWorkloadSecurityAgentRuleResponse result = apiInstance.createCSMThreatsAgentRule(body);
48+
System.out.println(result);
49+
} catch (ApiException e) {
50+
System.err.println("Exception when calling CsmThreatsApi#createCSMThreatsAgentRule");
51+
System.err.println("Status code: " + e.getCode());
52+
System.err.println("Reason: " + e.getResponseBody());
53+
System.err.println("Response headers: " + e.getResponseHeaders());
54+
e.printStackTrace();
55+
}
56+
}
57+
}

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

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
import java.util.List;
1919
import java.util.Map;
2020
import java.util.Objects;
21+
import org.openapitools.jackson.nullable.JsonNullable;
2122

2223
/** Create a new Cloud Workload Security Agent policy */
2324
@JsonPropertyOrder({
25+
CloudWorkloadSecurityAgentPolicyCreateAttributes.JSON_PROPERTY_ACTIONS,
2426
CloudWorkloadSecurityAgentPolicyCreateAttributes.JSON_PROPERTY_DESCRIPTION,
2527
CloudWorkloadSecurityAgentPolicyCreateAttributes.JSON_PROPERTY_ENABLED,
2628
CloudWorkloadSecurityAgentPolicyCreateAttributes.JSON_PROPERTY_HOST_TAGS,
@@ -31,6 +33,10 @@
3133
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
3234
public class CloudWorkloadSecurityAgentPolicyCreateAttributes {
3335
@JsonIgnore public boolean unparsed = false;
36+
public static final String JSON_PROPERTY_ACTIONS = "actions";
37+
private JsonNullable<List<CloudWorkloadSecurityAgentRuleAction>> actions =
38+
JsonNullable.<List<CloudWorkloadSecurityAgentRuleAction>>undefined();
39+
3440
public static final String JSON_PROPERTY_DESCRIPTION = "description";
3541
private String description;
3642

@@ -54,6 +60,52 @@ public CloudWorkloadSecurityAgentPolicyCreateAttributes(
5460
this.name = name;
5561
}
5662

63+
public CloudWorkloadSecurityAgentPolicyCreateAttributes actions(
64+
List<CloudWorkloadSecurityAgentRuleAction> actions) {
65+
this.actions = JsonNullable.<List<CloudWorkloadSecurityAgentRuleAction>>of(actions);
66+
return this;
67+
}
68+
69+
public CloudWorkloadSecurityAgentPolicyCreateAttributes addActionsItem(
70+
CloudWorkloadSecurityAgentRuleAction actionsItem) {
71+
if (this.actions == null || !this.actions.isPresent()) {
72+
this.actions = JsonNullable.<List<CloudWorkloadSecurityAgentRuleAction>>of(new ArrayList<>());
73+
}
74+
try {
75+
this.actions.get().add(actionsItem);
76+
} catch (java.util.NoSuchElementException e) {
77+
// this can never happen, as we make sure above that the value is present
78+
}
79+
return this;
80+
}
81+
82+
/**
83+
* The array of actions the rule can perform if triggered
84+
*
85+
* @return actions
86+
*/
87+
@jakarta.annotation.Nullable
88+
@JsonIgnore
89+
public List<CloudWorkloadSecurityAgentRuleAction> getActions() {
90+
return actions.orElse(null);
91+
}
92+
93+
@JsonProperty(JSON_PROPERTY_ACTIONS)
94+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
95+
public JsonNullable<List<CloudWorkloadSecurityAgentRuleAction>> getActions_JsonNullable() {
96+
return actions;
97+
}
98+
99+
@JsonProperty(JSON_PROPERTY_ACTIONS)
100+
public void setActions_JsonNullable(
101+
JsonNullable<List<CloudWorkloadSecurityAgentRuleAction>> actions) {
102+
this.actions = actions;
103+
}
104+
105+
public void setActions(List<CloudWorkloadSecurityAgentRuleAction> actions) {
106+
this.actions = JsonNullable.<List<CloudWorkloadSecurityAgentRuleAction>>of(actions);
107+
}
108+
57109
public CloudWorkloadSecurityAgentPolicyCreateAttributes description(String description) {
58110
this.description = description;
59111
return this;
@@ -236,7 +288,8 @@ public boolean equals(Object o) {
236288
CloudWorkloadSecurityAgentPolicyCreateAttributes
237289
cloudWorkloadSecurityAgentPolicyCreateAttributes =
238290
(CloudWorkloadSecurityAgentPolicyCreateAttributes) o;
239-
return Objects.equals(
291+
return Objects.equals(this.actions, cloudWorkloadSecurityAgentPolicyCreateAttributes.actions)
292+
&& Objects.equals(
240293
this.description, cloudWorkloadSecurityAgentPolicyCreateAttributes.description)
241294
&& Objects.equals(this.enabled, cloudWorkloadSecurityAgentPolicyCreateAttributes.enabled)
242295
&& Objects.equals(this.hostTags, cloudWorkloadSecurityAgentPolicyCreateAttributes.hostTags)
@@ -250,13 +303,15 @@ public boolean equals(Object o) {
250303

251304
@Override
252305
public int hashCode() {
253-
return Objects.hash(description, enabled, hostTags, hostTagsLists, name, additionalProperties);
306+
return Objects.hash(
307+
actions, description, enabled, hostTags, hostTagsLists, name, additionalProperties);
254308
}
255309

256310
@Override
257311
public String toString() {
258312
StringBuilder sb = new StringBuilder();
259313
sb.append("class CloudWorkloadSecurityAgentPolicyCreateAttributes {\n");
314+
sb.append(" actions: ").append(toIndentedString(actions)).append("\n");
260315
sb.append(" description: ").append(toIndentedString(description)).append("\n");
261316
sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n");
262317
sb.append(" hostTags: ").append(toIndentedString(hostTags)).append("\n");

0 commit comments

Comments
 (0)