Skip to content

Commit 4a3a1b6

Browse files
Datadog update version 2025-06-11 (#9352)
* minimised command size * added mandatory examples * removing version update * added test cases * added all tests * added few examples * updated test cases and attached their recordings * updated test cases * updated version & removed stale comments * removing the version update * accomodating pr reviews * Add licensing header * updating version --------- Co-authored-by: Bhanu Chand J <[email protected]>
1 parent d887490 commit 4a3a1b6

Some content is hidden

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

52 files changed

+5258
-198
lines changed

src/datadog/HISTORY.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
33
Release History
44
===============
5+
3.0.0
6+
++++++
7+
* Added multi subscription support
8+
* Updated dependencies to latest versions
9+
* Update monitor does not need location parameter anymore
10+
511
2.0.0
612
++++++
713
* Fix resource creation issue

src/datadog/azext_datadog/aaz/latest/datadog/monitor/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from .__cmd_group import *
1212
from ._create import *
1313
from ._delete import *
14+
from ._get_billing_info import *
1415
from ._get_default_key import *
1516
from ._list import *
1617
from ._list_api_key import *

src/datadog/azext_datadog/aaz/latest/datadog/monitor/_create.py

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class Create(AAZCommand):
2525
"""
2626

2727
_aaz_info = {
28-
"version": "2023-10-20",
28+
"version": "2025-06-11",
2929
"resources": [
30-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2023-10-20"],
30+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2025-06-11"],
3131
]
3232
}
3333

@@ -52,6 +52,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
5252
options=["-n", "--name", "--monitor-name"],
5353
help="Monitor resource name",
5454
required=True,
55+
fmt=AAZStrArgFormat(
56+
pattern="^[a-zA-Z0-9_][a-zA-Z0-9_-]+$",
57+
max_length=32,
58+
min_length=2,
59+
),
5560
)
5661
_args_schema.resource_group = AAZResourceGroupNameArg(
5762
required=True,
@@ -66,6 +71,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
6671
)
6772
_args_schema.location = AAZResourceLocationArg(
6873
arg_group="Body",
74+
help="The geo-location where the resource lives",
6975
fmt=AAZResourceLocationArgFormat(
7076
resource_group_arg="resource_group",
7177
),
@@ -77,6 +83,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
7783
_args_schema.tags = AAZDictArg(
7884
options=["--tags"],
7985
arg_group="Body",
86+
help="Resource tags.",
8087
)
8188

8289
identity = cls._args_schema.identity
@@ -118,13 +125,19 @@ def _build_arguments_schema(cls, *args, **kwargs):
118125
)
119126

120127
org_properties = cls._args_schema.org_properties
121-
org_properties.api_key = AAZStrArg(
128+
org_properties.api_key = AAZPasswordArg(
122129
options=["api-key"],
123130
help="Api key associated to the Datadog organization.",
131+
blank=AAZPromptPasswordInput(
132+
msg="Password:",
133+
),
124134
)
125-
org_properties.application_key = AAZStrArg(
135+
org_properties.application_key = AAZPasswordArg(
126136
options=["application-key"],
127137
help="Application key associated to the Datadog organization.",
138+
blank=AAZPromptPasswordInput(
139+
msg="Password:",
140+
),
128141
)
129142
org_properties.cspm = AAZBoolArg(
130143
options=["cspm"],
@@ -138,13 +151,19 @@ def _build_arguments_schema(cls, *args, **kwargs):
138151
options=["id"],
139152
help="Id of the Datadog organization.",
140153
)
141-
org_properties.linking_auth_code = AAZStrArg(
154+
org_properties.linking_auth_code = AAZPasswordArg(
142155
options=["linking-auth-code"],
143156
help="The auth code used to linking to an existing datadog organization.",
157+
blank=AAZPromptPasswordInput(
158+
msg="Password:",
159+
),
144160
)
145-
org_properties.linking_client_id = AAZStrArg(
161+
org_properties.linking_client_id = AAZPasswordArg(
146162
options=["linking-client-id"],
147163
help="The client_id from an existing in exchange for an auth token to link organization.",
164+
blank=AAZPromptPasswordInput(
165+
msg="Password:",
166+
),
148167
)
149168
org_properties.name = AAZStrArg(
150169
options=["name"],
@@ -154,6 +173,10 @@ def _build_arguments_schema(cls, *args, **kwargs):
154173
options=["redirect-uri"],
155174
help="The redirect uri for linking.",
156175
)
176+
org_properties.resource_collection = AAZBoolArg(
177+
options=["resource-collection"],
178+
help="The configuration which describes the state of resource collection. This collects configuration information for all resources in a subscription.",
179+
)
157180

158181
user_info = cls._args_schema.user_info
159182
user_info.email_address = AAZStrArg(
@@ -260,7 +283,7 @@ def url_parameters(self):
260283
def query_parameters(self):
261284
parameters = {
262285
**self.serialize_query_param(
263-
"api-version", "2023-10-20",
286+
"api-version", "2025-06-11",
264287
required=True,
265288
),
266289
}
@@ -299,7 +322,7 @@ def content(self):
299322
if properties is not None:
300323
properties.set_prop("datadogOrganizationProperties", AAZObjectType, ".org_properties")
301324
properties.set_prop("monitoringStatus", AAZStrType, ".monitoring_status")
302-
properties.set_prop("userInfo", AAZObjectType, ".user_info", typ_kwargs={"flags": {"secret": True}})
325+
properties.set_prop("userInfo", AAZObjectType, ".user_info")
303326

304327
datadog_organization_properties = _builder.get(".properties.datadogOrganizationProperties")
305328
if datadog_organization_properties is not None:
@@ -312,6 +335,7 @@ def content(self):
312335
datadog_organization_properties.set_prop("linkingClientId", AAZStrType, ".linking_client_id", typ_kwargs={"flags": {"secret": True}})
313336
datadog_organization_properties.set_prop("name", AAZStrType, ".name")
314337
datadog_organization_properties.set_prop("redirectUri", AAZStrType, ".redirect_uri")
338+
datadog_organization_properties.set_prop("resourceCollection", AAZBoolType, ".resource_collection")
315339

316340
user_info = _builder.get(".properties.userInfo")
317341
if user_info is not None:
@@ -404,13 +428,15 @@ def _build_schema_on_200_201(cls):
404428
)
405429
properties.user_info = AAZObjectType(
406430
serialized_name="userInfo",
407-
flags={"secret": True},
408431
)
409432

410433
datadog_organization_properties = cls._schema_on_200_201.properties.datadog_organization_properties
411434
datadog_organization_properties.cspm = AAZBoolType()
412435
datadog_organization_properties.id = AAZStrType()
413436
datadog_organization_properties.name = AAZStrType()
437+
datadog_organization_properties.resource_collection = AAZBoolType(
438+
serialized_name="resourceCollection",
439+
)
414440

415441
user_info = cls._schema_on_200_201.properties.user_info
416442
user_info.email_address = AAZStrType(

src/datadog/azext_datadog/aaz/latest/datadog/monitor/_delete.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class Delete(AAZCommand):
2323
"""
2424

2525
_aaz_info = {
26-
"version": "2023-10-20",
26+
"version": "2025-06-11",
2727
"resources": [
28-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2023-10-20"],
28+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2025-06-11"],
2929
]
3030
}
3131

@@ -51,6 +51,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
5151
help="Monitor resource name",
5252
required=True,
5353
id_part="name",
54+
fmt=AAZStrArgFormat(
55+
pattern="^[a-zA-Z0-9_][a-zA-Z0-9_-]+$",
56+
max_length=32,
57+
min_length=2,
58+
),
5459
)
5560
_args_schema.resource_group = AAZResourceGroupNameArg(
5661
required=True,
@@ -82,7 +87,7 @@ def __call__(self, *args, **kwargs):
8287
session,
8388
self.on_200,
8489
self.on_error,
85-
lro_options={"final-state-via": "azure-async-operation"},
90+
lro_options={"final-state-via": "location"},
8691
path_format_arguments=self.url_parameters,
8792
)
8893
if session.http_response.status_code in [200]:
@@ -91,7 +96,7 @@ def __call__(self, *args, **kwargs):
9196
session,
9297
self.on_200,
9398
self.on_error,
94-
lro_options={"final-state-via": "azure-async-operation"},
99+
lro_options={"final-state-via": "location"},
95100
path_format_arguments=self.url_parameters,
96101
)
97102
if session.http_response.status_code in [204]:
@@ -100,7 +105,7 @@ def __call__(self, *args, **kwargs):
100105
session,
101106
self.on_204,
102107
self.on_error,
103-
lro_options={"final-state-via": "azure-async-operation"},
108+
lro_options={"final-state-via": "location"},
104109
path_format_arguments=self.url_parameters,
105110
)
106111

@@ -143,7 +148,7 @@ def url_parameters(self):
143148
def query_parameters(self):
144149
parameters = {
145150
**self.serialize_query_param(
146-
"api-version", "2023-10-20",
151+
"api-version", "2025-06-11",
147152
required=True,
148153
),
149154
}

0 commit comments

Comments
 (0)