diff --git a/src/datadog/HISTORY.rst b/src/datadog/HISTORY.rst index eb706a85447..051c4fddde3 100644 --- a/src/datadog/HISTORY.rst +++ b/src/datadog/HISTORY.rst @@ -2,6 +2,9 @@ Release History =============== +2.0.0 +++++++ +* Fix resource creation issue 1.0.0 ++++++ diff --git a/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_create.py b/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_create.py index d374d447c9c..0c3551abf46 100644 --- a/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_create.py +++ b/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_create.py @@ -18,16 +18,16 @@ class Create(AAZCommand): """Creates a new Datadog monitor resource in your Azure subscription. This sets up the integration between Azure and your Datadog account, enabling observability and monitoring of your Azure resources through Datadog. :example: Monitors_Create - az datadog monitor create --name "myMonitor" --resource-group "myResourceGroup" --location "West US 2" --tags Environment="Dev" --user-info name="Alice" email-address="alice@microsoft.com" phone-number="123-456-7890" --type "SystemAssigned" --sku-name "payg_v2_Monthly" + az datadog monitor create --name "myMonitor" --resource-group "myResourceGroup" --location "West US 2" --org-properties name="myResourceGroup" --tags Environment="Dev" --user-info name="Alice" email-address="alice@microsoft.com" phone-number="123-456-7890" --sku name="payg_v3_Monthly" --identity type="SystemAssigned" --monitoring-status "Enabled" :example: Monitors creation with linking to Datadog organization. - az datadog monitor create --name "myMonitor" --resource-group "myResourceGroup" --location "West US 2" --datadog-organization-properties api-key=XX application-key=XX --tags Environment="Dev" --user-info name="Alice" email-address="alice@microsoft.com" phone-number="123-456-7890" --type "SystemAssigned" --sku-name "Linked" + az datadog monitor create --name "myMonitor-link" --resource-group "myResourceGroup" --location "West US 2" --org-properties api-key=XX application-key=XX --tags Environment="Dev" --user-info name="Alice" email-address="alice@microsoft.com" phone-number="123-456-7890" --identity type="SystemAssigned" --sku name="Linked" """ _aaz_info = { - "version": "2021-03-01", + "version": "2023-10-20", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2021-03-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2023-10-20"], ] } @@ -99,8 +99,8 @@ def _build_arguments_schema(cls, *args, **kwargs): # define Arg Group "Properties" _args_schema = cls._args_schema - _args_schema.datadog_organization_properties = AAZObjectArg( - options=["--datadog-organization-properties"], + _args_schema.org_properties = AAZObjectArg( + options=["--org-properties"], arg_group="Properties", help="Datadog organization properties", ) @@ -117,28 +117,40 @@ def _build_arguments_schema(cls, *args, **kwargs): help="User info", ) - datadog_organization_properties = cls._args_schema.datadog_organization_properties - datadog_organization_properties.api_key = AAZStrArg( + org_properties = cls._args_schema.org_properties + org_properties.api_key = AAZStrArg( options=["api-key"], help="Api key associated to the Datadog organization.", ) - datadog_organization_properties.application_key = AAZStrArg( + org_properties.application_key = AAZStrArg( options=["application-key"], help="Application key associated to the Datadog organization.", ) - datadog_organization_properties.enterprise_app_id = AAZStrArg( + org_properties.cspm = AAZBoolArg( + options=["cspm"], + help="The configuration which describes the state of cloud security posture management. This collects configuration information for all resources in a subscription and track conformance to industry benchmarks.", + ) + org_properties.enterprise_app_id = AAZStrArg( options=["enterprise-app-id"], help="The Id of the Enterprise App used for Single sign on.", ) - datadog_organization_properties.linking_auth_code = AAZStrArg( + org_properties.id = AAZStrArg( + options=["id"], + help="Id of the Datadog organization.", + ) + org_properties.linking_auth_code = AAZStrArg( options=["linking-auth-code"], help="The auth code used to linking to an existing datadog organization.", ) - datadog_organization_properties.linking_client_id = AAZStrArg( + org_properties.linking_client_id = AAZStrArg( options=["linking-client-id"], help="The client_id from an existing in exchange for an auth token to link organization.", ) - datadog_organization_properties.redirect_uri = AAZStrArg( + org_properties.name = AAZStrArg( + options=["name"], + help="Name of the Datadog organization.", + ) + org_properties.redirect_uri = AAZStrArg( options=["redirect-uri"], help="The redirect uri for linking.", ) @@ -248,7 +260,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2021-03-01", + "api-version", "2023-10-20", required=True, ), } @@ -285,7 +297,7 @@ def content(self): properties = _builder.get(".properties") if properties is not None: - properties.set_prop("datadogOrganizationProperties", AAZObjectType, ".datadog_organization_properties") + 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}}) @@ -293,9 +305,12 @@ def content(self): if datadog_organization_properties is not None: datadog_organization_properties.set_prop("apiKey", AAZStrType, ".api_key", typ_kwargs={"flags": {"secret": True}}) datadog_organization_properties.set_prop("applicationKey", AAZStrType, ".application_key", typ_kwargs={"flags": {"secret": True}}) + datadog_organization_properties.set_prop("cspm", AAZBoolType, ".cspm") datadog_organization_properties.set_prop("enterpriseAppId", AAZStrType, ".enterprise_app_id") + datadog_organization_properties.set_prop("id", AAZStrType, ".id") datadog_organization_properties.set_prop("linkingAuthCode", AAZStrType, ".linking_auth_code", typ_kwargs={"flags": {"secret": True}}) 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") user_info = _builder.get(".properties.userInfo") @@ -393,12 +408,9 @@ def _build_schema_on_200_201(cls): ) datadog_organization_properties = cls._schema_on_200_201.properties.datadog_organization_properties - datadog_organization_properties.id = AAZStrType( - flags={"read_only": True}, - ) - datadog_organization_properties.name = AAZStrType( - flags={"read_only": True}, - ) + datadog_organization_properties.cspm = AAZBoolType() + datadog_organization_properties.id = AAZStrType() + datadog_organization_properties.name = AAZStrType() user_info = cls._schema_on_200_201.properties.user_info user_info.email_address = AAZStrType( diff --git a/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_delete.py b/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_delete.py index e25fd4b9d7a..97aa54e10c4 100644 --- a/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_delete.py +++ b/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_delete.py @@ -23,9 +23,9 @@ class Delete(AAZCommand): """ _aaz_info = { - "version": "2021-03-01", + "version": "2023-10-20", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2021-03-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2023-10-20"], ] } @@ -143,7 +143,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2021-03-01", + "api-version", "2023-10-20", required=True, ), } diff --git a/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_show.py b/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_show.py index b304b422930..a123b20e7e4 100644 --- a/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_show.py +++ b/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_show.py @@ -22,9 +22,9 @@ class Show(AAZCommand): """ _aaz_info = { - "version": "2021-03-01", + "version": "2023-10-20", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2021-03-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2023-10-20"], ] } @@ -120,7 +120,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2021-03-01", + "api-version", "2023-10-20", required=True, ), } @@ -214,12 +214,9 @@ def _build_schema_on_200(cls): ) datadog_organization_properties = cls._schema_on_200.properties.datadog_organization_properties - datadog_organization_properties.id = AAZStrType( - flags={"read_only": True}, - ) - datadog_organization_properties.name = AAZStrType( - flags={"read_only": True}, - ) + datadog_organization_properties.cspm = AAZBoolType() + datadog_organization_properties.id = AAZStrType() + datadog_organization_properties.name = AAZStrType() user_info = cls._schema_on_200.properties.user_info user_info.email_address = AAZStrType( diff --git a/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_update.py b/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_update.py index 37b23c133dd..ae27868fd5b 100644 --- a/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_update.py +++ b/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_update.py @@ -22,9 +22,9 @@ class Update(AAZCommand): """ _aaz_info = { - "version": "2021-03-01", + "version": "2023-10-20", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2021-03-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2023-10-20"], ] } @@ -104,6 +104,12 @@ def _build_arguments_schema(cls, *args, **kwargs): # define Arg Group "Properties" _args_schema = cls._args_schema + _args_schema.org_properties = AAZObjectArg( + options=["--org-properties"], + arg_group="Properties", + help="Specify the Datadog organization name. In the case of linking to existing organizations, Id, ApiKey, and Applicationkey is required as well.", + nullable=True, + ) _args_schema.monitoring_status = AAZStrArg( options=["--monitoring-status"], arg_group="Properties", @@ -118,6 +124,13 @@ def _build_arguments_schema(cls, *args, **kwargs): nullable=True, ) + org_properties = cls._args_schema.org_properties + org_properties.cspm = AAZBoolArg( + options=["cspm"], + help="The configuration which describes the state of cloud security posture management. This collects configuration information for all resources in a subscription and track conformance to industry benchmarks.", + nullable=True, + ) + user_info = cls._args_schema.user_info user_info.email_address = AAZStrArg( options=["email-address"], @@ -223,7 +236,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2021-03-01", + "api-version", "2023-10-20", required=True, ), } @@ -322,7 +335,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2021-03-01", + "api-version", "2023-10-20", required=True, ), } @@ -392,9 +405,14 @@ def _update_instance(self, instance): properties = _builder.get(".properties") 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}}) + datadog_organization_properties = _builder.get(".properties.datadogOrganizationProperties") + if datadog_organization_properties is not None: + datadog_organization_properties.set_prop("cspm", AAZBoolType, ".cspm") + user_info = _builder.get(".properties.userInfo") if user_info is not None: user_info.set_prop("emailAddress", AAZStrType, ".email_address") @@ -503,12 +521,9 @@ def _build_schema_datadog_monitor_resource_read(cls, _schema): ) datadog_organization_properties = _schema_datadog_monitor_resource_read.properties.datadog_organization_properties - datadog_organization_properties.id = AAZStrType( - flags={"read_only": True}, - ) - datadog_organization_properties.name = AAZStrType( - flags={"read_only": True}, - ) + datadog_organization_properties.cspm = AAZBoolType() + datadog_organization_properties.id = AAZStrType() + datadog_organization_properties.name = AAZStrType() user_info = _schema_datadog_monitor_resource_read.properties.user_info user_info.email_address = AAZStrType( diff --git a/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_wait.py b/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_wait.py index 99cb2027225..1d4d7d35c1d 100644 --- a/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_wait.py +++ b/src/datadog/azext_datadog/aaz/latest/datadog/monitor/_wait.py @@ -20,7 +20,7 @@ class Wait(AAZWaitCommand): _aaz_info = { "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2021-03-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.datadog/monitors/{}", "2023-10-20"], ] } @@ -116,7 +116,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2021-03-01", + "api-version", "2023-10-20", required=True, ), } @@ -210,12 +210,9 @@ def _build_schema_on_200(cls): ) datadog_organization_properties = cls._schema_on_200.properties.datadog_organization_properties - datadog_organization_properties.id = AAZStrType( - flags={"read_only": True}, - ) - datadog_organization_properties.name = AAZStrType( - flags={"read_only": True}, - ) + datadog_organization_properties.cspm = AAZBoolType() + datadog_organization_properties.id = AAZStrType() + datadog_organization_properties.name = AAZStrType() user_info = cls._schema_on_200.properties.user_info user_info.email_address = AAZStrType( diff --git a/src/datadog/setup.py b/src/datadog/setup.py index 5b5ff5b82dd..f234f4397a9 100644 --- a/src/datadog/setup.py +++ b/src/datadog/setup.py @@ -10,7 +10,7 @@ # HISTORY.rst entry. -VERSION = '1.0.0' +VERSION = '2.0.0' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers