Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/datadog/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Release History
===============
2.0.1
++++++
* added api version 2025-06-11

2.0.0
++++++
* Fix resource creation issue
Expand Down
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
19 changes: 16 additions & 3 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 Down Expand Up @@ -154,6 +159,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 +269,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 @@ -312,6 +321,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 @@ -411,6 +421,9 @@ def _build_schema_on_200_201(cls):
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
11 changes: 8 additions & 3 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 @@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from azure.cli.core.aaz import *


@register_command(
"datadog monitor get-billing-info",
)
class GetBillingInfo(AAZCommand):
"""Get marketplace and organization info mapped to the given monitor.
"""

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

def _handler(self, command_args):
super()._handler(command_args)
self._execute_operations()
return self._output()

_args_schema = None

@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
if cls._args_schema is not None:
return cls._args_schema
cls._args_schema = super()._build_arguments_schema(*args, **kwargs)

# define Arg Group ""

_args_schema = cls._args_schema
_args_schema.monitor_name = AAZStrArg(
options=["--monitor-name"],
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,
)
return cls._args_schema

def _execute_operations(self):
self.pre_operations()
self.BillingInfoGet(ctx=self.ctx)()
self.post_operations()

@register_callback
def pre_operations(self):
pass

@register_callback
def post_operations(self):
pass

def _output(self, *args, **kwargs):
result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True)
return result

class BillingInfoGet(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)

return self.on_error(session.http_response)

@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getBillingInfo",
**self.url_parameters
)

@property
def method(self):
return "POST"

@property
def error_format(self):
return "MgmtErrorFormat"

@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"monitorName", self.ctx.args.monitor_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters

@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-06-11",
required=True,
),
}
return parameters

@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters

def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)

_schema_on_200 = None

@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200

cls._schema_on_200 = AAZObjectType()

_schema_on_200 = cls._schema_on_200
_schema_on_200.marketplace_saas_info = AAZObjectType(
serialized_name="marketplaceSaasInfo",
)
_schema_on_200.partner_billing_entity = AAZObjectType(
serialized_name="partnerBillingEntity",
)

marketplace_saas_info = cls._schema_on_200.marketplace_saas_info
marketplace_saas_info.billed_azure_subscription_id = AAZStrType(
serialized_name="billedAzureSubscriptionId",
)
marketplace_saas_info.marketplace_name = AAZStrType(
serialized_name="marketplaceName",
)
marketplace_saas_info.marketplace_status = AAZStrType(
serialized_name="marketplaceStatus",
)
marketplace_saas_info.marketplace_subscription_id = AAZStrType(
serialized_name="marketplaceSubscriptionId",
)
marketplace_saas_info.subscribed = AAZBoolType()

partner_billing_entity = cls._schema_on_200.partner_billing_entity
partner_billing_entity.id = AAZStrType()
partner_billing_entity.name = AAZStrType()
partner_billing_entity.partner_entity_uri = AAZStrType(
serialized_name="partnerEntityUri",
)

return cls._schema_on_200


class _GetBillingInfoHelper:
"""Helper class for GetBillingInfo"""


__all__ = ["GetBillingInfo"]
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class GetDefaultKey(AAZCommand):
"""

_aaz_info = {
"version": "2021-03-01",
"version": "2025-06-11",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}/getdefaultkey", "2021-03-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}/getdefaultkey", "2025-06-11"],
]
}

Expand All @@ -49,6 +49,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 @@ -120,7 +125,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2021-03-01",
"api-version", "2025-06-11",
required=True,
),
}
Expand Down
Loading
Loading