-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit 5efabbe7 of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Mar 1, 2024
1 parent
eac267b
commit 084c573
Showing
11 changed files
with
572 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
examples/v2/cloud-workload-security/CreateCSMThreatsAgentRule.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
""" | ||
Create a CSM Threats Agent rule returns "OK" response | ||
""" | ||
|
||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v2.api.cloud_workload_security_api import CloudWorkloadSecurityApi | ||
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_create_attributes import ( | ||
CloudWorkloadSecurityAgentRuleCreateAttributes, | ||
) | ||
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_create_data import ( | ||
CloudWorkloadSecurityAgentRuleCreateData, | ||
) | ||
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_create_request import ( | ||
CloudWorkloadSecurityAgentRuleCreateRequest, | ||
) | ||
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_type import CloudWorkloadSecurityAgentRuleType | ||
|
||
body = CloudWorkloadSecurityAgentRuleCreateRequest( | ||
data=CloudWorkloadSecurityAgentRuleCreateData( | ||
attributes=CloudWorkloadSecurityAgentRuleCreateAttributes( | ||
description="My Agent rule", | ||
enabled=True, | ||
expression='exec.file.name == \\"sh\\"', | ||
name="my_agent_rule", | ||
), | ||
type=CloudWorkloadSecurityAgentRuleType.AGENT_RULE, | ||
), | ||
) | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = CloudWorkloadSecurityApi(api_client) | ||
response = api_instance.create_csm_threats_agent_rule(body=body) | ||
|
||
print(response) |
13 changes: 13 additions & 0 deletions
13
examples/v2/cloud-workload-security/DeleteCSMThreatsAgentRule.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
""" | ||
Delete a CSM Threats Agent rule returns "OK" response | ||
""" | ||
|
||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v2.api.cloud_workload_security_api import CloudWorkloadSecurityApi | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = CloudWorkloadSecurityApi(api_client) | ||
api_instance.delete_csm_threats_agent_rule( | ||
agent_rule_id="agent_rule_id", | ||
) |
15 changes: 15 additions & 0 deletions
15
examples/v2/cloud-workload-security/GetCSMThreatsAgentRule.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Get a CSM Threats Agent rule returns "OK" response | ||
""" | ||
|
||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v2.api.cloud_workload_security_api import CloudWorkloadSecurityApi | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = CloudWorkloadSecurityApi(api_client) | ||
response = api_instance.get_csm_threats_agent_rule( | ||
agent_rule_id="agent_rule_id", | ||
) | ||
|
||
print(response) |
13 changes: 13 additions & 0 deletions
13
examples/v2/cloud-workload-security/ListCSMThreatsAgentRules.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
""" | ||
Get all CSM Threats Agent rules returns "OK" response | ||
""" | ||
|
||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v2.api.cloud_workload_security_api import CloudWorkloadSecurityApi | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = CloudWorkloadSecurityApi(api_client) | ||
response = api_instance.list_csm_threats_agent_rules() | ||
|
||
print(response) |
34 changes: 34 additions & 0 deletions
34
examples/v2/cloud-workload-security/UpdateCSMThreatsAgentRule.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" | ||
Update a CSM Threats Agent rule returns "OK" response | ||
""" | ||
|
||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v2.api.cloud_workload_security_api import CloudWorkloadSecurityApi | ||
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_type import CloudWorkloadSecurityAgentRuleType | ||
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_update_attributes import ( | ||
CloudWorkloadSecurityAgentRuleUpdateAttributes, | ||
) | ||
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_update_data import ( | ||
CloudWorkloadSecurityAgentRuleUpdateData, | ||
) | ||
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_update_request import ( | ||
CloudWorkloadSecurityAgentRuleUpdateRequest, | ||
) | ||
|
||
body = CloudWorkloadSecurityAgentRuleUpdateRequest( | ||
data=CloudWorkloadSecurityAgentRuleUpdateData( | ||
attributes=CloudWorkloadSecurityAgentRuleUpdateAttributes( | ||
description="My Agent rule", | ||
enabled=True, | ||
expression='exec.file.name == \\"sh\\"', | ||
), | ||
type=CloudWorkloadSecurityAgentRuleType.AGENT_RULE, | ||
), | ||
) | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = CloudWorkloadSecurityApi(api_client) | ||
response = api_instance.update_csm_threats_agent_rule(agent_rule_id="agent_rule_id", body=body) | ||
|
||
print(response) |
Oops, something went wrong.