Skip to content

Commit e06df86

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a7a536f2 of spec repo
1 parent 45affb1 commit e06df86

File tree

70 files changed

+1471
-713
lines changed

Some content is hidden

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

70 files changed

+1471
-713
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-26 12:46:03.517132",
8-
"spec_repo_commit": "a6954c1c"
7+
"regenerated": "2025-05-27 10:30:19.653493",
8+
"spec_repo_commit": "a7a536f2"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-26 12:46:03.532550",
13-
"spec_repo_commit": "a6954c1c"
12+
"regenerated": "2025-05-27 10:30:19.669816",
13+
"spec_repo_commit": "a7a536f2"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7375,6 +7375,8 @@ components:
73757375
CloudWorkloadSecurityAgentPolicyCreateAttributes:
73767376
description: Create a new Cloud Workload Security Agent policy
73777377
properties:
7378+
actions:
7379+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
73787380
description:
73797381
description: The description of the policy
73807382
example: My agent policy
@@ -7456,6 +7458,8 @@ components:
74567458
CloudWorkloadSecurityAgentPolicyUpdateAttributes:
74577459
description: Update an existing Cloud Workload Security Agent policy
74587460
properties:
7461+
actions:
7462+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
74597463
description:
74607464
description: The description of the policy
74617465
example: My agent policy
@@ -7526,6 +7530,50 @@ components:
75267530
type: string
75277531
kill:
75287532
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleKill'
7533+
metadata:
7534+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionMetadata'
7535+
set:
7536+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionSet'
7537+
type: object
7538+
CloudWorkloadSecurityAgentRuleActionMetadata:
7539+
description: The metadata action applied on the scope matching the rule
7540+
properties:
7541+
image_tag:
7542+
description: The image tag of the metadata action
7543+
type: string
7544+
service:
7545+
description: The service of the metadata action
7546+
type: string
7547+
short_image:
7548+
description: The short image of the metadata action
7549+
type: string
7550+
type: object
7551+
CloudWorkloadSecurityAgentRuleActionSet:
7552+
description: The set action applied on the scope matching the rule
7553+
properties:
7554+
append:
7555+
description: Whether the value should be appended to the field
7556+
type: boolean
7557+
field:
7558+
description: The field of the set action
7559+
type: string
7560+
name:
7561+
description: The name of the set action
7562+
type: string
7563+
scope:
7564+
description: The scope of the set action
7565+
type: string
7566+
size:
7567+
description: The size of the set action
7568+
format: int64
7569+
type: integer
7570+
ttl:
7571+
description: The time to live of the set action
7572+
format: int64
7573+
type: integer
7574+
value:
7575+
description: The value of the set action
7576+
type: string
75297577
type: object
75307578
CloudWorkloadSecurityAgentRuleActions:
75317579
description: The array of actions the rule can perform if triggered
@@ -7541,6 +7589,11 @@ components:
75417589
agentConstraint:
75427590
description: The version of the Agent
75437591
type: string
7592+
blocking:
7593+
description: The blocking policies that the rule belongs to
7594+
items:
7595+
type: string
7596+
type: array
75447597
category:
75457598
description: The category of the Agent rule
75467599
example: Process Activity
@@ -7564,6 +7617,11 @@ components:
75647617
description: The description of the Agent rule
75657618
example: My Agent rule
75667619
type: string
7620+
disabled:
7621+
description: The disabled policies that the rule belongs to
7622+
items:
7623+
type: string
7624+
type: array
75677625
enabled:
75687626
description: Whether the Agent rule is enabled
75697627
example: true
@@ -7577,6 +7635,11 @@ components:
75777635
items:
75787636
type: string
75797637
type: array
7638+
monitoring:
7639+
description: The monitoring policies that the rule belongs to
7640+
items:
7641+
type: string
7642+
type: array
75807643
name:
75817644
description: The name of the Agent rule
75827645
example: my_agent_rule
@@ -7611,10 +7674,22 @@ components:
76117674
CloudWorkloadSecurityAgentRuleCreateAttributes:
76127675
description: Create a new Cloud Workload Security Agent rule.
76137676
properties:
7677+
actions:
7678+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
7679+
blocking:
7680+
description: The blocking policies that the rule belongs to
7681+
items:
7682+
type: string
7683+
type: array
76147684
description:
76157685
description: The description of the Agent rule.
76167686
example: My Agent rule
76177687
type: string
7688+
disabled:
7689+
description: The disabled policies that the rule belongs to
7690+
items:
7691+
type: string
7692+
type: array
76187693
enabled:
76197694
description: Whether the Agent rule is enabled
76207695
example: true
@@ -7628,6 +7703,11 @@ components:
76287703
items:
76297704
type: string
76307705
type: array
7706+
monitoring:
7707+
description: The monitoring policies that the rule belongs to
7708+
items:
7709+
type: string
7710+
type: array
76317711
name:
76327712
description: The name of the Agent rule.
76337713
example: my_agent_rule
@@ -7718,10 +7798,20 @@ components:
77187798
CloudWorkloadSecurityAgentRuleUpdateAttributes:
77197799
description: Update an existing Cloud Workload Security Agent rule
77207800
properties:
7801+
blocking:
7802+
description: The blocking policies that the rule belongs to
7803+
items:
7804+
type: string
7805+
type: array
77217806
description:
77227807
description: The description of the Agent rule
77237808
example: My Agent rule
77247809
type: string
7810+
disabled:
7811+
description: The disabled policies that the rule belongs to
7812+
items:
7813+
type: string
7814+
type: array
77257815
enabled:
77267816
description: Whether the Agent rule is enabled
77277817
example: true
@@ -7730,6 +7820,11 @@ components:
77307820
description: The SECL expression of the Agent rule
77317821
example: exec.file.name == "sh"
77327822
type: string
7823+
monitoring:
7824+
description: The monitoring policies that the rule belongs to
7825+
items:
7826+
type: string
7827+
type: array
77337828
policy_id:
77347829
description: The ID of the policy where the Agent rule is saved
77357830
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 Workload Protection 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)