Skip to content

Commit 3bc7f4c

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit ce1f862f of spec repo
1 parent 39ce585 commit 3bc7f4c

13 files changed

+396
-8
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-09 19:42:44.655290",
8-
"spec_repo_commit": "c7bad6f6"
7+
"regenerated": "2025-05-12 14:50:38.933040",
8+
"spec_repo_commit": "ce1f862f"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-09 19:42:44.706830",
13-
"spec_repo_commit": "c7bad6f6"
12+
"regenerated": "2025-05-12 14:50:38.948369",
13+
"spec_repo_commit": "ce1f862f"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 59 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
@@ -7554,6 +7611,8 @@ components:
75547611
CloudWorkloadSecurityAgentRuleCreateAttributes:
75557612
description: Create a new Cloud Workload Security Agent rule.
75567613
properties:
7614+
actions:
7615+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
75577616
description:
75587617
description: The description of the Agent rule.
75597618
example: My Agent rule

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:

src/datadog_api_client/v2/model/cloud_workload_security_agent_policy_update_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 CloudWorkloadSecurityAgentPolicyUpdateAttributes(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",
@@ -34,6 +47,7 @@ def openapi_types(_):
3447

3548
def __init__(
3649
self_,
50+
actions: Union[List[CloudWorkloadSecurityAgentRuleAction], none_type, UnsetType] = unset,
3751
description: Union[str, UnsetType] = unset,
3852
enabled: Union[bool, UnsetType] = unset,
3953
host_tags: Union[List[str], UnsetType] = unset,
@@ -44,6 +58,9 @@ def __init__(
4458
"""
4559
Update an existing 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, optional
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:

src/datadog_api_client/v2/model/cloud_workload_security_agent_rule_action.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515

1616
if TYPE_CHECKING:
1717
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_kill import CloudWorkloadSecurityAgentRuleKill
18+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_metadata import (
19+
CloudWorkloadSecurityAgentRuleActionMetadata,
20+
)
21+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_set import (
22+
CloudWorkloadSecurityAgentRuleActionSet,
23+
)
1824

1925

2026
class CloudWorkloadSecurityAgentRuleAction(ModelNormal):
@@ -23,21 +29,33 @@ def openapi_types(_):
2329
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_kill import (
2430
CloudWorkloadSecurityAgentRuleKill,
2531
)
32+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_metadata import (
33+
CloudWorkloadSecurityAgentRuleActionMetadata,
34+
)
35+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_set import (
36+
CloudWorkloadSecurityAgentRuleActionSet,
37+
)
2638

2739
return {
2840
"filter": (str,),
2941
"kill": (CloudWorkloadSecurityAgentRuleKill,),
42+
"metadata": (CloudWorkloadSecurityAgentRuleActionMetadata,),
43+
"set": (CloudWorkloadSecurityAgentRuleActionSet,),
3044
}
3145

3246
attribute_map = {
3347
"filter": "filter",
3448
"kill": "kill",
49+
"metadata": "metadata",
50+
"set": "set",
3551
}
3652

3753
def __init__(
3854
self_,
3955
filter: Union[str, UnsetType] = unset,
4056
kill: Union[CloudWorkloadSecurityAgentRuleKill, UnsetType] = unset,
57+
metadata: Union[CloudWorkloadSecurityAgentRuleActionMetadata, UnsetType] = unset,
58+
set: Union[CloudWorkloadSecurityAgentRuleActionSet, UnsetType] = unset,
4159
**kwargs,
4260
):
4361
"""
@@ -48,9 +66,19 @@ def __init__(
4866
4967
:param kill: Kill system call applied on the container matching the rule
5068
:type kill: CloudWorkloadSecurityAgentRuleKill, optional
69+
70+
:param metadata: The metadata action applied on the scope matching the rule
71+
:type metadata: CloudWorkloadSecurityAgentRuleActionMetadata, optional
72+
73+
:param set: The set action applied on the scope matching the rule
74+
:type set: CloudWorkloadSecurityAgentRuleActionSet, optional
5175
"""
5276
if filter is not unset:
5377
kwargs["filter"] = filter
5478
if kill is not unset:
5579
kwargs["kill"] = kill
80+
if metadata is not unset:
81+
kwargs["metadata"] = metadata
82+
if set is not unset:
83+
kwargs["set"] = set
5684
super().__init__(kwargs)

0 commit comments

Comments
 (0)