Skip to content

Commit 2ada621

Browse files
committed
datadog updating version
1 parent 0640335 commit 2ada621

Some content is hidden

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

41 files changed

+2960
-86
lines changed

src/datadog/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
33
Release History
44
===============
5+
2.0.1
6+
++++++
7+
* added api version 2025-06-11
8+
59
2.0.0
610
++++++
711
* 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: 16 additions & 3 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,
@@ -154,6 +159,10 @@ def _build_arguments_schema(cls, *args, **kwargs):
154159
options=["redirect-uri"],
155160
help="The redirect uri for linking.",
156161
)
162+
org_properties.resource_collection = AAZBoolArg(
163+
options=["resource-collection"],
164+
help="The configuration which describes the state of resource collection. This collects configuration information for all resources in a subscription.",
165+
)
157166

158167
user_info = cls._args_schema.user_info
159168
user_info.email_address = AAZStrArg(
@@ -260,7 +269,7 @@ def url_parameters(self):
260269
def query_parameters(self):
261270
parameters = {
262271
**self.serialize_query_param(
263-
"api-version", "2023-10-20",
272+
"api-version", "2025-06-11",
264273
required=True,
265274
),
266275
}
@@ -312,6 +321,7 @@ def content(self):
312321
datadog_organization_properties.set_prop("linkingClientId", AAZStrType, ".linking_client_id", typ_kwargs={"flags": {"secret": True}})
313322
datadog_organization_properties.set_prop("name", AAZStrType, ".name")
314323
datadog_organization_properties.set_prop("redirectUri", AAZStrType, ".redirect_uri")
324+
datadog_organization_properties.set_prop("resourceCollection", AAZBoolType, ".resource_collection")
315325

316326
user_info = _builder.get(".properties.userInfo")
317327
if user_info is not None:
@@ -411,6 +421,9 @@ def _build_schema_on_200_201(cls):
411421
datadog_organization_properties.cspm = AAZBoolType()
412422
datadog_organization_properties.id = AAZStrType()
413423
datadog_organization_properties.name = AAZStrType()
424+
datadog_organization_properties.resource_collection = AAZBoolType(
425+
serialized_name="resourceCollection",
426+
)
414427

415428
user_info = cls._schema_on_200_201.properties.user_info
416429
user_info.email_address = AAZStrType(

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

Lines changed: 8 additions & 3 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,
@@ -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
}
Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from azure.cli.core.aaz import *
12+
13+
14+
@register_command(
15+
"datadog monitor get-billing-info",
16+
)
17+
class GetBillingInfo(AAZCommand):
18+
"""Get marketplace and organization info mapped to the given monitor.
19+
"""
20+
21+
_aaz_info = {
22+
"version": "2025-06-11",
23+
"resources": [
24+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}/getbillinginfo", "2025-06-11"],
25+
]
26+
}
27+
28+
def _handler(self, command_args):
29+
super()._handler(command_args)
30+
self._execute_operations()
31+
return self._output()
32+
33+
_args_schema = None
34+
35+
@classmethod
36+
def _build_arguments_schema(cls, *args, **kwargs):
37+
if cls._args_schema is not None:
38+
return cls._args_schema
39+
cls._args_schema = super()._build_arguments_schema(*args, **kwargs)
40+
41+
# define Arg Group ""
42+
43+
_args_schema = cls._args_schema
44+
_args_schema.monitor_name = AAZStrArg(
45+
options=["--monitor-name"],
46+
help="Monitor resource name",
47+
required=True,
48+
id_part="name",
49+
fmt=AAZStrArgFormat(
50+
pattern="^[a-zA-Z0-9_][a-zA-Z0-9_-]+$",
51+
max_length=32,
52+
min_length=2,
53+
),
54+
)
55+
_args_schema.resource_group = AAZResourceGroupNameArg(
56+
required=True,
57+
)
58+
return cls._args_schema
59+
60+
def _execute_operations(self):
61+
self.pre_operations()
62+
self.BillingInfoGet(ctx=self.ctx)()
63+
self.post_operations()
64+
65+
@register_callback
66+
def pre_operations(self):
67+
pass
68+
69+
@register_callback
70+
def post_operations(self):
71+
pass
72+
73+
def _output(self, *args, **kwargs):
74+
result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True)
75+
return result
76+
77+
class BillingInfoGet(AAZHttpOperation):
78+
CLIENT_TYPE = "MgmtClient"
79+
80+
def __call__(self, *args, **kwargs):
81+
request = self.make_request()
82+
session = self.client.send_request(request=request, stream=False, **kwargs)
83+
if session.http_response.status_code in [200]:
84+
return self.on_200(session)
85+
86+
return self.on_error(session.http_response)
87+
88+
@property
89+
def url(self):
90+
return self.client.format_url(
91+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getBillingInfo",
92+
**self.url_parameters
93+
)
94+
95+
@property
96+
def method(self):
97+
return "POST"
98+
99+
@property
100+
def error_format(self):
101+
return "MgmtErrorFormat"
102+
103+
@property
104+
def url_parameters(self):
105+
parameters = {
106+
**self.serialize_url_param(
107+
"monitorName", self.ctx.args.monitor_name,
108+
required=True,
109+
),
110+
**self.serialize_url_param(
111+
"resourceGroupName", self.ctx.args.resource_group,
112+
required=True,
113+
),
114+
**self.serialize_url_param(
115+
"subscriptionId", self.ctx.subscription_id,
116+
required=True,
117+
),
118+
}
119+
return parameters
120+
121+
@property
122+
def query_parameters(self):
123+
parameters = {
124+
**self.serialize_query_param(
125+
"api-version", "2025-06-11",
126+
required=True,
127+
),
128+
}
129+
return parameters
130+
131+
@property
132+
def header_parameters(self):
133+
parameters = {
134+
**self.serialize_header_param(
135+
"Accept", "application/json",
136+
),
137+
}
138+
return parameters
139+
140+
def on_200(self, session):
141+
data = self.deserialize_http_content(session)
142+
self.ctx.set_var(
143+
"instance",
144+
data,
145+
schema_builder=self._build_schema_on_200
146+
)
147+
148+
_schema_on_200 = None
149+
150+
@classmethod
151+
def _build_schema_on_200(cls):
152+
if cls._schema_on_200 is not None:
153+
return cls._schema_on_200
154+
155+
cls._schema_on_200 = AAZObjectType()
156+
157+
_schema_on_200 = cls._schema_on_200
158+
_schema_on_200.marketplace_saas_info = AAZObjectType(
159+
serialized_name="marketplaceSaasInfo",
160+
)
161+
_schema_on_200.partner_billing_entity = AAZObjectType(
162+
serialized_name="partnerBillingEntity",
163+
)
164+
165+
marketplace_saas_info = cls._schema_on_200.marketplace_saas_info
166+
marketplace_saas_info.billed_azure_subscription_id = AAZStrType(
167+
serialized_name="billedAzureSubscriptionId",
168+
)
169+
marketplace_saas_info.marketplace_name = AAZStrType(
170+
serialized_name="marketplaceName",
171+
)
172+
marketplace_saas_info.marketplace_status = AAZStrType(
173+
serialized_name="marketplaceStatus",
174+
)
175+
marketplace_saas_info.marketplace_subscription_id = AAZStrType(
176+
serialized_name="marketplaceSubscriptionId",
177+
)
178+
marketplace_saas_info.subscribed = AAZBoolType()
179+
180+
partner_billing_entity = cls._schema_on_200.partner_billing_entity
181+
partner_billing_entity.id = AAZStrType()
182+
partner_billing_entity.name = AAZStrType()
183+
partner_billing_entity.partner_entity_uri = AAZStrType(
184+
serialized_name="partnerEntityUri",
185+
)
186+
187+
return cls._schema_on_200
188+
189+
190+
class _GetBillingInfoHelper:
191+
"""Helper class for GetBillingInfo"""
192+
193+
194+
__all__ = ["GetBillingInfo"]

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class GetDefaultKey(AAZCommand):
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2021-03-01",
25+
"version": "2025-06-11",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}/getdefaultkey", "2021-03-01"],
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}/getdefaultkey", "2025-06-11"],
2828
]
2929
}
3030

@@ -49,6 +49,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
4949
help="Monitor resource name",
5050
required=True,
5151
id_part="name",
52+
fmt=AAZStrArgFormat(
53+
pattern="^[a-zA-Z0-9_][a-zA-Z0-9_-]+$",
54+
max_length=32,
55+
min_length=2,
56+
),
5257
)
5358
_args_schema.resource_group = AAZResourceGroupNameArg(
5459
required=True,
@@ -120,7 +125,7 @@ def url_parameters(self):
120125
def query_parameters(self):
121126
parameters = {
122127
**self.serialize_query_param(
123-
"api-version", "2021-03-01",
128+
"api-version", "2025-06-11",
124129
required=True,
125130
),
126131
}

0 commit comments

Comments
 (0)