Skip to content

Commit ade1bf6

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit b65aa68 of spec repo (#3636)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 3dd1073 commit ade1bf6

13 files changed

Lines changed: 942 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 388 additions & 0 deletions
Large diffs are not rendered by default.

docs/datadog_api_client.v2.model.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,6 +1817,41 @@ datadog\_api\_client.v2.model.application\_security\_policy\_update\_request mod
18171817
:members:
18181818
:show-inheritance:
18191819

1820+
datadog\_api\_client.v2.model.application\_security\_service\_attributes module
1821+
-------------------------------------------------------------------------------
1822+
1823+
.. automodule:: datadog_api_client.v2.model.application_security_service_attributes
1824+
:members:
1825+
:show-inheritance:
1826+
1827+
datadog\_api\_client.v2.model.application\_security\_service\_resource module
1828+
-----------------------------------------------------------------------------
1829+
1830+
.. automodule:: datadog_api_client.v2.model.application_security_service_resource
1831+
:members:
1832+
:show-inheritance:
1833+
1834+
datadog\_api\_client.v2.model.application\_security\_service\_type module
1835+
-------------------------------------------------------------------------
1836+
1837+
.. automodule:: datadog_api_client.v2.model.application_security_service_type
1838+
:members:
1839+
:show-inheritance:
1840+
1841+
datadog\_api\_client.v2.model.application\_security\_services\_metadata module
1842+
------------------------------------------------------------------------------
1843+
1844+
.. automodule:: datadog_api_client.v2.model.application_security_services_metadata
1845+
:members:
1846+
:show-inheritance:
1847+
1848+
datadog\_api\_client.v2.model.application\_security\_services\_response module
1849+
------------------------------------------------------------------------------
1850+
1851+
.. automodule:: datadog_api_client.v2.model.application_security_services_response
1852+
:members:
1853+
:show-inheritance:
1854+
18201855
datadog\_api\_client.v2.model.application\_security\_waf\_custom\_rule\_action module
18211856
-------------------------------------------------------------------------------------
18221857

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
Get Application Security details for a service returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.application_security_api import ApplicationSecurityApi
7+
8+
configuration = Configuration()
9+
configuration.unstable_operations["get_asm_service_by_name"] = True
10+
with ApiClient(configuration) as api_client:
11+
api_instance = ApplicationSecurityApi(api_client)
12+
response = api_instance.get_asm_service_by_name(
13+
service_filter="service_filter",
14+
)
15+
16+
print(response)

src/datadog_api_client/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,7 @@ def __init__(
669669
"v2.update_connection": False,
670670
"v2.get_pruned_trace_by_id": False,
671671
"v2.get_trace_by_id": False,
672+
"v2.get_asm_service_by_name": False,
672673
"v2.create_report_schedule": False,
673674
"v2.patch_report_schedule": False,
674675
"v2.delete_sourcemaps": False,

src/datadog_api_client/v2/api/application_security_api.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
from datadog_api_client.v2.model.application_security_policy_update_request import (
4040
ApplicationSecurityPolicyUpdateRequest,
4141
)
42+
from datadog_api_client.v2.model.application_security_services_response import ApplicationSecurityServicesResponse
4243

4344

4445
class ApplicationSecurityApi:
@@ -254,6 +255,29 @@ def __init__(self, api_client=None):
254255
api_client=api_client,
255256
)
256257

258+
self._get_asm_service_by_name_endpoint = _Endpoint(
259+
settings={
260+
"response_type": (ApplicationSecurityServicesResponse,),
261+
"auth": ["apiKeyAuth", "appKeyAuth"],
262+
"endpoint_path": "/api/v2/security/asm/services/{service_filter}",
263+
"operation_id": "get_asm_service_by_name",
264+
"http_method": "GET",
265+
"version": "v2",
266+
},
267+
params_map={
268+
"service_filter": {
269+
"required": True,
270+
"openapi_types": (str,),
271+
"attribute": "service_filter",
272+
"location": "path",
273+
},
274+
},
275+
headers_map={
276+
"accept": ["application/json"],
277+
},
278+
api_client=api_client,
279+
)
280+
257281
self._list_application_security_waf_custom_rules_endpoint = _Endpoint(
258282
settings={
259283
"response_type": (ApplicationSecurityWafCustomRuleListResponse,),
@@ -536,6 +560,27 @@ def get_application_security_waf_policy(
536560

537561
return self._get_application_security_waf_policy_endpoint.call_with_http_info(**kwargs)
538562

563+
def get_asm_service_by_name(
564+
self,
565+
service_filter: str,
566+
) -> ApplicationSecurityServicesResponse:
567+
"""Get Application Security details for a service.
568+
569+
Retrieve Application Security details for services matching the given name.
570+
Returns Application Security activation, compatibility, and product enablement
571+
information for each matching ``(service, environment)`` pair, along with a count
572+
of services that have Application Security Management (Threats) enabled.
573+
574+
:param service_filter: The name of the service to retrieve Application Security details for.
575+
Returns all matching services across environments.
576+
:type service_filter: str
577+
:rtype: ApplicationSecurityServicesResponse
578+
"""
579+
kwargs: Dict[str, Any] = {}
580+
kwargs["service_filter"] = service_filter
581+
582+
return self._get_asm_service_by_name_endpoint.call_with_http_info(**kwargs)
583+
539584
def list_application_security_waf_custom_rules(
540585
self,
541586
) -> ApplicationSecurityWafCustomRuleListResponse:
Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import List
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
)
12+
13+
14+
class ApplicationSecurityServiceAttributes(ModelNormal):
15+
@cached_property
16+
def openapi_types(_):
17+
return {
18+
"agent_versions": ([str],),
19+
"app_type": (str,),
20+
"asm_threat_compatible": (bool,),
21+
"backend_waf_event_count": (int,),
22+
"business_logic": ([str],),
23+
"color": (str,),
24+
"env": (str,),
25+
"event_count": (int,),
26+
"event_trend": ([int],),
27+
"has_appsec_enabled": (bool,),
28+
"hits": (int,),
29+
"iast_product_activation": (bool,),
30+
"iast_product_compatibility": (str,),
31+
"iast_product_compatibility_reasons": ([str],),
32+
"languages": ([str],),
33+
"last_ingested_spans": (int,),
34+
"rc_capabilities": ([str],),
35+
"recommended_business_logic": ([str],),
36+
"risk_product_activation": (bool,),
37+
"risk_product_compatibility": (str,),
38+
"risk_product_compatibility_reasons": ([str],),
39+
"rules_version": ([str],),
40+
"service": (str,),
41+
"signal_count": (int,),
42+
"signal_trend": ([int],),
43+
"source": ([str],),
44+
"teams": ([str],),
45+
"tracer_versions": ([str],),
46+
"vm_activation": (str,),
47+
"vuln_critical_count": (int,),
48+
"vuln_high_count": (int,),
49+
"without_filter_services": (int,),
50+
}
51+
52+
attribute_map = {
53+
"agent_versions": "agent_versions",
54+
"app_type": "app_type",
55+
"asm_threat_compatible": "asm_threat_compatible",
56+
"backend_waf_event_count": "backend_waf_event_count",
57+
"business_logic": "business_logic",
58+
"color": "color",
59+
"env": "env",
60+
"event_count": "event_count",
61+
"event_trend": "event_trend",
62+
"has_appsec_enabled": "has_appsec_enabled",
63+
"hits": "hits",
64+
"iast_product_activation": "iast_product_activation",
65+
"iast_product_compatibility": "iast_product_compatibility",
66+
"iast_product_compatibility_reasons": "iast_product_compatibility_reasons",
67+
"languages": "languages",
68+
"last_ingested_spans": "last_ingested_spans",
69+
"rc_capabilities": "rc_capabilities",
70+
"recommended_business_logic": "recommended_business_logic",
71+
"risk_product_activation": "risk_product_activation",
72+
"risk_product_compatibility": "risk_product_compatibility",
73+
"risk_product_compatibility_reasons": "risk_product_compatibility_reasons",
74+
"rules_version": "rules_version",
75+
"service": "service",
76+
"signal_count": "signal_count",
77+
"signal_trend": "signal_trend",
78+
"source": "source",
79+
"teams": "teams",
80+
"tracer_versions": "tracer_versions",
81+
"vm_activation": "vm-activation",
82+
"vuln_critical_count": "vuln_critical_count",
83+
"vuln_high_count": "vuln_high_count",
84+
"without_filter_services": "without_filter_services",
85+
}
86+
87+
def __init__(
88+
self_,
89+
agent_versions: List[str],
90+
app_type: str,
91+
asm_threat_compatible: bool,
92+
backend_waf_event_count: int,
93+
business_logic: List[str],
94+
color: str,
95+
env: str,
96+
event_count: int,
97+
event_trend: List[int],
98+
has_appsec_enabled: bool,
99+
hits: int,
100+
iast_product_activation: bool,
101+
iast_product_compatibility: str,
102+
iast_product_compatibility_reasons: List[str],
103+
languages: List[str],
104+
last_ingested_spans: int,
105+
rc_capabilities: List[str],
106+
recommended_business_logic: List[str],
107+
risk_product_activation: bool,
108+
risk_product_compatibility: str,
109+
risk_product_compatibility_reasons: List[str],
110+
rules_version: List[str],
111+
service: str,
112+
signal_count: int,
113+
signal_trend: List[int],
114+
source: List[str],
115+
teams: List[str],
116+
tracer_versions: List[str],
117+
vm_activation: str,
118+
vuln_critical_count: int,
119+
vuln_high_count: int,
120+
without_filter_services: int,
121+
**kwargs,
122+
):
123+
"""
124+
Application Security details describing a service in a given environment.
125+
126+
:param agent_versions: The Datadog Agent versions reporting for the service.
127+
:type agent_versions: [str]
128+
129+
:param app_type: The application type of the service, such as ``web`` or ``serverless``.
130+
:type app_type: str
131+
132+
:param asm_threat_compatible: Whether the service is compatible with Application Security Management (Threats).
133+
:type asm_threat_compatible: bool
134+
135+
:param backend_waf_event_count: The number of backend WAF events detected for the service.
136+
:type backend_waf_event_count: int
137+
138+
:param business_logic: The enabled business logic detection rules for the service.
139+
:type business_logic: [str]
140+
141+
:param color: Deprecated: a display color associated with the service in the UI. **Deprecated**.
142+
:type color: str
143+
144+
:param env: The environment the service runs in.
145+
:type env: str
146+
147+
:param event_count: The number of Application Security events detected for the service.
148+
:type event_count: int
149+
150+
:param event_trend: Deprecated: the trend of Application Security events over time. **Deprecated**.
151+
:type event_trend: [int]
152+
153+
:param has_appsec_enabled: Whether Application Security Management (Threats) is enabled for the service.
154+
:type has_appsec_enabled: bool
155+
156+
:param hits: Deprecated: the number of hits for the service. **Deprecated**.
157+
:type hits: int
158+
159+
:param iast_product_activation: Whether Interactive Application Security Testing (IAST) is enabled for the service.
160+
:type iast_product_activation: bool
161+
162+
:param iast_product_compatibility: The Interactive Application Security Testing (IAST) compatibility status of the service.
163+
:type iast_product_compatibility: str
164+
165+
:param iast_product_compatibility_reasons: The reasons explaining the Interactive Application Security Testing (IAST) compatibility status.
166+
:type iast_product_compatibility_reasons: [str]
167+
168+
:param languages: The programming languages detected for the service.
169+
:type languages: [str]
170+
171+
:param last_ingested_spans: The Unix timestamp, in seconds, of the last ingested span for the service.
172+
:type last_ingested_spans: int
173+
174+
:param rc_capabilities: The Remote Configuration capabilities reported by the service.
175+
:type rc_capabilities: [str]
176+
177+
:param recommended_business_logic: The recommended business logic detection rules for the service.
178+
:type recommended_business_logic: [str]
179+
180+
:param risk_product_activation: Whether Software Composition Analysis (SCA) is enabled for the service.
181+
:type risk_product_activation: bool
182+
183+
:param risk_product_compatibility: The Software Composition Analysis (SCA) compatibility status of the service.
184+
:type risk_product_compatibility: str
185+
186+
:param risk_product_compatibility_reasons: The reasons explaining the Software Composition Analysis (SCA) compatibility status.
187+
:type risk_product_compatibility_reasons: [str]
188+
189+
:param rules_version: The WAF rules versions applied to the service.
190+
:type rules_version: [str]
191+
192+
:param service: The name of the service.
193+
:type service: str
194+
195+
:param signal_count: Deprecated: the number of security signals for the service. **Deprecated**.
196+
:type signal_count: int
197+
198+
:param signal_trend: Deprecated: the trend of security signals over time. **Deprecated**.
199+
:type signal_trend: [int]
200+
201+
:param source: The data sources that contributed information about the service.
202+
:type source: [str]
203+
204+
:param teams: The teams that own the service.
205+
:type teams: [str]
206+
207+
:param tracer_versions: The Datadog tracing library versions reporting for the service.
208+
:type tracer_versions: [str]
209+
210+
:param vm_activation: The Vulnerability Management activation status of the service.
211+
:type vm_activation: str
212+
213+
:param vuln_critical_count: Deprecated: the number of critical-severity vulnerabilities for the service. **Deprecated**.
214+
:type vuln_critical_count: int
215+
216+
:param vuln_high_count: Deprecated: the number of high-severity vulnerabilities for the service. **Deprecated**.
217+
:type vuln_high_count: int
218+
219+
:param without_filter_services: The total number of services available without applying the service filter.
220+
:type without_filter_services: int
221+
"""
222+
super().__init__(kwargs)
223+
224+
self_.agent_versions = agent_versions
225+
self_.app_type = app_type
226+
self_.asm_threat_compatible = asm_threat_compatible
227+
self_.backend_waf_event_count = backend_waf_event_count
228+
self_.business_logic = business_logic
229+
self_.color = color
230+
self_.env = env
231+
self_.event_count = event_count
232+
self_.event_trend = event_trend
233+
self_.has_appsec_enabled = has_appsec_enabled
234+
self_.hits = hits
235+
self_.iast_product_activation = iast_product_activation
236+
self_.iast_product_compatibility = iast_product_compatibility
237+
self_.iast_product_compatibility_reasons = iast_product_compatibility_reasons
238+
self_.languages = languages
239+
self_.last_ingested_spans = last_ingested_spans
240+
self_.rc_capabilities = rc_capabilities
241+
self_.recommended_business_logic = recommended_business_logic
242+
self_.risk_product_activation = risk_product_activation
243+
self_.risk_product_compatibility = risk_product_compatibility
244+
self_.risk_product_compatibility_reasons = risk_product_compatibility_reasons
245+
self_.rules_version = rules_version
246+
self_.service = service
247+
self_.signal_count = signal_count
248+
self_.signal_trend = signal_trend
249+
self_.source = source
250+
self_.teams = teams
251+
self_.tracer_versions = tracer_versions
252+
self_.vm_activation = vm_activation
253+
self_.vuln_critical_count = vuln_critical_count
254+
self_.vuln_high_count = vuln_high_count
255+
self_.without_filter_services = without_filter_services

0 commit comments

Comments
 (0)