Skip to content

Commit 7221f0c

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 1f8661bb of spec repo
1 parent b6d5889 commit 7221f0c

File tree

79 files changed

+3845
-4981
lines changed

Some content is hidden

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

79 files changed

+3845
-4981
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-14 09:52:26.086305",
8-
"spec_repo_commit": "996fd99d"
7+
"regenerated": "2025-05-14 15:09:53.800030",
8+
"spec_repo_commit": "1f8661bb"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-14 09:52:26.102327",
13-
"spec_repo_commit": "996fd99d"
12+
"regenerated": "2025-05-14 15:09:53.832837",
13+
"spec_repo_commit": "1f8661bb"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 104 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,59 @@ 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+
anyOf:
7519+
- type: string
7520+
- format: double
7521+
type: number
7522+
- format: int64
7523+
type: integer
7524+
- type: boolean
7525+
- items: {}
7526+
type: array
7527+
- type: object
7528+
description: The value of the set action
74727529
type: object
74737530
CloudWorkloadSecurityAgentRuleActions:
74747531
description: The array of actions the rule can perform if triggered
@@ -7484,6 +7541,11 @@ components:
74847541
agentConstraint:
74857542
description: The version of the Agent
74867543
type: string
7544+
blocking:
7545+
description: The blocking policies that the rule belongs to
7546+
items:
7547+
type: string
7548+
type: array
74877549
category:
74887550
description: The category of the Agent rule
74897551
example: Process Activity
@@ -7507,6 +7569,11 @@ components:
75077569
description: The description of the Agent rule
75087570
example: My Agent rule
75097571
type: string
7572+
disabled:
7573+
description: The disabled policies that the rule belongs to
7574+
items:
7575+
type: string
7576+
type: array
75107577
enabled:
75117578
description: Whether the Agent rule is enabled
75127579
example: true
@@ -7520,6 +7587,11 @@ components:
75207587
items:
75217588
type: string
75227589
type: array
7590+
monitoring:
7591+
description: The monitoring policies that the rule belongs to
7592+
items:
7593+
type: string
7594+
type: array
75237595
name:
75247596
description: The name of the Agent rule
75257597
example: my_agent_rule
@@ -7554,10 +7626,22 @@ components:
75547626
CloudWorkloadSecurityAgentRuleCreateAttributes:
75557627
description: Create a new Cloud Workload Security Agent rule.
75567628
properties:
7629+
actions:
7630+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
7631+
blocking:
7632+
description: The blocking policies that the rule belongs to
7633+
items:
7634+
type: string
7635+
type: array
75577636
description:
75587637
description: The description of the Agent rule.
75597638
example: My Agent rule
75607639
type: string
7640+
disabled:
7641+
description: The disabled policies that the rule belongs to
7642+
items:
7643+
type: string
7644+
type: array
75617645
enabled:
75627646
description: Whether the Agent rule is enabled
75637647
example: true
@@ -7571,6 +7655,11 @@ components:
75717655
items:
75727656
type: string
75737657
type: array
7658+
monitoring:
7659+
description: The monitoring policies that the rule belongs to
7660+
items:
7661+
type: string
7662+
type: array
75747663
name:
75757664
description: The name of the Agent rule.
75767665
example: my_agent_rule
@@ -7661,10 +7750,20 @@ components:
76617750
CloudWorkloadSecurityAgentRuleUpdateAttributes:
76627751
description: Update an existing Cloud Workload Security Agent rule
76637752
properties:
7753+
blocking:
7754+
description: The blocking policies that the rule belongs to
7755+
items:
7756+
type: string
7757+
type: array
76647758
description:
76657759
description: The description of the Agent rule
76667760
example: My Agent rule
76677761
type: string
7762+
disabled:
7763+
description: The disabled policies that the rule belongs to
7764+
items:
7765+
type: string
7766+
type: array
76687767
enabled:
76697768
description: Whether the Agent rule is enabled
76707769
example: true
@@ -7673,6 +7772,11 @@ components:
76737772
description: The SECL expression of the Agent rule
76747773
example: exec.file.name == "sh"
76757774
type: string
7775+
monitoring:
7776+
description: The monitoring policies that the rule belongs to
7777+
items:
7778+
type: string
7779+
type: array
76767780
policy_id:
76777781
description: The ID of the policy where the Agent rule is saved
76787782
example: a8c8e364-6556-434d-b798-a4c23de29c0b

docs/datadog_api_client.v2.model.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2839,6 +2839,20 @@ datadog\_api\_client.v2.model.cloud\_workload\_security\_agent\_rule\_action mod
28392839
:members:
28402840
:show-inheritance:
28412841

