Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from .__cmd_group import *
from ._create import *
from ._delete import *
from ._get_billing_info import *
from ._get_default_key import *
from ._list import *
from ._list_api_key import *
Expand Down
44 changes: 35 additions & 9 deletions src/datadog/azext_datadog/aaz/latest/datadog/monitor/_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class Create(AAZCommand):
"""

_aaz_info = {
"version": "2023-10-20",
"version": "2025-06-11",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2023-10-20"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2025-06-11"],
]
}

Expand All @@ -52,6 +52,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
options=["-n", "--name", "--monitor-name"],
help="Monitor resource name",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9_][a-zA-Z0-9_-]+$",
max_length=32,
min_length=2,
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
Expand All @@ -66,6 +71,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
)
_args_schema.location = AAZResourceLocationArg(
arg_group="Body",
help="The geo-location where the resource lives",
fmt=AAZResourceLocationArgFormat(
resource_group_arg="resource_group",
),
Expand All @@ -77,6 +83,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema.tags = AAZDictArg(
options=["--tags"],
arg_group="Body",
help="Resource tags.",
)

identity = cls._args_schema.identity
Expand Down Expand Up @@ -118,13 +125,19 @@ def _build_arguments_schema(cls, *args, **kwargs):
)

org_properties = cls._args_schema.org_properties
org_properties.api_key = AAZStrArg(
org_properties.api_key = AAZPasswordArg(
options=["api-key"],
help="Api key associated to the Datadog organization.",
blank=AAZPromptPasswordInput(
msg="Password:",
),
)
org_properties.application_key = AAZStrArg(
org_properties.application_key = AAZPasswordArg(
options=["application-key"],
help="Application key associated to the Datadog organization.",
blank=AAZPromptPasswordInput(
msg="Password:",
),
)
org_properties.cspm = AAZBoolArg(
options=["cspm"],
Expand All @@ -138,13 +151,19 @@ def _build_arguments_schema(cls, *args, **kwargs):
options=["id"],
help="Id of the Datadog organization.",
)
org_properties.linking_auth_code = AAZStrArg(
org_properties.linking_auth_code = AAZPasswordArg(
options=["linking-auth-code"],
help="The auth code used to linking to an existing datadog organization.",
blank=AAZPromptPasswordInput(
msg="Password:",
),
)
org_properties.linking_client_id = AAZStrArg(
org_properties.linking_client_id = AAZPasswordArg(
options=["linking-client-id"],
help="The client_id from an existing in exchange for an auth token to link organization.",
blank=AAZPromptPasswordInput(
msg="Password:",
),
)
org_properties.name = AAZStrArg(
options=["name"],
Expand All @@ -154,6 +173,10 @@ def _build_arguments_schema(cls, *args, **kwargs):
options=["redirect-uri"],
help="The redirect uri for linking.",
)
org_properties.resource_collection = AAZBoolArg(
options=["resource-collection"],
help="The configuration which describes the state of resource collection. This collects configuration information for all resources in a subscription.",
)

user_info = cls._args_schema.user_info
user_info.email_address = AAZStrArg(
Expand Down Expand Up @@ -260,7 +283,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-10-20",
"api-version", "2025-06-11",
required=True,
),
}
Expand Down Expand Up @@ -299,7 +322,7 @@ def content(self):
if properties is not None:
properties.set_prop("datadogOrganizationProperties", AAZObjectType, ".org_properties")
properties.set_prop("monitoringStatus", AAZStrType, ".monitoring_status")
properties.set_prop("userInfo", AAZObjectType, ".user_info", typ_kwargs={"flags": {"secret": True}})
properties.set_prop("userInfo", AAZObjectType, ".user_info")

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

user_info = _builder.get(".properties.userInfo")
if user_info is not None:
Expand Down Expand Up @@ -404,13 +428,15 @@ def _build_schema_on_200_201(cls):
)
properties.user_info = AAZObjectType(
serialized_name="userInfo",
flags={"secret": True},
)

datadog_organization_properties = cls._schema_on_200_201.properties.datadog_organization_properties
datadog_organization_properties.cspm = AAZBoolType()
datadog_organization_properties.id = AAZStrType()
datadog_organization_properties.name = AAZStrType()
datadog_organization_properties.resource_collection = AAZBoolType(
serialized_name="resourceCollection",
)

user_info = cls._schema_on_200_201.properties.user_info
user_info.email_address = AAZStrType(
Expand Down
17 changes: 11 additions & 6 deletions src/datadog/azext_datadog/aaz/latest/datadog/monitor/_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class Delete(AAZCommand):
"""

_aaz_info = {
"version": "2023-10-20",
"version": "2025-06-11",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2023-10-20"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2025-06-11"],
]
}

Expand All @@ -51,6 +51,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="Monitor resource name",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9_][a-zA-Z0-9_-]+$",
max_length=32,
min_length=2,
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
Expand Down Expand Up @@ -82,7 +87,7 @@ def __call__(self, *args, **kwargs):
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
lro_options={"final-state-via": "location"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200]:
Expand All @@ -91,7 +96,7 @@ def __call__(self, *args, **kwargs):
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
lro_options={"final-state-via": "location"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [204]:
Expand All @@ -100,7 +105,7 @@ def __call__(self, *args, **kwargs):
session,
self.on_204,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
lro_options={"final-state-via": "location"},
path_format_arguments=self.url_parameters,
)

Expand Down Expand Up @@ -143,7 +148,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-10-20",
"api-version", "2025-06-11",
required=True,
),
}
Expand Down
Loading
Loading