diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/_meta.json b/sdk/dynatrace/azure-mgmt-dynatrace/_meta.json index 2c2b07c28265..9e95c78665ae 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/_meta.json +++ b/sdk/dynatrace/azure-mgmt-dynatrace/_meta.json @@ -1,11 +1,11 @@ { - "commit": "89a9bf17524904e7670f0fd2d62ac882ca00d85c", + "commit": "a77bab979f78902e00b54cf682093f74647aef93", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.7", + "@autorest/python@6.4.12", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/dynatrace/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/dynatrace/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.4.12 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/dynatrace/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_configuration.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_configuration.py index 156bbaa33ce7..f3b4ec5eb65d 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_configuration.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_configuration.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -15,11 +14,6 @@ from ._version import VERSION -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -35,14 +29,14 @@ class DynatraceObservabilityMgmtClientConfiguration(Configuration): # pylint: d :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2021-09-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-04-27". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(DynatraceObservabilityMgmtClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", "2021-09-01") + api_version: str = kwargs.pop("api_version", "2023-04-27") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_dynatrace_observability_mgmt_client.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_dynatrace_observability_mgmt_client.py index 9aa40c734669..9bcbe9eae7c3 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_dynatrace_observability_mgmt_client.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_dynatrace_observability_mgmt_client.py @@ -39,7 +39,7 @@ class DynatraceObservabilityMgmtClient: # pylint: disable=client-accepts-api-ve :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2021-09-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-04-27". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -56,7 +56,7 @@ def __init__( self._config = DynatraceObservabilityMgmtClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -96,5 +96,5 @@ def __enter__(self) -> "DynatraceObservabilityMgmtClient": self._client.__enter__() return self - def __exit__(self, *exc_details) -> None: + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_serialization.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_serialization.py index 2c170e28dbca..842ae727fbbc 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_serialization.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_serialization.py @@ -38,7 +38,22 @@ import re import sys import codecs -from typing import Optional, Union, AnyStr, IO, Mapping +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) try: from urllib import quote # type: ignore @@ -48,12 +63,14 @@ import isodate # type: ignore -from typing import Dict, Any, cast - from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback +from azure.core.serialization import NULL as AzureCoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + class RawDeserializer: @@ -277,8 +294,8 @@ class Model(object): _attribute_map: Dict[str, Dict[str, Any]] = {} _validation: Dict[str, Dict[str, Any]] = {} - def __init__(self, **kwargs): - self.additional_properties = {} + def __init__(self, **kwargs: Any) -> None: + self.additional_properties: Dict[str, Any] = {} for k in kwargs: if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -287,25 +304,25 @@ def __init__(self, **kwargs): else: setattr(self, k, kwargs[k]) - def __eq__(self, other): + def __eq__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False - def __ne__(self, other): + def __ne__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" return not self.__eq__(other) - def __str__(self): + def __str__(self) -> str: return str(self.__dict__) @classmethod - def enable_additional_properties_sending(cls): + def enable_additional_properties_sending(cls) -> None: cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} @classmethod - def is_xml_model(cls): + def is_xml_model(cls) -> bool: try: cls._xml_map # type: ignore except AttributeError: @@ -322,7 +339,7 @@ def _create_xml_node(cls): return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) - def serialize(self, keep_readonly=False, **kwargs): + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: """Return the JSON that would be sent to azure from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. @@ -336,8 +353,13 @@ def serialize(self, keep_readonly=False, **kwargs): serializer = Serializer(self._infer_class_models()) return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) - def as_dict(self, keep_readonly=True, key_transformer=attribute_transformer, **kwargs): - """Return a dict that can be JSONify using json.dump. + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. Advanced usage might optionally use a callback as parameter: @@ -384,7 +406,7 @@ def _infer_class_models(cls): return client_models @classmethod - def deserialize(cls, data, content_type=None): + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. @@ -396,7 +418,12 @@ def deserialize(cls, data, content_type=None): return deserializer(cls.__name__, data, content_type=content_type) @classmethod - def from_dict(cls, data, key_extractors=None, content_type=None): + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: """Parse a dict using given key extractor return a model. By default consider key @@ -409,8 +436,8 @@ def from_dict(cls, data, key_extractors=None, content_type=None): :raises: DeserializationError if something went wrong """ deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( - [ + deserializer.key_extractors = ( # type: ignore + [ # type: ignore attribute_key_case_insensitive_extractor, rest_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, @@ -518,7 +545,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -534,7 +561,7 @@ def __init__(self, classes=None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -602,7 +629,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if xml_desc.get("attr", False): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): @@ -626,8 +653,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized.append(local_node) # type: ignore else: # JSON for k in reversed(keys): # type: ignore - unflattened = {k: new_attr} - new_attr = unflattened + new_attr = {k: new_attr} _new_attr = new_attr _serialized = serialized @@ -656,8 +682,8 @@ def body(self, data, data_type, **kwargs): """ # Just in case this is a dict - internal_data_type = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type, None) + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) try: is_xml_model_serialization = kwargs["is_xml"] except KeyError: @@ -777,6 +803,8 @@ def serialize_data(self, data, data_type, **kwargs): raise ValueError("No value for given attribute") try: + if data is AzureCoreNull: + return None if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) @@ -1161,7 +1189,8 @@ def rest_key_extractor(attr, attr_desc, data): working_data = data while "." in key: - dict_keys = _FLATTEN.split(key) + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1242,7 +1271,7 @@ def _extract_name_from_internal_type(internal_type): xml_name = internal_type_xml_map.get("name", internal_type.__name__) xml_ns = internal_type_xml_map.get("ns", None) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) return xml_name @@ -1266,7 +1295,7 @@ def xml_key_extractor(attr, attr_desc, data): # Integrate namespace if necessary xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) # If it's an attribute, that's simple if xml_desc.get("attr", False): @@ -1332,7 +1361,7 @@ class Deserializer(object): valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1352,7 +1381,7 @@ def __init__(self, classes=None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1471,7 +1500,7 @@ def _classify_target(self, target, data): Once classification has been determined, initialize object. :param str target: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. """ if target is None: return None, None @@ -1486,7 +1515,7 @@ def _classify_target(self, target, data): target = target._classify(data, self.dependencies) except AttributeError: pass # Target is not a Model, no classify - return target, target.__class__.__name__ + return target, target.__class__.__name__ # type: ignore def failsafe_deserialize(self, target_obj, data, content_type=None): """Ignores any errors encountered in deserialization, @@ -1496,7 +1525,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): a deserialization error. :param str target_obj: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. """ try: diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_vendor.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_vendor.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_vendor.py @@ -5,6 +5,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import List, cast + from azure.core.pipeline.transport import HttpRequest @@ -22,6 +24,7 @@ def _format_url_section(template, **kwargs): try: return template.format(**kwargs) except KeyError as key: - formatted_components = template.split("/") + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_version.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_version.py index 653b73a4a199..e5754a47ce68 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_version.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/_configuration.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/_configuration.py index 96df943d8ab6..d62c3cb1cdc3 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/_configuration.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/_configuration.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -15,11 +14,6 @@ from .._version import VERSION -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -35,14 +29,14 @@ class DynatraceObservabilityMgmtClientConfiguration(Configuration): # pylint: d :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2021-09-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-04-27". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(DynatraceObservabilityMgmtClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", "2021-09-01") + api_version: str = kwargs.pop("api_version", "2023-04-27") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/_dynatrace_observability_mgmt_client.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/_dynatrace_observability_mgmt_client.py index aa1b99a05bfe..9db3107a3998 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/_dynatrace_observability_mgmt_client.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/_dynatrace_observability_mgmt_client.py @@ -39,7 +39,7 @@ class DynatraceObservabilityMgmtClient: # pylint: disable=client-accepts-api-ve :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2021-09-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-04-27". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -56,7 +56,7 @@ def __init__( self._config = DynatraceObservabilityMgmtClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -96,5 +96,5 @@ async def __aenter__(self) -> "DynatraceObservabilityMgmtClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/operations/_monitors_operations.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/operations/_monitors_operations.py index 4d9e9cb277f5..0b288e37823f 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/operations/_monitors_operations.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/operations/_monitors_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -34,7 +34,8 @@ from ...operations._monitors_operations import ( build_create_or_update_request, build_delete_request, - build_get_account_credentials_request, + build_get_marketplace_saa_s_resource_details_request, + build_get_metric_status_request, build_get_request, build_get_sso_details_request, build_get_vm_host_payload_request, @@ -47,10 +48,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,74 +71,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async - async def get_account_credentials( - self, resource_group_name: str, monitor_name: str, **kwargs: Any - ) -> _models.AccountInfoSecure: - """Gets the user account credentials for a Monitor. - - Gets the user account credentials for a Monitor. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param monitor_name: Monitor resource name. Required. - :type monitor_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountInfoSecure or the result of cls(response) - :rtype: ~azure.mgmt.dynatrace.models.AccountInfoSecure - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[_models.AccountInfoSecure] = kwargs.pop("cls", None) - - request = build_get_account_credentials_request( - resource_group_name=resource_group_name, - monitor_name=monitor_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get_account_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AccountInfoSecure", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_account_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/getAccountCredentials" - } - @distributed_trace def list_monitored_resources( self, resource_group_name: str, monitor_name: str, **kwargs: Any @@ -163,9 +92,7 @@ def list_monitored_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MonitoredResourceListResponse] = kwargs.pop("cls", None) error_map = { @@ -219,8 +146,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -268,9 +196,7 @@ async def get_vm_host_payload( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VMExtensionPayload] = kwargs.pop("cls", None) request = build_get_vm_host_payload_request( @@ -285,8 +211,9 @@ async def get_vm_host_payload( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -334,9 +261,7 @@ async def get(self, resource_group_name: str, monitor_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MonitorResource] = kwargs.pop("cls", None) request = build_get_request( @@ -351,8 +276,9 @@ async def get(self, resource_group_name: str, monitor_name: str, **kwargs: Any) request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -387,16 +313,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.MonitorResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(resource, (IO, bytes)): + if isinstance(resource, (IOBase, bytes)): _content = resource else: _json = self._serialize.body(resource, "MonitorResource") @@ -416,8 +340,9 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -531,7 +456,8 @@ async def begin_create_or_update( :type resource_group_name: str :param monitor_name: Monitor resource name. Required. :type monitor_name: str - :param resource: Resource create parameters. Is either a model type or a IO type. Required. + :param resource: Resource create parameters. Is either a MonitorResource type or a IO type. + Required. :type resource: ~azure.mgmt.dynatrace.models.MonitorResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -552,9 +478,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.MonitorResource] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -679,8 +603,8 @@ async def update( :type resource_group_name: str :param monitor_name: Monitor resource name. Required. :type monitor_name: str - :param resource: The resource properties to be updated. Is either a model type or a IO type. - Required. + :param resource: The resource properties to be updated. Is either a MonitorResourceUpdate type + or a IO type. Required. :type resource: ~azure.mgmt.dynatrace.models.MonitorResourceUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -701,16 +625,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.MonitorResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(resource, (IO, bytes)): + if isinstance(resource, (IOBase, bytes)): _content = resource else: _json = self._serialize.body(resource, "MonitorResourceUpdate") @@ -730,8 +652,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -766,9 +689,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -783,8 +704,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -827,9 +749,7 @@ async def begin_delete(self, resource_group_name: str, monitor_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -886,9 +806,7 @@ def list_by_subscription_id(self, **kwargs: Any) -> AsyncIterable["_models.Monit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MonitorResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -940,8 +858,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -977,9 +896,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MonitorResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -1032,8 +949,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1050,11 +968,125 @@ async def get_next(next_link=None): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors" } + @overload + async def get_marketplace_saa_s_resource_details( + self, + request: _models.MarketplaceSaaSResourceDetailsRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MarketplaceSaaSResourceDetailsResponse: + """Get Marketplace SaaS resource details of a tenant under a specific subscription. + + :param request: Tenant Id. Required. + :type request: ~azure.mgmt.dynatrace.models.MarketplaceSaaSResourceDetailsRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MarketplaceSaaSResourceDetailsResponse or the result of cls(response) + :rtype: ~azure.mgmt.dynatrace.models.MarketplaceSaaSResourceDetailsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def get_marketplace_saa_s_resource_details( + self, request: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.MarketplaceSaaSResourceDetailsResponse: + """Get Marketplace SaaS resource details of a tenant under a specific subscription. + + :param request: Tenant Id. Required. + :type request: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MarketplaceSaaSResourceDetailsResponse or the result of cls(response) + :rtype: ~azure.mgmt.dynatrace.models.MarketplaceSaaSResourceDetailsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def get_marketplace_saa_s_resource_details( + self, request: Union[_models.MarketplaceSaaSResourceDetailsRequest, IO], **kwargs: Any + ) -> _models.MarketplaceSaaSResourceDetailsResponse: + """Get Marketplace SaaS resource details of a tenant under a specific subscription. + + :param request: Tenant Id. Is either a MarketplaceSaaSResourceDetailsRequest type or a IO type. + Required. + :type request: ~azure.mgmt.dynatrace.models.MarketplaceSaaSResourceDetailsRequest or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MarketplaceSaaSResourceDetailsResponse or the result of cls(response) + :rtype: ~azure.mgmt.dynatrace.models.MarketplaceSaaSResourceDetailsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 404: lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MarketplaceSaaSResourceDetailsResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "MarketplaceSaaSResourceDetailsRequest") + + request = build_get_marketplace_saa_s_resource_details_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.get_marketplace_saa_s_resource_details.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MarketplaceSaaSResourceDetailsResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_marketplace_saa_s_resource_details.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Dynatrace.Observability/getMarketplaceSaaSResourceDetails" + } + @distributed_trace def list_hosts(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> AsyncIterable["_models.VMInfo"]: - """List the compute resources currently being monitored by the Dynatrace resource. + """List the VM/VMSS resources currently being monitored by the Dynatrace resource. - List the compute resources currently being monitored by the Dynatrace resource. + List the VM/VMSS resources currently being monitored by the Dynatrace resource. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1069,9 +1101,7 @@ def list_hosts(self, resource_group_name: str, monitor_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VMHostsListResponse] = kwargs.pop("cls", None) error_map = { @@ -1125,8 +1155,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1143,6 +1174,71 @@ async def get_next(next_link=None): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/listHosts" } + @distributed_trace_async + async def get_metric_status( + self, resource_group_name: str, monitor_name: str, **kwargs: Any + ) -> _models.MetricsStatusResponse: + """Get metric status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param monitor_name: Name of the Monitor resource. Required. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MetricsStatusResponse or the result of cls(response) + :rtype: ~azure.mgmt.dynatrace.models.MetricsStatusResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.MetricsStatusResponse] = kwargs.pop("cls", None) + + request = build_get_metric_status_request( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_metric_status.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MetricsStatusResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_metric_status.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/getMetricStatus" + } + @distributed_trace def list_app_services( self, resource_group_name: str, monitor_name: str, **kwargs: Any @@ -1164,9 +1260,7 @@ def list_app_services( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AppServiceListResponse] = kwargs.pop("cls", None) error_map = { @@ -1220,8 +1314,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1315,8 +1410,8 @@ async def get_sso_details( :type resource_group_name: str :param monitor_name: Monitor resource name. Required. :type monitor_name: str - :param request: The details of the get sso details request. Is either a model type or a IO - type. Default value is None. + :param request: The details of the get sso details request. Is either a SSODetailsRequest type + or a IO type. Default value is None. :type request: ~azure.mgmt.dynatrace.models.SSODetailsRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1337,16 +1432,14 @@ async def get_sso_details( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SSODetailsResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(request, (IO, bytes)): + if isinstance(request, (IOBase, bytes)): _content = request else: if request is not None: @@ -1369,8 +1462,9 @@ async def get_sso_details( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1472,8 +1566,8 @@ def list_linkable_environments( :type resource_group_name: str :param monitor_name: Monitor resource name. Required. :type monitor_name: str - :param request: The details of the linkable environment request. Is either a model type or a IO - type. Required. + :param request: The details of the linkable environment request. Is either a + LinkableEnvironmentRequest type or a IO type. Required. :type request: ~azure.mgmt.dynatrace.models.LinkableEnvironmentRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1488,9 +1582,7 @@ def list_linkable_environments( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkableEnvironmentListResponse] = kwargs.pop("cls", None) @@ -1504,7 +1596,7 @@ def list_linkable_environments( content_type = content_type or "application/json" _json = None _content = None - if isinstance(request, (IO, bytes)): + if isinstance(request, (IOBase, bytes)): _content = request else: _json = self._serialize.body(request, "LinkableEnvironmentRequest") @@ -1555,8 +1647,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/operations/_operations.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/operations/_operations.py index 8dcde1395102..269e031c7f9c 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/operations/_operations.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,9 +66,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -124,8 +117,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/operations/_single_sign_on_operations.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/operations/_single_sign_on_operations.py index b1b69cf73172..6e14e0c859d8 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/operations/_single_sign_on_operations.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/operations/_single_sign_on_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,10 +37,6 @@ build_list_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,16 +79,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DynatraceSingleSignOnResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(resource, (IO, bytes)): + if isinstance(resource, (IOBase, bytes)): _content = resource else: _json = self._serialize.body(resource, "DynatraceSingleSignOnResource") @@ -113,8 +107,9 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -243,7 +238,8 @@ async def begin_create_or_update( :type monitor_name: str :param configuration_name: Single Sign On Configuration Name. Required. :type configuration_name: str - :param resource: Resource create parameters. Is either a model type or a IO type. Required. + :param resource: Resource create parameters. Is either a DynatraceSingleSignOnResource type or + a IO type. Required. :type resource: ~azure.mgmt.dynatrace.models.DynatraceSingleSignOnResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -265,9 +261,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DynatraceSingleSignOnResource] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -347,9 +341,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DynatraceSingleSignOnResource] = kwargs.pop("cls", None) request = build_get_request( @@ -365,8 +357,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -410,9 +403,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DynatraceSingleSignOnResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -466,8 +457,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/operations/_tag_rules_operations.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/operations/_tag_rules_operations.py index 2f4ee06921d3..2c65bfae6336 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/operations/_tag_rules_operations.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/aio/operations/_tag_rules_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -36,13 +36,8 @@ build_delete_request, build_get_request, build_list_request, - build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,9 +92,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.TagRule] = kwargs.pop("cls", None) request = build_get_request( @@ -115,8 +108,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -156,16 +150,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(resource, (IO, bytes)): + if isinstance(resource, (IOBase, bytes)): _content = resource else: _json = self._serialize.body(resource, "TagRule") @@ -186,8 +178,9 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -314,7 +307,7 @@ async def begin_create_or_update( :type monitor_name: str :param rule_set_name: Monitor resource name. Required. :type rule_set_name: str - :param resource: Resource create parameters. Is either a model type or a IO type. Required. + :param resource: Resource create parameters. Is either a TagRule type or a IO type. Required. :type resource: ~azure.mgmt.dynatrace.models.TagRule or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -335,9 +328,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagRule] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -386,166 +377,6 @@ def get_long_running_output(pipeline_response): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/tagRules/{ruleSetName}" } - @overload - async def update( - self, - resource_group_name: str, - monitor_name: str, - rule_set_name: str, - resource: _models.TagRuleUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TagRule: - """Update a TagRule. - - Update a TagRule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param monitor_name: Monitor resource name. Required. - :type monitor_name: str - :param rule_set_name: Monitor resource name. Required. - :type rule_set_name: str - :param resource: The resource properties to be updated. Required. - :type resource: ~azure.mgmt.dynatrace.models.TagRuleUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: TagRule or the result of cls(response) - :rtype: ~azure.mgmt.dynatrace.models.TagRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - monitor_name: str, - rule_set_name: str, - resource: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TagRule: - """Update a TagRule. - - Update a TagRule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param monitor_name: Monitor resource name. Required. - :type monitor_name: str - :param rule_set_name: Monitor resource name. Required. - :type rule_set_name: str - :param resource: The resource properties to be updated. Required. - :type resource: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: TagRule or the result of cls(response) - :rtype: ~azure.mgmt.dynatrace.models.TagRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - monitor_name: str, - rule_set_name: str, - resource: Union[_models.TagRuleUpdate, IO], - **kwargs: Any - ) -> _models.TagRule: - """Update a TagRule. - - Update a TagRule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param monitor_name: Monitor resource name. Required. - :type monitor_name: str - :param rule_set_name: Monitor resource name. Required. - :type rule_set_name: str - :param resource: The resource properties to be updated. Is either a model type or a IO type. - Required. - :type resource: ~azure.mgmt.dynatrace.models.TagRuleUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: TagRule or the result of cls(response) - :rtype: ~azure.mgmt.dynatrace.models.TagRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TagRule] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IO, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "TagRuleUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - monitor_name=monitor_name, - rule_set_name=rule_set_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.update.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TagRule", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/tagRules/{ruleSetName}" - } - async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, monitor_name: str, rule_set_name: str, **kwargs: Any ) -> None: @@ -560,9 +391,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -578,8 +407,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -626,9 +456,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -691,9 +519,7 @@ def list(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> As _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.TagRuleListResult] = kwargs.pop("cls", None) error_map = { @@ -747,8 +573,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/models/__init__.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/models/__init__.py index d2bd61a01756..05e6d5dfa99e 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/models/__init__.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/models/__init__.py @@ -7,7 +7,6 @@ # -------------------------------------------------------------------------- from ._models_py3 import AccountInfo -from ._models_py3 import AccountInfoSecure from ._models_py3 import AppServiceInfo from ._models_py3 import AppServiceListResponse from ._models_py3 import DynatraceEnvironmentProperties @@ -24,7 +23,10 @@ from ._models_py3 import LinkableEnvironmentRequest from ._models_py3 import LinkableEnvironmentResponse from ._models_py3 import LogRules +from ._models_py3 import MarketplaceSaaSResourceDetailsRequest +from ._models_py3 import MarketplaceSaaSResourceDetailsResponse from ._models_py3 import MetricRules +from ._models_py3 import MetricsStatusResponse from ._models_py3 import MonitorResource from ._models_py3 import MonitorResourceListResult from ._models_py3 import MonitorResourceUpdate @@ -41,7 +43,6 @@ from ._models_py3 import SystemData from ._models_py3 import TagRule from ._models_py3 import TagRuleListResult -from ._models_py3 import TagRuleUpdate from ._models_py3 import TrackedResource from ._models_py3 import UserAssignedIdentity from ._models_py3 import UserInfo @@ -76,7 +77,6 @@ __all__ = [ "AccountInfo", - "AccountInfoSecure", "AppServiceInfo", "AppServiceListResponse", "DynatraceEnvironmentProperties", @@ -93,7 +93,10 @@ "LinkableEnvironmentRequest", "LinkableEnvironmentResponse", "LogRules", + "MarketplaceSaaSResourceDetailsRequest", + "MarketplaceSaaSResourceDetailsResponse", "MetricRules", + "MetricsStatusResponse", "MonitorResource", "MonitorResourceListResult", "MonitorResourceUpdate", @@ -110,7 +113,6 @@ "SystemData", "TagRule", "TagRuleListResult", - "TagRuleUpdate", "TrackedResource", "UserAssignedIdentity", "UserInfo", diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/models/_models_py3.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/models/_models_py3.py index 67ffea937008..252ad2f658a4 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/models/_models_py3.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/models/_models_py3.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from .. import _serialization @@ -31,7 +31,7 @@ class AccountInfo(_serialization.Model): "region_id": {"key": "regionId", "type": "str"}, } - def __init__(self, *, account_id: Optional[str] = None, region_id: Optional[str] = None, **kwargs): + def __init__(self, *, account_id: Optional[str] = None, region_id: Optional[str] = None, **kwargs: Any) -> None: """ :keyword account_id: Account Id of the account this environment is linked to. :paramtype account_id: str @@ -43,39 +43,6 @@ def __init__(self, *, account_id: Optional[str] = None, region_id: Optional[str] self.region_id = region_id -class AccountInfoSecure(_serialization.Model): - """Dynatrace account API Key. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar account_id: Account Id of the account this environment is linked to. - :vartype account_id: str - :ivar api_key: API Key of the user account. - :vartype api_key: str - :ivar region_id: Region in which the account is created. - :vartype region_id: str - """ - - _validation = { - "account_id": {"readonly": True}, - "api_key": {"readonly": True}, - "region_id": {"readonly": True}, - } - - _attribute_map = { - "account_id": {"key": "accountId", "type": "str"}, - "api_key": {"key": "apiKey", "type": "str"}, - "region_id": {"key": "regionId", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super().__init__(**kwargs) - self.account_id = None - self.api_key = None - self.region_id = None - - class AppServiceInfo(_serialization.Model): """Details of App Services having Dynatrace OneAgent installed. @@ -130,8 +97,8 @@ def __init__( log_module: Optional[Union[str, "_models.LogModule"]] = None, host_group: Optional[str] = None, host_name: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword resource_id: App service resource ID. :paramtype resource_id: str @@ -186,8 +153,8 @@ class AppServiceListResponse(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.AppServiceInfo"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, *, value: Optional[List["_models.AppServiceInfo"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: The items on this page. :paramtype value: list[~azure.mgmt.dynatrace.models.AppServiceInfo] @@ -227,8 +194,8 @@ def __init__( account_info: Optional["_models.AccountInfo"] = None, environment_info: Optional["_models.EnvironmentInfo"] = None, single_sign_on_properties: Optional["_models.DynatraceSingleSignOnProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword user_id: User id. :paramtype user_id: str @@ -286,8 +253,8 @@ def __init__( enterprise_app_id: Optional[str] = None, single_sign_on_url: Optional[str] = None, aad_domains: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword single_sign_on_state: State of Single Sign On. Known values are: "Initial", "Enable", "Disable", and "Existing". @@ -334,7 +301,7 @@ class Resource(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -343,7 +310,8 @@ def __init__(self, **kwargs): class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. Variables are only populated by the server, and will be ignored when sending a request. @@ -369,7 +337,7 @@ class ProxyResource(Resource): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) @@ -431,8 +399,8 @@ def __init__( enterprise_app_id: Optional[str] = None, single_sign_on_url: Optional[str] = None, aad_domains: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword single_sign_on_state: State of Single Sign On. Known values are: "Initial", "Enable", "Disable", and "Existing". @@ -474,8 +442,8 @@ class DynatraceSingleSignOnResourceListResult(_serialization.Model): } def __init__( - self, *, value: List["_models.DynatraceSingleSignOnResource"], next_link: Optional[str] = None, **kwargs - ): + self, *, value: List["_models.DynatraceSingleSignOnResource"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: The items on this page. Required. :paramtype value: list[~azure.mgmt.dynatrace.models.DynatraceSingleSignOnResource] @@ -514,8 +482,8 @@ def __init__( ingestion_key: Optional[str] = None, logs_ingestion_endpoint: Optional[str] = None, landing_url: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword environment_id: Id of the environment created. :paramtype environment_id: str @@ -554,7 +522,7 @@ class ErrorAdditionalInfo(_serialization.Model): "info": {"key": "info", "type": "object"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.type = None @@ -594,7 +562,7 @@ class ErrorDetail(_serialization.Model): "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -605,7 +573,8 @@ def __init__(self, **kwargs): class ErrorResponse(_serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). :ivar error: The error object. :vartype error: ~azure.mgmt.dynatrace.models.ErrorDetail @@ -615,7 +584,7 @@ class ErrorResponse(_serialization.Model): "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: """ :keyword error: The error object. :paramtype error: ~azure.mgmt.dynatrace.models.ErrorDetail @@ -625,7 +594,8 @@ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs): class FilteringTag(_serialization.Model): - """The definition of a filtering tag. Filtering tags are used for capturing resources and include/exclude them from being monitored. + """The definition of a filtering tag. Filtering tags are used for capturing resources and + include/exclude them from being monitored. :ivar name: The name (also known as the key) of the tag. :vartype name: str @@ -648,8 +618,8 @@ def __init__( name: Optional[str] = None, value: Optional[str] = None, action: Optional[Union[str, "_models.TagAction"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The name (also known as the key) of the tag. :paramtype name: str @@ -701,8 +671,8 @@ def __init__( *, type: Union[str, "_models.ManagedIdentityType"], user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: The type of managed identity assigned to this resource. Required. Known values are: "SystemAssigned", "UserAssigned", and "SystemAndUserAssigned". @@ -737,8 +707,8 @@ def __init__( *, value: Optional[List["_models.LinkableEnvironmentResponse"]] = None, next_link: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword value: List of environments for which user is an admin. :paramtype value: list[~azure.mgmt.dynatrace.models.LinkableEnvironmentResponse] @@ -753,34 +723,35 @@ def __init__( class LinkableEnvironmentRequest(_serialization.Model): """Request for getting all the linkable environments for a user. - :ivar tenant_id: Tenant Id of the user in which they want to link the environment. + All required parameters must be populated in order to send to Azure. + + :ivar tenant_id: Tenant Id of the user in which they want to link the environment. Required. :vartype tenant_id: str - :ivar user_principal: user principal id of the user. + :ivar user_principal: user principal id of the user. Required. :vartype user_principal: str - :ivar region: Azure region in which we want to link the environment. + :ivar region: Azure region in which we want to link the environment. Required. :vartype region: str """ + _validation = { + "tenant_id": {"required": True}, + "user_principal": {"required": True}, + "region": {"required": True}, + } + _attribute_map = { "tenant_id": {"key": "tenantId", "type": "str"}, "user_principal": {"key": "userPrincipal", "type": "str"}, "region": {"key": "region", "type": "str"}, } - def __init__( - self, - *, - tenant_id: Optional[str] = None, - user_principal: Optional[str] = None, - region: Optional[str] = None, - **kwargs - ): + def __init__(self, *, tenant_id: str, user_principal: str, region: str, **kwargs: Any) -> None: """ - :keyword tenant_id: Tenant Id of the user in which they want to link the environment. + :keyword tenant_id: Tenant Id of the user in which they want to link the environment. Required. :paramtype tenant_id: str - :keyword user_principal: user principal id of the user. + :keyword user_principal: user principal id of the user. Required. :paramtype user_principal: str - :keyword region: Azure region in which we want to link the environment. + :keyword region: Azure region in which we want to link the environment. Required. :paramtype region: str """ super().__init__(**kwargs) @@ -812,8 +783,8 @@ def __init__( environment_id: Optional[str] = None, environment_name: Optional[str] = None, plan_data: Optional["_models.PlanData"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword environment_id: environment id for which user is an admin. :paramtype environment_id: str @@ -862,8 +833,8 @@ def __init__( send_subscription_logs: Optional[Union[str, "_models.SendSubscriptionLogsStatus"]] = None, send_activity_logs: Optional[Union[str, "_models.SendActivityLogsStatus"]] = None, filtering_tags: Optional[List["_models.FilteringTag"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword send_aad_logs: Flag specifying if AAD logs should be sent for the Monitor resource. Known values are: "Enabled" and "Disabled". @@ -889,9 +860,81 @@ def __init__( self.filtering_tags = filtering_tags +class MarketplaceSaaSResourceDetailsRequest(_serialization.Model): + """Request for getting Marketplace SaaS resource details for a tenant Id. + + All required parameters must be populated in order to send to Azure. + + :ivar tenant_id: Tenant Id. Required. + :vartype tenant_id: str + """ + + _validation = { + "tenant_id": {"required": True}, + } + + _attribute_map = { + "tenant_id": {"key": "tenantId", "type": "str"}, + } + + def __init__(self, *, tenant_id: str, **kwargs: Any) -> None: + """ + :keyword tenant_id: Tenant Id. Required. + :paramtype tenant_id: str + """ + super().__init__(**kwargs) + self.tenant_id = tenant_id + + +class MarketplaceSaaSResourceDetailsResponse(_serialization.Model): + """Marketplace SaaS resource details linked to the given tenant Id. + + :ivar marketplace_saa_s_resource_id: Id of the Marketplace SaaS Resource. + :vartype marketplace_saa_s_resource_id: str + :ivar plan_id: Id of the plan. + :vartype plan_id: str + :ivar marketplace_subscription_status: Marketplace subscription status. Known values are: + "Active" and "Suspended". + :vartype marketplace_subscription_status: str or + ~azure.mgmt.dynatrace.models.MarketplaceSubscriptionStatus + """ + + _attribute_map = { + "marketplace_saa_s_resource_id": {"key": "marketplaceSaaSResourceId", "type": "str"}, + "plan_id": {"key": "planId", "type": "str"}, + "marketplace_subscription_status": {"key": "marketplaceSubscriptionStatus", "type": "str"}, + } + + def __init__( + self, + *, + marketplace_saa_s_resource_id: Optional[str] = None, + plan_id: Optional[str] = None, + marketplace_subscription_status: Optional[Union[str, "_models.MarketplaceSubscriptionStatus"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword marketplace_saa_s_resource_id: Id of the Marketplace SaaS Resource. + :paramtype marketplace_saa_s_resource_id: str + :keyword plan_id: Id of the plan. + :paramtype plan_id: str + :keyword marketplace_subscription_status: Marketplace subscription status. Known values are: + "Active" and "Suspended". + :paramtype marketplace_subscription_status: str or + ~azure.mgmt.dynatrace.models.MarketplaceSubscriptionStatus + """ + super().__init__(**kwargs) + self.marketplace_saa_s_resource_id = marketplace_saa_s_resource_id + self.plan_id = plan_id + self.marketplace_subscription_status = marketplace_subscription_status + + class MetricRules(_serialization.Model): """Set of rules for sending metrics for the Monitor resource. + :ivar sending_metrics: Flag specifying if metrics from Azure resources should be sent for the + Monitor resource. Known values are: "Enabled" and "Disabled". + :vartype sending_metrics: str or ~azure.mgmt.dynatrace.models.SendingMetricsStatus :ivar filtering_tags: List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include @@ -900,11 +943,21 @@ class MetricRules(_serialization.Model): """ _attribute_map = { + "sending_metrics": {"key": "sendingMetrics", "type": "str"}, "filtering_tags": {"key": "filteringTags", "type": "[FilteringTag]"}, } - def __init__(self, *, filtering_tags: Optional[List["_models.FilteringTag"]] = None, **kwargs): + def __init__( + self, + *, + sending_metrics: Optional[Union[str, "_models.SendingMetricsStatus"]] = None, + filtering_tags: Optional[List["_models.FilteringTag"]] = None, + **kwargs: Any + ) -> None: """ + :keyword sending_metrics: Flag specifying if metrics from Azure resources should be sent for + the Monitor resource. Known values are: "Enabled" and "Disabled". + :paramtype sending_metrics: str or ~azure.mgmt.dynatrace.models.SendingMetricsStatus :keyword filtering_tags: List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include @@ -912,9 +965,30 @@ def __init__(self, *, filtering_tags: Optional[List["_models.FilteringTag"]] = N :paramtype filtering_tags: list[~azure.mgmt.dynatrace.models.FilteringTag] """ super().__init__(**kwargs) + self.sending_metrics = sending_metrics self.filtering_tags = filtering_tags +class MetricsStatusResponse(_serialization.Model): + """Response of get metrics status operation. + + :ivar azure_resource_ids: Azure resource IDs. + :vartype azure_resource_ids: list[str] + """ + + _attribute_map = { + "azure_resource_ids": {"key": "azureResourceIds", "type": "[str]"}, + } + + def __init__(self, *, azure_resource_ids: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword azure_resource_ids: Azure resource IDs. + :paramtype azure_resource_ids: list[str] + """ + super().__init__(**kwargs) + self.azure_resource_ids = azure_resource_ids + + class MonitoredResource(_serialization.Model): """Details of resource being monitored by Dynatrace monitor resource. @@ -950,8 +1024,8 @@ def __init__( reason_for_metrics_status: Optional[str] = None, sending_logs: Optional[Union[str, "_models.SendingLogsStatus"]] = None, reason_for_logs_status: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: The ARM id of the resource. :paramtype id: str @@ -991,8 +1065,12 @@ class MonitoredResourceListResponse(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.MonitoredResource"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, + *, + value: Optional[List["_models.MonitoredResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword value: The items on this page. :paramtype value: list[~azure.mgmt.dynatrace.models.MonitoredResource] @@ -1005,7 +1083,8 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. Variables are only populated by the server, and will be ignored when sending a request. @@ -1040,7 +1119,7 @@ class TrackedResource(Resource): "location": {"key": "location", "type": "str"}, } - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -1142,8 +1221,8 @@ def __init__( dynatrace_environment_properties: Optional["_models.DynatraceEnvironmentProperties"] = None, user_info: Optional["_models.UserInfo"] = None, plan_data: Optional["_models.PlanData"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -1198,7 +1277,9 @@ class MonitorResourceListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: List["_models.MonitorResource"], next_link: Optional[str] = None, **kwargs): + def __init__( + self, *, value: List["_models.MonitorResource"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: The items on this page. Required. :paramtype value: list[~azure.mgmt.dynatrace.models.MonitorResource] @@ -1215,68 +1296,19 @@ class MonitorResourceUpdate(_serialization.Model): :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar monitoring_status: Status of the monitor. Known values are: "Enabled" and "Disabled". - :vartype monitoring_status: str or ~azure.mgmt.dynatrace.models.MonitoringStatus - :ivar marketplace_subscription_status: Marketplace subscription status. Known values are: - "Active" and "Suspended". - :vartype marketplace_subscription_status: str or - ~azure.mgmt.dynatrace.models.MarketplaceSubscriptionStatus - :ivar dynatrace_environment_properties: Properties of the Dynatrace environment. - :vartype dynatrace_environment_properties: - ~azure.mgmt.dynatrace.models.DynatraceEnvironmentProperties - :ivar user_info: User info. - :vartype user_info: ~azure.mgmt.dynatrace.models.UserInfo - :ivar plan_data: Billing plan information. - :vartype plan_data: ~azure.mgmt.dynatrace.models.PlanData """ _attribute_map = { "tags": {"key": "tags", "type": "{str}"}, - "monitoring_status": {"key": "monitoringStatus", "type": "str"}, - "marketplace_subscription_status": {"key": "marketplaceSubscriptionStatus", "type": "str"}, - "dynatrace_environment_properties": { - "key": "dynatraceEnvironmentProperties", - "type": "DynatraceEnvironmentProperties", - }, - "user_info": {"key": "userInfo", "type": "UserInfo"}, - "plan_data": {"key": "planData", "type": "PlanData"}, } - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - monitoring_status: Optional[Union[str, "_models.MonitoringStatus"]] = None, - marketplace_subscription_status: Optional[Union[str, "_models.MarketplaceSubscriptionStatus"]] = None, - dynatrace_environment_properties: Optional["_models.DynatraceEnvironmentProperties"] = None, - user_info: Optional["_models.UserInfo"] = None, - plan_data: Optional["_models.PlanData"] = None, - **kwargs - ): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] - :keyword monitoring_status: Status of the monitor. Known values are: "Enabled" and "Disabled". - :paramtype monitoring_status: str or ~azure.mgmt.dynatrace.models.MonitoringStatus - :keyword marketplace_subscription_status: Marketplace subscription status. Known values are: - "Active" and "Suspended". - :paramtype marketplace_subscription_status: str or - ~azure.mgmt.dynatrace.models.MarketplaceSubscriptionStatus - :keyword dynatrace_environment_properties: Properties of the Dynatrace environment. - :paramtype dynatrace_environment_properties: - ~azure.mgmt.dynatrace.models.DynatraceEnvironmentProperties - :keyword user_info: User info. - :paramtype user_info: ~azure.mgmt.dynatrace.models.UserInfo - :keyword plan_data: Billing plan information. - :paramtype plan_data: ~azure.mgmt.dynatrace.models.PlanData """ super().__init__(**kwargs) self.tags = tags - self.monitoring_status = monitoring_status - self.marketplace_subscription_status = marketplace_subscription_status - self.dynatrace_environment_properties = dynatrace_environment_properties - self.user_info = user_info - self.plan_data = plan_data class Operation(_serialization.Model): @@ -1316,7 +1348,7 @@ class Operation(_serialization.Model): "action_type": {"key": "actionType", "type": "str"}, } - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs): + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: """ :keyword display: Localized display information for this particular operation. :paramtype display: ~azure.mgmt.dynatrace.models.OperationDisplay @@ -1362,7 +1394,7 @@ class OperationDisplay(_serialization.Model): "description": {"key": "description", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.provider = None @@ -1372,7 +1404,8 @@ def __init__(self, **kwargs): class OperationListResult(_serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link + to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. @@ -1392,7 +1425,7 @@ class OperationListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1426,8 +1459,8 @@ def __init__( billing_cycle: Optional[str] = None, plan_details: Optional[str] = None, effective_date: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword usage_type: different usage type like PAYG/COMMITTED. this could be enum. :paramtype usage_type: str @@ -1448,17 +1481,23 @@ def __init__( class SSODetailsRequest(_serialization.Model): """Request for getting sso details for a user. - :ivar user_principal: user principal id of the user. + All required parameters must be populated in order to send to Azure. + + :ivar user_principal: user principal id of the user. Required. :vartype user_principal: str """ + _validation = { + "user_principal": {"required": True}, + } + _attribute_map = { "user_principal": {"key": "userPrincipal", "type": "str"}, } - def __init__(self, *, user_principal: Optional[str] = None, **kwargs): + def __init__(self, *, user_principal: str, **kwargs: Any) -> None: """ - :keyword user_principal: user principal id of the user. + :keyword user_principal: user principal id of the user. Required. :paramtype user_principal: str """ super().__init__(**kwargs) @@ -1497,8 +1536,8 @@ def __init__( single_sign_on_url: Optional[str] = None, aad_domains: Optional[List[str]] = None, admin_users: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword is_sso_enabled: Whether the SSO is enabled for this resource or not. Known values are: "Enabled" and "Disabled". @@ -1557,8 +1596,8 @@ def __init__( last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -1632,8 +1671,8 @@ def __init__( *, log_rules: Optional["_models.LogRules"] = None, metric_rules: Optional["_models.MetricRules"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword log_rules: Set of rules for sending logs for the Monitor resource. :paramtype log_rules: ~azure.mgmt.dynatrace.models.LogRules @@ -1667,7 +1706,7 @@ class TagRuleListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: List["_models.TagRule"], next_link: Optional[str] = None, **kwargs): + def __init__(self, *, value: List["_models.TagRule"], next_link: Optional[str] = None, **kwargs: Any) -> None: """ :keyword value: The items on this page. Required. :paramtype value: list[~azure.mgmt.dynatrace.models.TagRule] @@ -1679,38 +1718,6 @@ def __init__(self, *, value: List["_models.TagRule"], next_link: Optional[str] = self.next_link = next_link -class TagRuleUpdate(_serialization.Model): - """The updatable properties of the TagRule. - - :ivar log_rules: Set of rules for sending logs for the Monitor resource. - :vartype log_rules: ~azure.mgmt.dynatrace.models.LogRules - :ivar metric_rules: Set of rules for sending metrics for the Monitor resource. - :vartype metric_rules: ~azure.mgmt.dynatrace.models.MetricRules - """ - - _attribute_map = { - "log_rules": {"key": "logRules", "type": "LogRules"}, - "metric_rules": {"key": "metricRules", "type": "MetricRules"}, - } - - def __init__( - self, - *, - log_rules: Optional["_models.LogRules"] = None, - metric_rules: Optional["_models.MetricRules"] = None, - **kwargs - ): - """ - :keyword log_rules: Set of rules for sending logs for the Monitor resource. - :paramtype log_rules: ~azure.mgmt.dynatrace.models.LogRules - :keyword metric_rules: Set of rules for sending metrics for the Monitor resource. - :paramtype metric_rules: ~azure.mgmt.dynatrace.models.MetricRules - """ - super().__init__(**kwargs) - self.log_rules = log_rules - self.metric_rules = metric_rules - - class UserAssignedIdentity(_serialization.Model): """A managed identity assigned by the user. @@ -1732,7 +1739,7 @@ class UserAssignedIdentity(_serialization.Model): "principal_id": {"key": "principalId", "type": "str"}, } - def __init__(self, *, client_id: str, principal_id: str, **kwargs): + def __init__(self, *, client_id: str, principal_id: str, **kwargs: Any) -> None: """ :keyword client_id: The active directory client identifier for this principal. Required. :paramtype client_id: str @@ -1780,8 +1787,8 @@ def __init__( email_address: Optional[str] = None, phone_number: Optional[str] = None, country: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword first_name: First Name of the user. :paramtype first_name: str @@ -1817,7 +1824,9 @@ class VMExtensionPayload(_serialization.Model): "environment_id": {"key": "environmentId", "type": "str"}, } - def __init__(self, *, ingestion_key: Optional[str] = None, environment_id: Optional[str] = None, **kwargs): + def __init__( + self, *, ingestion_key: Optional[str] = None, environment_id: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword ingestion_key: Ingestion key of the environment. :paramtype ingestion_key: str @@ -1843,7 +1852,9 @@ class VMHostsListResponse(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.VMInfo"]] = None, next_link: Optional[str] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.VMInfo"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: The items on this page. :paramtype value: list[~azure.mgmt.dynatrace.models.VMInfo] @@ -1909,8 +1920,8 @@ def __init__( log_module: Optional[Union[str, "_models.LogModule"]] = None, host_group: Optional[str] = None, host_name: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword resource_id: Azure VM resource ID. :paramtype resource_id: str diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/operations/_monitors_operations.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/operations/_monitors_operations.py index 7a68e7c1ecfa..294206b2bf7f 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/operations/_monitors_operations.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/operations/_monitors_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -32,10 +32,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,46 +39,13 @@ _SERIALIZER.client_side_validation = False -def build_get_account_credentials_request( - resource_group_name: str, monitor_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/getAccountCredentials", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - def build_list_monitored_resources_request( resource_group_name: str, monitor_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,7 +78,7 @@ def build_get_vm_host_payload_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +109,7 @@ def build_get_request(resource_group_name: str, monitor_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +142,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -215,7 +178,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -251,7 +214,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +245,7 @@ def build_list_by_subscription_id_request(subscription_id: str, **kwargs: Any) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -306,7 +269,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -332,13 +295,43 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_get_marketplace_saa_s_resource_details_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Dynatrace.Observability/getMarketplaceSaaSResourceDetails", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_list_hosts_request( resource_group_name: str, monitor_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -365,13 +358,46 @@ def build_list_hosts_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_get_metric_status_request( + resource_group_name: str, monitor_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/getMetricStatus", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_list_app_services_request( resource_group_name: str, monitor_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -404,7 +430,7 @@ def build_get_sso_details_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -440,7 +466,7 @@ def build_list_linkable_environments_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -489,74 +515,6 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def get_account_credentials( - self, resource_group_name: str, monitor_name: str, **kwargs: Any - ) -> _models.AccountInfoSecure: - """Gets the user account credentials for a Monitor. - - Gets the user account credentials for a Monitor. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param monitor_name: Monitor resource name. Required. - :type monitor_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountInfoSecure or the result of cls(response) - :rtype: ~azure.mgmt.dynatrace.models.AccountInfoSecure - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[_models.AccountInfoSecure] = kwargs.pop("cls", None) - - request = build_get_account_credentials_request( - resource_group_name=resource_group_name, - monitor_name=monitor_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get_account_credentials.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AccountInfoSecure", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_account_credentials.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/getAccountCredentials" - } - @distributed_trace def list_monitored_resources( self, resource_group_name: str, monitor_name: str, **kwargs: Any @@ -578,9 +536,7 @@ def list_monitored_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MonitoredResourceListResponse] = kwargs.pop("cls", None) error_map = { @@ -634,8 +590,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -683,9 +640,7 @@ def get_vm_host_payload( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VMExtensionPayload] = kwargs.pop("cls", None) request = build_get_vm_host_payload_request( @@ -700,8 +655,9 @@ def get_vm_host_payload( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -749,9 +705,7 @@ def get(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MonitorResource] = kwargs.pop("cls", None) request = build_get_request( @@ -766,8 +720,9 @@ def get(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> _mo request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -802,16 +757,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.MonitorResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(resource, (IO, bytes)): + if isinstance(resource, (IOBase, bytes)): _content = resource else: _json = self._serialize.body(resource, "MonitorResource") @@ -831,8 +784,9 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -946,7 +900,8 @@ def begin_create_or_update( :type resource_group_name: str :param monitor_name: Monitor resource name. Required. :type monitor_name: str - :param resource: Resource create parameters. Is either a model type or a IO type. Required. + :param resource: Resource create parameters. Is either a MonitorResource type or a IO type. + Required. :type resource: ~azure.mgmt.dynatrace.models.MonitorResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -967,9 +922,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.MonitorResource] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1093,8 +1046,8 @@ def update( :type resource_group_name: str :param monitor_name: Monitor resource name. Required. :type monitor_name: str - :param resource: The resource properties to be updated. Is either a model type or a IO type. - Required. + :param resource: The resource properties to be updated. Is either a MonitorResourceUpdate type + or a IO type. Required. :type resource: ~azure.mgmt.dynatrace.models.MonitorResourceUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1115,16 +1068,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.MonitorResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(resource, (IO, bytes)): + if isinstance(resource, (IOBase, bytes)): _content = resource else: _json = self._serialize.body(resource, "MonitorResourceUpdate") @@ -1144,8 +1095,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1180,9 +1132,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -1197,8 +1147,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1241,9 +1192,7 @@ def begin_delete(self, resource_group_name: str, monitor_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1299,9 +1248,7 @@ def list_by_subscription_id(self, **kwargs: Any) -> Iterable["_models.MonitorRes _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MonitorResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -1353,8 +1300,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1388,9 +1336,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MonitorResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -1443,8 +1389,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1461,11 +1408,125 @@ def get_next(next_link=None): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors" } + @overload + def get_marketplace_saa_s_resource_details( + self, + request: _models.MarketplaceSaaSResourceDetailsRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MarketplaceSaaSResourceDetailsResponse: + """Get Marketplace SaaS resource details of a tenant under a specific subscription. + + :param request: Tenant Id. Required. + :type request: ~azure.mgmt.dynatrace.models.MarketplaceSaaSResourceDetailsRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MarketplaceSaaSResourceDetailsResponse or the result of cls(response) + :rtype: ~azure.mgmt.dynatrace.models.MarketplaceSaaSResourceDetailsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def get_marketplace_saa_s_resource_details( + self, request: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.MarketplaceSaaSResourceDetailsResponse: + """Get Marketplace SaaS resource details of a tenant under a specific subscription. + + :param request: Tenant Id. Required. + :type request: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MarketplaceSaaSResourceDetailsResponse or the result of cls(response) + :rtype: ~azure.mgmt.dynatrace.models.MarketplaceSaaSResourceDetailsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def get_marketplace_saa_s_resource_details( + self, request: Union[_models.MarketplaceSaaSResourceDetailsRequest, IO], **kwargs: Any + ) -> _models.MarketplaceSaaSResourceDetailsResponse: + """Get Marketplace SaaS resource details of a tenant under a specific subscription. + + :param request: Tenant Id. Is either a MarketplaceSaaSResourceDetailsRequest type or a IO type. + Required. + :type request: ~azure.mgmt.dynatrace.models.MarketplaceSaaSResourceDetailsRequest or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MarketplaceSaaSResourceDetailsResponse or the result of cls(response) + :rtype: ~azure.mgmt.dynatrace.models.MarketplaceSaaSResourceDetailsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 404: lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MarketplaceSaaSResourceDetailsResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = self._serialize.body(request, "MarketplaceSaaSResourceDetailsRequest") + + request = build_get_marketplace_saa_s_resource_details_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.get_marketplace_saa_s_resource_details.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MarketplaceSaaSResourceDetailsResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_marketplace_saa_s_resource_details.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Dynatrace.Observability/getMarketplaceSaaSResourceDetails" + } + @distributed_trace def list_hosts(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> Iterable["_models.VMInfo"]: - """List the compute resources currently being monitored by the Dynatrace resource. + """List the VM/VMSS resources currently being monitored by the Dynatrace resource. - List the compute resources currently being monitored by the Dynatrace resource. + List the VM/VMSS resources currently being monitored by the Dynatrace resource. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1480,9 +1541,7 @@ def list_hosts(self, resource_group_name: str, monitor_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VMHostsListResponse] = kwargs.pop("cls", None) error_map = { @@ -1536,8 +1595,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1554,6 +1614,71 @@ def get_next(next_link=None): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/listHosts" } + @distributed_trace + def get_metric_status( + self, resource_group_name: str, monitor_name: str, **kwargs: Any + ) -> _models.MetricsStatusResponse: + """Get metric status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param monitor_name: Name of the Monitor resource. Required. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MetricsStatusResponse or the result of cls(response) + :rtype: ~azure.mgmt.dynatrace.models.MetricsStatusResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.MetricsStatusResponse] = kwargs.pop("cls", None) + + request = build_get_metric_status_request( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_metric_status.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MetricsStatusResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_metric_status.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/getMetricStatus" + } + @distributed_trace def list_app_services( self, resource_group_name: str, monitor_name: str, **kwargs: Any @@ -1575,9 +1700,7 @@ def list_app_services( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AppServiceListResponse] = kwargs.pop("cls", None) error_map = { @@ -1631,8 +1754,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1726,8 +1850,8 @@ def get_sso_details( :type resource_group_name: str :param monitor_name: Monitor resource name. Required. :type monitor_name: str - :param request: The details of the get sso details request. Is either a model type or a IO - type. Default value is None. + :param request: The details of the get sso details request. Is either a SSODetailsRequest type + or a IO type. Default value is None. :type request: ~azure.mgmt.dynatrace.models.SSODetailsRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1748,16 +1872,14 @@ def get_sso_details( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SSODetailsResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(request, (IO, bytes)): + if isinstance(request, (IOBase, bytes)): _content = request else: if request is not None: @@ -1780,8 +1902,9 @@ def get_sso_details( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1881,8 +2004,8 @@ def list_linkable_environments( :type resource_group_name: str :param monitor_name: Monitor resource name. Required. :type monitor_name: str - :param request: The details of the linkable environment request. Is either a model type or a IO - type. Required. + :param request: The details of the linkable environment request. Is either a + LinkableEnvironmentRequest type or a IO type. Required. :type request: ~azure.mgmt.dynatrace.models.LinkableEnvironmentRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1896,9 +2019,7 @@ def list_linkable_environments( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkableEnvironmentListResponse] = kwargs.pop("cls", None) @@ -1912,7 +2033,7 @@ def list_linkable_environments( content_type = content_type or "application/json" _json = None _content = None - if isinstance(request, (IO, bytes)): + if isinstance(request, (IOBase, bytes)): _content = request else: _json = self._serialize.body(request, "LinkableEnvironmentRequest") @@ -1963,8 +2084,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/operations/_operations.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/operations/_operations.py index 09728109259f..c2ad38cf3377 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/operations/_operations.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,9 +88,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -146,8 +139,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/operations/_single_sign_on_operations.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/operations/_single_sign_on_operations.py index 83d90f1e61aa..5b6642d4408d 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/operations/_single_sign_on_operations.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/operations/_single_sign_on_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -32,10 +32,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +45,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -86,7 +82,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,7 +114,7 @@ def build_list_request(resource_group_name: str, monitor_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,16 +179,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DynatraceSingleSignOnResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(resource, (IO, bytes)): + if isinstance(resource, (IOBase, bytes)): _content = resource else: _json = self._serialize.body(resource, "DynatraceSingleSignOnResource") @@ -213,8 +207,9 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,7 +338,8 @@ def begin_create_or_update( :type monitor_name: str :param configuration_name: Single Sign On Configuration Name. Required. :type configuration_name: str - :param resource: Resource create parameters. Is either a model type or a IO type. Required. + :param resource: Resource create parameters. Is either a DynatraceSingleSignOnResource type or + a IO type. Required. :type resource: ~azure.mgmt.dynatrace.models.DynatraceSingleSignOnResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -365,9 +361,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DynatraceSingleSignOnResource] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -446,9 +440,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DynatraceSingleSignOnResource] = kwargs.pop("cls", None) request = build_get_request( @@ -464,8 +456,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -509,9 +502,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DynatraceSingleSignOnResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -565,8 +556,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/operations/_tag_rules_operations.py b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/operations/_tag_rules_operations.py index b4e20ed9e0f0..8805288223b0 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/operations/_tag_rules_operations.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/azure/mgmt/dynatrace/operations/_tag_rules_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -32,10 +32,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +45,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +79,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -114,50 +110,13 @@ def build_create_or_update_request( return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_request( - resource_group_name: str, monitor_name: str, rule_set_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/tagRules/{ruleSetName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), - "ruleSetName": _SERIALIZER.url("rule_set_name", rule_set_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - def build_delete_request( resource_group_name: str, monitor_name: str, rule_set_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -189,7 +148,7 @@ def build_list_request(resource_group_name: str, monitor_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-27")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -264,9 +223,7 @@ def get(self, resource_group_name: str, monitor_name: str, rule_set_name: str, * _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.TagRule] = kwargs.pop("cls", None) request = build_get_request( @@ -282,8 +239,9 @@ def get(self, resource_group_name: str, monitor_name: str, rule_set_name: str, * request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -323,16 +281,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(resource, (IO, bytes)): + if isinstance(resource, (IOBase, bytes)): _content = resource else: _json = self._serialize.body(resource, "TagRule") @@ -353,8 +309,9 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -479,7 +436,7 @@ def begin_create_or_update( :type monitor_name: str :param rule_set_name: Monitor resource name. Required. :type rule_set_name: str - :param resource: Resource create parameters. Is either a model type or a IO type. Required. + :param resource: Resource create parameters. Is either a TagRule type or a IO type. Required. :type resource: ~azure.mgmt.dynatrace.models.TagRule or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -499,9 +456,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagRule] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -549,166 +504,6 @@ def get_long_running_output(pipeline_response): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/tagRules/{ruleSetName}" } - @overload - def update( - self, - resource_group_name: str, - monitor_name: str, - rule_set_name: str, - resource: _models.TagRuleUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TagRule: - """Update a TagRule. - - Update a TagRule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param monitor_name: Monitor resource name. Required. - :type monitor_name: str - :param rule_set_name: Monitor resource name. Required. - :type rule_set_name: str - :param resource: The resource properties to be updated. Required. - :type resource: ~azure.mgmt.dynatrace.models.TagRuleUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: TagRule or the result of cls(response) - :rtype: ~azure.mgmt.dynatrace.models.TagRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - monitor_name: str, - rule_set_name: str, - resource: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TagRule: - """Update a TagRule. - - Update a TagRule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param monitor_name: Monitor resource name. Required. - :type monitor_name: str - :param rule_set_name: Monitor resource name. Required. - :type rule_set_name: str - :param resource: The resource properties to be updated. Required. - :type resource: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: TagRule or the result of cls(response) - :rtype: ~azure.mgmt.dynatrace.models.TagRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - monitor_name: str, - rule_set_name: str, - resource: Union[_models.TagRuleUpdate, IO], - **kwargs: Any - ) -> _models.TagRule: - """Update a TagRule. - - Update a TagRule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param monitor_name: Monitor resource name. Required. - :type monitor_name: str - :param rule_set_name: Monitor resource name. Required. - :type rule_set_name: str - :param resource: The resource properties to be updated. Is either a model type or a IO type. - Required. - :type resource: ~azure.mgmt.dynatrace.models.TagRuleUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: TagRule or the result of cls(response) - :rtype: ~azure.mgmt.dynatrace.models.TagRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TagRule] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IO, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "TagRuleUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - monitor_name=monitor_name, - rule_set_name=rule_set_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.update.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TagRule", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/tagRules/{ruleSetName}" - } - def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, monitor_name: str, rule_set_name: str, **kwargs: Any ) -> None: @@ -723,9 +518,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -741,8 +534,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -789,9 +583,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -853,9 +645,7 @@ def list(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> It _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-09-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.TagRuleListResult] = kwargs.pop("cls", None) error_map = { @@ -909,8 +699,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_create_or_update_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_create_or_update_maximum_set_gen.py index ecae40fb62be..b3f8aa583468 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_create_or_update_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_create_or_update_maximum_set_gen.py @@ -65,6 +65,6 @@ def main(): print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_create_or_update_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_create_or_update_minimum_set_gen.py index 17624519d57d..b4cd200647ee 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_create_or_update_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_create_or_update_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_CreateOrUpdate_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_CreateOrUpdate_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_delete_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_delete_maximum_set_gen.py index a9b43fe0b29b..2b22c8af6810 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_delete_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_delete_maximum_set_gen.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.monitors.begin_delete( + client.monitors.begin_delete( resource_group_name="myResourceGroup", monitor_name="myMonitor", ).result() - print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_Delete_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_delete_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_delete_minimum_set_gen.py index b9ba2b1b02d7..28673c6f9e9c 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_delete_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_delete_minimum_set_gen.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.monitors.begin_delete( + client.monitors.begin_delete( resource_group_name="myResourceGroup", monitor_name="myMonitor", ).result() - print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_Delete_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_Delete_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_account_credentials_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_marketplace_saa_sresource_details_maximum_set_gen.py similarity index 77% rename from sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_account_credentials_maximum_set_gen.py rename to sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_marketplace_saa_sresource_details_maximum_set_gen.py index b81514e72848..bb3836fbff92 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_account_credentials_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_marketplace_saa_sresource_details_maximum_set_gen.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-dynatrace # USAGE - python monitors_get_account_credentials_maximum_set_gen.py + python monitors_get_marketplace_saa_sresource_details_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -26,16 +26,15 @@ def main(): client = DynatraceObservabilityMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="nqmcgifgaqlf", ) - response = client.monitors.get_account_credentials( - resource_group_name="myResourceGroup", - monitor_name="myMonitor", + response = client.monitors.get_marketplace_saa_s_resource_details( + request={"tenantId": "urnmattojzhktcfw"}, ) print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_GetAccountCredentials_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_GetMarketplaceSaaSResourceDetails_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_account_credentials_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_marketplace_saa_sresource_details_minimum_set_gen.py similarity index 77% rename from sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_account_credentials_minimum_set_gen.py rename to sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_marketplace_saa_sresource_details_minimum_set_gen.py index a6dc04fbf5f2..cbcd5f8adebb 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_account_credentials_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_marketplace_saa_sresource_details_minimum_set_gen.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-dynatrace # USAGE - python monitors_get_account_credentials_minimum_set_gen.py + python monitors_get_marketplace_saa_sresource_details_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -26,16 +26,15 @@ def main(): client = DynatraceObservabilityMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="nqmcgifgaqlf", ) - response = client.monitors.get_account_credentials( - resource_group_name="myResourceGroup", - monitor_name="myMonitor", + response = client.monitors.get_marketplace_saa_s_resource_details( + request={"tenantId": "urnmattojzhktcfw"}, ) print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_GetAccountCredentials_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_GetMarketplaceSaaSResourceDetails_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_maximum_set_gen.py index 1a80c27a9537..2fd6bf3ff655 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_Get_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_metric_status_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_metric_status_maximum_set_gen.py new file mode 100644 index 000000000000..50a3caebd8bc --- /dev/null +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_metric_status_maximum_set_gen.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.dynatrace import DynatraceObservabilityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-dynatrace +# USAGE + python monitors_get_metric_status_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DynatraceObservabilityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="nqmcgifgaqlf", + ) + + response = client.monitors.get_metric_status( + resource_group_name="rgDynatrace", + monitor_name="fhcjxnxumkdlgpwanewtkdnyuz", + ) + print(response) + + +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_GetMetricStatus_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_metric_status_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_metric_status_minimum_set_gen.py new file mode 100644 index 000000000000..d18424ac471c --- /dev/null +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_metric_status_minimum_set_gen.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.dynatrace import DynatraceObservabilityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-dynatrace +# USAGE + python monitors_get_metric_status_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DynatraceObservabilityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="nqmcgifgaqlf", + ) + + response = client.monitors.get_metric_status( + resource_group_name="rgDynatrace", + monitor_name="fhcjxnxumkdlgpwanewtkdnyuz", + ) + print(response) + + +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_GetMetricStatus_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_minimum_set_gen.py index 6ff86237630f..05fe88cb5262 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_minimum_set_gen.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_Get_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_Get_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_sso_details_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_sso_details_maximum_set_gen.py index e86785eb9b9a..0a3ef0d38954 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_sso_details_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_sso_details_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_GetSSODetails_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_GetSSODetails_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_sso_details_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_sso_details_minimum_set_gen.py index 660bfb94f9b6..d51d068e3345 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_sso_details_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_sso_details_minimum_set_gen.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_GetSSODetails_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_GetSSODetails_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_vm_host_payload_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_vm_host_payload_maximum_set_gen.py index 96d88b08e20b..c9cd2e986ac5 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_vm_host_payload_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_vm_host_payload_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_GetVMHostPayload_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_GetVMHostPayload_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_vm_host_payload_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_vm_host_payload_minimum_set_gen.py index cf225a7e75f7..39a5661d05d4 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_vm_host_payload_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_get_vm_host_payload_minimum_set_gen.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_GetVMHostPayload_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_GetVMHostPayload_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_app_services_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_app_services_maximum_set_gen.py index b7b815e46a5d..7bda37260f58 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_app_services_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_app_services_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListAppServices_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_ListAppServices_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_app_services_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_app_services_minimum_set_gen.py index b17d7e1ac1f5..f6fa6c432180 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_app_services_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_app_services_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListAppServices_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_ListAppServices_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_by_resource_group_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_by_resource_group_maximum_set_gen.py index 3a94fef1fd93..fe3eb7077e60 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_by_resource_group_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_by_resource_group_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_by_resource_group_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_by_resource_group_minimum_set_gen.py index 0b496e54df56..f98511e2efd4 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_by_resource_group_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_by_resource_group_minimum_set_gen.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListByResourceGroup_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_ListByResourceGroup_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_by_subscription_id_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_by_subscription_id_maximum_set_gen.py index 94ec8141d8fc..2a2eb5ef9e6e 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_by_subscription_id_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_by_subscription_id_maximum_set_gen.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListBySubscriptionId_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_ListBySubscriptionId_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_by_subscription_id_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_by_subscription_id_minimum_set_gen.py index e195a78d2334..58ac1df06468 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_by_subscription_id_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_by_subscription_id_minimum_set_gen.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListBySubscriptionId_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_ListBySubscriptionId_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_hosts_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_hosts_maximum_set_gen.py index c6d0e44c721d..2d42f69e2abd 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_hosts_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_hosts_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListHosts_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_ListHosts_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_hosts_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_hosts_minimum_set_gen.py index af71a895e843..df9a538a92db 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_hosts_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_hosts_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListHosts_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_ListHosts_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_linkable_environments_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_linkable_environments_maximum_set_gen.py index 8cbc17b8592a..31b51b925097 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_linkable_environments_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_linkable_environments_maximum_set_gen.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListLinkableEnvironments_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_ListLinkableEnvironments_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_update_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_linkable_environments_minimum_set_gen.py similarity index 65% rename from sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_update_maximum_set_gen.py rename to sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_linkable_environments_minimum_set_gen.py index 2d9db5efbfeb..8b627eeddecd 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_update_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_linkable_environments_minimum_set_gen.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-dynatrace # USAGE - python tag_rules_update_maximum_set_gen.py + python monitors_list_linkable_environments_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -29,26 +29,19 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.tag_rules.update( + response = client.monitors.list_linkable_environments( resource_group_name="myResourceGroup", monitor_name="myMonitor", - rule_set_name="default", - resource={ - "logRules": { - "filteringTags": [ - {"action": "Include", "name": "Environment", "value": "Prod"}, - {"action": "Exclude", "name": "Environment", "value": "Dev"}, - ], - "sendAadLogs": "Enabled", - "sendActivityLogs": "Enabled", - "sendSubscriptionLogs": "Enabled", - }, - "metricRules": {"filteringTags": [{"action": "Include", "name": "Environment", "value": "Prod"}]}, + request={ + "region": "East US", + "tenantId": "00000000-0000-0000-0000-000000000000", + "userPrincipal": "alice@microsoft.com", }, ) - print(response) + for item in response: + print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_Update_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_ListLinkableEnvironments_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_monitored_resources_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_monitored_resources_maximum_set_gen.py index fa9d3854f6eb..f26559f5a268 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_monitored_resources_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_monitored_resources_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_monitored_resources_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_monitored_resources_minimum_set_gen.py index 6f1046c89a74..b718e67232dc 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_monitored_resources_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_list_monitored_resources_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_update_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_update_maximum_set_gen.py index d5f2b37efc7c..76cadc6c21e6 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_update_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/monitors_update_maximum_set_gen.py @@ -32,29 +32,11 @@ def main(): response = client.monitors.update( resource_group_name="myResourceGroup", monitor_name="myMonitor", - resource={ - "dynatraceEnvironmentProperties": {"accountInfo": {}, "environmentInfo": {}, "singleSignOnProperties": {}}, - "marketplaceSubscriptionStatus": "Active", - "monitoringStatus": "Enabled", - "planData": { - "billingCycle": "Monthly", - "effectiveDate": "2019-08-30T15:14:33+02:00", - "planDetails": "dynatraceapitestplan", - "usageType": "Committed", - }, - "tags": {"Environment": "Dev"}, - "userInfo": { - "country": "westus2", - "emailAddress": "alice@microsoft.com", - "firstName": "Alice", - "lastName": "Bobab", - "phoneNumber": "123456", - }, - }, + resource={"tags": {"Environment": "Dev"}}, ) print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_Update_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Monitors_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/operations_list_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/operations_list_maximum_set_gen.py index cb20dc2ac118..8d7cbd69a35b 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/operations_list_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/operations_list_maximum_set_gen.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Operations_List_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Operations_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/operations_list_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/operations_list_minimum_set_gen.py index 819fa3ff01d0..33dce5bcfdfc 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/operations_list_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/operations_list_minimum_set_gen.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Operations_List_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/Operations_List_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_create_or_update_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_create_or_update_maximum_set_gen.py index dc541caf0dba..0aba980f9167 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_create_or_update_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_create_or_update_maximum_set_gen.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/SingleSignOn_CreateOrUpdate_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/SingleSignOn_CreateOrUpdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_create_or_update_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_create_or_update_minimum_set_gen.py index f62a2272b227..c6ae98328c2c 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_create_or_update_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_create_or_update_minimum_set_gen.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/SingleSignOn_CreateOrUpdate_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/SingleSignOn_CreateOrUpdate_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_get_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_get_maximum_set_gen.py index 22d735a94c6d..6dfc0887de56 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_get_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_get_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/SingleSignOn_Get_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/SingleSignOn_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_get_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_get_minimum_set_gen.py index 0b318cea0c0a..92cb7319fe73 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_get_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_get_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/SingleSignOn_Get_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/SingleSignOn_Get_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_list_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_list_maximum_set_gen.py index 7dfc843af980..a04d56d5da04 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_list_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_list_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/SingleSignOn_List_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/SingleSignOn_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_list_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_list_minimum_set_gen.py index cbba373ee5f8..a4b66db498b6 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_list_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/single_sign_on_list_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/SingleSignOn_List_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/SingleSignOn_List_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_create_or_update_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_create_or_update_maximum_set_gen.py index e4af6427aa7f..4d3577226984 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_create_or_update_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_create_or_update_maximum_set_gen.py @@ -44,7 +44,10 @@ def main(): "sendActivityLogs": "Enabled", "sendSubscriptionLogs": "Enabled", }, - "metricRules": {"filteringTags": [{"action": "Include", "name": "Environment", "value": "Prod"}]}, + "metricRules": { + "filteringTags": [{"action": "Include", "name": "Environment", "value": "Prod"}], + "sendingMetrics": "Enabled", + }, "provisioningState": "Accepted", } }, @@ -52,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_create_or_update_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_create_or_update_minimum_set_gen.py index d198e6f9b2ab..50cd8e8573b0 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_create_or_update_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_create_or_update_minimum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_delete_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_delete_maximum_set_gen.py index 352159bb6963..84f179e85daa 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_delete_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_delete_maximum_set_gen.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.tag_rules.begin_delete( + client.tag_rules.begin_delete( resource_group_name="myResourceGroup", monitor_name="myMonitor", rule_set_name="default", ).result() - print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_Delete_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/TagRules_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_delete_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_delete_minimum_set_gen.py index e43b8ada032c..cc7527939a8b 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_delete_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_delete_minimum_set_gen.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.tag_rules.begin_delete( + client.tag_rules.begin_delete( resource_group_name="myResourceGroup", monitor_name="myMonitor", rule_set_name="default", ).result() - print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_Delete_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/TagRules_Delete_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_get_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_get_maximum_set_gen.py index 5cd6db5d6139..d58364b96931 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_get_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_get_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_Get_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/TagRules_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_get_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_get_minimum_set_gen.py index b6454d6a0621..314a0d5fcedd 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_get_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_get_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_Get_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/TagRules_Get_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_list_maximum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_list_maximum_set_gen.py index b827f3378e75..ea3d23e0d39a 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_list_maximum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_list_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_List_MaximumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/TagRules_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_list_minimum_set_gen.py b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_list_minimum_set_gen.py index 14da2dac92b2..65ea0e15b86a 100644 --- a/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_list_minimum_set_gen.py +++ b/sdk/dynatrace/azure-mgmt-dynatrace/generated_samples/tag_rules_list_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_List_MinimumSet_Gen.json +# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2023-04-27/examples/TagRules_List_MinimumSet_Gen.json if __name__ == "__main__": main()