2842+
datadog\_api\_client.v2.model.cloud\_workload\_security\_agent\_rule\_action\_metadata module
2843+
---------------------------------------------------------------------------------------------
2844+
2845+
.. automodule:: datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_metadata
2846+
:members:
2847+
:show-inheritance:
2848+
2849+
datadog\_api\_client.v2.model.cloud\_workload\_security\_agent\_rule\_action\_set module
2850+
----------------------------------------------------------------------------------------
2851+
2852+
.. automodule:: datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_set
2853+
:members:
2854+
:show-inheritance:
2855+
28422856
datadog\_api\_client.v2.model.cloud\_workload\_security\_agent\_rule\_attributes module
28432857
---------------------------------------------------------------------------------------
28442858

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
"""
2+
Create a CSM Threats Agent rule with set action returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.csm_threats_api import CSMThreatsApi
8+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action import CloudWorkloadSecurityAgentRuleAction
9+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_set import (
10+
CloudWorkloadSecurityAgentRuleActionSet,
11+
)
12+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_create_attributes import (
13+
CloudWorkloadSecurityAgentRuleCreateAttributes,
14+
)
15+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_create_data import (
16+
CloudWorkloadSecurityAgentRuleCreateData,
17+
)
18+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_create_request import (
19+
CloudWorkloadSecurityAgentRuleCreateRequest,
20+
)
21+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_type import CloudWorkloadSecurityAgentRuleType
22+
23+
# there is a valid "policy_rc" in the system
24+
POLICY_DATA_ID = environ["POLICY_DATA_ID"]
25+
26+
body = CloudWorkloadSecurityAgentRuleCreateRequest(
27+
data=CloudWorkloadSecurityAgentRuleCreateData(
28+
attributes=CloudWorkloadSecurityAgentRuleCreateAttributes(
29+
description="My Agent rule with set action",
30+
enabled=True,
31+
expression='exec.file.name == "sh"',
32+
filters=[],
33+
name="examplecsmthreat",
34+
policy_id=POLICY_DATA_ID,
35+
product_tags=[],
36+
actions=[
37+
CloudWorkloadSecurityAgentRuleAction(
38+
set=CloudWorkloadSecurityAgentRuleActionSet(
39+
name="test_set",
40+
value="test_value",
41+
scope="process",
42+
),
43+
),
44+
],
45+
),
46+
type=CloudWorkloadSecurityAgentRuleType.AGENT_RULE,
47+
),
48+
)
49+
50+
configuration = Configuration()
51+
with ApiClient(configuration) as api_client:
52+
api_instance = CSMThreatsApi(api_client)
53+
response = api_instance.create_csm_threats_agent_rule(body=body)
54+
55+
print(response)

src/datadog_api_client/v2/model/cloud_workload_security_agent_policy_create_attributes.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,32 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import List, Union
6+
from typing import List, Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
1010
cached_property,
11+
none_type,
1112
unset,
1213
UnsetType,
1314
)
1415

1516

17+
if TYPE_CHECKING:
18+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action import (
19+
CloudWorkloadSecurityAgentRuleAction,
20+
)
21+
22+
1623
class CloudWorkloadSecurityAgentPolicyCreateAttributes(ModelNormal):
1724
@cached_property
1825
def openapi_types(_):
26+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action import (
27+
CloudWorkloadSecurityAgentRuleAction,
28+
)
29+
1930
return {
31+
"actions": ([CloudWorkloadSecurityAgentRuleAction],),
2032
"description": (str,),
2133
"enabled": (bool,),
2234
"host_tags": ([str],),
@@ -25,6 +37,7 @@ def openapi_types(_):
2537
}
2638

2739
attribute_map = {
40+
"actions": "actions",
2841
"description": "description",
2942
"enabled": "enabled",
3043
"host_tags": "hostTags",
@@ -35,6 +48,7 @@ def openapi_types(_):
3548
def __init__(
3649
self_,
3750
name: str,
51+
actions: Union[List[CloudWorkloadSecurityAgentRuleAction], none_type, UnsetType] = unset,
3852
description: Union[str, UnsetType] = unset,
3953
enabled: Union[bool, UnsetType] = unset,
4054
host_tags: Union[List[str], UnsetType] = unset,
@@ -44,6 +58,9 @@ def __init__(
4458
"""
4559
Create a new Cloud Workload Security Agent policy
4660
61+
:param actions: The array of actions the rule can perform if triggered
62+
:type actions: [CloudWorkloadSecurityAgentRuleAction], none_type, optional
63+
4764
:param description: The description of the policy
4865
:type description: str, optional
4966
@@ -59,6 +76,8 @@ def __init__(
5976
:param name: The name of the policy
6077
:type name: str
6178
"""
79+
if actions is not unset:
80+
kwargs["actions"] = actions
6281
if description is not unset:
6382
kwargs["description"] = description
6483
if enabled is not unset:

0 commit comments

Comments
 (0)