From 2d12516e7926fba6024dc9c1c577b4738bcdd4a3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 31 Jan 2023 06:34:50 +0000 Subject: [PATCH] CodeGen from PR 22207 in Azure/azure-rest-api-specs Merge eb8c8d5b04de42d2a1b8123af8cb4dcf292e4edd into 794b03f1b40b6f7646528fbe06bcfce7b58223a9 --- sdk/workloads/azure-mgmt-workloads/_meta.json | 6 +- .../azure/mgmt/workloads/_configuration.py | 4 +- .../azure/mgmt/workloads/_serialization.py | 87 +- .../azure/mgmt/workloads/_vendor.py | 5 +- .../azure/mgmt/workloads/_version.py | 2 +- .../azure/mgmt/workloads/_workloads_client.py | 28 +- .../mgmt/workloads/aio/_configuration.py | 4 +- .../mgmt/workloads/aio/_workloads_client.py | 29 +- .../mgmt/workloads/aio/operations/__init__.py | 12 +- .../aio/operations/_monitors_operations.py | 16 +- .../workloads/aio/operations/_operations.py | 2 +- .../operations/_php_workloads_operations.py | 809 ---- .../_provider_instances_operations.py | 12 +- ...application_server_instances_operations.py | 404 +- .../_sap_central_instances_operations.py | 404 +- .../_sap_database_instances_operations.py | 404 +- .../_sap_landscape_monitor_operations.py | 578 +++ .../_sap_virtual_instances_operations.py | 24 +- .../aio/operations/_skus_operations.py | 141 - .../_wordpress_instances_operations.py | 525 --- .../_workloads_client_operations.py | 8 +- .../azure/mgmt/workloads/models/__init__.py | 178 +- .../mgmt/workloads/models/_models_py3.py | 3481 +++++++---------- .../models/_workloads_client_enums.py | 230 +- .../mgmt/workloads/operations/__init__.py | 12 +- .../operations/_monitors_operations.py | 40 +- .../mgmt/workloads/operations/_operations.py | 6 +- .../operations/_php_workloads_operations.py | 1011 ----- .../_provider_instances_operations.py | 28 +- ...application_server_instances_operations.py | 503 ++- .../_sap_central_instances_operations.py | 503 ++- .../_sap_database_instances_operations.py | 503 ++- .../_sap_landscape_monitor_operations.py | 749 ++++ .../_sap_virtual_instances_operations.py | 56 +- .../workloads/operations/_skus_operations.py | 169 - .../_wordpress_instances_operations.py | 657 ---- .../_workloads_client_operations.py | 24 +- .../db2_provider_instances_create.py | 2 +- ...vider_instances_create_root_certificate.py | 2 +- .../db2_provider_instances_get.py | 2 +- .../generated_samples/monitors_delete.py | 2 +- .../generated_samples/monitors_get.py | 2 +- .../generated_samples/monitors_list.py | 2 +- .../generated_samples/monitors_list_by_rg.py | 2 +- .../generated_samples/monitors_patch_tags.py | 2 +- .../monitors_patch_tags_delete.py | 2 +- .../ms_sql_server_provider_instance_create.py | 2 +- ...ovider_instance_create_root_certificate.py | 2 +- .../ms_sql_server_provider_instance_get.py | 2 +- .../net_weaver_provider_instances_create.py | 2 +- ...vider_instances_create_root_certificate.py | 2 +- .../net_weaver_provider_instances_get.py | 2 +- .../generated_samples/operations_list.py | 2 +- .../php_workloads_create_or_update.py | 111 - .../php_workloads_list_by_resource_group.py | 41 - .../php_workloads_list_by_subscription.py | 39 - ...us_ha_cluster_provider_instances_create.py | 2 +- ...vider_instances_create_root_certificate.py | 2 +- ...theus_ha_cluster_provider_instances_get.py | 2 +- ...prometheus_os_provider_instances_create.py | 3 +- ...vider_instances_create_root_certificate.py | 3 +- .../prometheus_os_provider_instances_get.py | 2 +- .../provider_instances_create.py | 3 +- ...vider_instances_create_root_certificate.py | 3 +- .../provider_instances_delete.py | 2 +- .../provider_instances_get.py | 2 +- .../provider_instances_list.py | 2 +- ...sap_application_server_instances_create.py | 2 +- ...ation_server_instances_create_ha_av_set.py | 42 + ...sap_application_server_instances_delete.py | 2 +- .../sap_application_server_instances_get.py | 2 +- .../sap_application_server_instances_list.py | 2 +- ...ication_server_instances_start_instance.py | 42 + ...lication_server_instances_stop_instance.py | 42 + ...sap_application_server_instances_update.py | 2 +- .../sap_availability_zone_details_eastus.py | 2 +- ...p_availability_zone_details_northeurope.py | 2 +- .../sap_central_instances_create.py | 2 +- .../sap_central_instances_create_ha_av_set.py | 42 + .../sap_central_instances_delete.py | 2 +- .../sap_central_instances_get.py | 2 +- .../sap_central_instances_list.py | 2 +- .../sap_central_instances_start_instance.py | 42 + .../sap_central_instances_stop_instance.py | 42 + .../sap_central_instances_update.py | 2 +- .../sap_database_instances_create.py | 2 +- ...sap_database_instances_create_ha_av_set.py | 42 + .../sap_database_instances_delete.py | 2 +- .../sap_database_instances_get.py | 2 +- .../sap_database_instances_list.py | 2 +- .../sap_database_instances_start_instance.py | 42 + .../sap_database_instances_stop_instance.py | 42 + .../sap_database_instances_update.py | 2 +- .../sap_disk_configurations_non_prod.py | 2 +- .../sap_disk_configurations_prod.py | 2 +- ...ate.py => sap_landscape_monitor_create.py} | 24 +- .../sap_landscape_monitor_delete.py | 41 + .../sap_landscape_monitor_get.py | 41 + .../sap_landscape_monitor_list.py | 41 + .../sap_landscape_monitor_update.py | 50 + ...ing_recommendations_s4_hana_distributed.py | 2 +- ...izing_recommendations_s4_hana_ha_av_set.py | 2 +- ...zing_recommendations_s4_hana_ha_av_zone.py | 2 +- ...g_recommendations_s4_hana_single_server.py | 2 +- .../sap_supported_skus_distributed.py | 2 +- ...ap_supported_skus_distributed_ha_av_set.py | 2 +- ...p_supported_skus_distributed_ha_av_zone.py | 2 +- .../sap_supported_skus_single_server.py | 2 +- ..._custom_full_resource_names_distributed.py | 41 + ...te_custom_full_resource_names_ha_av_set.py | 41 + ...e_custom_full_resource_names_ha_av_zone.py | 41 + ...ustom_full_resource_names_single_server.py | 41 + .../sap_virtual_instances_create_discover.py | 2 +- ...iscover_custom_mrg_storage_account_name.py | 41 + ...tances_create_disk_details_distributed.py} | 10 +- ...nstances_create_disk_details_ha_av_set.py} | 8 +- ...stances_create_disk_details_ha_av_zone.py} | 10 +- ...ances_create_disk_details_single_server.py | 41 + ...ap_virtual_instances_create_distributed.py | 2 +- ...stances_create_distributed_create_trans.py | 41 + ...stances_create_distributed_mount_trans.py} | 10 +- ...ces_create_distributed_skip_trans_mount.py | 41 + .../sap_virtual_instances_create_ha_av_set.py | 2 +- ...sap_virtual_instances_create_ha_av_zone.py | 2 +- ..._virtual_instances_create_single_server.py | 2 +- ...ances_create_with_os_config_distributed.py | 2 +- ...stances_create_with_os_config_ha_av_set.py | 2 +- ...tances_create_with_os_config_ha_av_zone.py | 2 +- ...ces_create_with_os_config_single_server.py | 2 +- .../sap_virtual_instances_delete.py | 2 +- ...stances_detect_installation_distributed.py | 2 +- ...instances_detect_installation_ha_av_set.py | 2 +- ...nstances_detect_installation_ha_av_zone.py | 2 +- ...ances_detect_installation_single_server.py | 2 +- .../sap_virtual_instances_get.py | 2 +- ...p_virtual_instances_install_distributed.py | 2 +- ...virtual_instances_install_single_server.py | 2 +- ...irtual_instances_list_by_resource_group.py | 2 +- ..._virtual_instances_list_by_subscription.py | 2 +- .../sap_virtual_instances_start.py | 2 +- .../sap_virtual_instances_stop.py | 2 +- .../sap_virtual_instances_update.py | 2 +- .../generated_samples/skus_list.py | 39 - .../wordpress_instances_list.py | 42 - 144 files changed, 6794 insertions(+), 6229 deletions(-) delete mode 100644 sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_php_workloads_operations.py create mode 100644 sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_landscape_monitor_operations.py delete mode 100644 sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_skus_operations.py delete mode 100644 sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_wordpress_instances_operations.py delete mode 100644 sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_php_workloads_operations.py create mode 100644 sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_landscape_monitor_operations.py delete mode 100644 sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_skus_operations.py delete mode 100644 sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_wordpress_instances_operations.py delete mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_create_or_update.py delete mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_list_by_resource_group.py delete mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_list_by_subscription.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_create_ha_av_set.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_start_instance.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_stop_instance.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_create_ha_av_set.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_start_instance.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_stop_instance.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_create_ha_av_set.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_start_instance.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_stop_instance.py rename sdk/workloads/azure-mgmt-workloads/generated_samples/{wordpress_instances_create_or_update.py => sap_landscape_monitor_create.py} (62%) create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_delete.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_get.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_list.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_update.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_custom_full_resource_names_distributed.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_custom_full_resource_names_ha_av_set.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_custom_full_resource_names_ha_av_zone.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_custom_full_resource_names_single_server.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_discover_custom_mrg_storage_account_name.py rename sdk/workloads/azure-mgmt-workloads/generated_samples/{wordpress_instances_delete.py => sap_virtual_instances_create_disk_details_distributed.py} (81%) rename sdk/workloads/azure-mgmt-workloads/generated_samples/{php_workloads_delete.py => sap_virtual_instances_create_disk_details_ha_av_set.py} (82%) rename sdk/workloads/azure-mgmt-workloads/generated_samples/{php_workloads_get.py => sap_virtual_instances_create_disk_details_ha_av_zone.py} (81%) create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_disk_details_single_server.py create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_distributed_create_trans.py rename sdk/workloads/azure-mgmt-workloads/generated_samples/{wordpress_instances_get.py => sap_virtual_instances_create_distributed_mount_trans.py} (81%) create mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_distributed_skip_trans_mount.py delete mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/skus_list.py delete mode 100644 sdk/workloads/azure-mgmt-workloads/generated_samples/wordpress_instances_list.py diff --git a/sdk/workloads/azure-mgmt-workloads/_meta.json b/sdk/workloads/azure-mgmt-workloads/_meta.json index 089d2088cf05..7770f174868f 100644 --- a/sdk/workloads/azure-mgmt-workloads/_meta.json +++ b/sdk/workloads/azure-mgmt-workloads/_meta.json @@ -1,11 +1,11 @@ { - "commit": "2f2e48923cebd95f7d184608a29bcd06d9cb3653", + "commit": "ff4a1f9c323a8e2bcecee7c87e307ad86b4dced6", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.7", + "@autorest/python@6.2.16", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/workloads/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/workloads/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.2.16 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/workloads/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_configuration.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_configuration.py index 44cdf0057074..8f78801309d5 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_configuration.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_configuration.py @@ -35,14 +35,14 @@ class WorkloadsClientConfiguration(Configuration): # pylint: disable=too-many-i :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-12-01-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2022-11-01-preview". 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(WorkloadsClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2021-12-01-preview"] = kwargs.pop("api_version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop("api_version", "2022-11-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_serialization.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_serialization.py index 2c170e28dbca..f17c068e833e 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_serialization.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_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 @@ -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 @@ -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/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_vendor.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_vendor.py index 2eb4e11d58b3..4e7adcab424f 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_vendor.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_vendor.py @@ -6,7 +6,7 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import TYPE_CHECKING +from typing import List, TYPE_CHECKING, cast from azure.core.pipeline.transport import HttpRequest @@ -33,7 +33,8 @@ 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/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_version.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_version.py index dfa6ee022f15..e5754a47ce68 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_version.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_workloads_client.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_workloads_client.py index 3a45b2b43848..ac2e1f2a3f29 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_workloads_client.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/_workloads_client.py @@ -18,14 +18,12 @@ from .operations import ( MonitorsOperations, Operations, - PhpWorkloadsOperations, ProviderInstancesOperations, SAPApplicationServerInstancesOperations, SAPCentralInstancesOperations, SAPDatabaseInstancesOperations, SAPVirtualInstancesOperations, - SkusOperations, - WordpressInstancesOperations, + SapLandscapeMonitorOperations, WorkloadsClientOperationsMixin, ) @@ -39,10 +37,6 @@ class WorkloadsClient( ): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes """Workloads client provides access to various workload operations. - :ivar php_workloads: PhpWorkloadsOperations operations - :vartype php_workloads: azure.mgmt.workloads.operations.PhpWorkloadsOperations - :ivar wordpress_instances: WordpressInstancesOperations operations - :vartype wordpress_instances: azure.mgmt.workloads.operations.WordpressInstancesOperations :ivar sap_virtual_instances: SAPVirtualInstancesOperations operations :vartype sap_virtual_instances: azure.mgmt.workloads.operations.SAPVirtualInstancesOperations :ivar sap_central_instances: SAPCentralInstancesOperations operations @@ -52,21 +46,21 @@ class WorkloadsClient( :ivar sap_application_server_instances: SAPApplicationServerInstancesOperations operations :vartype sap_application_server_instances: azure.mgmt.workloads.operations.SAPApplicationServerInstancesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.workloads.operations.Operations :ivar monitors: MonitorsOperations operations :vartype monitors: azure.mgmt.workloads.operations.MonitorsOperations :ivar provider_instances: ProviderInstancesOperations operations :vartype provider_instances: azure.mgmt.workloads.operations.ProviderInstancesOperations - :ivar skus: SkusOperations operations - :vartype skus: azure.mgmt.workloads.operations.SkusOperations + :ivar sap_landscape_monitor: SapLandscapeMonitorOperations operations + :vartype sap_landscape_monitor: azure.mgmt.workloads.operations.SapLandscapeMonitorOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.workloads.operations.Operations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :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-12-01-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2022-11-01-preview". 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 @@ -87,10 +81,6 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.php_workloads = PhpWorkloadsOperations(self._client, self._config, self._serialize, self._deserialize) - self.wordpress_instances = WordpressInstancesOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.sap_virtual_instances = SAPVirtualInstancesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -103,12 +93,14 @@ def __init__( self.sap_application_server_instances = SAPApplicationServerInstancesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.monitors = MonitorsOperations(self._client, self._config, self._serialize, self._deserialize) self.provider_instances = ProviderInstancesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize) + self.sap_landscape_monitor = SapLandscapeMonitorOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/_configuration.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/_configuration.py index 29b3a12ee9e0..9d13abb0e47e 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/_configuration.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/_configuration.py @@ -35,14 +35,14 @@ class WorkloadsClientConfiguration(Configuration): # pylint: disable=too-many-i :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-12-01-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2022-11-01-preview". 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(WorkloadsClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2021-12-01-preview"] = kwargs.pop("api_version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop("api_version", "2022-11-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/_workloads_client.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/_workloads_client.py index d86a9e5ec713..969131e9b16d 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/_workloads_client.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/_workloads_client.py @@ -18,14 +18,12 @@ from .operations import ( MonitorsOperations, Operations, - PhpWorkloadsOperations, ProviderInstancesOperations, SAPApplicationServerInstancesOperations, SAPCentralInstancesOperations, SAPDatabaseInstancesOperations, SAPVirtualInstancesOperations, - SkusOperations, - WordpressInstancesOperations, + SapLandscapeMonitorOperations, WorkloadsClientOperationsMixin, ) @@ -39,10 +37,6 @@ class WorkloadsClient( ): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes """Workloads client provides access to various workload operations. - :ivar php_workloads: PhpWorkloadsOperations operations - :vartype php_workloads: azure.mgmt.workloads.aio.operations.PhpWorkloadsOperations - :ivar wordpress_instances: WordpressInstancesOperations operations - :vartype wordpress_instances: azure.mgmt.workloads.aio.operations.WordpressInstancesOperations :ivar sap_virtual_instances: SAPVirtualInstancesOperations operations :vartype sap_virtual_instances: azure.mgmt.workloads.aio.operations.SAPVirtualInstancesOperations @@ -55,21 +49,22 @@ class WorkloadsClient( :ivar sap_application_server_instances: SAPApplicationServerInstancesOperations operations :vartype sap_application_server_instances: azure.mgmt.workloads.aio.operations.SAPApplicationServerInstancesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.workloads.aio.operations.Operations :ivar monitors: MonitorsOperations operations :vartype monitors: azure.mgmt.workloads.aio.operations.MonitorsOperations :ivar provider_instances: ProviderInstancesOperations operations :vartype provider_instances: azure.mgmt.workloads.aio.operations.ProviderInstancesOperations - :ivar skus: SkusOperations operations - :vartype skus: azure.mgmt.workloads.aio.operations.SkusOperations + :ivar sap_landscape_monitor: SapLandscapeMonitorOperations operations + :vartype sap_landscape_monitor: + azure.mgmt.workloads.aio.operations.SapLandscapeMonitorOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.workloads.aio.operations.Operations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :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-12-01-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2022-11-01-preview". 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 @@ -90,10 +85,6 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.php_workloads = PhpWorkloadsOperations(self._client, self._config, self._serialize, self._deserialize) - self.wordpress_instances = WordpressInstancesOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.sap_virtual_instances = SAPVirtualInstancesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -106,12 +97,14 @@ def __init__( self.sap_application_server_instances = SAPApplicationServerInstancesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.monitors = MonitorsOperations(self._client, self._config, self._serialize, self._deserialize) self.provider_instances = ProviderInstancesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize) + self.sap_landscape_monitor = SapLandscapeMonitorOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/__init__.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/__init__.py index 9ec296484c8e..fe951707c6a1 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/__init__.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/__init__.py @@ -6,34 +6,30 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._php_workloads_operations import PhpWorkloadsOperations -from ._wordpress_instances_operations import WordpressInstancesOperations from ._workloads_client_operations import WorkloadsClientOperationsMixin from ._sap_virtual_instances_operations import SAPVirtualInstancesOperations from ._sap_central_instances_operations import SAPCentralInstancesOperations from ._sap_database_instances_operations import SAPDatabaseInstancesOperations from ._sap_application_server_instances_operations import SAPApplicationServerInstancesOperations -from ._operations import Operations from ._monitors_operations import MonitorsOperations from ._provider_instances_operations import ProviderInstancesOperations -from ._skus_operations import SkusOperations +from ._sap_landscape_monitor_operations import SapLandscapeMonitorOperations +from ._operations import Operations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ - "PhpWorkloadsOperations", - "WordpressInstancesOperations", "WorkloadsClientOperationsMixin", "SAPVirtualInstancesOperations", "SAPCentralInstancesOperations", "SAPDatabaseInstancesOperations", "SAPApplicationServerInstancesOperations", - "Operations", "MonitorsOperations", "ProviderInstancesOperations", - "SkusOperations", + "SapLandscapeMonitorOperations", + "Operations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_monitors_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_monitors_operations.py index 55603e3df385..87cf5cb34bde 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_monitors_operations.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_monitors_operations.py @@ -83,7 +83,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Monitor"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.MonitorListResult] = kwargs.pop("cls", None) @@ -170,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.MonitorListResult] = kwargs.pop("cls", None) @@ -271,7 +271,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-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.Monitor] = kwargs.pop("cls", None) @@ -324,7 +324,7 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -490,7 +490,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -554,7 +554,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) @@ -624,7 +624,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) @@ -769,7 +769,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_operations.py index f7be96927c12..7908e8d9556f 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_operations.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_operations.py @@ -70,7 +70,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-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_php_workloads_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_php_workloads_operations.py deleted file mode 100644 index 99e6c5ecadf2..000000000000 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_php_workloads_operations.py +++ /dev/null @@ -1,809 +0,0 @@ -# pylint: disable=too-many-lines -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._php_workloads_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) -from .._vendor import WorkloadsClientMixinABC - -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]] - - -class PhpWorkloadsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.workloads.aio.WorkloadsClient`'s - :attr:`php_workloads` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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 list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.PhpWorkloadResource"]: - """Lists PHP workload resources for a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PhpWorkloadResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.workloads.models.PhpWorkloadResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[_models.PhpWorkloadResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PhpWorkloadResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - 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) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/phpWorkloads" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.PhpWorkloadResource"]: - """Lists PHP workload resources in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PhpWorkloadResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.workloads.models.PhpWorkloadResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[_models.PhpWorkloadResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PhpWorkloadResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - 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) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads" - } - - @distributed_trace_async - async def get(self, resource_group_name: str, php_workload_name: str, **kwargs: Any) -> _models.PhpWorkloadResource: - """Gets the PHP workload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PhpWorkloadResource or the result of cls(response) - :rtype: ~azure.mgmt.workloads.models.PhpWorkloadResource - :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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[_models.PhpWorkloadResource] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.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("PhpWorkloadResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}" - } - - async def _create_or_update_initial( - self, - resource_group_name: str, - php_workload_name: str, - php_workload_resource: Union[_models.PhpWorkloadResource, IO], - **kwargs: Any - ) -> _models.PhpWorkloadResource: - 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-12-01-preview"] = 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.PhpWorkloadResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(php_workload_resource, (IO, bytes)): - _content = php_workload_resource - else: - _json = self._serialize.body(php_workload_resource, "PhpWorkloadResource") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.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, 201]: - 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) - - if response.status_code == 200: - deserialized = self._deserialize("PhpWorkloadResource", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("PhpWorkloadResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}" - } - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - php_workload_name: str, - php_workload_resource: _models.PhpWorkloadResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhpWorkloadResource]: - """Create or updated PHP workload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param php_workload_resource: Resource create or update request payload. Required. - :type php_workload_resource: ~azure.mgmt.workloads.models.PhpWorkloadResource - :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 - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PhpWorkloadResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.PhpWorkloadResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - php_workload_name: str, - php_workload_resource: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhpWorkloadResource]: - """Create or updated PHP workload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param php_workload_resource: Resource create or update request payload. Required. - :type php_workload_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 - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PhpWorkloadResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.PhpWorkloadResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - php_workload_name: str, - php_workload_resource: Union[_models.PhpWorkloadResource, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhpWorkloadResource]: - """Create or updated PHP workload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param php_workload_resource: Resource create or update request payload. Is either a model type - or a IO type. Required. - :type php_workload_resource: ~azure.mgmt.workloads.models.PhpWorkloadResource 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 - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PhpWorkloadResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.PhpWorkloadResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-12-01-preview"] = 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.PhpWorkloadResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - php_workload_resource=php_workload_resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhpWorkloadResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}" - } - - @overload - async def update( - self, - resource_group_name: str, - php_workload_name: str, - resource_patch_request_body: _models.PatchResourceRequestBody, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PhpWorkloadResource: - """Update PHP workload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param resource_patch_request_body: Workload resource update data. Required. - :type resource_patch_request_body: ~azure.mgmt.workloads.models.PatchResourceRequestBody - :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: PhpWorkloadResource or the result of cls(response) - :rtype: ~azure.mgmt.workloads.models.PhpWorkloadResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - php_workload_name: str, - resource_patch_request_body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PhpWorkloadResource: - """Update PHP workload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param resource_patch_request_body: Workload resource update data. Required. - :type resource_patch_request_body: 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: PhpWorkloadResource or the result of cls(response) - :rtype: ~azure.mgmt.workloads.models.PhpWorkloadResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - php_workload_name: str, - resource_patch_request_body: Union[_models.PatchResourceRequestBody, IO], - **kwargs: Any - ) -> _models.PhpWorkloadResource: - """Update PHP workload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param resource_patch_request_body: Workload resource update data. Is either a model type or a - IO type. Required. - :type resource_patch_request_body: ~azure.mgmt.workloads.models.PatchResourceRequestBody 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: PhpWorkloadResource or the result of cls(response) - :rtype: ~azure.mgmt.workloads.models.PhpWorkloadResource - :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-12-01-preview"] = 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.PhpWorkloadResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource_patch_request_body, (IO, bytes)): - _content = resource_patch_request_body - else: - _json = self._serialize.body(resource_patch_request_body, "PatchResourceRequestBody") - - request = build_update_request( - resource_group_name=resource_group_name, - php_workload_name=php_workload_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("PhpWorkloadResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, php_workload_name: str, delete_infra: Optional[str] = None, **kwargs: Any - ) -> None: - 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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - subscription_id=self._config.subscription_id, - delete_infra=delete_infra, - api_version=api_version, - template_url=self._delete_initial.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, 202, 204]: - 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) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, php_workload_name: str, delete_infra: Optional[str] = None, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete PHP workload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param delete_infra: Whether to delete infra along with workload resource. Default value is - None. - :type delete_infra: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-12-01-preview"] = 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - delete_infra=delete_infra, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}" - } diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_provider_instances_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_provider_instances_operations.py index 95e116c8ffb3..44afb424fac7 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_provider_instances_operations.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_provider_instances_operations.py @@ -88,7 +88,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ProviderInstanceListResult] = kwargs.pop("cls", None) @@ -194,7 +194,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ProviderInstance] = kwargs.pop("cls", None) @@ -253,7 +253,7 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -436,7 +436,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -501,7 +501,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) @@ -575,7 +575,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_application_server_instances_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_application_server_instances_operations.py index 2eca6e10fb8e..95d5a70a1c5c 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_application_server_instances_operations.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_application_server_instances_operations.py @@ -36,6 +36,8 @@ build_delete_request, build_get_request, build_list_request, + build_start_instance_request, + build_stop_instance_request, build_update_request, ) from .._vendor import WorkloadsClientMixinABC @@ -99,7 +101,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPApplicationServerInstance] = kwargs.pop("cls", None) @@ -158,7 +160,7 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -347,7 +349,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -417,7 +419,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -603,7 +605,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -668,7 +670,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) @@ -742,7 +744,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) @@ -813,7 +815,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPApplicationServerInstanceList] = kwargs.pop("cls", None) @@ -886,3 +888,389 @@ async def get_next(next_link=None): list.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances" } + + async def _start_instance_initial( + self, resource_group_name: str, sap_virtual_instance_name: str, application_instance_name: str, **kwargs: Any + ) -> Optional[_models.OperationStatusResult]: + 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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) + + request = build_start_instance_request( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + application_instance_name=application_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._start_instance_initial.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, 202]: + 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 = None + if response.status_code == 200: + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _start_instance_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/start" + } + + @distributed_trace_async + async def begin_start_instance( + self, resource_group_name: str, sap_virtual_instance_name: str, application_instance_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Starts the SAP Application Server Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param application_instance_name: The name of SAP Application Server instance resource. + Required. + :type application_instance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatusResult or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_instance_initial( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + application_instance_name=application_instance_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_start_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/start" + } + + async def _stop_instance_initial( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + application_instance_name: str, + body: Optional[Union[_models.StopRequest, IO]] = None, + **kwargs: Any + ) -> Optional[_models.OperationStatusResult]: + 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["2022-11-01-preview"] = 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[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "StopRequest") + else: + _json = None + + request = build_stop_instance_request( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + application_instance_name=application_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._stop_instance_initial.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, 202]: + 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 = None + if response.status_code == 200: + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _stop_instance_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/stop" + } + + @overload + async def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + application_instance_name: str, + body: Optional[_models.StopRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Stops the SAP Application Server Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param application_instance_name: The name of SAP Application Server instance resource. + Required. + :type application_instance_name: str + :param body: SAP Application server instance stop request body. Default value is None. + :type body: ~azure.mgmt.workloads.models.StopRequest + :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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatusResult or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + application_instance_name: str, + body: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Stops the SAP Application Server Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param application_instance_name: The name of SAP Application Server instance resource. + Required. + :type application_instance_name: str + :param body: SAP Application server instance stop request body. Default value is None. + :type body: 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatusResult or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + application_instance_name: str, + body: Optional[Union[_models.StopRequest, IO]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Stops the SAP Application Server Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param application_instance_name: The name of SAP Application Server instance resource. + Required. + :type application_instance_name: str + :param body: SAP Application server instance stop request body. Is either a model type or a IO + type. Default value is None. + :type body: ~azure.mgmt.workloads.models.StopRequest 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatusResult or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-01-preview"] = 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.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_instance_initial( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + application_instance_name=application_instance_name, + body=body, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_stop_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/stop" + } diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_central_instances_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_central_instances_operations.py index 72e03de48430..e4fbc3b91764 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_central_instances_operations.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_central_instances_operations.py @@ -36,6 +36,8 @@ build_delete_request, build_get_request, build_list_request, + build_start_instance_request, + build_stop_instance_request, build_update_request, ) from .._vendor import WorkloadsClientMixinABC @@ -98,7 +100,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPCentralServerInstance] = kwargs.pop("cls", None) @@ -157,7 +159,7 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -346,7 +348,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -416,7 +418,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -605,7 +607,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -670,7 +672,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) @@ -746,7 +748,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) @@ -817,7 +819,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPCentralInstanceList] = kwargs.pop("cls", None) @@ -890,3 +892,389 @@ async def get_next(next_link=None): list.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances" } + + async def _start_instance_initial( + self, resource_group_name: str, sap_virtual_instance_name: str, central_instance_name: str, **kwargs: Any + ) -> Optional[_models.OperationStatusResult]: + 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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) + + request = build_start_instance_request( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + central_instance_name=central_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._start_instance_initial.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, 202]: + 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 = None + if response.status_code == 200: + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _start_instance_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/start" + } + + @distributed_trace_async + async def begin_start_instance( + self, resource_group_name: str, sap_virtual_instance_name: str, central_instance_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Starts the SAP Central Services Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param central_instance_name: Central Services Instance resource name string modeled as + parameter for auto generation to work correctly. Required. + :type central_instance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatusResult or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_instance_initial( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + central_instance_name=central_instance_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_start_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/start" + } + + async def _stop_instance_initial( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + central_instance_name: str, + body: Optional[Union[_models.StopRequest, IO]] = None, + **kwargs: Any + ) -> Optional[_models.OperationStatusResult]: + 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["2022-11-01-preview"] = 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[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "StopRequest") + else: + _json = None + + request = build_stop_instance_request( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + central_instance_name=central_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._stop_instance_initial.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, 202]: + 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 = None + if response.status_code == 200: + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _stop_instance_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/stop" + } + + @overload + async def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + central_instance_name: str, + body: Optional[_models.StopRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Stops the SAP Central Services Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param central_instance_name: Central Services Instance resource name string modeled as + parameter for auto generation to work correctly. Required. + :type central_instance_name: str + :param body: SAP Central Services instance stop request body. Default value is None. + :type body: ~azure.mgmt.workloads.models.StopRequest + :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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatusResult or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + central_instance_name: str, + body: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Stops the SAP Central Services Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param central_instance_name: Central Services Instance resource name string modeled as + parameter for auto generation to work correctly. Required. + :type central_instance_name: str + :param body: SAP Central Services instance stop request body. Default value is None. + :type body: 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatusResult or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + central_instance_name: str, + body: Optional[Union[_models.StopRequest, IO]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Stops the SAP Central Services Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param central_instance_name: Central Services Instance resource name string modeled as + parameter for auto generation to work correctly. Required. + :type central_instance_name: str + :param body: SAP Central Services instance stop request body. Is either a model type or a IO + type. Default value is None. + :type body: ~azure.mgmt.workloads.models.StopRequest 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatusResult or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-01-preview"] = 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.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_instance_initial( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + central_instance_name=central_instance_name, + body=body, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_stop_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/stop" + } diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_database_instances_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_database_instances_operations.py index d2f55a6e9445..d03d684f5fb4 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_database_instances_operations.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_database_instances_operations.py @@ -36,6 +36,8 @@ build_delete_request, build_get_request, build_list_request, + build_start_instance_request, + build_stop_instance_request, build_update_request, ) from .._vendor import WorkloadsClientMixinABC @@ -98,7 +100,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPDatabaseInstance] = kwargs.pop("cls", None) @@ -157,7 +159,7 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -346,7 +348,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -416,7 +418,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -599,7 +601,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -664,7 +666,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) @@ -739,7 +741,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) @@ -808,7 +810,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPDatabaseInstanceList] = kwargs.pop("cls", None) @@ -881,3 +883,389 @@ async def get_next(next_link=None): list.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances" } + + async def _start_instance_initial( + self, resource_group_name: str, sap_virtual_instance_name: str, database_instance_name: str, **kwargs: Any + ) -> Optional[_models.OperationStatusResult]: + 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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) + + request = build_start_instance_request( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + database_instance_name=database_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._start_instance_initial.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, 202]: + 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 = None + if response.status_code == 200: + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _start_instance_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/start" + } + + @distributed_trace_async + async def begin_start_instance( + self, resource_group_name: str, sap_virtual_instance_name: str, database_instance_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Starts the database instance of the SAP system. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param database_instance_name: Database resource name string modeled as parameter for auto + generation to work correctly. Required. + :type database_instance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatusResult or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_instance_initial( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + database_instance_name=database_instance_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_start_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/start" + } + + async def _stop_instance_initial( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + database_instance_name: str, + body: Optional[Union[_models.StopRequest, IO]] = None, + **kwargs: Any + ) -> Optional[_models.OperationStatusResult]: + 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["2022-11-01-preview"] = 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[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "StopRequest") + else: + _json = None + + request = build_stop_instance_request( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + database_instance_name=database_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._stop_instance_initial.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, 202]: + 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 = None + if response.status_code == 200: + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _stop_instance_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/stop" + } + + @overload + async def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + database_instance_name: str, + body: Optional[_models.StopRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Stops the database instance of the SAP system. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param database_instance_name: Database resource name string modeled as parameter for auto + generation to work correctly. Required. + :type database_instance_name: str + :param body: Stop request for the database instance of the SAP system. Default value is None. + :type body: ~azure.mgmt.workloads.models.StopRequest + :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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatusResult or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + database_instance_name: str, + body: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Stops the database instance of the SAP system. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param database_instance_name: Database resource name string modeled as parameter for auto + generation to work correctly. Required. + :type database_instance_name: str + :param body: Stop request for the database instance of the SAP system. Default value is None. + :type body: 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatusResult or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + database_instance_name: str, + body: Optional[Union[_models.StopRequest, IO]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Stops the database instance of the SAP system. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param database_instance_name: Database resource name string modeled as parameter for auto + generation to work correctly. Required. + :type database_instance_name: str + :param body: Stop request for the database instance of the SAP system. Is either a model type + or a IO type. Default value is None. + :type body: ~azure.mgmt.workloads.models.StopRequest 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatusResult or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-01-preview"] = 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.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_instance_initial( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + database_instance_name=database_instance_name, + body=body, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_stop_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/stop" + } diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_landscape_monitor_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_landscape_monitor_operations.py new file mode 100644 index 000000000000..60ada0d3b98c --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_landscape_monitor_operations.py @@ -0,0 +1,578 @@ +# pylint: disable=too-many-lines +# 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. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._sap_landscape_monitor_operations import ( + build_create_request, + build_delete_request, + build_get_request, + build_list_request, + build_update_request, +) +from .._vendor import WorkloadsClientMixinABC + +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]] + + +class SapLandscapeMonitorOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.workloads.aio.WorkloadsClient`'s + :attr:`sap_landscape_monitor` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + 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(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> _models.SapLandscapeMonitor: + """Gets configuration values for Single Pane Of Glass for SAP monitor. + + Gets configuration values for Single Pane Of Glass for SAP monitor for the specified + subscription, resource group, and resource name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SapLandscapeMonitor or the result of cls(response) + :rtype: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.SapLandscapeMonitor] = kwargs.pop("cls", None) + + request = build_get_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.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("SapLandscapeMonitor", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default" + } + + @overload + async def create( + self, + resource_group_name: str, + monitor_name: str, + sap_landscape_monitor_parameter: _models.SapLandscapeMonitor, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SapLandscapeMonitor: + """Creates a SAP Landscape Monitor Dashboard. + + Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and + resource name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :param sap_landscape_monitor_parameter: Request body representing a configuration for Sap + Landscape Monitor Dashboard. Required. + :type sap_landscape_monitor_parameter: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :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: SapLandscapeMonitor or the result of cls(response) + :rtype: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + resource_group_name: str, + monitor_name: str, + sap_landscape_monitor_parameter: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SapLandscapeMonitor: + """Creates a SAP Landscape Monitor Dashboard. + + Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and + resource name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :param sap_landscape_monitor_parameter: Request body representing a configuration for Sap + Landscape Monitor Dashboard. Required. + :type sap_landscape_monitor_parameter: 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: SapLandscapeMonitor or the result of cls(response) + :rtype: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create( + self, + resource_group_name: str, + monitor_name: str, + sap_landscape_monitor_parameter: Union[_models.SapLandscapeMonitor, IO], + **kwargs: Any + ) -> _models.SapLandscapeMonitor: + """Creates a SAP Landscape Monitor Dashboard. + + Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and + resource name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :param sap_landscape_monitor_parameter: Request body representing a configuration for Sap + Landscape Monitor Dashboard. Is either a model type or a IO type. Required. + :type sap_landscape_monitor_parameter: ~azure.mgmt.workloads.models.SapLandscapeMonitor 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: SapLandscapeMonitor or the result of cls(response) + :rtype: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :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["2022-11-01-preview"] = 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.SapLandscapeMonitor] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(sap_landscape_monitor_parameter, (IO, bytes)): + _content = sap_landscape_monitor_parameter + else: + _json = self._serialize.body(sap_landscape_monitor_parameter, "SapLandscapeMonitor") + + request = build_create_request( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.create.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, 201]: + 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) + + if response.status_code == 200: + deserialized = self._deserialize("SapLandscapeMonitor", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SapLandscapeMonitor", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default" + } + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, monitor_name: str, **kwargs: Any + ) -> None: + """Deletes a SAP Landscape Monitor Dashboard. + + Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and + SAP monitor name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.delete.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, 204]: + 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) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default" + } + + @overload + async def update( + self, + resource_group_name: str, + monitor_name: str, + sap_landscape_monitor_parameter: _models.SapLandscapeMonitor, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SapLandscapeMonitor: + """Patches the SAP Landscape Monitor Dashboard. + + Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and + SAP monitor name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :param sap_landscape_monitor_parameter: Request body representing a configuration for Sap + Landscape Monitor Dashboard. Required. + :type sap_landscape_monitor_parameter: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :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: SapLandscapeMonitor or the result of cls(response) + :rtype: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + monitor_name: str, + sap_landscape_monitor_parameter: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SapLandscapeMonitor: + """Patches the SAP Landscape Monitor Dashboard. + + Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and + SAP monitor name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :param sap_landscape_monitor_parameter: Request body representing a configuration for Sap + Landscape Monitor Dashboard. Required. + :type sap_landscape_monitor_parameter: 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: SapLandscapeMonitor or the result of cls(response) + :rtype: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + monitor_name: str, + sap_landscape_monitor_parameter: Union[_models.SapLandscapeMonitor, IO], + **kwargs: Any + ) -> _models.SapLandscapeMonitor: + """Patches the SAP Landscape Monitor Dashboard. + + Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and + SAP monitor name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :param sap_landscape_monitor_parameter: Request body representing a configuration for Sap + Landscape Monitor Dashboard. Is either a model type or a IO type. Required. + :type sap_landscape_monitor_parameter: ~azure.mgmt.workloads.models.SapLandscapeMonitor 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: SapLandscapeMonitor or the result of cls(response) + :rtype: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :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["2022-11-01-preview"] = 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.SapLandscapeMonitor] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(sap_landscape_monitor_parameter, (IO, bytes)): + _content = sap_landscape_monitor_parameter + else: + _json = self._serialize.body(sap_landscape_monitor_parameter, "SapLandscapeMonitor") + + request = build_update_request( + resource_group_name=resource_group_name, + monitor_name=monitor_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("SapLandscapeMonitor", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default" + } + + @distributed_trace_async + async def list( + self, resource_group_name: str, monitor_name: str, **kwargs: Any + ) -> _models.SapLandscapeMonitorListResult: + """Gets configuration values for Single Pane Of Glass for SAP monitor. + + Gets configuration values for Single Pane Of Glass for SAP monitor for the specified + subscription, resource group, and resource name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SapLandscapeMonitorListResult or the result of cls(response) + :rtype: ~azure.mgmt.workloads.models.SapLandscapeMonitorListResult + :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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.SapLandscapeMonitorListResult] = kwargs.pop("cls", None) + + request = build_list_request( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.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("SapLandscapeMonitorListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor" + } diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_virtual_instances_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_virtual_instances_operations.py index 5b0ee6269fb9..830d02e508f8 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_virtual_instances_operations.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_sap_virtual_instances_operations.py @@ -88,7 +88,7 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -258,7 +258,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -336,7 +336,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPVirtualInstance] = kwargs.pop("cls", None) @@ -473,7 +473,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -541,7 +541,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) @@ -611,7 +611,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) @@ -676,7 +676,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPVirtualInstanceList] = kwargs.pop("cls", None) @@ -762,7 +762,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SAPVirtu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPVirtualInstanceList] = kwargs.pop("cls", None) @@ -848,7 +848,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) @@ -918,7 +918,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) @@ -983,7 +983,7 @@ async def _stop_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -1156,7 +1156,7 @@ async def begin_stop( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_skus_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_skus_operations.py deleted file mode 100644 index e5aa635128f9..000000000000 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_skus_operations.py +++ /dev/null @@ -1,141 +0,0 @@ -# pylint: disable=too-many-lines -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._skus_operations import build_list_request -from .._vendor import WorkloadsClientMixinABC - -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]] - - -class SkusOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.workloads.aio.WorkloadsClient`'s - :attr:`skus` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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 list(self, **kwargs: Any) -> AsyncIterable["_models.SkuDefinition"]: - """Lists all the available SKUs under this PR. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuDefinition or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.workloads.models.SkuDefinition] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[_models.SkusListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkusListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - 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) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/skus"} diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_wordpress_instances_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_wordpress_instances_operations.py deleted file mode 100644 index 7fc7213fbb3d..000000000000 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_wordpress_instances_operations.py +++ /dev/null @@ -1,525 +0,0 @@ -# pylint: disable=too-many-lines -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._wordpress_instances_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, -) -from .._vendor import WorkloadsClientMixinABC - -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]] - - -class WordpressInstancesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.workloads.aio.WorkloadsClient`'s - :attr:`wordpress_instances` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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 list( - self, resource_group_name: str, php_workload_name: str, **kwargs: Any - ) -> AsyncIterable["_models.WordpressInstanceResource"]: - """Lists WordPress instance resources under a phpWorkload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WordpressInstanceResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.workloads.models.WordpressInstanceResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[_models.WordpressInstanceResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WordpressInstanceResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - 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) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances" - } - - @distributed_trace_async - async def get( - self, resource_group_name: str, php_workload_name: str, **kwargs: Any - ) -> _models.WordpressInstanceResource: - """Gets the WordPress instance resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WordpressInstanceResource or the result of cls(response) - :rtype: ~azure.mgmt.workloads.models.WordpressInstanceResource - :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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[_models.WordpressInstanceResource] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.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("WordpressInstanceResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances/default" - } - - async def _create_or_update_initial( - self, - resource_group_name: str, - php_workload_name: str, - wordpress_instance_resource: Union[_models.WordpressInstanceResource, IO], - **kwargs: Any - ) -> _models.WordpressInstanceResource: - 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-12-01-preview"] = 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.WordpressInstanceResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(wordpress_instance_resource, (IO, bytes)): - _content = wordpress_instance_resource - else: - _json = self._serialize.body(wordpress_instance_resource, "WordpressInstanceResource") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.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, 201]: - 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) - - if response.status_code == 200: - deserialized = self._deserialize("WordpressInstanceResource", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("WordpressInstanceResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances/default" - } - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - php_workload_name: str, - wordpress_instance_resource: _models.WordpressInstanceResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.WordpressInstanceResource]: - """Create or updated WordPress instance resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param wordpress_instance_resource: Resource create or update request payload. Required. - :type wordpress_instance_resource: ~azure.mgmt.workloads.models.WordpressInstanceResource - :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 - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either WordpressInstanceResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.WordpressInstanceResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - php_workload_name: str, - wordpress_instance_resource: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.WordpressInstanceResource]: - """Create or updated WordPress instance resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param wordpress_instance_resource: Resource create or update request payload. Required. - :type wordpress_instance_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 - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either WordpressInstanceResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.WordpressInstanceResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - php_workload_name: str, - wordpress_instance_resource: Union[_models.WordpressInstanceResource, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.WordpressInstanceResource]: - """Create or updated WordPress instance resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param wordpress_instance_resource: Resource create or update request payload. Is either a - model type or a IO type. Required. - :type wordpress_instance_resource: ~azure.mgmt.workloads.models.WordpressInstanceResource 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 - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either WordpressInstanceResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.workloads.models.WordpressInstanceResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-12-01-preview"] = 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.WordpressInstanceResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - wordpress_instance_resource=wordpress_instance_resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WordpressInstanceResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances/default" - } - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, php_workload_name: str, **kwargs: Any - ) -> None: - """Delete WordPress instance resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.delete.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, 204]: - 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) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances/default" - } diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_workloads_client_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_workloads_client_operations.py index 54e3af577e04..95e5bf1bfa65 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_workloads_client_operations.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/aio/operations/_workloads_client_operations.py @@ -130,7 +130,7 @@ async def sap_sizing_recommendations( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -264,7 +264,7 @@ async def sap_supported_sku( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -398,7 +398,7 @@ async def sap_disk_configurations( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -536,7 +536,7 @@ async def sap_availability_zone_details( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/models/__init__.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/models/__init__.py index 031cfb2bdb82..c4af3e6e5f02 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/models/__init__.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/models/__init__.py @@ -7,19 +7,24 @@ # -------------------------------------------------------------------------- from ._models_py3 import ApplicationServerConfiguration -from ._models_py3 import BackupProfile -from ._models_py3 import CacheProfile +from ._models_py3 import ApplicationServerFullResourceNames +from ._models_py3 import ApplicationServerVmDetails from ._models_py3 import CentralServerConfiguration +from ._models_py3 import CentralServerFullResourceNames from ._models_py3 import CentralServerVmDetails +from ._models_py3 import CreateAndMountFileShareConfiguration from ._models_py3 import DB2ProviderInstanceProperties from ._models_py3 import DatabaseConfiguration -from ._models_py3 import DatabaseProfile +from ._models_py3 import DatabaseServerFullResourceNames from ._models_py3 import DatabaseVmDetails from ._models_py3 import DeployerVmPackages from ._models_py3 import DeploymentConfiguration from ._models_py3 import DeploymentWithOSConfiguration from ._models_py3 import DiscoveryConfiguration -from ._models_py3 import DiskInfo +from ._models_py3 import DiskConfiguration +from ._models_py3 import DiskDetails +from ._models_py3 import DiskSku +from ._models_py3 import DiskVolumeConfiguration from ._models_py3 import EnqueueReplicationServerProperties from ._models_py3 import EnqueueServerProperties from ._models_py3 import Error @@ -29,7 +34,7 @@ from ._models_py3 import ErrorInnerError from ._models_py3 import ErrorResponse from ._models_py3 import ExternalInstallationSoftwareConfiguration -from ._models_py3 import FileshareProfile +from ._models_py3 import FileShareConfiguration from ._models_py3 import GatewayServerProperties from ._models_py3 import HanaDbProviderInstanceProperties from ._models_py3 import HighAvailabilityConfiguration @@ -37,15 +42,17 @@ from ._models_py3 import ImageReference from ._models_py3 import InfrastructureConfiguration from ._models_py3 import LinuxConfiguration +from ._models_py3 import LoadBalancerDetails +from ._models_py3 import LoadBalancerResourceNames from ._models_py3 import ManagedRGConfiguration from ._models_py3 import MessageServerProperties from ._models_py3 import Monitor from ._models_py3 import MonitorListResult from ._models_py3 import MonitorPropertiesErrors +from ._models_py3 import MountFileShareConfiguration from ._models_py3 import MsSqlServerProviderInstanceProperties from ._models_py3 import NetworkConfiguration -from ._models_py3 import NetworkProfile -from ._models_py3 import NodeProfile +from ._models_py3 import NetworkInterfaceResourceNames from ._models_py3 import OSConfiguration from ._models_py3 import OSProfile from ._models_py3 import Operation @@ -57,14 +64,7 @@ from ._models_py3 import OperationsDefinitionArrayResponseWithContinuation from ._models_py3 import OperationsDefinitionDisplay from ._models_py3 import OperationsDisplayDefinition -from ._models_py3 import OsImageProfile from ._models_py3 import OsSapConfiguration -from ._models_py3 import PatchResourceRequestBody -from ._models_py3 import PatchResourceRequestBodyIdentity -from ._models_py3 import PhpProfile -from ._models_py3 import PhpWorkloadResource -from ._models_py3 import PhpWorkloadResourceIdentity -from ._models_py3 import PhpWorkloadResourceList from ._models_py3 import PrometheusHaClusterProviderInstanceProperties from ._models_py3 import PrometheusOSProviderInstanceProperties from ._models_py3 import ProviderInstance @@ -73,7 +73,6 @@ from ._models_py3 import ProviderSpecificProperties from ._models_py3 import ProxyResource from ._models_py3 import Resource -from ._models_py3 import RestrictionInfo from ._models_py3 import SAPApplicationServerInstance from ._models_py3 import SAPApplicationServerInstanceList from ._models_py3 import SAPAvailabilityZoneDetailsRequest @@ -96,29 +95,31 @@ from ._models_py3 import SAPVirtualInstance from ._models_py3 import SAPVirtualInstanceError from ._models_py3 import SAPVirtualInstanceList +from ._models_py3 import SapLandscapeMonitor +from ._models_py3 import SapLandscapeMonitorListResult +from ._models_py3 import SapLandscapeMonitorMetricThresholds +from ._models_py3 import SapLandscapeMonitorPropertiesGrouping +from ._models_py3 import SapLandscapeMonitorSidMapping from ._models_py3 import SapNetWeaverProviderInstanceProperties -from ._models_py3 import SearchProfile from ._models_py3 import ServiceInitiatedSoftwareConfiguration +from ._models_py3 import SharedStorageResourceNames from ._models_py3 import SingleServerConfiguration +from ._models_py3 import SingleServerCustomResourceNames +from ._models_py3 import SingleServerFullResourceNames from ._models_py3 import SingleServerRecommendationResult -from ._models_py3 import SiteProfile -from ._models_py3 import Sku -from ._models_py3 import SkuCapability -from ._models_py3 import SkuCapacity -from ._models_py3 import SkuCost -from ._models_py3 import SkuDefinition -from ._models_py3 import SkuLocationAndZones -from ._models_py3 import SkuRestriction -from ._models_py3 import SkuZoneDetail -from ._models_py3 import SkusListResult +from ._models_py3 import SkipFileShareConfiguration from ._models_py3 import SoftwareConfiguration from ._models_py3 import SshConfiguration from ._models_py3 import SshKeyPair from ._models_py3 import SshPublicKey from ._models_py3 import StopRequest +from ._models_py3 import StorageConfiguration +from ._models_py3 import StorageInformation from ._models_py3 import SystemData from ._models_py3 import Tags from ._models_py3 import ThreeTierConfiguration +from ._models_py3 import ThreeTierCustomResourceNames +from ._models_py3 import ThreeTierFullResourceNames from ._models_py3 import ThreeTierRecommendationResult from ._models_py3 import TrackedResource from ._models_py3 import UpdateMonitorRequest @@ -128,40 +129,22 @@ from ._models_py3 import UpdateSAPVirtualInstanceRequest from ._models_py3 import UserAssignedIdentity from ._models_py3 import UserAssignedServiceIdentity -from ._models_py3 import UserProfile from ._models_py3 import VirtualMachineConfiguration -from ._models_py3 import VmssNodesProfile +from ._models_py3 import VirtualMachineResourceNames from ._models_py3 import WindowsConfiguration -from ._models_py3 import WordpressInstanceResource -from ._models_py3 import WordpressInstanceResourceList from ._workloads_client_enums import ActionType -from ._workloads_client_enums import ApplicationProvisioningState -from ._workloads_client_enums import AzureFrontDoorEnabled +from ._workloads_client_enums import ApplicationServerVirtualMachineType from ._workloads_client_enums import CentralServerVirtualMachineType +from ._workloads_client_enums import ConfigurationType from ._workloads_client_enums import CreatedByType -from ._workloads_client_enums import DatabaseTier -from ._workloads_client_enums import DatabaseType -from ._workloads_client_enums import DiskStorageType -from ._workloads_client_enums import EnableBackup -from ._workloads_client_enums import EnableSslEnforcement +from ._workloads_client_enums import DiskSkuName from ._workloads_client_enums import EnqueueReplicationServerType -from ._workloads_client_enums import FileShareStorageType -from ._workloads_client_enums import FileShareType -from ._workloads_client_enums import HAEnabled -from ._workloads_client_enums import LoadBalancerType -from ._workloads_client_enums import LocationType from ._workloads_client_enums import ManagedServiceIdentityType -from ._workloads_client_enums import OSImageOffer -from ._workloads_client_enums import OSImagePublisher -from ._workloads_client_enums import OSImageSku -from ._workloads_client_enums import OSImageVersion +from ._workloads_client_enums import NamingPatternType from ._workloads_client_enums import OSType from ._workloads_client_enums import OperationProperties from ._workloads_client_enums import Origin -from ._workloads_client_enums import PHPVersion -from ._workloads_client_enums import PhpWorkloadProvisioningState -from ._workloads_client_enums import RedisCacheFamily from ._workloads_client_enums import RoutingPreference from ._workloads_client_enums import SAPConfigurationType from ._workloads_client_enums import SAPDatabaseScaleMethod @@ -174,15 +157,9 @@ from ._workloads_client_enums import SAPSoftwareInstallationType from ._workloads_client_enums import SAPVirtualInstanceState from ._workloads_client_enums import SAPVirtualInstanceStatus +from ._workloads_client_enums import SapLandscapeMonitorProvisioningState from ._workloads_client_enums import SapVirtualInstanceProvisioningState -from ._workloads_client_enums import SearchType -from ._workloads_client_enums import SkuRestrictionReasonCode -from ._workloads_client_enums import SkuRestrictionType -from ._workloads_client_enums import SkuScaleType -from ._workloads_client_enums import SkuTier from ._workloads_client_enums import SslPreference -from ._workloads_client_enums import WordpressVersions -from ._workloads_client_enums import WorkloadKind from ._workloads_client_enums import WorkloadMonitorActionType from ._workloads_client_enums import WorkloadMonitorProvisioningState from ._patch import __all__ as _patch_all @@ -191,19 +168,24 @@ __all__ = [ "ApplicationServerConfiguration", - "BackupProfile", - "CacheProfile", + "ApplicationServerFullResourceNames", + "ApplicationServerVmDetails", "CentralServerConfiguration", + "CentralServerFullResourceNames", "CentralServerVmDetails", + "CreateAndMountFileShareConfiguration", "DB2ProviderInstanceProperties", "DatabaseConfiguration", - "DatabaseProfile", + "DatabaseServerFullResourceNames", "DatabaseVmDetails", "DeployerVmPackages", "DeploymentConfiguration", "DeploymentWithOSConfiguration", "DiscoveryConfiguration", - "DiskInfo", + "DiskConfiguration", + "DiskDetails", + "DiskSku", + "DiskVolumeConfiguration", "EnqueueReplicationServerProperties", "EnqueueServerProperties", "Error", @@ -213,7 +195,7 @@ "ErrorInnerError", "ErrorResponse", "ExternalInstallationSoftwareConfiguration", - "FileshareProfile", + "FileShareConfiguration", "GatewayServerProperties", "HanaDbProviderInstanceProperties", "HighAvailabilityConfiguration", @@ -221,15 +203,17 @@ "ImageReference", "InfrastructureConfiguration", "LinuxConfiguration", + "LoadBalancerDetails", + "LoadBalancerResourceNames", "ManagedRGConfiguration", "MessageServerProperties", "Monitor", "MonitorListResult", "MonitorPropertiesErrors", + "MountFileShareConfiguration", "MsSqlServerProviderInstanceProperties", "NetworkConfiguration", - "NetworkProfile", - "NodeProfile", + "NetworkInterfaceResourceNames", "OSConfiguration", "OSProfile", "Operation", @@ -241,14 +225,7 @@ "OperationsDefinitionArrayResponseWithContinuation", "OperationsDefinitionDisplay", "OperationsDisplayDefinition", - "OsImageProfile", "OsSapConfiguration", - "PatchResourceRequestBody", - "PatchResourceRequestBodyIdentity", - "PhpProfile", - "PhpWorkloadResource", - "PhpWorkloadResourceIdentity", - "PhpWorkloadResourceList", "PrometheusHaClusterProviderInstanceProperties", "PrometheusOSProviderInstanceProperties", "ProviderInstance", @@ -257,7 +234,6 @@ "ProviderSpecificProperties", "ProxyResource", "Resource", - "RestrictionInfo", "SAPApplicationServerInstance", "SAPApplicationServerInstanceList", "SAPAvailabilityZoneDetailsRequest", @@ -280,29 +256,31 @@ "SAPVirtualInstance", "SAPVirtualInstanceError", "SAPVirtualInstanceList", + "SapLandscapeMonitor", + "SapLandscapeMonitorListResult", + "SapLandscapeMonitorMetricThresholds", + "SapLandscapeMonitorPropertiesGrouping", + "SapLandscapeMonitorSidMapping", "SapNetWeaverProviderInstanceProperties", - "SearchProfile", "ServiceInitiatedSoftwareConfiguration", + "SharedStorageResourceNames", "SingleServerConfiguration", + "SingleServerCustomResourceNames", + "SingleServerFullResourceNames", "SingleServerRecommendationResult", - "SiteProfile", - "Sku", - "SkuCapability", - "SkuCapacity", - "SkuCost", - "SkuDefinition", - "SkuLocationAndZones", - "SkuRestriction", - "SkuZoneDetail", - "SkusListResult", + "SkipFileShareConfiguration", "SoftwareConfiguration", "SshConfiguration", "SshKeyPair", "SshPublicKey", "StopRequest", + "StorageConfiguration", + "StorageInformation", "SystemData", "Tags", "ThreeTierConfiguration", + "ThreeTierCustomResourceNames", + "ThreeTierFullResourceNames", "ThreeTierRecommendationResult", "TrackedResource", "UpdateMonitorRequest", @@ -312,39 +290,21 @@ "UpdateSAPVirtualInstanceRequest", "UserAssignedIdentity", "UserAssignedServiceIdentity", - "UserProfile", "VirtualMachineConfiguration", - "VmssNodesProfile", + "VirtualMachineResourceNames", "WindowsConfiguration", - "WordpressInstanceResource", - "WordpressInstanceResourceList", "ActionType", - "ApplicationProvisioningState", - "AzureFrontDoorEnabled", + "ApplicationServerVirtualMachineType", "CentralServerVirtualMachineType", + "ConfigurationType", "CreatedByType", - "DatabaseTier", - "DatabaseType", - "DiskStorageType", - "EnableBackup", - "EnableSslEnforcement", + "DiskSkuName", "EnqueueReplicationServerType", - "FileShareStorageType", - "FileShareType", - "HAEnabled", - "LoadBalancerType", - "LocationType", "ManagedServiceIdentityType", - "OSImageOffer", - "OSImagePublisher", - "OSImageSku", - "OSImageVersion", + "NamingPatternType", "OSType", "OperationProperties", "Origin", - "PHPVersion", - "PhpWorkloadProvisioningState", - "RedisCacheFamily", "RoutingPreference", "SAPConfigurationType", "SAPDatabaseScaleMethod", @@ -357,15 +317,9 @@ "SAPSoftwareInstallationType", "SAPVirtualInstanceState", "SAPVirtualInstanceStatus", + "SapLandscapeMonitorProvisioningState", "SapVirtualInstanceProvisioningState", - "SearchType", - "SkuRestrictionReasonCode", - "SkuRestrictionType", - "SkuScaleType", - "SkuTier", "SslPreference", - "WordpressVersions", - "WorkloadKind", "WorkloadMonitorActionType", "WorkloadMonitorProvisioningState", ] diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/models/_models_py3.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/models/_models_py3.py index 5d21fad549a2..de1b391c40e5 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/models/_models_py3.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/models/_models_py3.py @@ -8,20 +8,13 @@ # -------------------------------------------------------------------------- import datetime -import sys from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from .. import _serialization -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from .. import models as _models -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object class ApplicationServerConfiguration(_serialization.Model): @@ -56,8 +49,8 @@ def __init__( subnet_id: str, virtual_machine_configuration: "_models.VirtualMachineConfiguration", instance_count: int, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword subnet_id: The subnet id. Required. :paramtype subnet_id: str @@ -74,100 +67,74 @@ def __init__( self.instance_count = instance_count -class BackupProfile(_serialization.Model): - """Backup profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. +class ApplicationServerFullResourceNames(_serialization.Model): + """The full resource names object for application layer resources. The number of entries in this + list should be equal to the number VMs to be created for application layer. - :ivar backup_enabled: Whether to enable Azure backup for the workload. Required. Known values - are: "Enabled" and "Disabled". - :vartype backup_enabled: str or ~azure.mgmt.workloads.models.EnableBackup - :ivar vault_resource_id: Backup vault resource Id. - :vartype vault_resource_id: str + :ivar virtual_machines: The list of virtual machine naming details. + :vartype virtual_machines: list[~azure.mgmt.workloads.models.VirtualMachineResourceNames] + :ivar availability_set_name: The full name for availability set. In case name is not provided, + it will be defaulted to {SID}-App-AvSet. + :vartype availability_set_name: str """ - _validation = { - "backup_enabled": {"required": True}, - "vault_resource_id": {"readonly": True}, - } - _attribute_map = { - "backup_enabled": {"key": "backupEnabled", "type": "str"}, - "vault_resource_id": {"key": "vaultResourceId", "type": "str"}, + "virtual_machines": {"key": "virtualMachines", "type": "[VirtualMachineResourceNames]"}, + "availability_set_name": {"key": "availabilitySetName", "type": "str"}, } - def __init__(self, *, backup_enabled: Union[str, "_models.EnableBackup"], **kwargs): + def __init__( + self, + *, + virtual_machines: Optional[List["_models.VirtualMachineResourceNames"]] = None, + availability_set_name: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword backup_enabled: Whether to enable Azure backup for the workload. Required. Known - values are: "Enabled" and "Disabled". - :paramtype backup_enabled: str or ~azure.mgmt.workloads.models.EnableBackup + :keyword virtual_machines: The list of virtual machine naming details. + :paramtype virtual_machines: list[~azure.mgmt.workloads.models.VirtualMachineResourceNames] + :keyword availability_set_name: The full name for availability set. In case name is not + provided, it will be defaulted to {SID}-App-AvSet. + :paramtype availability_set_name: str """ super().__init__(**kwargs) - self.backup_enabled = backup_enabled - self.vault_resource_id = None + self.virtual_machines = virtual_machines + self.availability_set_name = availability_set_name -class CacheProfile(_serialization.Model): - """Cache profile. +class ApplicationServerVmDetails(_serialization.Model): + """The Application Server VM Details. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar name: Cache name. - :vartype name: str - :ivar sku_name: Cache SKU name. Required. - :vartype sku_name: str - :ivar family: Cache family. Required. Known values are: "C" and "P". - :vartype family: str or ~azure.mgmt.workloads.models.RedisCacheFamily - :ivar capacity: Cache capacity. Required. - :vartype capacity: int - :ivar cache_resource_id: Cache resource Id. - :vartype cache_resource_id: str + :ivar type: Defines the type of application server VM. Known values are: "Active", "Standby", + and "Unknown". + :vartype type: str or ~azure.mgmt.workloads.models.ApplicationServerVirtualMachineType + :ivar virtual_machine_id: + :vartype virtual_machine_id: str + :ivar storage_details: Storage details of all the Storage Accounts attached to the App Virtual + Machine. For e.g. NFS on AFS Shared Storage. + :vartype storage_details: list[~azure.mgmt.workloads.models.StorageInformation] """ _validation = { - "sku_name": {"required": True}, - "family": {"required": True}, - "capacity": {"required": True}, - "cache_resource_id": {"readonly": True}, + "type": {"readonly": True}, + "virtual_machine_id": {"readonly": True}, + "storage_details": {"readonly": True}, } _attribute_map = { - "name": {"key": "name", "type": "str"}, - "sku_name": {"key": "skuName", "type": "str"}, - "family": {"key": "family", "type": "str"}, - "capacity": {"key": "capacity", "type": "int"}, - "cache_resource_id": {"key": "cacheResourceId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "virtual_machine_id": {"key": "virtualMachineId", "type": "str"}, + "storage_details": {"key": "storageDetails", "type": "[StorageInformation]"}, } - def __init__( - self, - *, - sku_name: str, - family: Union[str, "_models.RedisCacheFamily"], - capacity: int, - name: Optional[str] = None, - **kwargs - ): - """ - :keyword name: Cache name. - :paramtype name: str - :keyword sku_name: Cache SKU name. Required. - :paramtype sku_name: str - :keyword family: Cache family. Required. Known values are: "C" and "P". - :paramtype family: str or ~azure.mgmt.workloads.models.RedisCacheFamily - :keyword capacity: Cache capacity. Required. - :paramtype capacity: int - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.name = name - self.sku_name = sku_name - self.family = family - self.capacity = capacity - self.cache_resource_id = None + self.type = None + self.virtual_machine_id = None + self.storage_details = None class CentralServerConfiguration(_serialization.Model): @@ -202,8 +169,8 @@ def __init__( subnet_id: str, virtual_machine_configuration: "_models.VirtualMachineConfiguration", instance_count: int, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword subnet_id: The subnet id. Required. :paramtype subnet_id: str @@ -220,6 +187,55 @@ def __init__( self.instance_count = instance_count +class CentralServerFullResourceNames(_serialization.Model): + """The full resource names object for central server layer resources. + + :ivar virtual_machines: The list of names for all ASCS virtual machines to be deployed. The + number of entries in this list should be equal to the number VMs to be created for ASCS layer. + At maximum, there can be two virtual machines at this layer: ASCS and ERS. + :vartype virtual_machines: list[~azure.mgmt.workloads.models.VirtualMachineResourceNames] + :ivar availability_set_name: The full name for availability set. In case name is not provided, + it will be defaulted to {SID}-ASCS-AvSet. + :vartype availability_set_name: str + :ivar load_balancer: The resource names object for load balancer and related resources. + :vartype load_balancer: ~azure.mgmt.workloads.models.LoadBalancerResourceNames + """ + + _validation = { + "virtual_machines": {"max_items": 2, "min_items": 0}, + } + + _attribute_map = { + "virtual_machines": {"key": "virtualMachines", "type": "[VirtualMachineResourceNames]"}, + "availability_set_name": {"key": "availabilitySetName", "type": "str"}, + "load_balancer": {"key": "loadBalancer", "type": "LoadBalancerResourceNames"}, + } + + def __init__( + self, + *, + virtual_machines: Optional[List["_models.VirtualMachineResourceNames"]] = None, + availability_set_name: Optional[str] = None, + load_balancer: Optional["_models.LoadBalancerResourceNames"] = None, + **kwargs: Any + ) -> None: + """ + :keyword virtual_machines: The list of names for all ASCS virtual machines to be deployed. The + number of entries in this list should be equal to the number VMs to be created for ASCS layer. + At maximum, there can be two virtual machines at this layer: ASCS and ERS. + :paramtype virtual_machines: list[~azure.mgmt.workloads.models.VirtualMachineResourceNames] + :keyword availability_set_name: The full name for availability set. In case name is not + provided, it will be defaulted to {SID}-ASCS-AvSet. + :paramtype availability_set_name: str + :keyword load_balancer: The resource names object for load balancer and related resources. + :paramtype load_balancer: ~azure.mgmt.workloads.models.LoadBalancerResourceNames + """ + super().__init__(**kwargs) + self.virtual_machines = virtual_machines + self.availability_set_name = availability_set_name + self.load_balancer = load_balancer + + class CentralServerVmDetails(_serialization.Model): """The SAP Central Services Instance VM details. @@ -230,23 +246,108 @@ class CentralServerVmDetails(_serialization.Model): :vartype type: str or ~azure.mgmt.workloads.models.CentralServerVirtualMachineType :ivar virtual_machine_id: :vartype virtual_machine_id: str + :ivar storage_details: Storage details of all the Storage Accounts attached to the ASCS Virtual + Machine. For e.g. NFS on AFS Shared Storage. + :vartype storage_details: list[~azure.mgmt.workloads.models.StorageInformation] """ _validation = { "type": {"readonly": True}, "virtual_machine_id": {"readonly": True}, + "storage_details": {"readonly": True}, } _attribute_map = { "type": {"key": "type", "type": "str"}, "virtual_machine_id": {"key": "virtualMachineId", "type": "str"}, + "storage_details": {"key": "storageDetails", "type": "[StorageInformation]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.type = None self.virtual_machine_id = None + self.storage_details = None + + +class FileShareConfiguration(_serialization.Model): + """File Share configuration details, populated with information on storage configuration mounted + on the VIS. The createAndMount option is selected in case of missing input. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + CreateAndMountFileShareConfiguration, MountFileShareConfiguration, SkipFileShareConfiguration + + All required parameters must be populated in order to send to Azure. + + :ivar configuration_type: The type of file share config. Required. Known values are: "Skip", + "CreateAndMount", and "Mount". + :vartype configuration_type: str or ~azure.mgmt.workloads.models.ConfigurationType + """ + + _validation = { + "configuration_type": {"required": True}, + } + + _attribute_map = { + "configuration_type": {"key": "configurationType", "type": "str"}, + } + + _subtype_map = { + "configuration_type": { + "CreateAndMount": "CreateAndMountFileShareConfiguration", + "Mount": "MountFileShareConfiguration", + "Skip": "SkipFileShareConfiguration", + } + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.configuration_type: Optional[str] = None + + +class CreateAndMountFileShareConfiguration(FileShareConfiguration): + """Gets or sets the file share configuration for file share created with the VIS case. + + All required parameters must be populated in order to send to Azure. + + :ivar configuration_type: The type of file share config. Required. Known values are: "Skip", + "CreateAndMount", and "Mount". + :vartype configuration_type: str or ~azure.mgmt.workloads.models.ConfigurationType + :ivar resource_group: The name of file share resource group. The app rg is used in case of + missing input. + :vartype resource_group: str + :ivar storage_account_name: The name of file share storage account name . A custom name is used + in case of missing input. + :vartype storage_account_name: str + """ + + _validation = { + "configuration_type": {"required": True}, + } + + _attribute_map = { + "configuration_type": {"key": "configurationType", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "storage_account_name": {"key": "storageAccountName", "type": "str"}, + } + + def __init__( + self, *, resource_group: Optional[str] = None, storage_account_name: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword resource_group: The name of file share resource group. The app rg is used in case of + missing input. + :paramtype resource_group: str + :keyword storage_account_name: The name of file share storage account name . A custom name is + used in case of missing input. + :paramtype storage_account_name: str + """ + super().__init__(**kwargs) + self.configuration_type: str = "CreateAndMount" + self.resource_group = resource_group + self.storage_account_name = storage_account_name class DatabaseConfiguration(_serialization.Model): @@ -263,6 +364,8 @@ class DatabaseConfiguration(_serialization.Model): ~azure.mgmt.workloads.models.VirtualMachineConfiguration :ivar instance_count: The number of database VMs. Required. :vartype instance_count: int + :ivar disk_configuration: Gets or sets the disk configuration. + :vartype disk_configuration: ~azure.mgmt.workloads.models.DiskConfiguration """ _validation = { @@ -276,6 +379,7 @@ class DatabaseConfiguration(_serialization.Model): "subnet_id": {"key": "subnetId", "type": "str"}, "virtual_machine_configuration": {"key": "virtualMachineConfiguration", "type": "VirtualMachineConfiguration"}, "instance_count": {"key": "instanceCount", "type": "int"}, + "disk_configuration": {"key": "diskConfiguration", "type": "DiskConfiguration"}, } def __init__( @@ -285,8 +389,9 @@ def __init__( virtual_machine_configuration: "_models.VirtualMachineConfiguration", instance_count: int, database_type: Optional[Union[str, "_models.SAPDatabaseType"]] = None, - **kwargs - ): + disk_configuration: Optional["_models.DiskConfiguration"] = None, + **kwargs: Any + ) -> None: """ :keyword database_type: The database type. Known values are: "HANA" and "DB2". :paramtype database_type: str or ~azure.mgmt.workloads.models.SAPDatabaseType @@ -298,129 +403,61 @@ def __init__( ~azure.mgmt.workloads.models.VirtualMachineConfiguration :keyword instance_count: The number of database VMs. Required. :paramtype instance_count: int + :keyword disk_configuration: Gets or sets the disk configuration. + :paramtype disk_configuration: ~azure.mgmt.workloads.models.DiskConfiguration """ super().__init__(**kwargs) self.database_type = database_type self.subnet_id = subnet_id self.virtual_machine_configuration = virtual_machine_configuration self.instance_count = instance_count + self.disk_configuration = disk_configuration -class DatabaseProfile(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Workload database profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. +class DatabaseServerFullResourceNames(_serialization.Model): + """The full resource names object for database layer resources. The number of entries in this list + should be equal to the number VMs to be created for database layer. - :ivar type: Database type. Required. "MySql" - :vartype type: str or ~azure.mgmt.workloads.models.DatabaseType - :ivar server_name: Database server name. - :vartype server_name: str - :ivar version: Database version. - :vartype version: str - :ivar sku: The name of the server SKU, e.g. Standard_D32s_v4. Required. - :vartype sku: str - :ivar tier: Tier of the server SKU. Required. Known values are: "Burstable", "GeneralPurpose", - and "MemoryOptimized". - :vartype tier: str or ~azure.mgmt.workloads.models.DatabaseTier - :ivar ha_enabled: Whether to enable HA for the server. Known values are: "Enabled" and - "Disabled". - :vartype ha_enabled: str or ~azure.mgmt.workloads.models.HAEnabled - :ivar storage_sku: SKU name for database storage. - :vartype storage_sku: str - :ivar storage_in_gb: Database storage size in GB. - :vartype storage_in_gb: int - :ivar storage_iops: Storage IOPS for the server. - :vartype storage_iops: int - :ivar backup_retention_days: Backup retention days for the server. - :vartype backup_retention_days: int - :ivar ssl_enforcement_enabled: Whether to enable SSL enforcement on the database. Known values - are: "Enabled" and "Disabled". - :vartype ssl_enforcement_enabled: str or ~azure.mgmt.workloads.models.EnableSslEnforcement - :ivar server_resource_id: Azure Database Server resource Id. - :vartype server_resource_id: str + :ivar virtual_machines: The list of virtual machine naming details. + :vartype virtual_machines: list[~azure.mgmt.workloads.models.VirtualMachineResourceNames] + :ivar availability_set_name: The full name for availability set. In case name is not provided, + it will be defaulted to {SID}-DB-AvSet. + :vartype availability_set_name: str + :ivar load_balancer: The resource names object for load balancer and related resources. + :vartype load_balancer: ~azure.mgmt.workloads.models.LoadBalancerResourceNames """ _validation = { - "type": {"required": True}, - "sku": {"required": True}, - "tier": {"required": True}, - "storage_in_gb": {"minimum": 1}, - "server_resource_id": {"readonly": True}, + "virtual_machines": {"max_items": 2, "min_items": 0}, } _attribute_map = { - "type": {"key": "type", "type": "str"}, - "server_name": {"key": "serverName", "type": "str"}, - "version": {"key": "version", "type": "str"}, - "sku": {"key": "sku", "type": "str"}, - "tier": {"key": "tier", "type": "str"}, - "ha_enabled": {"key": "haEnabled", "type": "str"}, - "storage_sku": {"key": "storageSku", "type": "str"}, - "storage_in_gb": {"key": "storageInGB", "type": "int"}, - "storage_iops": {"key": "storageIops", "type": "int"}, - "backup_retention_days": {"key": "backupRetentionDays", "type": "int"}, - "ssl_enforcement_enabled": {"key": "sslEnforcementEnabled", "type": "str"}, - "server_resource_id": {"key": "serverResourceId", "type": "str"}, + "virtual_machines": {"key": "virtualMachines", "type": "[VirtualMachineResourceNames]"}, + "availability_set_name": {"key": "availabilitySetName", "type": "str"}, + "load_balancer": {"key": "loadBalancer", "type": "LoadBalancerResourceNames"}, } def __init__( self, *, - type: Union[str, "_models.DatabaseType"], - sku: str, - tier: Union[str, "_models.DatabaseTier"], - server_name: Optional[str] = None, - version: Optional[str] = None, - ha_enabled: Optional[Union[str, "_models.HAEnabled"]] = None, - storage_sku: Optional[str] = None, - storage_in_gb: Optional[int] = None, - storage_iops: Optional[int] = None, - backup_retention_days: Optional[int] = None, - ssl_enforcement_enabled: Optional[Union[str, "_models.EnableSslEnforcement"]] = None, - **kwargs - ): - """ - :keyword type: Database type. Required. "MySql" - :paramtype type: str or ~azure.mgmt.workloads.models.DatabaseType - :keyword server_name: Database server name. - :paramtype server_name: str - :keyword version: Database version. - :paramtype version: str - :keyword sku: The name of the server SKU, e.g. Standard_D32s_v4. Required. - :paramtype sku: str - :keyword tier: Tier of the server SKU. Required. Known values are: "Burstable", - "GeneralPurpose", and "MemoryOptimized". - :paramtype tier: str or ~azure.mgmt.workloads.models.DatabaseTier - :keyword ha_enabled: Whether to enable HA for the server. Known values are: "Enabled" and - "Disabled". - :paramtype ha_enabled: str or ~azure.mgmt.workloads.models.HAEnabled - :keyword storage_sku: SKU name for database storage. - :paramtype storage_sku: str - :keyword storage_in_gb: Database storage size in GB. - :paramtype storage_in_gb: int - :keyword storage_iops: Storage IOPS for the server. - :paramtype storage_iops: int - :keyword backup_retention_days: Backup retention days for the server. - :paramtype backup_retention_days: int - :keyword ssl_enforcement_enabled: Whether to enable SSL enforcement on the database. Known - values are: "Enabled" and "Disabled". - :paramtype ssl_enforcement_enabled: str or ~azure.mgmt.workloads.models.EnableSslEnforcement + virtual_machines: Optional[List["_models.VirtualMachineResourceNames"]] = None, + availability_set_name: Optional[str] = None, + load_balancer: Optional["_models.LoadBalancerResourceNames"] = None, + **kwargs: Any + ) -> None: + """ + :keyword virtual_machines: The list of virtual machine naming details. + :paramtype virtual_machines: list[~azure.mgmt.workloads.models.VirtualMachineResourceNames] + :keyword availability_set_name: The full name for availability set. In case name is not + provided, it will be defaulted to {SID}-DB-AvSet. + :paramtype availability_set_name: str + :keyword load_balancer: The resource names object for load balancer and related resources. + :paramtype load_balancer: ~azure.mgmt.workloads.models.LoadBalancerResourceNames """ super().__init__(**kwargs) - self.type = type - self.server_name = server_name - self.version = version - self.sku = sku - self.tier = tier - self.ha_enabled = ha_enabled - self.storage_sku = storage_sku - self.storage_in_gb = storage_in_gb - self.storage_iops = storage_iops - self.backup_retention_days = backup_retention_days - self.ssl_enforcement_enabled = ssl_enforcement_enabled - self.server_resource_id = None + self.virtual_machines = virtual_machines + self.availability_set_name = availability_set_name + self.load_balancer = load_balancer class DatabaseVmDetails(_serialization.Model): @@ -431,25 +468,31 @@ class DatabaseVmDetails(_serialization.Model): :ivar virtual_machine_id: :vartype virtual_machine_id: str :ivar status: Defines the SAP Instance status. Known values are: "Starting", "Running", - "Stopping", "Offline", "PartiallyRunning", and "Unavailable". + "Stopping", "Offline", "PartiallyRunning", "Unavailable", and "SoftShutdown". :vartype status: str or ~azure.mgmt.workloads.models.SAPVirtualInstanceStatus + :ivar storage_details: Storage details of all the Storage Accounts attached to the Database + Virtual Machine. For e.g. NFS on AFS Shared Storage. + :vartype storage_details: list[~azure.mgmt.workloads.models.StorageInformation] """ _validation = { "virtual_machine_id": {"readonly": True}, "status": {"readonly": True}, + "storage_details": {"readonly": True}, } _attribute_map = { "virtual_machine_id": {"key": "virtualMachineId", "type": "str"}, "status": {"key": "status", "type": "str"}, + "storage_details": {"key": "storageDetails", "type": "[StorageInformation]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.virtual_machine_id = None self.status = None + self.storage_details = None class ProviderSpecificProperties(_serialization.Model): @@ -485,7 +528,7 @@ class ProviderSpecificProperties(_serialization.Model): } } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.provider_type: Optional[str] = None @@ -548,8 +591,8 @@ def __init__( sap_sid: Optional[str] = None, ssl_preference: Optional[Union[str, "_models.SslPreference"]] = None, ssl_certificate_uri: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword hostname: Gets or sets the target virtual machine name. :paramtype hostname: str @@ -599,7 +642,7 @@ class DeployerVmPackages(_serialization.Model): "storage_account_id": {"key": "storageAccountId", "type": "str"}, } - def __init__(self, *, url: Optional[str] = None, storage_account_id: Optional[str] = None, **kwargs): + def __init__(self, *, url: Optional[str] = None, storage_account_id: Optional[str] = None, **kwargs: Any) -> None: """ :keyword url: The URL to the deployer VM packages file. :paramtype url: str @@ -640,7 +683,7 @@ class SAPConfiguration(_serialization.Model): } } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.configuration_type: Optional[str] = None @@ -679,8 +722,8 @@ def __init__( app_location: Optional[str] = None, infrastructure_configuration: Optional["_models.InfrastructureConfiguration"] = None, software_configuration: Optional["_models.SoftwareConfiguration"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword app_location: The geo-location where the SAP system is to be created. :paramtype app_location: str @@ -734,8 +777,8 @@ def __init__( infrastructure_configuration: Optional["_models.InfrastructureConfiguration"] = None, software_configuration: Optional["_models.SoftwareConfiguration"] = None, os_sap_configuration: Optional["_models.OsSapConfiguration"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword app_location: The geo-location where the SAP system is to be created. :paramtype app_location: str @@ -767,66 +810,210 @@ class DiscoveryConfiguration(SAPConfiguration): :vartype configuration_type: str or ~azure.mgmt.workloads.models.SAPConfigurationType :ivar central_server_vm_id: The virtual machine ID of the Central Server. :vartype central_server_vm_id: str + :ivar managed_rg_storage_account_name: The custom storage account name for the storage account + created by the service in the managed resource group created as part of VIS + deployment.:code:`
`:code:`
`Refer to the storage account naming rules `here + `_.:code:`
`:code:`
`If + not provided, the service will create the storage account with a random name. + :vartype managed_rg_storage_account_name: str :ivar app_location: The geo-location where the SAP system exists. :vartype app_location: str """ _validation = { "configuration_type": {"required": True}, + "managed_rg_storage_account_name": {"max_length": 24, "min_length": 3}, "app_location": {"readonly": True}, } _attribute_map = { "configuration_type": {"key": "configurationType", "type": "str"}, "central_server_vm_id": {"key": "centralServerVmId", "type": "str"}, + "managed_rg_storage_account_name": {"key": "managedRgStorageAccountName", "type": "str"}, "app_location": {"key": "appLocation", "type": "str"}, } - def __init__(self, *, central_server_vm_id: Optional[str] = None, **kwargs): + def __init__( + self, + *, + central_server_vm_id: Optional[str] = None, + managed_rg_storage_account_name: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword central_server_vm_id: The virtual machine ID of the Central Server. :paramtype central_server_vm_id: str + :keyword managed_rg_storage_account_name: The custom storage account name for the storage + account created by the service in the managed resource group created as part of VIS + deployment.:code:`
`:code:`
`Refer to the storage account naming rules `here + `_.:code:`
`:code:`
`If + not provided, the service will create the storage account with a random name. + :paramtype managed_rg_storage_account_name: str """ super().__init__(**kwargs) self.configuration_type: str = "Discovery" self.central_server_vm_id = central_server_vm_id + self.managed_rg_storage_account_name = managed_rg_storage_account_name self.app_location = None -class DiskInfo(_serialization.Model): - """Disk resource creation details. - - All required parameters must be populated in order to send to Azure. +class DiskConfiguration(_serialization.Model): + """The Disk Configuration Details. - :ivar storage_type: Storage type. Required. Known values are: "Premium_LRS", "Standard_LRS", - and "StandardSSD_LRS". - :vartype storage_type: str or ~azure.mgmt.workloads.models.DiskStorageType - :ivar size_in_gb: Disk size in GB. - :vartype size_in_gb: int + :ivar disk_volume_configurations: The disk configuration for the db volume. For HANA, Required + volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : + ['backup']. + :vartype disk_volume_configurations: dict[str, + ~azure.mgmt.workloads.models.DiskVolumeConfiguration] """ - _validation = { - "storage_type": {"required": True}, + _attribute_map = { + "disk_volume_configurations": {"key": "diskVolumeConfigurations", "type": "{DiskVolumeConfiguration}"}, } + def __init__( + self, + *, + disk_volume_configurations: Optional[Dict[str, "_models.DiskVolumeConfiguration"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword disk_volume_configurations: The disk configuration for the db volume. For HANA, + Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume + : ['backup']. + :paramtype disk_volume_configurations: dict[str, + ~azure.mgmt.workloads.models.DiskVolumeConfiguration] + """ + super().__init__(**kwargs) + self.disk_volume_configurations = disk_volume_configurations + + +class DiskDetails(_serialization.Model): + """The supported disk size details for a disk type. + + :ivar sku: The disk sku. + :vartype sku: ~azure.mgmt.workloads.models.DiskSku + :ivar size_gb: The disk size in GB. + :vartype size_gb: int + :ivar minimum_supported_disk_count: The minimum supported disk count. + :vartype minimum_supported_disk_count: int + :ivar maximum_supported_disk_count: The maximum supported disk count. + :vartype maximum_supported_disk_count: int + :ivar iops_read_write: The disk Iops. + :vartype iops_read_write: int + :ivar mbps_read_write: The disk provisioned throughput in MBps. + :vartype mbps_read_write: int + :ivar disk_tier: The disk tier, e.g. P10, E10. + :vartype disk_tier: str + """ + _attribute_map = { - "storage_type": {"key": "storageType", "type": "str"}, - "size_in_gb": {"key": "sizeInGB", "type": "int"}, + "sku": {"key": "sku", "type": "DiskSku"}, + "size_gb": {"key": "sizeGB", "type": "int"}, + "minimum_supported_disk_count": {"key": "minimumSupportedDiskCount", "type": "int"}, + "maximum_supported_disk_count": {"key": "maximumSupportedDiskCount", "type": "int"}, + "iops_read_write": {"key": "iopsReadWrite", "type": "int"}, + "mbps_read_write": {"key": "mbpsReadWrite", "type": "int"}, + "disk_tier": {"key": "diskTier", "type": "str"}, } def __init__( - self, *, storage_type: Union[str, "_models.DiskStorageType"], size_in_gb: Optional[int] = None, **kwargs - ): + self, + *, + sku: Optional["_models.DiskSku"] = None, + size_gb: Optional[int] = None, + minimum_supported_disk_count: Optional[int] = None, + maximum_supported_disk_count: Optional[int] = None, + iops_read_write: Optional[int] = None, + mbps_read_write: Optional[int] = None, + disk_tier: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword sku: The disk sku. + :paramtype sku: ~azure.mgmt.workloads.models.DiskSku + :keyword size_gb: The disk size in GB. + :paramtype size_gb: int + :keyword minimum_supported_disk_count: The minimum supported disk count. + :paramtype minimum_supported_disk_count: int + :keyword maximum_supported_disk_count: The maximum supported disk count. + :paramtype maximum_supported_disk_count: int + :keyword iops_read_write: The disk Iops. + :paramtype iops_read_write: int + :keyword mbps_read_write: The disk provisioned throughput in MBps. + :paramtype mbps_read_write: int + :keyword disk_tier: The disk tier, e.g. P10, E10. + :paramtype disk_tier: str """ - :keyword storage_type: Storage type. Required. Known values are: "Premium_LRS", "Standard_LRS", - and "StandardSSD_LRS". - :paramtype storage_type: str or ~azure.mgmt.workloads.models.DiskStorageType - :keyword size_in_gb: Disk size in GB. - :paramtype size_in_gb: int + super().__init__(**kwargs) + self.sku = sku + self.size_gb = size_gb + self.minimum_supported_disk_count = minimum_supported_disk_count + self.maximum_supported_disk_count = maximum_supported_disk_count + self.iops_read_write = iops_read_write + self.mbps_read_write = mbps_read_write + self.disk_tier = disk_tier + + +class DiskSku(_serialization.Model): + """The disk sku. + + :ivar name: Defines the disk sku name. Known values are: "Standard_LRS", "Premium_LRS", + "StandardSSD_LRS", "UltraSSD_LRS", "Premium_ZRS", "StandardSSD_ZRS", and "PremiumV2_LRS". + :vartype name: str or ~azure.mgmt.workloads.models.DiskSkuName + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + } + + def __init__(self, *, name: Optional[Union[str, "_models.DiskSkuName"]] = None, **kwargs: Any) -> None: + """ + :keyword name: Defines the disk sku name. Known values are: "Standard_LRS", "Premium_LRS", + "StandardSSD_LRS", "UltraSSD_LRS", "Premium_ZRS", "StandardSSD_ZRS", and "PremiumV2_LRS". + :paramtype name: str or ~azure.mgmt.workloads.models.DiskSkuName + """ + super().__init__(**kwargs) + self.name = name + + +class DiskVolumeConfiguration(_serialization.Model): + """The disk configuration required for the selected volume. + + :ivar count: The total number of disks required for the concerned volume. + :vartype count: int + :ivar size_gb: The disk size in GB. + :vartype size_gb: int + :ivar sku: The disk SKU details. + :vartype sku: ~azure.mgmt.workloads.models.DiskSku + """ + + _attribute_map = { + "count": {"key": "count", "type": "int"}, + "size_gb": {"key": "sizeGB", "type": "int"}, + "sku": {"key": "sku", "type": "DiskSku"}, + } + + def __init__( + self, + *, + count: Optional[int] = None, + size_gb: Optional[int] = None, + sku: Optional["_models.DiskSku"] = None, + **kwargs: Any + ) -> None: + """ + :keyword count: The total number of disks required for the concerned volume. + :paramtype count: int + :keyword size_gb: The disk size in GB. + :paramtype size_gb: int + :keyword sku: The disk SKU details. + :paramtype sku: ~azure.mgmt.workloads.models.DiskSku """ super().__init__(**kwargs) - self.storage_type = storage_type - self.size_in_gb = size_in_gb + self.count = count + self.size_gb = size_gb + self.sku = sku class EnqueueReplicationServerProperties(_serialization.Model): @@ -872,7 +1059,7 @@ class EnqueueReplicationServerProperties(_serialization.Model): "health": {"key": "health", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.ers_version = None @@ -914,7 +1101,7 @@ class EnqueueServerProperties(_serialization.Model): "health": {"key": "health", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.hostname = None @@ -957,7 +1144,7 @@ class Error(_serialization.Model): "inner_error": {"key": "innerError", "type": "ErrorInnerError"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -988,7 +1175,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 @@ -1020,7 +1207,7 @@ class ErrorDefinition(_serialization.Model): "details": {"key": "details", "type": "[ErrorDefinition]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -1061,7 +1248,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 @@ -1082,7 +1269,7 @@ class ErrorInnerError(_serialization.Model): "inner_error": {"key": "innerError", "type": "Error"}, } - def __init__(self, *, inner_error: Optional["_models.Error"] = None, **kwargs): + def __init__(self, *, inner_error: Optional["_models.Error"] = None, **kwargs: Any) -> None: """ :keyword inner_error: Standard error object. :paramtype inner_error: ~azure.mgmt.workloads.models.Error @@ -1092,7 +1279,8 @@ def __init__(self, *, inner_error: Optional["_models.Error"] = None, **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.workloads.models.ErrorDetail @@ -1102,7 +1290,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.workloads.models.ErrorDetail @@ -1142,14 +1330,15 @@ class SoftwareConfiguration(_serialization.Model): } } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.software_installation_type: Optional[str] = None class ExternalInstallationSoftwareConfiguration(SoftwareConfiguration): - """The SAP Software configuration Input when the software is installed externally outside the service. + """The SAP Software configuration Input when the software is installed externally outside the + service. All required parameters must be populated in order to send to Azure. @@ -1171,7 +1360,7 @@ class ExternalInstallationSoftwareConfiguration(SoftwareConfiguration): "central_server_vm_id": {"key": "centralServerVmId", "type": "str"}, } - def __init__(self, *, central_server_vm_id: Optional[str] = None, **kwargs): + def __init__(self, *, central_server_vm_id: Optional[str] = None, **kwargs: Any) -> None: """ :keyword central_server_vm_id: The resource ID of the virtual machine containing the central server instance. @@ -1182,68 +1371,6 @@ def __init__(self, *, central_server_vm_id: Optional[str] = None, **kwargs): self.central_server_vm_id = central_server_vm_id -class FileshareProfile(_serialization.Model): - """File share profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar share_type: Share type. Required. Known values are: "NfsOnController" and "AzureFiles". - :vartype share_type: str or ~azure.mgmt.workloads.models.FileShareType - :ivar storage_type: File share backing storage type. Required. Known values are: - "Standard_LRS", "Standard_GRS", "Standard_ZRS", and "Premium_LRS". - :vartype storage_type: str or ~azure.mgmt.workloads.models.FileShareStorageType - :ivar share_size_in_gb: File share size in GB. - :vartype share_size_in_gb: int - :ivar storage_resource_id: File share storage resource id. - :vartype storage_resource_id: str - :ivar share_name: File share name. - :vartype share_name: str - """ - - _validation = { - "share_type": {"required": True}, - "storage_type": {"required": True}, - "share_size_in_gb": {"minimum": 1}, - "storage_resource_id": {"readonly": True}, - "share_name": {"readonly": True}, - } - - _attribute_map = { - "share_type": {"key": "shareType", "type": "str"}, - "storage_type": {"key": "storageType", "type": "str"}, - "share_size_in_gb": {"key": "shareSizeInGB", "type": "int"}, - "storage_resource_id": {"key": "storageResourceId", "type": "str"}, - "share_name": {"key": "shareName", "type": "str"}, - } - - def __init__( - self, - *, - share_type: Union[str, "_models.FileShareType"], - storage_type: Union[str, "_models.FileShareStorageType"], - share_size_in_gb: Optional[int] = None, - **kwargs - ): - """ - :keyword share_type: Share type. Required. Known values are: "NfsOnController" and - "AzureFiles". - :paramtype share_type: str or ~azure.mgmt.workloads.models.FileShareType - :keyword storage_type: File share backing storage type. Required. Known values are: - "Standard_LRS", "Standard_GRS", "Standard_ZRS", and "Premium_LRS". - :paramtype storage_type: str or ~azure.mgmt.workloads.models.FileShareStorageType - :keyword share_size_in_gb: File share size in GB. - :paramtype share_size_in_gb: int - """ - super().__init__(**kwargs) - self.share_type = share_type - self.storage_type = storage_type - self.share_size_in_gb = share_size_in_gb - self.storage_resource_id = None - self.share_name = None - - class GatewayServerProperties(_serialization.Model): """Defines the SAP Gateway Server properties. @@ -1266,7 +1393,7 @@ class GatewayServerProperties(_serialization.Model): "health": {"key": "health", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.port = None @@ -1294,8 +1421,6 @@ class HanaDbProviderInstanceProperties(ProviderSpecificProperties): # pylint: d :vartype db_password: str :ivar db_password_uri: Gets or sets the key vault URI to secret with the database password. :vartype db_password_uri: str - :ivar db_ssl_certificate_uri: Gets or sets the blob URI to SSL certificate for the DB. - :vartype db_ssl_certificate_uri: str :ivar ssl_certificate_uri: Gets or sets the blob URI to SSL certificate for the DB. :vartype ssl_certificate_uri: str :ivar ssl_host_name_in_certificate: Gets or sets the hostname(s) in the SSL certificate. @@ -1303,6 +1428,8 @@ class HanaDbProviderInstanceProperties(ProviderSpecificProperties): # pylint: d :ivar ssl_preference: Gets or sets certificate preference if secure communication is enabled. Known values are: "Disabled", "RootCertificate", and "ServerCertificate". :vartype ssl_preference: str or ~azure.mgmt.workloads.models.SslPreference + :ivar sap_sid: Gets or sets the SAP System Identifier. + :vartype sap_sid: str """ _validation = { @@ -1318,10 +1445,10 @@ class HanaDbProviderInstanceProperties(ProviderSpecificProperties): # pylint: d "db_username": {"key": "dbUsername", "type": "str"}, "db_password": {"key": "dbPassword", "type": "str"}, "db_password_uri": {"key": "dbPasswordUri", "type": "str"}, - "db_ssl_certificate_uri": {"key": "dbSslCertificateUri", "type": "str"}, "ssl_certificate_uri": {"key": "sslCertificateUri", "type": "str"}, "ssl_host_name_in_certificate": {"key": "sslHostNameInCertificate", "type": "str"}, "ssl_preference": {"key": "sslPreference", "type": "str"}, + "sap_sid": {"key": "sapSid", "type": "str"}, } def __init__( @@ -1334,12 +1461,12 @@ def __init__( db_username: Optional[str] = None, db_password: Optional[str] = None, db_password_uri: Optional[str] = None, - db_ssl_certificate_uri: Optional[str] = None, ssl_certificate_uri: Optional[str] = None, ssl_host_name_in_certificate: Optional[str] = None, ssl_preference: Optional[Union[str, "_models.SslPreference"]] = None, - **kwargs - ): + sap_sid: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword hostname: Gets or sets the target virtual machine size. :paramtype hostname: str @@ -1355,8 +1482,6 @@ def __init__( :paramtype db_password: str :keyword db_password_uri: Gets or sets the key vault URI to secret with the database password. :paramtype db_password_uri: str - :keyword db_ssl_certificate_uri: Gets or sets the blob URI to SSL certificate for the DB. - :paramtype db_ssl_certificate_uri: str :keyword ssl_certificate_uri: Gets or sets the blob URI to SSL certificate for the DB. :paramtype ssl_certificate_uri: str :keyword ssl_host_name_in_certificate: Gets or sets the hostname(s) in the SSL certificate. @@ -1364,6 +1489,8 @@ def __init__( :keyword ssl_preference: Gets or sets certificate preference if secure communication is enabled. Known values are: "Disabled", "RootCertificate", and "ServerCertificate". :paramtype ssl_preference: str or ~azure.mgmt.workloads.models.SslPreference + :keyword sap_sid: Gets or sets the SAP System Identifier. + :paramtype sap_sid: str """ super().__init__(**kwargs) self.provider_type: str = "SapHana" @@ -1374,10 +1501,10 @@ def __init__( self.db_username = db_username self.db_password = db_password self.db_password_uri = db_password_uri - self.db_ssl_certificate_uri = db_ssl_certificate_uri self.ssl_certificate_uri = ssl_certificate_uri self.ssl_host_name_in_certificate = ssl_host_name_in_certificate self.ssl_preference = ssl_preference + self.sap_sid = sap_sid class HighAvailabilityConfiguration(_serialization.Model): @@ -1398,7 +1525,7 @@ class HighAvailabilityConfiguration(_serialization.Model): "high_availability_type": {"key": "highAvailabilityType", "type": "str"}, } - def __init__(self, *, high_availability_type: Union[str, "_models.SAPHighAvailabilityType"], **kwargs): + def __init__(self, *, high_availability_type: Union[str, "_models.SAPHighAvailabilityType"], **kwargs: Any) -> None: """ :keyword high_availability_type: The high availability type. Required. Known values are: "AvailabilitySet" and "AvailabilityZone". @@ -1430,7 +1557,7 @@ class HighAvailabilitySoftwareConfiguration(_serialization.Model): "fencing_client_password": {"key": "fencingClientPassword", "type": "str"}, } - def __init__(self, *, fencing_client_id: str, fencing_client_password: str, **kwargs): + def __init__(self, *, fencing_client_id: str, fencing_client_password: str, **kwargs: Any) -> None: """ :keyword fencing_client_id: The fencing client id. Required. :paramtype fencing_client_id: str @@ -1444,7 +1571,11 @@ def __init__(self, *, fencing_client_id: str, fencing_client_password: str, **kw class ImageReference(_serialization.Model): - """Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. + """Specifies information about the image to use. You can specify information about platform + images, marketplace images, or virtual machine images. This element is required when you want + to use a platform image, marketplace image, or virtual machine image, but is not used in other + creation operations. NOTE: Image reference publisher and offer can only be set when you create + the scale set. Variables are only populated by the server, and will be ignored when sending a request. @@ -1491,8 +1622,8 @@ def __init__( sku: Optional[str] = None, version: Optional[str] = None, shared_gallery_image_id: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword publisher: The image publisher. :paramtype publisher: str @@ -1550,7 +1681,7 @@ class InfrastructureConfiguration(_serialization.Model): "deployment_type": {"SingleServer": "SingleServerConfiguration", "ThreeTier": "ThreeTierConfiguration"} } - def __init__(self, *, app_resource_group: str, **kwargs): + def __init__(self, *, app_resource_group: str, **kwargs: Any) -> None: """ :keyword app_resource_group: The application resource group where SAP system resources will be deployed. Required. @@ -1583,14 +1714,17 @@ class OSConfiguration(_serialization.Model): _subtype_map = {"os_type": {"Linux": "LinuxConfiguration", "Windows": "WindowsConfiguration"}} - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.os_type: Optional[str] = None class LinuxConfiguration(OSConfiguration): - """Specifies the Linux operating system settings on the virtual machine. :code:`
`:code:`
`For a list of supported Linux distributions, see `Linux on Azure-Endorsed Distributions `_. + """Specifies the Linux operating system settings on the virtual machine. + :code:`
`:code:`
`For a list of supported Linux distributions, see `Linux on + Azure-Endorsed Distributions + `_. All required parameters must be populated in order to send to Azure. @@ -1623,8 +1757,8 @@ def __init__( disable_password_authentication: Optional[bool] = None, ssh: Optional["_models.SshConfiguration"] = None, ssh_key_pair: Optional["_models.SshKeyPair"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword disable_password_authentication: Specifies whether password authentication should be disabled. @@ -1642,6 +1776,90 @@ def __init__( self.ssh_key_pair = ssh_key_pair +class LoadBalancerDetails(_serialization.Model): + """The Load Balancer details such as Load Balancer ID. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: + :vartype id: str + """ + + _validation = { + "id": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + + +class LoadBalancerResourceNames(_serialization.Model): + """The resource names object for load balancer and related resources. + + :ivar load_balancer_name: The full resource name for load balancer. If this value is not + provided, load balancer will be name as {ASCS/DB}-loadBalancer. + :vartype load_balancer_name: str + :ivar frontend_ip_configuration_names: The list of frontend IP configuration names. If provided + as input, size of this list should be 2 for cs layer and should be 1 for database layer. + :vartype frontend_ip_configuration_names: list[str] + :ivar backend_pool_names: The list of backend pool names. Currently, ACSS deploys only one + backend pool and hence, size of this list should be 1. + :vartype backend_pool_names: list[str] + :ivar health_probe_names: The list of health probe names. If provided as input, size of this + list should be 2 for cs layer and should be 1 for database layer. + :vartype health_probe_names: list[str] + """ + + _validation = { + "frontend_ip_configuration_names": {"max_items": 2, "min_items": 0}, + "backend_pool_names": {"max_items": 1, "min_items": 0}, + "health_probe_names": {"max_items": 2, "min_items": 0}, + } + + _attribute_map = { + "load_balancer_name": {"key": "loadBalancerName", "type": "str"}, + "frontend_ip_configuration_names": {"key": "frontendIpConfigurationNames", "type": "[str]"}, + "backend_pool_names": {"key": "backendPoolNames", "type": "[str]"}, + "health_probe_names": {"key": "healthProbeNames", "type": "[str]"}, + } + + def __init__( + self, + *, + load_balancer_name: Optional[str] = None, + frontend_ip_configuration_names: Optional[List[str]] = None, + backend_pool_names: Optional[List[str]] = None, + health_probe_names: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword load_balancer_name: The full resource name for load balancer. If this value is not + provided, load balancer will be name as {ASCS/DB}-loadBalancer. + :paramtype load_balancer_name: str + :keyword frontend_ip_configuration_names: The list of frontend IP configuration names. If + provided as input, size of this list should be 2 for cs layer and should be 1 for database + layer. + :paramtype frontend_ip_configuration_names: list[str] + :keyword backend_pool_names: The list of backend pool names. Currently, ACSS deploys only one + backend pool and hence, size of this list should be 1. + :paramtype backend_pool_names: list[str] + :keyword health_probe_names: The list of health probe names. If provided as input, size of this + list should be 2 for cs layer and should be 1 for database layer. + :paramtype health_probe_names: list[str] + """ + super().__init__(**kwargs) + self.load_balancer_name = load_balancer_name + self.frontend_ip_configuration_names = frontend_ip_configuration_names + self.backend_pool_names = backend_pool_names + self.health_probe_names = health_probe_names + + class ManagedRGConfiguration(_serialization.Model): """Managed resource group configuration. @@ -1653,7 +1871,7 @@ class ManagedRGConfiguration(_serialization.Model): "name": {"key": "name", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Managed resource group name. :paramtype name: str @@ -1704,7 +1922,7 @@ class MessageServerProperties(_serialization.Model): "health": {"key": "health", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.ms_port = None @@ -1748,7 +1966,7 @@ class Resource(_serialization.Model): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -1758,7 +1976,8 @@ def __init__(self, **kwargs): 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. @@ -1798,7 +2017,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] @@ -1910,8 +2129,8 @@ def __init__( managed_resource_group_configuration: Optional["_models.ManagedRGConfiguration"] = None, log_analytics_workspace_arm_id: Optional[str] = None, monitor_subnet: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -1966,7 +2185,9 @@ class MonitorListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.Monitor"]] = None, next_link: Optional[str] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.Monitor"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: The list of SAP monitors. :paramtype value: list[~azure.mgmt.workloads.models.Monitor] @@ -2012,11 +2233,52 @@ class MonitorPropertiesErrors(Error): "inner_error": {"key": "innerError", "type": "ErrorInnerError"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) +class MountFileShareConfiguration(FileShareConfiguration): + """Gets or sets the file share configuration for externally mounted cases. + + All required parameters must be populated in order to send to Azure. + + :ivar configuration_type: The type of file share config. Required. Known values are: "Skip", + "CreateAndMount", and "Mount". + :vartype configuration_type: str or ~azure.mgmt.workloads.models.ConfigurationType + :ivar id: The fileshare resource ID. Required. + :vartype id: str + :ivar private_endpoint_id: The private endpoint resource ID. Required. + :vartype private_endpoint_id: str + """ + + _validation = { + "configuration_type": {"required": True}, + "id": {"required": True}, + "private_endpoint_id": {"required": True}, + } + + _attribute_map = { + "configuration_type": {"key": "configurationType", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "private_endpoint_id": {"key": "privateEndpointId", "type": "str"}, + } + + def __init__( + self, *, id: str, private_endpoint_id: str, **kwargs: Any # pylint: disable=redefined-builtin + ) -> None: + """ + :keyword id: The fileshare resource ID. Required. + :paramtype id: str + :keyword private_endpoint_id: The private endpoint resource ID. Required. + :paramtype private_endpoint_id: str + """ + super().__init__(**kwargs) + self.configuration_type: str = "Mount" + self.id = id + self.private_endpoint_id = private_endpoint_id + + class MsSqlServerProviderInstanceProperties(ProviderSpecificProperties): """Gets or sets the SQL server provider properties. @@ -2070,8 +2332,8 @@ def __init__( sap_sid: Optional[str] = None, ssl_preference: Optional[Union[str, "_models.SslPreference"]] = None, ssl_certificate_uri: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword hostname: Gets or sets the SQL server host name. :paramtype hostname: str @@ -2116,7 +2378,7 @@ class NetworkConfiguration(_serialization.Model): "is_secondary_ip_enabled": {"key": "isSecondaryIpEnabled", "type": "bool"}, } - def __init__(self, *, is_secondary_ip_enabled: bool = False, **kwargs): + def __init__(self, *, is_secondary_ip_enabled: bool = False, **kwargs: Any) -> None: """ :keyword is_secondary_ip_enabled: Specifies whether a secondary IP address should be added to the network interface on all VMs of the SAP system being deployed. @@ -2126,166 +2388,38 @@ def __init__(self, *, is_secondary_ip_enabled: bool = False, **kwargs): self.is_secondary_ip_enabled = is_secondary_ip_enabled -class NetworkProfile(_serialization.Model): - """Network profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. +class NetworkInterfaceResourceNames(_serialization.Model): + """The resource names object for network interface and related resources. - :ivar load_balancer_type: Load balancer type. Required. Known values are: "ApplicationGateway" - and "LoadBalancer". - :vartype load_balancer_type: str or ~azure.mgmt.workloads.models.LoadBalancerType - :ivar load_balancer_sku: Load balancer SKU. - :vartype load_balancer_sku: str - :ivar load_balancer_tier: Load balancer tier. - :vartype load_balancer_tier: str - :ivar capacity: Capacity, applicable only for Application Gateway. - :vartype capacity: int - :ivar azure_front_door_enabled: Whether to enable Azure front door. Known values are: "Enabled" - and "Disabled". - :vartype azure_front_door_enabled: str or ~azure.mgmt.workloads.models.AzureFrontDoorEnabled - :ivar v_net_resource_id: Virtual network resource Id. - :vartype v_net_resource_id: str - :ivar load_balancer_resource_id: Azure Loadbalancer or ApplicationGateway resource Id. - :vartype load_balancer_resource_id: str - :ivar azure_front_door_resource_id: Azure front door resource id. - :vartype azure_front_door_resource_id: str - :ivar front_end_public_ip_resource_id: Loadbalancer front-end IP address resource Id. - :vartype front_end_public_ip_resource_id: str - :ivar outbound_public_ip_resource_ids: List of outbound public IP resource IDs. - :vartype outbound_public_ip_resource_ids: list[str] + :ivar network_interface_name: The full name for network interface. If name is not provided, + service uses a default name based on the deployment type. For SingleServer, default name is + {SID}-Nic. In case of HA-AvZone systems, default name will be {SID}-{App/ASCS/DB}-Zone{A/B}-Nic + with an incrementor at the end in case of more than 1 instance per layer. For distributed and + HA-AvSet systems, default name will be {SID}-{App/ASCS/DB}-Nic with an incrementor at the end + in case of more than 1 instance per layer. + :vartype network_interface_name: str """ - _validation = { - "load_balancer_type": {"required": True}, - "v_net_resource_id": {"readonly": True}, - "load_balancer_resource_id": {"readonly": True}, - "azure_front_door_resource_id": {"readonly": True}, - "front_end_public_ip_resource_id": {"readonly": True}, - "outbound_public_ip_resource_ids": {"readonly": True}, - } - _attribute_map = { - "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, - "load_balancer_sku": {"key": "loadBalancerSku", "type": "str"}, - "load_balancer_tier": {"key": "loadBalancerTier", "type": "str"}, - "capacity": {"key": "capacity", "type": "int"}, - "azure_front_door_enabled": {"key": "azureFrontDoorEnabled", "type": "str"}, - "v_net_resource_id": {"key": "vNetResourceId", "type": "str"}, - "load_balancer_resource_id": {"key": "loadBalancerResourceId", "type": "str"}, - "azure_front_door_resource_id": {"key": "azureFrontDoorResourceId", "type": "str"}, - "front_end_public_ip_resource_id": {"key": "frontEndPublicIpResourceId", "type": "str"}, - "outbound_public_ip_resource_ids": {"key": "outboundPublicIpResourceIds", "type": "[str]"}, + "network_interface_name": {"key": "networkInterfaceName", "type": "str"}, } - def __init__( - self, - *, - load_balancer_type: Union[str, "_models.LoadBalancerType"], - load_balancer_sku: Optional[str] = None, - load_balancer_tier: Optional[str] = None, - capacity: Optional[int] = None, - azure_front_door_enabled: Optional[Union[str, "_models.AzureFrontDoorEnabled"]] = None, - **kwargs - ): - """ - :keyword load_balancer_type: Load balancer type. Required. Known values are: - "ApplicationGateway" and "LoadBalancer". - :paramtype load_balancer_type: str or ~azure.mgmt.workloads.models.LoadBalancerType - :keyword load_balancer_sku: Load balancer SKU. - :paramtype load_balancer_sku: str - :keyword load_balancer_tier: Load balancer tier. - :paramtype load_balancer_tier: str - :keyword capacity: Capacity, applicable only for Application Gateway. - :paramtype capacity: int - :keyword azure_front_door_enabled: Whether to enable Azure front door. Known values are: - "Enabled" and "Disabled". - :paramtype azure_front_door_enabled: str or ~azure.mgmt.workloads.models.AzureFrontDoorEnabled + def __init__(self, *, network_interface_name: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword network_interface_name: The full name for network interface. If name is not provided, + service uses a default name based on the deployment type. For SingleServer, default name is + {SID}-Nic. In case of HA-AvZone systems, default name will be {SID}-{App/ASCS/DB}-Zone{A/B}-Nic + with an incrementor at the end in case of more than 1 instance per layer. For distributed and + HA-AvSet systems, default name will be {SID}-{App/ASCS/DB}-Nic with an incrementor at the end + in case of more than 1 instance per layer. + :paramtype network_interface_name: str """ super().__init__(**kwargs) - self.load_balancer_type = load_balancer_type - self.load_balancer_sku = load_balancer_sku - self.load_balancer_tier = load_balancer_tier - self.capacity = capacity - self.azure_front_door_enabled = azure_front_door_enabled - self.v_net_resource_id = None - self.load_balancer_resource_id = None - self.azure_front_door_resource_id = None - self.front_end_public_ip_resource_id = None - self.outbound_public_ip_resource_ids = None + self.network_interface_name = network_interface_name -class NodeProfile(_serialization.Model): - """VM or VMSS node profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar name: VM or VMSS name. - :vartype name: str - :ivar node_sku: VM SKU for node(s). Required. - :vartype node_sku: str - :ivar os_image: OS image used for creating the nodes. Required. - :vartype os_image: ~azure.mgmt.workloads.models.OsImageProfile - :ivar os_disk: OS disk details. Required. - :vartype os_disk: ~azure.mgmt.workloads.models.DiskInfo - :ivar data_disks: Data disks details. This property is not in use right now. - :vartype data_disks: list[~azure.mgmt.workloads.models.DiskInfo] - :ivar node_resource_ids: VM/VMSS resource ARM Ids. - :vartype node_resource_ids: list[str] - """ - - _validation = { - "node_sku": {"required": True}, - "os_image": {"required": True}, - "os_disk": {"required": True}, - "node_resource_ids": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "node_sku": {"key": "nodeSku", "type": "str"}, - "os_image": {"key": "osImage", "type": "OsImageProfile"}, - "os_disk": {"key": "osDisk", "type": "DiskInfo"}, - "data_disks": {"key": "dataDisks", "type": "[DiskInfo]"}, - "node_resource_ids": {"key": "nodeResourceIds", "type": "[str]"}, - } - - def __init__( - self, - *, - node_sku: str, - os_image: "_models.OsImageProfile", - os_disk: "_models.DiskInfo", - name: Optional[str] = None, - data_disks: Optional[List["_models.DiskInfo"]] = None, - **kwargs - ): - """ - :keyword name: VM or VMSS name. - :paramtype name: str - :keyword node_sku: VM SKU for node(s). Required. - :paramtype node_sku: str - :keyword os_image: OS image used for creating the nodes. Required. - :paramtype os_image: ~azure.mgmt.workloads.models.OsImageProfile - :keyword os_disk: OS disk details. Required. - :paramtype os_disk: ~azure.mgmt.workloads.models.DiskInfo - :keyword data_disks: Data disks details. This property is not in use right now. - :paramtype data_disks: list[~azure.mgmt.workloads.models.DiskInfo] - """ - super().__init__(**kwargs) - self.name = name - self.node_sku = node_sku - self.os_image = os_image - self.os_disk = os_disk - self.data_disks = data_disks - self.node_resource_ids = None - - -class Operation(_serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. +class Operation(_serialization.Model): + """Details of a REST API operation, returned from the Resource Provider Operations API. Variables are only populated by the server, and will be ignored when sending a request. @@ -2321,7 +2455,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.workloads.models.OperationDisplay @@ -2367,7 +2501,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 @@ -2377,7 +2511,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. @@ -2397,7 +2532,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 @@ -2465,8 +2600,8 @@ def __init__( display: Optional["_models.OperationsDefinitionDisplay"] = None, action_type: Optional[Union[str, "_models.WorkloadMonitorActionType"]] = None, properties: Optional[Any] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name_properties_name: Name of the operation. :paramtype name_properties_name: str @@ -2536,8 +2671,8 @@ def __init__( origin: Optional[Union[str, "_models.OperationProperties"]] = None, action_type: Optional[Union[str, "_models.WorkloadMonitorActionType"]] = None, properties: Optional[Any] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Name of the operation. Required. :paramtype name: str @@ -2578,8 +2713,12 @@ class OperationsDefinitionArrayResponseWithContinuation(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.OperationsDefinition"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, + *, + value: Optional[List["_models.OperationsDefinition"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword value: Defines the workload operation definition response properties. :paramtype value: list[~azure.mgmt.workloads.models.OperationsDefinition] @@ -2620,7 +2759,7 @@ class OperationsDisplayDefinition(_serialization.Model): "description": {"key": "description", "type": "str"}, } - def __init__(self, *, provider: str, resource: str, operation: str, description: str, **kwargs): + def __init__(self, *, provider: str, resource: str, operation: str, description: str, **kwargs: Any) -> None: """ :keyword provider: Defines the workload provider. Required. :paramtype provider: str @@ -2667,7 +2806,7 @@ class OperationsDefinitionDisplay(OperationsDisplayDefinition): "description": {"key": "description", "type": "str"}, } - def __init__(self, *, provider: str, resource: str, operation: str, description: str, **kwargs): + def __init__(self, *, provider: str, resource: str, operation: str, description: str, **kwargs: Any) -> None: """ :keyword provider: Defines the workload provider. Required. :paramtype provider: str @@ -2731,8 +2870,8 @@ def __init__( end_time: Optional[datetime.datetime] = None, operations: Optional[List["_models.OperationStatusResult"]] = None, error: Optional["_models.ErrorDetail"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Fully qualified ID for the async operation. :paramtype id: str @@ -2762,54 +2901,9 @@ def __init__( self.error = error -class OsImageProfile(_serialization.Model): - """OS image profile. - - :ivar publisher: OS image publisher. "Canonical" - :vartype publisher: str or ~azure.mgmt.workloads.models.OSImagePublisher - :ivar offer: OS image offer. "UbuntuServer" - :vartype offer: str or ~azure.mgmt.workloads.models.OSImageOffer - :ivar sku: OS image sku. Known values are: "18.04-LTS" and "16.04-LTS". - :vartype sku: str or ~azure.mgmt.workloads.models.OSImageSku - :ivar version: OS image version. "latest" - :vartype version: str or ~azure.mgmt.workloads.models.OSImageVersion - """ - - _attribute_map = { - "publisher": {"key": "publisher", "type": "str"}, - "offer": {"key": "offer", "type": "str"}, - "sku": {"key": "sku", "type": "str"}, - "version": {"key": "version", "type": "str"}, - } - - def __init__( - self, - *, - publisher: Optional[Union[str, "_models.OSImagePublisher"]] = None, - offer: Optional[Union[str, "_models.OSImageOffer"]] = None, - sku: Optional[Union[str, "_models.OSImageSku"]] = None, - version: Optional[Union[str, "_models.OSImageVersion"]] = None, - **kwargs - ): - """ - :keyword publisher: OS image publisher. "Canonical" - :paramtype publisher: str or ~azure.mgmt.workloads.models.OSImagePublisher - :keyword offer: OS image offer. "UbuntuServer" - :paramtype offer: str or ~azure.mgmt.workloads.models.OSImageOffer - :keyword sku: OS image sku. Known values are: "18.04-LTS" and "16.04-LTS". - :paramtype sku: str or ~azure.mgmt.workloads.models.OSImageSku - :keyword version: OS image version. "latest" - :paramtype version: str or ~azure.mgmt.workloads.models.OSImageVersion - """ - super().__init__(**kwargs) - self.publisher = publisher - self.offer = offer - self.sku = sku - self.version = version - - class OSProfile(_serialization.Model): - """Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is provisioned. + """Specifies the operating system settings for the virtual machine. Some of the settings cannot be + changed once VM is provisioned. :ivar admin_username: Specifies the name of the administrator account. :code:`
`:code:`
` This property cannot be updated after the VM is created. :code:`
`:code:`
` @@ -2852,8 +2946,8 @@ def __init__( admin_username: Optional[str] = None, admin_password: Optional[str] = None, os_configuration: Optional["_models.OSConfiguration"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword admin_username: Specifies the name of the administrator account. :code:`
`:code:`
` This property cannot be updated after the VM is created. @@ -2910,8 +3004,8 @@ def __init__( *, deployer_vm_packages: Optional["_models.DeployerVmPackages"] = None, sap_fqdn: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword deployer_vm_packages: The url and storage account ID where deployer VM packages are uploaded. @@ -2924,147 +3018,183 @@ def __init__( self.sap_fqdn = sap_fqdn -class PatchResourceRequestBody(_serialization.Model): - """Resource patch request body. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar identity: - :vartype identity: ~azure.mgmt.workloads.models.PatchResourceRequestBodyIdentity - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "PatchResourceRequestBodyIdentity"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.PatchResourceRequestBodyIdentity"] = None, - **kwargs - ): - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: - :paramtype identity: ~azure.mgmt.workloads.models.PatchResourceRequestBodyIdentity - """ - super().__init__(**kwargs) - self.tags = tags - self.identity = identity - - -class UserAssignedServiceIdentity(_serialization.Model): - """Managed service identity (user assigned identities). +class PrometheusHaClusterProviderInstanceProperties(ProviderSpecificProperties): + """Gets or sets the PrometheusHaCluster provider properties. All required parameters must be populated in order to send to Azure. - :ivar type: Type of manage identity. Required. Known values are: "None" and "UserAssigned". - :vartype type: str or ~azure.mgmt.workloads.models.ManagedServiceIdentityType - :ivar user_assigned_identities: User assigned identities dictionary. - :vartype user_assigned_identities: dict[str, ~azure.mgmt.workloads.models.UserAssignedIdentity] + :ivar provider_type: The provider type. For example, the value can be SapHana. Required. + :vartype provider_type: str + :ivar prometheus_url: URL of the Node Exporter endpoint. + :vartype prometheus_url: str + :ivar hostname: Gets or sets the target machine name. + :vartype hostname: str + :ivar sid: Gets or sets the cluster sid. + :vartype sid: str + :ivar cluster_name: Gets or sets the clusterName. + :vartype cluster_name: str + :ivar ssl_preference: Gets or sets certificate preference if secure communication is enabled. + Known values are: "Disabled", "RootCertificate", and "ServerCertificate". + :vartype ssl_preference: str or ~azure.mgmt.workloads.models.SslPreference + :ivar ssl_certificate_uri: Gets or sets the blob URI to SSL certificate for the HA cluster + exporter. + :vartype ssl_certificate_uri: str """ _validation = { - "type": {"required": True}, + "provider_type": {"required": True}, } _attribute_map = { - "type": {"key": "type", "type": "str"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentity}"}, + "provider_type": {"key": "providerType", "type": "str"}, + "prometheus_url": {"key": "prometheusUrl", "type": "str"}, + "hostname": {"key": "hostname", "type": "str"}, + "sid": {"key": "sid", "type": "str"}, + "cluster_name": {"key": "clusterName", "type": "str"}, + "ssl_preference": {"key": "sslPreference", "type": "str"}, + "ssl_certificate_uri": {"key": "sslCertificateUri", "type": "str"}, } def __init__( self, *, - type: Union[str, "_models.ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, - **kwargs - ): + prometheus_url: Optional[str] = None, + hostname: Optional[str] = None, + sid: Optional[str] = None, + cluster_name: Optional[str] = None, + ssl_preference: Optional[Union[str, "_models.SslPreference"]] = None, + ssl_certificate_uri: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword type: Type of manage identity. Required. Known values are: "None" and "UserAssigned". - :paramtype type: str or ~azure.mgmt.workloads.models.ManagedServiceIdentityType - :keyword user_assigned_identities: User assigned identities dictionary. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.workloads.models.UserAssignedIdentity] + :keyword prometheus_url: URL of the Node Exporter endpoint. + :paramtype prometheus_url: str + :keyword hostname: Gets or sets the target machine name. + :paramtype hostname: str + :keyword sid: Gets or sets the cluster sid. + :paramtype sid: str + :keyword cluster_name: Gets or sets the clusterName. + :paramtype cluster_name: str + :keyword ssl_preference: Gets or sets certificate preference if secure communication is + enabled. Known values are: "Disabled", "RootCertificate", and "ServerCertificate". + :paramtype ssl_preference: str or ~azure.mgmt.workloads.models.SslPreference + :keyword ssl_certificate_uri: Gets or sets the blob URI to SSL certificate for the HA cluster + exporter. + :paramtype ssl_certificate_uri: str """ super().__init__(**kwargs) - self.type = type - self.user_assigned_identities = user_assigned_identities + self.provider_type: str = "PrometheusHaCluster" + self.prometheus_url = prometheus_url + self.hostname = hostname + self.sid = sid + self.cluster_name = cluster_name + self.ssl_preference = ssl_preference + self.ssl_certificate_uri = ssl_certificate_uri -class PatchResourceRequestBodyIdentity(UserAssignedServiceIdentity): - """PatchResourceRequestBodyIdentity. +class PrometheusOSProviderInstanceProperties(ProviderSpecificProperties): + """Gets or sets the PrometheusOS provider properties. All required parameters must be populated in order to send to Azure. - :ivar type: Type of manage identity. Required. Known values are: "None" and "UserAssigned". - :vartype type: str or ~azure.mgmt.workloads.models.ManagedServiceIdentityType - :ivar user_assigned_identities: User assigned identities dictionary. - :vartype user_assigned_identities: dict[str, ~azure.mgmt.workloads.models.UserAssignedIdentity] + :ivar provider_type: The provider type. For example, the value can be SapHana. Required. + :vartype provider_type: str + :ivar prometheus_url: URL of the Node Exporter endpoint. + :vartype prometheus_url: str + :ivar ssl_preference: Gets or sets certificate preference if secure communication is enabled. + Known values are: "Disabled", "RootCertificate", and "ServerCertificate". + :vartype ssl_preference: str or ~azure.mgmt.workloads.models.SslPreference + :ivar ssl_certificate_uri: Gets or sets the blob URI to SSL certificate for the prometheus node + exporter. + :vartype ssl_certificate_uri: str + :ivar sap_sid: Gets or sets the SAP System Identifier. + :vartype sap_sid: str """ _validation = { - "type": {"required": True}, + "provider_type": {"required": True}, } _attribute_map = { - "type": {"key": "type", "type": "str"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentity}"}, + "provider_type": {"key": "providerType", "type": "str"}, + "prometheus_url": {"key": "prometheusUrl", "type": "str"}, + "ssl_preference": {"key": "sslPreference", "type": "str"}, + "ssl_certificate_uri": {"key": "sslCertificateUri", "type": "str"}, + "sap_sid": {"key": "sapSid", "type": "str"}, } def __init__( self, *, - type: Union[str, "_models.ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, - **kwargs - ): + prometheus_url: Optional[str] = None, + ssl_preference: Optional[Union[str, "_models.SslPreference"]] = None, + ssl_certificate_uri: Optional[str] = None, + sap_sid: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword type: Type of manage identity. Required. Known values are: "None" and "UserAssigned". - :paramtype type: str or ~azure.mgmt.workloads.models.ManagedServiceIdentityType - :keyword user_assigned_identities: User assigned identities dictionary. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.workloads.models.UserAssignedIdentity] + :keyword prometheus_url: URL of the Node Exporter endpoint. + :paramtype prometheus_url: str + :keyword ssl_preference: Gets or sets certificate preference if secure communication is + enabled. Known values are: "Disabled", "RootCertificate", and "ServerCertificate". + :paramtype ssl_preference: str or ~azure.mgmt.workloads.models.SslPreference + :keyword ssl_certificate_uri: Gets or sets the blob URI to SSL certificate for the prometheus + node exporter. + :paramtype ssl_certificate_uri: str + :keyword sap_sid: Gets or sets the SAP System Identifier. + :paramtype sap_sid: str """ - super().__init__(type=type, user_assigned_identities=user_assigned_identities, **kwargs) + super().__init__(**kwargs) + self.provider_type: str = "PrometheusOS" + self.prometheus_url = prometheus_url + self.ssl_preference = ssl_preference + self.ssl_certificate_uri = ssl_certificate_uri + self.sap_sid = sap_sid -class PhpProfile(_serialization.Model): - """PHP profile. +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar version: PHP version. Required. Known values are: "7.2", "7.3", and "7.4". - :vartype version: str or ~azure.mgmt.workloads.models.PHPVersion + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.workloads.models.SystemData """ _validation = { - "version": {"required": True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - "version": {"key": "version", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, *, version: Union[str, "_models.PHPVersion"], **kwargs): - """ - :keyword version: PHP version. Required. Known values are: "7.2", "7.3", and "7.4". - :paramtype version: str or ~azure.mgmt.workloads.models.PHPVersion - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.version = version -class PhpWorkloadResource(TrackedResource): # pylint: disable=too-many-instance-attributes - """Php workload resource. +class ProviderInstance(ProxyResource): + """A provider instance associated with SAP monitor. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str @@ -3076,49 +3206,16 @@ class PhpWorkloadResource(TrackedResource): # pylint: disable=too-many-instance :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.workloads.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar kind: Indicates which kind of php workload this resource represent e.g WordPress. - Required. "WordPress" - :vartype kind: str or ~azure.mgmt.workloads.models.WorkloadKind - :ivar sku: Php workloads SKU. - :vartype sku: ~azure.mgmt.workloads.models.Sku - :ivar identity: Identity for the resource. Currently not supported. - :vartype identity: ~azure.mgmt.workloads.models.PhpWorkloadResourceIdentity - :ivar app_location: The infra resources for PHP workload will be created in this location. - :vartype app_location: str - :ivar managed_resource_group_configuration: Managed resource group configuration of the - workload. - :vartype managed_resource_group_configuration: - ~azure.mgmt.workloads.models.ManagedRGConfiguration - :ivar admin_user_profile: Admin user profile used for VM and VMSS. - :vartype admin_user_profile: ~azure.mgmt.workloads.models.UserProfile - :ivar web_nodes_profile: VMSS web nodes profile. - :vartype web_nodes_profile: ~azure.mgmt.workloads.models.VmssNodesProfile - :ivar controller_profile: Controller VM profile. - :vartype controller_profile: ~azure.mgmt.workloads.models.NodeProfile - :ivar network_profile: Network profile. - :vartype network_profile: ~azure.mgmt.workloads.models.NetworkProfile - :ivar database_profile: Database profile. - :vartype database_profile: ~azure.mgmt.workloads.models.DatabaseProfile - :ivar site_profile: Site profile. - :vartype site_profile: ~azure.mgmt.workloads.models.SiteProfile - :ivar fileshare_profile: File share profile. - :vartype fileshare_profile: ~azure.mgmt.workloads.models.FileshareProfile - :ivar php_profile: PHP profile. - :vartype php_profile: ~azure.mgmt.workloads.models.PhpProfile - :ivar search_profile: Search profile. - :vartype search_profile: ~azure.mgmt.workloads.models.SearchProfile - :ivar cache_profile: Cache profile. - :vartype cache_profile: ~azure.mgmt.workloads.models.CacheProfile - :ivar backup_profile: Backup profile. - :vartype backup_profile: ~azure.mgmt.workloads.models.BackupProfile - :ivar provisioning_state: Php workload resource provisioning state. Known values are: - "NotSpecified", "Accepted", "Created", "Succeeded", "Failed", "Canceled", "Provisioning", and - "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.workloads.models.PhpWorkloadProvisioningState + :ivar identity: Managed service identity (user assigned identities). + :vartype identity: ~azure.mgmt.workloads.models.UserAssignedServiceIdentity + :ivar provisioning_state: State of provisioning of the provider instance. Known values are: + "Accepted", "Creating", "Updating", "Failed", "Succeeded", "Deleting", and "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.workloads.models.WorkloadMonitorProvisioningState + :ivar errors: Defines the provider instance errors. + :vartype errors: ~azure.mgmt.workloads.models.ProviderInstancePropertiesErrors + :ivar provider_settings: Defines the provider instance errors. + :vartype provider_settings: ~azure.mgmt.workloads.models.ProviderSpecificProperties """ _validation = { @@ -3126,9 +3223,8 @@ class PhpWorkloadResource(TrackedResource): # pylint: disable=too-many-instance "name": {"readonly": True}, "type": {"readonly": True}, "system_data": {"readonly": True}, - "location": {"required": True}, - "kind": {"required": True}, "provisioning_state": {"readonly": True}, + "errors": {"readonly": True}, } _attribute_map = { @@ -3136,386 +3232,7 @@ class PhpWorkloadResource(TrackedResource): # pylint: disable=too-many-instance "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "sku": {"key": "sku", "type": "Sku"}, - "identity": {"key": "identity", "type": "PhpWorkloadResourceIdentity"}, - "app_location": {"key": "properties.appLocation", "type": "str"}, - "managed_resource_group_configuration": { - "key": "properties.managedResourceGroupConfiguration", - "type": "ManagedRGConfiguration", - }, - "admin_user_profile": {"key": "properties.adminUserProfile", "type": "UserProfile"}, - "web_nodes_profile": {"key": "properties.webNodesProfile", "type": "VmssNodesProfile"}, - "controller_profile": {"key": "properties.controllerProfile", "type": "NodeProfile"}, - "network_profile": {"key": "properties.networkProfile", "type": "NetworkProfile"}, - "database_profile": {"key": "properties.databaseProfile", "type": "DatabaseProfile"}, - "site_profile": {"key": "properties.siteProfile", "type": "SiteProfile"}, - "fileshare_profile": {"key": "properties.fileshareProfile", "type": "FileshareProfile"}, - "php_profile": {"key": "properties.phpProfile", "type": "PhpProfile"}, - "search_profile": {"key": "properties.searchProfile", "type": "SearchProfile"}, - "cache_profile": {"key": "properties.cacheProfile", "type": "CacheProfile"}, - "backup_profile": {"key": "properties.backupProfile", "type": "BackupProfile"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - kind: Union[str, "_models.WorkloadKind"], - tags: Optional[Dict[str, str]] = None, - sku: Optional["_models.Sku"] = None, - identity: Optional["_models.PhpWorkloadResourceIdentity"] = None, - app_location: Optional[str] = None, - managed_resource_group_configuration: Optional["_models.ManagedRGConfiguration"] = None, - admin_user_profile: Optional["_models.UserProfile"] = None, - web_nodes_profile: Optional["_models.VmssNodesProfile"] = None, - controller_profile: Optional["_models.NodeProfile"] = None, - network_profile: Optional["_models.NetworkProfile"] = None, - database_profile: Optional["_models.DatabaseProfile"] = None, - site_profile: Optional["_models.SiteProfile"] = None, - fileshare_profile: Optional["_models.FileshareProfile"] = None, - php_profile: Optional["_models.PhpProfile"] = None, - search_profile: Optional["_models.SearchProfile"] = None, - cache_profile: Optional["_models.CacheProfile"] = None, - backup_profile: Optional["_models.BackupProfile"] = None, - **kwargs - ): - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword kind: Indicates which kind of php workload this resource represent e.g WordPress. - Required. "WordPress" - :paramtype kind: str or ~azure.mgmt.workloads.models.WorkloadKind - :keyword sku: Php workloads SKU. - :paramtype sku: ~azure.mgmt.workloads.models.Sku - :keyword identity: Identity for the resource. Currently not supported. - :paramtype identity: ~azure.mgmt.workloads.models.PhpWorkloadResourceIdentity - :keyword app_location: The infra resources for PHP workload will be created in this location. - :paramtype app_location: str - :keyword managed_resource_group_configuration: Managed resource group configuration of the - workload. - :paramtype managed_resource_group_configuration: - ~azure.mgmt.workloads.models.ManagedRGConfiguration - :keyword admin_user_profile: Admin user profile used for VM and VMSS. - :paramtype admin_user_profile: ~azure.mgmt.workloads.models.UserProfile - :keyword web_nodes_profile: VMSS web nodes profile. - :paramtype web_nodes_profile: ~azure.mgmt.workloads.models.VmssNodesProfile - :keyword controller_profile: Controller VM profile. - :paramtype controller_profile: ~azure.mgmt.workloads.models.NodeProfile - :keyword network_profile: Network profile. - :paramtype network_profile: ~azure.mgmt.workloads.models.NetworkProfile - :keyword database_profile: Database profile. - :paramtype database_profile: ~azure.mgmt.workloads.models.DatabaseProfile - :keyword site_profile: Site profile. - :paramtype site_profile: ~azure.mgmt.workloads.models.SiteProfile - :keyword fileshare_profile: File share profile. - :paramtype fileshare_profile: ~azure.mgmt.workloads.models.FileshareProfile - :keyword php_profile: PHP profile. - :paramtype php_profile: ~azure.mgmt.workloads.models.PhpProfile - :keyword search_profile: Search profile. - :paramtype search_profile: ~azure.mgmt.workloads.models.SearchProfile - :keyword cache_profile: Cache profile. - :paramtype cache_profile: ~azure.mgmt.workloads.models.CacheProfile - :keyword backup_profile: Backup profile. - :paramtype backup_profile: ~azure.mgmt.workloads.models.BackupProfile - """ - super().__init__(tags=tags, location=location, **kwargs) - self.kind = kind - self.sku = sku - self.identity = identity - self.app_location = app_location - self.managed_resource_group_configuration = managed_resource_group_configuration - self.admin_user_profile = admin_user_profile - self.web_nodes_profile = web_nodes_profile - self.controller_profile = controller_profile - self.network_profile = network_profile - self.database_profile = database_profile - self.site_profile = site_profile - self.fileshare_profile = fileshare_profile - self.php_profile = php_profile - self.search_profile = search_profile - self.cache_profile = cache_profile - self.backup_profile = backup_profile - self.provisioning_state = None - - -class PhpWorkloadResourceIdentity(UserAssignedServiceIdentity): - """Identity for the resource. Currently not supported. - - All required parameters must be populated in order to send to Azure. - - :ivar type: Type of manage identity. Required. Known values are: "None" and "UserAssigned". - :vartype type: str or ~azure.mgmt.workloads.models.ManagedServiceIdentityType - :ivar user_assigned_identities: User assigned identities dictionary. - :vartype user_assigned_identities: dict[str, ~azure.mgmt.workloads.models.UserAssignedIdentity] - """ - - _validation = { - "type": {"required": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentity}"}, - } - - def __init__( - self, - *, - type: Union[str, "_models.ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: Type of manage identity. Required. Known values are: "None" and "UserAssigned". - :paramtype type: str or ~azure.mgmt.workloads.models.ManagedServiceIdentityType - :keyword user_assigned_identities: User assigned identities dictionary. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.workloads.models.UserAssignedIdentity] - """ - super().__init__(type=type, user_assigned_identities=user_assigned_identities, **kwargs) - - -class PhpWorkloadResourceList(_serialization.Model): - """Php workload resource list. - - :ivar value: List of resources in current page. - :vartype value: list[~azure.mgmt.workloads.models.PhpWorkloadResource] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[PhpWorkloadResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.PhpWorkloadResource"]] = None, next_link: Optional[str] = None, **kwargs - ): - """ - :keyword value: List of resources in current page. - :paramtype value: list[~azure.mgmt.workloads.models.PhpWorkloadResource] - :keyword next_link: Link to next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class PrometheusHaClusterProviderInstanceProperties(ProviderSpecificProperties): - """Gets or sets the PrometheusHaCluster provider properties. - - All required parameters must be populated in order to send to Azure. - - :ivar provider_type: The provider type. For example, the value can be SapHana. Required. - :vartype provider_type: str - :ivar prometheus_url: URL of the Node Exporter endpoint. - :vartype prometheus_url: str - :ivar hostname: Gets or sets the target machine name. - :vartype hostname: str - :ivar sid: Gets or sets the cluster sid. - :vartype sid: str - :ivar cluster_name: Gets or sets the clusterName. - :vartype cluster_name: str - :ivar ssl_preference: Gets or sets certificate preference if secure communication is enabled. - Known values are: "Disabled", "RootCertificate", and "ServerCertificate". - :vartype ssl_preference: str or ~azure.mgmt.workloads.models.SslPreference - :ivar ssl_certificate_uri: Gets or sets the blob URI to SSL certificate for the HA cluster - exporter. - :vartype ssl_certificate_uri: str - """ - - _validation = { - "provider_type": {"required": True}, - } - - _attribute_map = { - "provider_type": {"key": "providerType", "type": "str"}, - "prometheus_url": {"key": "prometheusUrl", "type": "str"}, - "hostname": {"key": "hostname", "type": "str"}, - "sid": {"key": "sid", "type": "str"}, - "cluster_name": {"key": "clusterName", "type": "str"}, - "ssl_preference": {"key": "sslPreference", "type": "str"}, - "ssl_certificate_uri": {"key": "sslCertificateUri", "type": "str"}, - } - - def __init__( - self, - *, - prometheus_url: Optional[str] = None, - hostname: Optional[str] = None, - sid: Optional[str] = None, - cluster_name: Optional[str] = None, - ssl_preference: Optional[Union[str, "_models.SslPreference"]] = None, - ssl_certificate_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword prometheus_url: URL of the Node Exporter endpoint. - :paramtype prometheus_url: str - :keyword hostname: Gets or sets the target machine name. - :paramtype hostname: str - :keyword sid: Gets or sets the cluster sid. - :paramtype sid: str - :keyword cluster_name: Gets or sets the clusterName. - :paramtype cluster_name: str - :keyword ssl_preference: Gets or sets certificate preference if secure communication is - enabled. Known values are: "Disabled", "RootCertificate", and "ServerCertificate". - :paramtype ssl_preference: str or ~azure.mgmt.workloads.models.SslPreference - :keyword ssl_certificate_uri: Gets or sets the blob URI to SSL certificate for the HA cluster - exporter. - :paramtype ssl_certificate_uri: str - """ - super().__init__(**kwargs) - self.provider_type: str = "PrometheusHaCluster" - self.prometheus_url = prometheus_url - self.hostname = hostname - self.sid = sid - self.cluster_name = cluster_name - self.ssl_preference = ssl_preference - self.ssl_certificate_uri = ssl_certificate_uri - - -class PrometheusOSProviderInstanceProperties(ProviderSpecificProperties): - """Gets or sets the PrometheusOS provider properties. - - All required parameters must be populated in order to send to Azure. - - :ivar provider_type: The provider type. For example, the value can be SapHana. Required. - :vartype provider_type: str - :ivar prometheus_url: URL of the Node Exporter endpoint. - :vartype prometheus_url: str - :ivar ssl_preference: Gets or sets certificate preference if secure communication is enabled. - Known values are: "Disabled", "RootCertificate", and "ServerCertificate". - :vartype ssl_preference: str or ~azure.mgmt.workloads.models.SslPreference - :ivar ssl_certificate_uri: Gets or sets the blob URI to SSL certificate for the prometheus node - exporter. - :vartype ssl_certificate_uri: str - """ - - _validation = { - "provider_type": {"required": True}, - } - - _attribute_map = { - "provider_type": {"key": "providerType", "type": "str"}, - "prometheus_url": {"key": "prometheusUrl", "type": "str"}, - "ssl_preference": {"key": "sslPreference", "type": "str"}, - "ssl_certificate_uri": {"key": "sslCertificateUri", "type": "str"}, - } - - def __init__( - self, - *, - prometheus_url: Optional[str] = None, - ssl_preference: Optional[Union[str, "_models.SslPreference"]] = None, - ssl_certificate_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword prometheus_url: URL of the Node Exporter endpoint. - :paramtype prometheus_url: str - :keyword ssl_preference: Gets or sets certificate preference if secure communication is - enabled. Known values are: "Disabled", "RootCertificate", and "ServerCertificate". - :paramtype ssl_preference: str or ~azure.mgmt.workloads.models.SslPreference - :keyword ssl_certificate_uri: Gets or sets the blob URI to SSL certificate for the prometheus - node exporter. - :paramtype ssl_certificate_uri: str - """ - super().__init__(**kwargs) - self.provider_type: str = "PrometheusOS" - self.prometheus_url = prometheus_url - self.ssl_preference = ssl_preference - self.ssl_certificate_uri = ssl_certificate_uri - - -class ProxyResource(Resource): - """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. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.workloads.models.SystemData - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs): - """ """ - super().__init__(**kwargs) - - -class ProviderInstance(ProxyResource): - """A provider instance associated with SAP monitor. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.workloads.models.SystemData - :ivar identity: Managed service identity (user assigned identities). - :vartype identity: ~azure.mgmt.workloads.models.UserAssignedServiceIdentity - :ivar provisioning_state: State of provisioning of the provider instance. Known values are: - "Accepted", "Creating", "Updating", "Failed", "Succeeded", "Deleting", and "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.workloads.models.WorkloadMonitorProvisioningState - :ivar errors: Defines the provider instance errors. - :vartype errors: ~azure.mgmt.workloads.models.ProviderInstancePropertiesErrors - :ivar provider_settings: Defines the provider instance errors. - :vartype provider_settings: ~azure.mgmt.workloads.models.ProviderSpecificProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "errors": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "identity": {"key": "identity", "type": "UserAssignedServiceIdentity"}, + "identity": {"key": "identity", "type": "UserAssignedServiceIdentity"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "errors": {"key": "properties.errors", "type": "ProviderInstancePropertiesErrors"}, "provider_settings": {"key": "properties.providerSettings", "type": "ProviderSpecificProperties"}, @@ -3526,8 +3243,8 @@ def __init__( *, identity: Optional["_models.UserAssignedServiceIdentity"] = None, provider_settings: Optional["_models.ProviderSpecificProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword identity: Managed service identity (user assigned identities). :paramtype identity: ~azure.mgmt.workloads.models.UserAssignedServiceIdentity @@ -3556,8 +3273,12 @@ class ProviderInstanceListResult(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.ProviderInstance"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, + *, + value: Optional[List["_models.ProviderInstance"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword value: The list of provider instances. :paramtype value: list[~azure.mgmt.workloads.models.ProviderInstance] @@ -3600,38 +3321,12 @@ class ProviderInstancePropertiesErrors(Error): "message": {"key": "message", "type": "str"}, "target": {"key": "target", "type": "str"}, "details": {"key": "details", "type": "[Error]"}, - "inner_error": {"key": "innerError", "type": "ErrorInnerError"}, - } - - def __init__(self, **kwargs): - """ """ - super().__init__(**kwargs) - - -class RestrictionInfo(_serialization.Model): - """The SKU restriction information. - - :ivar locations: The restriction locations. - :vartype locations: list[str] - :ivar zones: The restriction zones. - :vartype zones: list[str] - """ - - _attribute_map = { - "locations": {"key": "locations", "type": "[str]"}, - "zones": {"key": "zones", "type": "[str]"}, + "inner_error": {"key": "innerError", "type": "ErrorInnerError"}, } - def __init__(self, *, locations: Optional[List[str]] = None, zones: Optional[List[str]] = None, **kwargs): - """ - :keyword locations: The restriction locations. - :paramtype locations: list[str] - :keyword zones: The restriction zones. - :paramtype zones: list[str] - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.locations = locations - self.zones = zones class SAPApplicationServerInstance(TrackedResource): # pylint: disable=too-many-instance-attributes @@ -3674,10 +3369,13 @@ class SAPApplicationServerInstance(TrackedResource): # pylint: disable=too-many :vartype icm_http_port: int :ivar icm_https_port: Application server instance ICM HTTPS Port. :vartype icm_https_port: int - :ivar virtual_machine_id: The virtual machine. - :vartype virtual_machine_id: str + :ivar load_balancer_details: The Load Balancer details such as LoadBalancer ID attached to + Application Server Virtual Machines. + :vartype load_balancer_details: ~azure.mgmt.workloads.models.LoadBalancerDetails + :ivar vm_details: The list of virtual machines. + :vartype vm_details: list[~azure.mgmt.workloads.models.ApplicationServerVmDetails] :ivar status: Defines the SAP Instance status. Known values are: "Starting", "Running", - "Stopping", "Offline", "PartiallyRunning", and "Unavailable". + "Stopping", "Offline", "PartiallyRunning", "Unavailable", and "SoftShutdown". :vartype status: str or ~azure.mgmt.workloads.models.SAPVirtualInstanceStatus :ivar health: Defines the health of SAP Instances. Known values are: "Unknown", "Healthy", "Unhealthy", and "Degraded". @@ -3705,7 +3403,8 @@ class SAPApplicationServerInstance(TrackedResource): # pylint: disable=too-many "gateway_port": {"readonly": True}, "icm_http_port": {"readonly": True}, "icm_https_port": {"readonly": True}, - "virtual_machine_id": {"readonly": True}, + "load_balancer_details": {"readonly": True}, + "vm_details": {"readonly": True}, "status": {"readonly": True}, "health": {"readonly": True}, "provisioning_state": {"readonly": True}, @@ -3728,14 +3427,15 @@ class SAPApplicationServerInstance(TrackedResource): # pylint: disable=too-many "gateway_port": {"key": "properties.gatewayPort", "type": "int"}, "icm_http_port": {"key": "properties.icmHttpPort", "type": "int"}, "icm_https_port": {"key": "properties.icmHttpsPort", "type": "int"}, - "virtual_machine_id": {"key": "properties.virtualMachineId", "type": "str"}, + "load_balancer_details": {"key": "properties.loadBalancerDetails", "type": "LoadBalancerDetails"}, + "vm_details": {"key": "properties.vmDetails", "type": "[ApplicationServerVmDetails]"}, "status": {"key": "properties.status", "type": "str"}, "health": {"key": "properties.health", "type": "str"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "errors": {"key": "properties.errors", "type": "SAPVirtualInstanceError"}, } - 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] @@ -3752,7 +3452,8 @@ def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kw self.gateway_port = None self.icm_http_port = None self.icm_https_port = None - self.virtual_machine_id = None + self.load_balancer_details = None + self.vm_details = None self.status = None self.health = None self.provisioning_state = None @@ -3778,8 +3479,8 @@ def __init__( *, value: Optional[List["_models.SAPApplicationServerInstance"]] = None, next_link: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword value: Gets the list of SAP Application Server instance resources. :paramtype value: list[~azure.mgmt.workloads.models.SAPApplicationServerInstance] @@ -3824,8 +3525,8 @@ def __init__( app_location: str, sap_product: Union[str, "_models.SAPProductType"], database_type: Union[str, "_models.SAPDatabaseType"], - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword app_location: The geo-location where the SAP resources will be created. Required. :paramtype app_location: str @@ -3853,7 +3554,9 @@ class SAPAvailabilityZoneDetailsResult(_serialization.Model): "availability_zone_pairs": {"key": "availabilityZonePairs", "type": "[SAPAvailabilityZonePair]"}, } - def __init__(self, *, availability_zone_pairs: Optional[List["_models.SAPAvailabilityZonePair"]] = None, **kwargs): + def __init__( + self, *, availability_zone_pairs: Optional[List["_models.SAPAvailabilityZonePair"]] = None, **kwargs: Any + ) -> None: """ :keyword availability_zone_pairs: Gets the list of availability zone pairs. :paramtype availability_zone_pairs: list[~azure.mgmt.workloads.models.SAPAvailabilityZonePair] @@ -3876,7 +3579,7 @@ class SAPAvailabilityZonePair(_serialization.Model): "zone_b": {"key": "zoneB", "type": "int"}, } - def __init__(self, *, zone_a: Optional[int] = None, zone_b: Optional[int] = None, **kwargs): + def __init__(self, *, zone_a: Optional[int] = None, zone_b: Optional[int] = None, **kwargs: Any) -> None: """ :keyword zone_a: The zone A. :paramtype zone_a: int @@ -3907,8 +3610,8 @@ def __init__( *, value: Optional[List["_models.SAPCentralServerInstance"]] = None, next_link: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword value: Gets the list of SAP central services instance resources. :paramtype value: list[~azure.mgmt.workloads.models.SAPCentralServerInstance] @@ -3960,10 +3663,13 @@ class SAPCentralServerInstance(TrackedResource): # pylint: disable=too-many-ins :vartype kernel_version: str :ivar kernel_patch: The central services instance Kernel Patch level. :vartype kernel_patch: str + :ivar load_balancer_details: The Load Balancer details such as LoadBalancer ID attached to ASCS + Virtual Machines. + :vartype load_balancer_details: ~azure.mgmt.workloads.models.LoadBalancerDetails :ivar vm_details: The list of virtual machines corresponding to the Central Services instance. :vartype vm_details: list[~azure.mgmt.workloads.models.CentralServerVmDetails] :ivar status: Defines the SAP Instance status. Known values are: "Starting", "Running", - "Stopping", "Offline", "PartiallyRunning", and "Unavailable". + "Stopping", "Offline", "PartiallyRunning", "Unavailable", and "SoftShutdown". :vartype status: str or ~azure.mgmt.workloads.models.SAPVirtualInstanceStatus :ivar health: Defines the health of SAP Instances. Known values are: "Unknown", "Healthy", "Unhealthy", and "Degraded". @@ -3986,6 +3692,7 @@ class SAPCentralServerInstance(TrackedResource): # pylint: disable=too-many-ins "subnet": {"readonly": True}, "kernel_version": {"readonly": True}, "kernel_patch": {"readonly": True}, + "load_balancer_details": {"readonly": True}, "vm_details": {"readonly": True}, "status": {"readonly": True}, "health": {"readonly": True}, @@ -4011,6 +3718,7 @@ class SAPCentralServerInstance(TrackedResource): # pylint: disable=too-many-ins }, "kernel_version": {"key": "properties.kernelVersion", "type": "str"}, "kernel_patch": {"key": "properties.kernelPatch", "type": "str"}, + "load_balancer_details": {"key": "properties.loadBalancerDetails", "type": "LoadBalancerDetails"}, "vm_details": {"key": "properties.vmDetails", "type": "[CentralServerVmDetails]"}, "status": {"key": "properties.status", "type": "str"}, "health": {"key": "properties.health", "type": "str"}, @@ -4027,8 +3735,8 @@ def __init__( enqueue_server_properties: Optional["_models.EnqueueServerProperties"] = None, gateway_server_properties: Optional["_models.GatewayServerProperties"] = None, enqueue_replication_server_properties: Optional["_models.EnqueueReplicationServerProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -4054,6 +3762,7 @@ def __init__( self.enqueue_replication_server_properties = enqueue_replication_server_properties self.kernel_version = None self.kernel_patch = None + self.load_balancer_details = None self.vm_details = None self.status = None self.health = None @@ -4092,10 +3801,13 @@ class SAPDatabaseInstance(TrackedResource): # pylint: disable=too-many-instance :vartype database_type: str :ivar ip_address: Database IP Address. :vartype ip_address: str + :ivar load_balancer_details: The Load Balancer details such as LoadBalancer ID attached to + Database Virtual Machines. + :vartype load_balancer_details: ~azure.mgmt.workloads.models.LoadBalancerDetails :ivar vm_details: The list of virtual machines corresponding to the Database resource. :vartype vm_details: list[~azure.mgmt.workloads.models.DatabaseVmDetails] :ivar status: Defines the SAP Instance status. Known values are: "Starting", "Running", - "Stopping", "Offline", "PartiallyRunning", and "Unavailable". + "Stopping", "Offline", "PartiallyRunning", "Unavailable", and "SoftShutdown". :vartype status: str or ~azure.mgmt.workloads.models.SAPVirtualInstanceStatus :ivar provisioning_state: Defines the provisioning states. Known values are: "Succeeded", "Updating", "Creating", "Failed", and "Deleting". @@ -4115,6 +3827,7 @@ class SAPDatabaseInstance(TrackedResource): # pylint: disable=too-many-instance "database_sid": {"readonly": True}, "database_type": {"readonly": True}, "ip_address": {"readonly": True}, + "load_balancer_details": {"readonly": True}, "vm_details": {"readonly": True}, "status": {"readonly": True}, "provisioning_state": {"readonly": True}, @@ -4132,13 +3845,14 @@ class SAPDatabaseInstance(TrackedResource): # pylint: disable=too-many-instance "database_sid": {"key": "properties.databaseSid", "type": "str"}, "database_type": {"key": "properties.databaseType", "type": "str"}, "ip_address": {"key": "properties.ipAddress", "type": "str"}, + "load_balancer_details": {"key": "properties.loadBalancerDetails", "type": "LoadBalancerDetails"}, "vm_details": {"key": "properties.vmDetails", "type": "[DatabaseVmDetails]"}, "status": {"key": "properties.status", "type": "str"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "errors": {"key": "properties.errors", "type": "SAPVirtualInstanceError"}, } - 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] @@ -4150,6 +3864,7 @@ def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kw self.database_sid = None self.database_type = None self.ip_address = None + self.load_balancer_details = None self.vm_details = None self.status = None self.provisioning_state = None @@ -4171,8 +3886,12 @@ class SAPDatabaseInstanceList(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.SAPDatabaseInstance"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, + *, + value: Optional[List["_models.SAPDatabaseInstance"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword value: Gets the list of SAP Database instances. :paramtype value: list[~azure.mgmt.workloads.models.SAPDatabaseInstance] @@ -4185,70 +3904,36 @@ def __init__( class SAPDiskConfiguration(_serialization.Model): - """The SAP Disk Configuration. - - :ivar volume: The volume name. - :vartype volume: str - :ivar disk_type: The disk type. - :vartype disk_type: str - :ivar disk_count: The disk count. - :vartype disk_count: int - :ivar disk_size_gb: The disk size in GB. - :vartype disk_size_gb: int - :ivar disk_iops_read_write: The disk Iops. - :vartype disk_iops_read_write: int - :ivar disk_m_bps_read_write: The disk provisioned throughput in MBps. - :vartype disk_m_bps_read_write: int - :ivar disk_storage_type: The disk storage type. - :vartype disk_storage_type: str + """The SAP Disk Configuration contains 'recommended disk' details and list of supported disks + detail for a volume type. + + :ivar recommended_configuration: The recommended disk details for a given VM Sku. + :vartype recommended_configuration: ~azure.mgmt.workloads.models.DiskVolumeConfiguration + :ivar supported_configurations: The list of supported disks for a given VM Sku. + :vartype supported_configurations: list[~azure.mgmt.workloads.models.DiskDetails] """ _attribute_map = { - "volume": {"key": "volume", "type": "str"}, - "disk_type": {"key": "diskType", "type": "str"}, - "disk_count": {"key": "diskCount", "type": "int"}, - "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, - "disk_iops_read_write": {"key": "diskIopsReadWrite", "type": "int"}, - "disk_m_bps_read_write": {"key": "diskMBpsReadWrite", "type": "int"}, - "disk_storage_type": {"key": "diskStorageType", "type": "str"}, + "recommended_configuration": {"key": "recommendedConfiguration", "type": "DiskVolumeConfiguration"}, + "supported_configurations": {"key": "supportedConfigurations", "type": "[DiskDetails]"}, } def __init__( self, *, - volume: Optional[str] = None, - disk_type: Optional[str] = None, - disk_count: Optional[int] = None, - disk_size_gb: Optional[int] = None, - disk_iops_read_write: Optional[int] = None, - disk_m_bps_read_write: Optional[int] = None, - disk_storage_type: Optional[str] = None, - **kwargs - ): - """ - :keyword volume: The volume name. - :paramtype volume: str - :keyword disk_type: The disk type. - :paramtype disk_type: str - :keyword disk_count: The disk count. - :paramtype disk_count: int - :keyword disk_size_gb: The disk size in GB. - :paramtype disk_size_gb: int - :keyword disk_iops_read_write: The disk Iops. - :paramtype disk_iops_read_write: int - :keyword disk_m_bps_read_write: The disk provisioned throughput in MBps. - :paramtype disk_m_bps_read_write: int - :keyword disk_storage_type: The disk storage type. - :paramtype disk_storage_type: str + recommended_configuration: Optional["_models.DiskVolumeConfiguration"] = None, + supported_configurations: Optional[List["_models.DiskDetails"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword recommended_configuration: The recommended disk details for a given VM Sku. + :paramtype recommended_configuration: ~azure.mgmt.workloads.models.DiskVolumeConfiguration + :keyword supported_configurations: The list of supported disks for a given VM Sku. + :paramtype supported_configurations: list[~azure.mgmt.workloads.models.DiskDetails] """ super().__init__(**kwargs) - self.volume = volume - self.disk_type = disk_type - self.disk_count = disk_count - self.disk_size_gb = disk_size_gb - self.disk_iops_read_write = disk_iops_read_write - self.disk_m_bps_read_write = disk_m_bps_read_write - self.disk_storage_type = disk_storage_type + self.recommended_configuration = recommended_configuration + self.supported_configurations = supported_configurations class SAPDiskConfigurationsRequest(_serialization.Model): @@ -4301,8 +3986,8 @@ def __init__( database_type: Union[str, "_models.SAPDatabaseType"], deployment_type: Union[str, "_models.SAPDeploymentType"], db_vm_sku: str, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword app_location: The geo-location where the SAP resources will be created. Required. :paramtype app_location: str @@ -4333,25 +4018,32 @@ def __init__( class SAPDiskConfigurationsResult(_serialization.Model): """The list of disk configuration for vmSku which are part of SAP deployment. - :ivar disk_configurations: Gets the list of Disk Configurations. - :vartype disk_configurations: list[~azure.mgmt.workloads.models.SAPDiskConfiguration] + :ivar volume_configurations: The disk configuration for the db volume. For HANA, Required + volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : + ['backup']. + :vartype volume_configurations: dict[str, ~azure.mgmt.workloads.models.SAPDiskConfiguration] """ _attribute_map = { - "disk_configurations": {"key": "diskConfigurations", "type": "[SAPDiskConfiguration]"}, + "volume_configurations": {"key": "volumeConfigurations", "type": "{SAPDiskConfiguration}"}, } - def __init__(self, *, disk_configurations: Optional[List["_models.SAPDiskConfiguration"]] = None, **kwargs): + def __init__( + self, *, volume_configurations: Optional[Dict[str, "_models.SAPDiskConfiguration"]] = None, **kwargs: Any + ) -> None: """ - :keyword disk_configurations: Gets the list of Disk Configurations. - :paramtype disk_configurations: list[~azure.mgmt.workloads.models.SAPDiskConfiguration] + :keyword volume_configurations: The disk configuration for the db volume. For HANA, Required + volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : + ['backup']. + :paramtype volume_configurations: dict[str, ~azure.mgmt.workloads.models.SAPDiskConfiguration] """ super().__init__(**kwargs) - self.disk_configurations = disk_configurations + self.volume_configurations = volume_configurations class SAPInstallWithoutOSConfigSoftwareConfiguration(SoftwareConfiguration): - """The SAP Software configuration Input when the software is to be installed by service without OS Configurations. + """The SAP Software configuration Input when the software is to be installed by service without OS + Configurations. All required parameters must be populated in order to send to Azure. @@ -4395,8 +4087,8 @@ def __init__( sap_bits_storage_account_id: str, software_version: str, high_availability_software_configuration: Optional["_models.HighAvailabilitySoftwareConfiguration"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword bom_url: The URL to the SAP Build of Materials(BOM) file. Required. :paramtype bom_url: str @@ -4416,6 +4108,212 @@ def __init__( self.high_availability_software_configuration = high_availability_software_configuration +class SapLandscapeMonitor(ProxyResource): + """configuration associated with SAP Landscape Monitor Dashboard. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.workloads.models.SystemData + :ivar provisioning_state: State of provisioning of the SAP monitor. Known values are: + "Accepted", "Created", "Failed", "Succeeded", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.workloads.models.SapLandscapeMonitorProvisioningState + :ivar grouping: Gets or sets the SID groupings by landscape and Environment. + :vartype grouping: ~azure.mgmt.workloads.models.SapLandscapeMonitorPropertiesGrouping + :ivar top_metrics_thresholds: Gets or sets the list Top Metric Thresholds for SAP Landscape + Monitor Dashboard. + :vartype top_metrics_thresholds: + list[~azure.mgmt.workloads.models.SapLandscapeMonitorMetricThresholds] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "grouping": {"key": "properties.grouping", "type": "SapLandscapeMonitorPropertiesGrouping"}, + "top_metrics_thresholds": { + "key": "properties.topMetricsThresholds", + "type": "[SapLandscapeMonitorMetricThresholds]", + }, + } + + def __init__( + self, + *, + grouping: Optional["_models.SapLandscapeMonitorPropertiesGrouping"] = None, + top_metrics_thresholds: Optional[List["_models.SapLandscapeMonitorMetricThresholds"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword grouping: Gets or sets the SID groupings by landscape and Environment. + :paramtype grouping: ~azure.mgmt.workloads.models.SapLandscapeMonitorPropertiesGrouping + :keyword top_metrics_thresholds: Gets or sets the list Top Metric Thresholds for SAP Landscape + Monitor Dashboard. + :paramtype top_metrics_thresholds: + list[~azure.mgmt.workloads.models.SapLandscapeMonitorMetricThresholds] + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.grouping = grouping + self.top_metrics_thresholds = top_metrics_thresholds + + +class SapLandscapeMonitorListResult(_serialization.Model): + """The response from the List SAP Landscape Monitor Dashboard operation. + + :ivar value: The list of Sap Landscape Monitor configuration. + :vartype value: list[~azure.mgmt.workloads.models.SapLandscapeMonitor] + :ivar next_link: The URL to get the next set of SAP Landscape Monitor Dashboard. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[SapLandscapeMonitor]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.SapLandscapeMonitor"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The list of Sap Landscape Monitor configuration. + :paramtype value: list[~azure.mgmt.workloads.models.SapLandscapeMonitor] + :keyword next_link: The URL to get the next set of SAP Landscape Monitor Dashboard. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SapLandscapeMonitorMetricThresholds(_serialization.Model): + """Gets or sets the Threshold Values for Top Metrics Health. + + :ivar name: Gets or sets the name of the threshold. + :vartype name: str + :ivar green: Gets or sets the threshold value for Green. + :vartype green: float + :ivar yellow: Gets or sets the threshold value for Yellow. + :vartype yellow: float + :ivar red: Gets or sets the threshold value for Red. + :vartype red: float + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "green": {"key": "green", "type": "float"}, + "yellow": {"key": "yellow", "type": "float"}, + "red": {"key": "red", "type": "float"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + green: Optional[float] = None, + yellow: Optional[float] = None, + red: Optional[float] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Gets or sets the name of the threshold. + :paramtype name: str + :keyword green: Gets or sets the threshold value for Green. + :paramtype green: float + :keyword yellow: Gets or sets the threshold value for Yellow. + :paramtype yellow: float + :keyword red: Gets or sets the threshold value for Red. + :paramtype red: float + """ + super().__init__(**kwargs) + self.name = name + self.green = green + self.yellow = yellow + self.red = red + + +class SapLandscapeMonitorPropertiesGrouping(_serialization.Model): + """Gets or sets the SID groupings by landscape and Environment. + + :ivar landscape: Gets or sets the list of landscape to SID mappings. + :vartype landscape: list[~azure.mgmt.workloads.models.SapLandscapeMonitorSidMapping] + :ivar sap_application: Gets or sets the list of Sap Applications to SID mappings. + :vartype sap_application: list[~azure.mgmt.workloads.models.SapLandscapeMonitorSidMapping] + """ + + _attribute_map = { + "landscape": {"key": "landscape", "type": "[SapLandscapeMonitorSidMapping]"}, + "sap_application": {"key": "sapApplication", "type": "[SapLandscapeMonitorSidMapping]"}, + } + + def __init__( + self, + *, + landscape: Optional[List["_models.SapLandscapeMonitorSidMapping"]] = None, + sap_application: Optional[List["_models.SapLandscapeMonitorSidMapping"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword landscape: Gets or sets the list of landscape to SID mappings. + :paramtype landscape: list[~azure.mgmt.workloads.models.SapLandscapeMonitorSidMapping] + :keyword sap_application: Gets or sets the list of Sap Applications to SID mappings. + :paramtype sap_application: list[~azure.mgmt.workloads.models.SapLandscapeMonitorSidMapping] + """ + super().__init__(**kwargs) + self.landscape = landscape + self.sap_application = sap_application + + +class SapLandscapeMonitorSidMapping(_serialization.Model): + """Gets or sets the mapping for SID to Environment/Applications. + + :ivar name: Gets or sets the name of the grouping. + :vartype name: str + :ivar top_sid: Gets or sets the list of SID's. + :vartype top_sid: list[str] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "top_sid": {"key": "topSid", "type": "[str]"}, + } + + def __init__(self, *, name: Optional[str] = None, top_sid: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword name: Gets or sets the name of the grouping. + :paramtype name: str + :keyword top_sid: Gets or sets the list of SID's. + :paramtype top_sid: list[str] + """ + super().__init__(**kwargs) + self.name = name + self.top_sid = top_sid + + class SapNetWeaverProviderInstanceProperties( ProviderSpecificProperties ): # pylint: disable=too-many-instance-attributes @@ -4443,8 +4341,6 @@ class SapNetWeaverProviderInstanceProperties( :vartype sap_client_id: str :ivar sap_port_number: Gets or sets the SAP HTTP port number. :vartype sap_port_number: str - :ivar sap_ssl_certificate_uri: Gets or sets the blob URI to SSL certificate for the SAP system. - :vartype sap_ssl_certificate_uri: str :ivar ssl_certificate_uri: Gets or sets the blob URI to SSL certificate for the SAP system. :vartype ssl_certificate_uri: str :ivar ssl_preference: Gets or sets certificate preference if secure communication is enabled. @@ -4467,7 +4363,6 @@ class SapNetWeaverProviderInstanceProperties( "sap_password_uri": {"key": "sapPasswordUri", "type": "str"}, "sap_client_id": {"key": "sapClientId", "type": "str"}, "sap_port_number": {"key": "sapPortNumber", "type": "str"}, - "sap_ssl_certificate_uri": {"key": "sapSslCertificateUri", "type": "str"}, "ssl_certificate_uri": {"key": "sslCertificateUri", "type": "str"}, "ssl_preference": {"key": "sslPreference", "type": "str"}, } @@ -4484,11 +4379,10 @@ def __init__( sap_password_uri: Optional[str] = None, sap_client_id: Optional[str] = None, sap_port_number: Optional[str] = None, - sap_ssl_certificate_uri: Optional[str] = None, ssl_certificate_uri: Optional[str] = None, ssl_preference: Optional[Union[str, "_models.SslPreference"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword sap_sid: Gets or sets the SAP System Identifier. :paramtype sap_sid: str @@ -4508,9 +4402,6 @@ def __init__( :paramtype sap_client_id: str :keyword sap_port_number: Gets or sets the SAP HTTP port number. :paramtype sap_port_number: str - :keyword sap_ssl_certificate_uri: Gets or sets the blob URI to SSL certificate for the SAP - system. - :paramtype sap_ssl_certificate_uri: str :keyword ssl_certificate_uri: Gets or sets the blob URI to SSL certificate for the SAP system. :paramtype ssl_certificate_uri: str :keyword ssl_preference: Gets or sets certificate preference if secure communication is @@ -4528,7 +4419,6 @@ def __init__( self.sap_password_uri = sap_password_uri self.sap_client_id = sap_client_id self.sap_port_number = sap_port_number - self.sap_ssl_certificate_uri = sap_ssl_certificate_uri self.ssl_certificate_uri = ssl_certificate_uri self.ssl_preference = ssl_preference @@ -4596,8 +4486,8 @@ def __init__( database_type: Union[str, "_models.SAPDatabaseType"], db_scale_method: Optional[Union[str, "_models.SAPDatabaseScaleMethod"]] = None, high_availability_type: Optional[Union[str, "_models.SAPHighAvailabilityType"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword app_location: The geo-location where the resource is to be created. Required. :paramtype app_location: str @@ -4662,7 +4552,7 @@ class SAPSizingRecommendationResult(_serialization.Model): } } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.deployment_type: Optional[str] = None @@ -4679,7 +4569,7 @@ class SAPSupportedResourceSkusResult(_serialization.Model): "supported_skus": {"key": "supportedSkus", "type": "[SAPSupportedSku]"}, } - def __init__(self, *, supported_skus: Optional[List["_models.SAPSupportedSku"]] = None, **kwargs): + def __init__(self, *, supported_skus: Optional[List["_models.SAPSupportedSku"]] = None, **kwargs: Any) -> None: """ :keyword supported_skus: Gets the list of SAP supported SKUs. :paramtype supported_skus: list[~azure.mgmt.workloads.models.SAPSupportedSku] @@ -4712,8 +4602,8 @@ def __init__( vm_sku: Optional[str] = None, is_app_server_certified: Optional[bool] = None, is_database_certified: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword vm_sku: The VM Sku. :paramtype vm_sku: str @@ -4780,8 +4670,8 @@ def __init__( deployment_type: Union[str, "_models.SAPDeploymentType"], database_type: Union[str, "_models.SAPDatabaseType"], high_availability_type: Optional[Union[str, "_models.SAPHighAvailabilityType"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword app_location: The geo-location where the resource is to be created. Required. :paramtype app_location: str @@ -4847,7 +4737,7 @@ class SAPVirtualInstance(TrackedResource): # pylint: disable=too-many-instance- :vartype managed_resource_group_configuration: ~azure.mgmt.workloads.models.ManagedRGConfiguration :ivar status: Defines the SAP Instance status. Known values are: "Starting", "Running", - "Stopping", "Offline", "PartiallyRunning", and "Unavailable". + "Stopping", "Offline", "PartiallyRunning", "Unavailable", and "SoftShutdown". :vartype status: str or ~azure.mgmt.workloads.models.SAPVirtualInstanceStatus :ivar health: Defines the health of SAP Instances. Known values are: "Unknown", "Healthy", "Unhealthy", and "Degraded". @@ -4915,8 +4805,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.UserAssignedServiceIdentity"] = None, managed_resource_group_configuration: Optional["_models.ManagedRGConfiguration"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -4961,7 +4851,7 @@ class SAPVirtualInstanceError(_serialization.Model): "properties": {"key": "properties", "type": "ErrorDefinition"}, } - def __init__(self, *, properties: Optional["_models.ErrorDefinition"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.ErrorDefinition"] = None, **kwargs: Any) -> None: """ :keyword properties: The Virtual Instance for SAP error body. :paramtype properties: ~azure.mgmt.workloads.models.ErrorDefinition @@ -4985,8 +4875,12 @@ class SAPVirtualInstanceList(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.SAPVirtualInstance"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, + *, + value: Optional[List["_models.SAPVirtualInstance"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword value: Gets the list of Virtual Instances for SAP solutions resources. :paramtype value: list[~azure.mgmt.workloads.models.SAPVirtualInstance] @@ -4998,78 +4892,6 @@ def __init__( self.next_link = next_link -class SearchProfile(NodeProfile): - """Search profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar name: VM or VMSS name. - :vartype name: str - :ivar node_sku: VM SKU for node(s). Required. - :vartype node_sku: str - :ivar os_image: OS image used for creating the nodes. Required. - :vartype os_image: ~azure.mgmt.workloads.models.OsImageProfile - :ivar os_disk: OS disk details. Required. - :vartype os_disk: ~azure.mgmt.workloads.models.DiskInfo - :ivar data_disks: Data disks details. This property is not in use right now. - :vartype data_disks: list[~azure.mgmt.workloads.models.DiskInfo] - :ivar node_resource_ids: VM/VMSS resource ARM Ids. - :vartype node_resource_ids: list[str] - :ivar search_type: Search type. Required. "Elastic" - :vartype search_type: str or ~azure.mgmt.workloads.models.SearchType - """ - - _validation = { - "node_sku": {"required": True}, - "os_image": {"required": True}, - "os_disk": {"required": True}, - "node_resource_ids": {"readonly": True}, - "search_type": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "node_sku": {"key": "nodeSku", "type": "str"}, - "os_image": {"key": "osImage", "type": "OsImageProfile"}, - "os_disk": {"key": "osDisk", "type": "DiskInfo"}, - "data_disks": {"key": "dataDisks", "type": "[DiskInfo]"}, - "node_resource_ids": {"key": "nodeResourceIds", "type": "[str]"}, - "search_type": {"key": "searchType", "type": "str"}, - } - - def __init__( - self, - *, - node_sku: str, - os_image: "_models.OsImageProfile", - os_disk: "_models.DiskInfo", - search_type: Union[str, "_models.SearchType"], - name: Optional[str] = None, - data_disks: Optional[List["_models.DiskInfo"]] = None, - **kwargs - ): - """ - :keyword name: VM or VMSS name. - :paramtype name: str - :keyword node_sku: VM SKU for node(s). Required. - :paramtype node_sku: str - :keyword os_image: OS image used for creating the nodes. Required. - :paramtype os_image: ~azure.mgmt.workloads.models.OsImageProfile - :keyword os_disk: OS disk details. Required. - :paramtype os_disk: ~azure.mgmt.workloads.models.DiskInfo - :keyword data_disks: Data disks details. This property is not in use right now. - :paramtype data_disks: list[~azure.mgmt.workloads.models.DiskInfo] - :keyword search_type: Search type. Required. "Elastic" - :paramtype search_type: str or ~azure.mgmt.workloads.models.SearchType - """ - super().__init__( - name=name, node_sku=node_sku, os_image=os_image, os_disk=os_disk, data_disks=data_disks, **kwargs - ) - self.search_type = search_type - - class ServiceInitiatedSoftwareConfiguration(SoftwareConfiguration): """The SAP Software configuration Input when the software is to be installed by service. @@ -5125,8 +4947,8 @@ def __init__( sap_fqdn: str, ssh_private_key: str, high_availability_software_configuration: Optional["_models.HighAvailabilitySoftwareConfiguration"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword bom_url: The URL to the SAP Build of Materials(BOM) file. Required. :paramtype bom_url: str @@ -5152,6 +4974,46 @@ def __init__( self.high_availability_software_configuration = high_availability_software_configuration +class SharedStorageResourceNames(_serialization.Model): + """The resource names object for shared storage. + + :ivar shared_storage_account_name: The full name of the shared storage account. If it is not + provided, it will be defaulted to {SID}nfs{guid of 15 chars}. + :vartype shared_storage_account_name: str + :ivar shared_storage_account_private_end_point_name: The full name of private end point for the + shared storage account. If it is not provided, it will be defaulted to {storageAccountName}_pe. + :vartype shared_storage_account_private_end_point_name: str + """ + + _attribute_map = { + "shared_storage_account_name": {"key": "sharedStorageAccountName", "type": "str"}, + "shared_storage_account_private_end_point_name": { + "key": "sharedStorageAccountPrivateEndPointName", + "type": "str", + }, + } + + def __init__( + self, + *, + shared_storage_account_name: Optional[str] = None, + shared_storage_account_private_end_point_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword shared_storage_account_name: The full name of the shared storage account. If it is not + provided, it will be defaulted to {SID}nfs{guid of 15 chars}. + :paramtype shared_storage_account_name: str + :keyword shared_storage_account_private_end_point_name: The full name of private end point for + the shared storage account. If it is not provided, it will be defaulted to + {storageAccountName}_pe. + :paramtype shared_storage_account_private_end_point_name: str + """ + super().__init__(**kwargs) + self.shared_storage_account_name = shared_storage_account_name + self.shared_storage_account_private_end_point_name = shared_storage_account_private_end_point_name + + class SingleServerConfiguration(InfrastructureConfiguration): """Gets or sets the single server configuration. @@ -5172,6 +5034,11 @@ class SingleServerConfiguration(InfrastructureConfiguration): :ivar virtual_machine_configuration: Gets or sets the virtual machine configuration. Required. :vartype virtual_machine_configuration: ~azure.mgmt.workloads.models.VirtualMachineConfiguration + :ivar db_disk_configuration: Gets or sets the disk configuration. + :vartype db_disk_configuration: ~azure.mgmt.workloads.models.DiskConfiguration + :ivar custom_resource_names: The set of custom names to be used for underlying azure resources + that are part of the SAP system. + :vartype custom_resource_names: ~azure.mgmt.workloads.models.SingleServerCustomResourceNames """ _validation = { @@ -5188,6 +5055,8 @@ class SingleServerConfiguration(InfrastructureConfiguration): "database_type": {"key": "databaseType", "type": "str"}, "subnet_id": {"key": "subnetId", "type": "str"}, "virtual_machine_configuration": {"key": "virtualMachineConfiguration", "type": "VirtualMachineConfiguration"}, + "db_disk_configuration": {"key": "dbDiskConfiguration", "type": "DiskConfiguration"}, + "custom_resource_names": {"key": "customResourceNames", "type": "SingleServerCustomResourceNames"}, } def __init__( @@ -5198,8 +5067,10 @@ def __init__( virtual_machine_configuration: "_models.VirtualMachineConfiguration", network_configuration: Optional["_models.NetworkConfiguration"] = None, database_type: Optional[Union[str, "_models.SAPDatabaseType"]] = None, - **kwargs - ): + db_disk_configuration: Optional["_models.DiskConfiguration"] = None, + custom_resource_names: Optional["_models.SingleServerCustomResourceNames"] = None, + **kwargs: Any + ) -> None: """ :keyword app_resource_group: The application resource group where SAP system resources will be deployed. Required. @@ -5214,526 +5085,139 @@ def __init__( Required. :paramtype virtual_machine_configuration: ~azure.mgmt.workloads.models.VirtualMachineConfiguration + :keyword db_disk_configuration: Gets or sets the disk configuration. + :paramtype db_disk_configuration: ~azure.mgmt.workloads.models.DiskConfiguration + :keyword custom_resource_names: The set of custom names to be used for underlying azure + resources that are part of the SAP system. + :paramtype custom_resource_names: ~azure.mgmt.workloads.models.SingleServerCustomResourceNames """ super().__init__(app_resource_group=app_resource_group, **kwargs) self.deployment_type: str = "SingleServer" self.network_configuration = network_configuration - self.database_type = database_type - self.subnet_id = subnet_id - self.virtual_machine_configuration = virtual_machine_configuration - - -class SingleServerRecommendationResult(SAPSizingRecommendationResult): - """The recommended configuration for a single server SAP system. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_type: The type of SAP deployment, single server or Three tier. Required. Known - values are: "SingleServer" and "ThreeTier". - :vartype deployment_type: str or ~azure.mgmt.workloads.models.SAPDeploymentType - :ivar vm_sku: The recommended VM SKU for single server. - :vartype vm_sku: str - """ - - _validation = { - "deployment_type": {"required": True}, - } - - _attribute_map = { - "deployment_type": {"key": "deploymentType", "type": "str"}, - "vm_sku": {"key": "vmSku", "type": "str"}, - } - - def __init__(self, *, vm_sku: Optional[str] = None, **kwargs): - """ - :keyword vm_sku: The recommended VM SKU for single server. - :paramtype vm_sku: str - """ - super().__init__(**kwargs) - self.deployment_type: str = "SingleServer" - self.vm_sku = vm_sku - - -class SiteProfile(_serialization.Model): - """Workload website profile. - - :ivar domain_name: Domain name for the application site URL. - :vartype domain_name: str - """ - - _attribute_map = { - "domain_name": {"key": "domainName", "type": "str"}, - } - - def __init__(self, *, domain_name: Optional[str] = None, **kwargs): - """ - :keyword domain_name: Domain name for the application site URL. - :paramtype domain_name: str - """ - super().__init__(**kwargs) - self.domain_name = domain_name - - -class Sku(_serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. Required. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic", - "Standard", and "Premium". - :vartype tier: str or ~azure.mgmt.workloads.models.SkuTier - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "tier": {"key": "tier", "type": "str"}, - "size": {"key": "size", "type": "str"}, - "family": {"key": "family", "type": "str"}, - "capacity": {"key": "capacity", "type": "int"}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "_models.SkuTier"]] = None, - size: Optional[str] = None, - family: Optional[str] = None, - capacity: Optional[int] = None, - **kwargs - ): - """ - :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. Required. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic", - "Standard", and "Premium". - :paramtype tier: str or ~azure.mgmt.workloads.models.SkuTier - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - """ - super().__init__(**kwargs) - self.name = name - self.tier = tier - self.size = size - self.family = family - self.capacity = capacity - - -class SkuCapability(_serialization.Model): - """The SKU capability definition. - - :ivar name: The capability name. - :vartype name: str - :ivar value: The capability value. - :vartype value: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "value": {"key": "value", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs): - """ - :keyword name: The capability name. - :paramtype name: str - :keyword value: The capability value. - :paramtype value: str - """ - super().__init__(**kwargs) - self.name = name - self.value = value - - -class SkuCapacity(_serialization.Model): - """The SKU capacity. - - :ivar minimum: Minimum capacity value. - :vartype minimum: int - :ivar maximum: Maximum capacity value. - :vartype maximum: int - :ivar default: Default capacity value. - :vartype default: int - :ivar scale_type: Scale type of the SKU capacity. Known values are: "None", "Manual", and - "Automatic". - :vartype scale_type: str or ~azure.mgmt.workloads.models.SkuScaleType - """ + self.database_type = database_type + self.subnet_id = subnet_id + self.virtual_machine_configuration = virtual_machine_configuration + self.db_disk_configuration = db_disk_configuration + self.custom_resource_names = custom_resource_names - _attribute_map = { - "minimum": {"key": "minimum", "type": "int"}, - "maximum": {"key": "maximum", "type": "int"}, - "default": {"key": "default", "type": "int"}, - "scale_type": {"key": "scaleType", "type": "str"}, - } - def __init__( - self, - *, - minimum: Optional[int] = None, - maximum: Optional[int] = None, - default: Optional[int] = None, - scale_type: Optional[Union[str, "_models.SkuScaleType"]] = None, - **kwargs - ): - """ - :keyword minimum: Minimum capacity value. - :paramtype minimum: int - :keyword maximum: Maximum capacity value. - :paramtype maximum: int - :keyword default: Default capacity value. - :paramtype default: int - :keyword scale_type: Scale type of the SKU capacity. Known values are: "None", "Manual", and - "Automatic". - :paramtype scale_type: str or ~azure.mgmt.workloads.models.SkuScaleType - """ - super().__init__(**kwargs) - self.minimum = minimum - self.maximum = maximum - self.default = default - self.scale_type = scale_type +class SingleServerCustomResourceNames(_serialization.Model): + """The resource-names input to specify custom names for underlying azure resources that are part + of a single server SAP system. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + SingleServerFullResourceNames -class SkuCost(_serialization.Model): - """The SKU cost definition. + All required parameters must be populated in order to send to Azure. - :ivar meter_id: Billing meter id. - :vartype meter_id: str - :ivar quantity: The quantity. - :vartype quantity: int - :ivar extended_unit: The extended unit. - :vartype extended_unit: str + :ivar naming_pattern_type: The pattern type to be used for resource naming. Required. + "FullResourceName" + :vartype naming_pattern_type: str or ~azure.mgmt.workloads.models.NamingPatternType """ + _validation = { + "naming_pattern_type": {"required": True}, + } + _attribute_map = { - "meter_id": {"key": "meterId", "type": "str"}, - "quantity": {"key": "quantity", "type": "int"}, - "extended_unit": {"key": "extendedUnit", "type": "str"}, + "naming_pattern_type": {"key": "namingPatternType", "type": "str"}, } - def __init__( - self, - *, - meter_id: Optional[str] = None, - quantity: Optional[int] = None, - extended_unit: Optional[str] = None, - **kwargs - ): - """ - :keyword meter_id: Billing meter id. - :paramtype meter_id: str - :keyword quantity: The quantity. - :paramtype quantity: int - :keyword extended_unit: The extended unit. - :paramtype extended_unit: str - """ + _subtype_map = {"naming_pattern_type": {"FullResourceName": "SingleServerFullResourceNames"}} + + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.meter_id = meter_id - self.quantity = quantity - self.extended_unit = extended_unit + self.naming_pattern_type: Optional[str] = None -class SkuDefinition(_serialization.Model): # pylint: disable=too-many-instance-attributes - """The SKU definition. +class SingleServerFullResourceNames(SingleServerCustomResourceNames): + """The resource name object where the specified values will be full resource names of the + corresponding resources in a single server SAP system. All required parameters must be populated in order to send to Azure. - :ivar name: The name of the SKU. Required. - :vartype name: str - :ivar resource_type: Resource type the SKU applicable for. - :vartype resource_type: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. - :vartype tier: str - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar kind: If the service has different kinds of hardware, for the same SKU, then that can be - captured here. - :vartype kind: str - :ivar locations: List of locations where this SKU is available. - :vartype locations: list[str] - :ivar location_info: List of locations where this SKU is available. - :vartype location_info: list[~azure.mgmt.workloads.models.SkuLocationAndZones] - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: JSON - :ivar costs: The SKU costs. - :vartype costs: list[~azure.mgmt.workloads.models.SkuCost] - :ivar capabilities: The SKU capabilities. - :vartype capabilities: list[~azure.mgmt.workloads.models.SkuCapability] - :ivar restrictions: The SKU restrictions. - :vartype restrictions: list[~azure.mgmt.workloads.models.SkuRestriction] + :ivar naming_pattern_type: The pattern type to be used for resource naming. Required. + "FullResourceName" + :vartype naming_pattern_type: str or ~azure.mgmt.workloads.models.NamingPatternType + :ivar virtual_machine: The resource names object for virtual machine and related resources. + :vartype virtual_machine: ~azure.mgmt.workloads.models.VirtualMachineResourceNames """ _validation = { - "name": {"required": True}, + "naming_pattern_type": {"required": True}, } _attribute_map = { - "name": {"key": "name", "type": "str"}, - "resource_type": {"key": "resourceType", "type": "str"}, - "tier": {"key": "tier", "type": "str"}, - "size": {"key": "size", "type": "str"}, - "family": {"key": "family", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "locations": {"key": "locations", "type": "[str]"}, - "location_info": {"key": "locationInfo", "type": "[SkuLocationAndZones]"}, - "capacity": {"key": "capacity", "type": "object"}, - "costs": {"key": "costs", "type": "[SkuCost]"}, - "capabilities": {"key": "capabilities", "type": "[SkuCapability]"}, - "restrictions": {"key": "restrictions", "type": "[SkuRestriction]"}, + "naming_pattern_type": {"key": "namingPatternType", "type": "str"}, + "virtual_machine": {"key": "virtualMachine", "type": "VirtualMachineResourceNames"}, } def __init__( - self, - *, - name: str, - resource_type: Optional[str] = None, - tier: Optional[str] = None, - size: Optional[str] = None, - family: Optional[str] = None, - kind: Optional[str] = None, - locations: Optional[List[str]] = None, - location_info: Optional[List["_models.SkuLocationAndZones"]] = None, - capacity: Optional[JSON] = None, - costs: Optional[List["_models.SkuCost"]] = None, - capabilities: Optional[List["_models.SkuCapability"]] = None, - restrictions: Optional[List["_models.SkuRestriction"]] = None, - **kwargs - ): - """ - :keyword name: The name of the SKU. Required. - :paramtype name: str - :keyword resource_type: Resource type the SKU applicable for. - :paramtype resource_type: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. - :paramtype tier: str - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword kind: If the service has different kinds of hardware, for the same SKU, then that can - be captured here. - :paramtype kind: str - :keyword locations: List of locations where this SKU is available. - :paramtype locations: list[str] - :keyword location_info: List of locations where this SKU is available. - :paramtype location_info: list[~azure.mgmt.workloads.models.SkuLocationAndZones] - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: JSON - :keyword costs: The SKU costs. - :paramtype costs: list[~azure.mgmt.workloads.models.SkuCost] - :keyword capabilities: The SKU capabilities. - :paramtype capabilities: list[~azure.mgmt.workloads.models.SkuCapability] - :keyword restrictions: The SKU restrictions. - :paramtype restrictions: list[~azure.mgmt.workloads.models.SkuRestriction] + self, *, virtual_machine: Optional["_models.VirtualMachineResourceNames"] = None, **kwargs: Any + ) -> None: """ - super().__init__(**kwargs) - self.name = name - self.resource_type = resource_type - self.tier = tier - self.size = size - self.family = family - self.kind = kind - self.locations = locations - self.location_info = location_info - self.capacity = capacity - self.costs = costs - self.capabilities = capabilities - self.restrictions = restrictions - - -class SkuLocationAndZones(_serialization.Model): - """The SKU location and zone. - - :ivar location: The location of the SKU. - :vartype location: str - :ivar zones: The availability zones of SKU location. - :vartype zones: list[str] - :ivar zone_details: The availability zone details of the SKU location. - :vartype zone_details: list[~azure.mgmt.workloads.models.SkuZoneDetail] - :ivar extended_locations: The extended locations of SKU. - :vartype extended_locations: list[str] - :ivar type: Type of the extended location. Known values are: "Region" and "EdgeZone". - :vartype type: str or ~azure.mgmt.workloads.models.LocationType - """ - - _attribute_map = { - "location": {"key": "location", "type": "str"}, - "zones": {"key": "zones", "type": "[str]"}, - "zone_details": {"key": "zoneDetails", "type": "[SkuZoneDetail]"}, - "extended_locations": {"key": "extendedLocations", "type": "[str]"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__( - self, - *, - location: Optional[str] = None, - zones: Optional[List[str]] = None, - zone_details: Optional[List["_models.SkuZoneDetail"]] = None, - extended_locations: Optional[List[str]] = None, - type: Optional[Union[str, "_models.LocationType"]] = None, - **kwargs - ): - """ - :keyword location: The location of the SKU. - :paramtype location: str - :keyword zones: The availability zones of SKU location. - :paramtype zones: list[str] - :keyword zone_details: The availability zone details of the SKU location. - :paramtype zone_details: list[~azure.mgmt.workloads.models.SkuZoneDetail] - :keyword extended_locations: The extended locations of SKU. - :paramtype extended_locations: list[str] - :keyword type: Type of the extended location. Known values are: "Region" and "EdgeZone". - :paramtype type: str or ~azure.mgmt.workloads.models.LocationType + :keyword virtual_machine: The resource names object for virtual machine and related resources. + :paramtype virtual_machine: ~azure.mgmt.workloads.models.VirtualMachineResourceNames """ super().__init__(**kwargs) - self.location = location - self.zones = zones - self.zone_details = zone_details - self.extended_locations = extended_locations - self.type = type + self.naming_pattern_type: str = "FullResourceName" + self.virtual_machine = virtual_machine -class SkuRestriction(_serialization.Model): - """The SKU restriction definition. +class SingleServerRecommendationResult(SAPSizingRecommendationResult): + """The recommended configuration for a single server SAP system. + + All required parameters must be populated in order to send to Azure. - :ivar type: The SKU restriction type. Known values are: "NotSpecified", "Location", and "Zone". - :vartype type: str or ~azure.mgmt.workloads.models.SkuRestrictionType - :ivar values: Restriction values. - :vartype values: list[str] - :ivar restriction_info: The restriction information. - :vartype restriction_info: JSON - :ivar reason_code: The SKU restriction reason code. Known values are: "NotSpecified", - "QuotaId", and "NotAvailableForSubscription". - :vartype reason_code: str or ~azure.mgmt.workloads.models.SkuRestrictionReasonCode + :ivar deployment_type: The type of SAP deployment, single server or Three tier. Required. Known + values are: "SingleServer" and "ThreeTier". + :vartype deployment_type: str or ~azure.mgmt.workloads.models.SAPDeploymentType + :ivar vm_sku: The recommended VM SKU for single server. + :vartype vm_sku: str """ + _validation = { + "deployment_type": {"required": True}, + } + _attribute_map = { - "type": {"key": "type", "type": "str"}, - "values": {"key": "values", "type": "[str]"}, - "restriction_info": {"key": "restrictionInfo", "type": "object"}, - "reason_code": {"key": "reasonCode", "type": "str"}, + "deployment_type": {"key": "deploymentType", "type": "str"}, + "vm_sku": {"key": "vmSku", "type": "str"}, } - def __init__( - self, - *, - type: Optional[Union[str, "_models.SkuRestrictionType"]] = None, - values: Optional[List[str]] = None, - restriction_info: Optional[JSON] = None, - reason_code: Optional[Union[str, "_models.SkuRestrictionReasonCode"]] = None, - **kwargs - ): - """ - :keyword type: The SKU restriction type. Known values are: "NotSpecified", "Location", and - "Zone". - :paramtype type: str or ~azure.mgmt.workloads.models.SkuRestrictionType - :keyword values: Restriction values. - :paramtype values: list[str] - :keyword restriction_info: The restriction information. - :paramtype restriction_info: JSON - :keyword reason_code: The SKU restriction reason code. Known values are: "NotSpecified", - "QuotaId", and "NotAvailableForSubscription". - :paramtype reason_code: str or ~azure.mgmt.workloads.models.SkuRestrictionReasonCode + def __init__(self, *, vm_sku: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword vm_sku: The recommended VM SKU for single server. + :paramtype vm_sku: str """ super().__init__(**kwargs) - self.type = type - self.values = values - self.restriction_info = restriction_info - self.reason_code = reason_code + self.deployment_type: str = "SingleServer" + self.vm_sku = vm_sku -class SkusListResult(_serialization.Model): - """A list of SKUs supported by an Azure Resource Provider. +class SkipFileShareConfiguration(FileShareConfiguration): + """Gets or sets the skip file share configuration. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar value: List of SKUs supported by the resource provider. - :vartype value: list[~azure.mgmt.workloads.models.SkuDefinition] - :ivar next_link: URL to get the next set of SKU list results (if there are any). - :vartype next_link: str + :ivar configuration_type: The type of file share config. Required. Known values are: "Skip", + "CreateAndMount", and "Mount". + :vartype configuration_type: str or ~azure.mgmt.workloads.models.ConfigurationType """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "configuration_type": {"required": True}, } _attribute_map = { - "value": {"key": "value", "type": "[SkuDefinition]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "configuration_type": {"key": "configurationType", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class SkuZoneDetail(_serialization.Model): - """The SKU zone details. - - :ivar zones: The physical zones. - :vartype zones: list[str] - :ivar capabilities: The capabilities. - :vartype capabilities: list[~azure.mgmt.workloads.models.SkuCapability] - """ - - _attribute_map = { - "zones": {"key": "zones", "type": "[str]"}, - "capabilities": {"key": "capabilities", "type": "[SkuCapability]"}, - } - - def __init__( - self, - *, - zones: Optional[List[str]] = None, - capabilities: Optional[List["_models.SkuCapability"]] = None, - **kwargs - ): - """ - :keyword zones: The physical zones. - :paramtype zones: list[str] - :keyword capabilities: The capabilities. - :paramtype capabilities: list[~azure.mgmt.workloads.models.SkuCapability] - """ - super().__init__(**kwargs) - self.zones = zones - self.capabilities = capabilities + self.configuration_type: str = "Skip" class SshConfiguration(_serialization.Model): @@ -5747,7 +5231,7 @@ class SshConfiguration(_serialization.Model): "public_keys": {"key": "publicKeys", "type": "[SshPublicKey]"}, } - def __init__(self, *, public_keys: Optional[List["_models.SshPublicKey"]] = None, **kwargs): + def __init__(self, *, public_keys: Optional[List["_models.SshPublicKey"]] = None, **kwargs: Any) -> None: """ :keyword public_keys: The list of SSH public keys used to authenticate with linux based VMs. :paramtype public_keys: list[~azure.mgmt.workloads.models.SshPublicKey] @@ -5757,7 +5241,10 @@ def __init__(self, *, public_keys: Optional[List["_models.SshPublicKey"]] = None class SshKeyPair(_serialization.Model): - """The SSH Key-pair used to authenticate with the VM. The key needs to be at least 2048-bit and in ssh-rsa format. :code:`
`:code:`
` For creating ssh keys, see `Create SSH keys on Linux and Mac for Linux VMs in Azure `_. + """The SSH Key-pair used to authenticate with the VM. The key needs to be at least 2048-bit and in + ssh-rsa format. :code:`
`:code:`
` For creating ssh keys, see `Create SSH keys on Linux + and Mac for Linux VMs in Azure + `_. :ivar public_key: SSH public key. :vartype public_key: str @@ -5770,7 +5257,7 @@ class SshKeyPair(_serialization.Model): "private_key": {"key": "privateKey", "type": "str"}, } - def __init__(self, *, public_key: Optional[str] = None, private_key: Optional[str] = None, **kwargs): + def __init__(self, *, public_key: Optional[str] = None, private_key: Optional[str] = None, **kwargs: Any) -> None: """ :keyword public_key: SSH public key. :paramtype public_key: str @@ -5783,7 +5270,8 @@ def __init__(self, *, public_key: Optional[str] = None, private_key: Optional[st class SshPublicKey(_serialization.Model): - """Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed. + """Contains information about SSH certificate public key and the path on the Linux VM where the + public key is placed. :ivar key_data: SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. :code:`
`:code:`
` For creating @@ -5796,7 +5284,7 @@ class SshPublicKey(_serialization.Model): "key_data": {"key": "keyData", "type": "str"}, } - def __init__(self, *, key_data: Optional[str] = None, **kwargs): + def __init__(self, *, key_data: Optional[str] = None, **kwargs: Any) -> None: """ :keyword key_data: SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. :code:`
`:code:`
` For creating @@ -5809,23 +5297,84 @@ def __init__(self, *, key_data: Optional[str] = None, **kwargs): class StopRequest(_serialization.Model): - """Stop SAP Request. + """Stop SAP instance(s) request body. + + :ivar soft_stop_timeout_seconds: This parameter defines how long (in seconds) the soft shutdown + waits until the RFC/HTTP clients no longer consider the server for calls with load balancing. + Value 0 means that the kernel does not wait, but goes directly into the next shutdown state, + i.e. hard stop. + :vartype soft_stop_timeout_seconds: int + """ + + _attribute_map = { + "soft_stop_timeout_seconds": {"key": "softStopTimeoutSeconds", "type": "int"}, + } + + def __init__(self, *, soft_stop_timeout_seconds: int = 0, **kwargs: Any) -> None: + """ + :keyword soft_stop_timeout_seconds: This parameter defines how long (in seconds) the soft + shutdown waits until the RFC/HTTP clients no longer consider the server for calls with load + balancing. Value 0 means that the kernel does not wait, but goes directly into the next + shutdown state, i.e. hard stop. + :paramtype soft_stop_timeout_seconds: int + """ + super().__init__(**kwargs) + self.soft_stop_timeout_seconds = soft_stop_timeout_seconds + + +class StorageConfiguration(_serialization.Model): + """Gets or sets the storage configuration. - :ivar hard_stop: A boolean to specify if the SAP system should be hard-stopped. - :vartype hard_stop: bool + :ivar transport_file_share_configuration: The properties of the transport directory attached to + the VIS. The default for transportFileShareConfiguration is the createAndMount flow if storage + configuration is missing. + :vartype transport_file_share_configuration: + ~azure.mgmt.workloads.models.FileShareConfiguration """ _attribute_map = { - "hard_stop": {"key": "hardStop", "type": "bool"}, + "transport_file_share_configuration": { + "key": "transportFileShareConfiguration", + "type": "FileShareConfiguration", + }, } - def __init__(self, *, hard_stop: bool = False, **kwargs): + def __init__( + self, *, transport_file_share_configuration: Optional["_models.FileShareConfiguration"] = None, **kwargs: Any + ) -> None: """ - :keyword hard_stop: A boolean to specify if the SAP system should be hard-stopped. - :paramtype hard_stop: bool + :keyword transport_file_share_configuration: The properties of the transport directory attached + to the VIS. The default for transportFileShareConfiguration is the createAndMount flow if + storage configuration is missing. + :paramtype transport_file_share_configuration: + ~azure.mgmt.workloads.models.FileShareConfiguration """ super().__init__(**kwargs) - self.hard_stop = hard_stop + self.transport_file_share_configuration = transport_file_share_configuration + + +class StorageInformation(_serialization.Model): + """Storage details of all the Storage accounts attached to the VM. For e.g. NFS on AFS Shared + Storage. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: + :vartype id: str + """ + + _validation = { + "id": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None class SystemData(_serialization.Model): @@ -5865,8 +5414,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 @@ -5903,7 +5452,7 @@ class Tags(_serialization.Model): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Tags field of the resource. :paramtype tags: dict[str, str] @@ -5933,6 +5482,11 @@ class ThreeTierConfiguration(InfrastructureConfiguration): :vartype database_server: ~azure.mgmt.workloads.models.DatabaseConfiguration :ivar high_availability_config: The high availability configuration. :vartype high_availability_config: ~azure.mgmt.workloads.models.HighAvailabilityConfiguration + :ivar storage_configuration: The storage configuration. + :vartype storage_configuration: ~azure.mgmt.workloads.models.StorageConfiguration + :ivar custom_resource_names: The set of custom names to be used for underlying azure resources + that are part of the SAP system. + :vartype custom_resource_names: ~azure.mgmt.workloads.models.ThreeTierCustomResourceNames """ _validation = { @@ -5951,6 +5505,8 @@ class ThreeTierConfiguration(InfrastructureConfiguration): "application_server": {"key": "applicationServer", "type": "ApplicationServerConfiguration"}, "database_server": {"key": "databaseServer", "type": "DatabaseConfiguration"}, "high_availability_config": {"key": "highAvailabilityConfig", "type": "HighAvailabilityConfiguration"}, + "storage_configuration": {"key": "storageConfiguration", "type": "StorageConfiguration"}, + "custom_resource_names": {"key": "customResourceNames", "type": "ThreeTierCustomResourceNames"}, } def __init__( @@ -5962,8 +5518,10 @@ def __init__( database_server: "_models.DatabaseConfiguration", network_configuration: Optional["_models.NetworkConfiguration"] = None, high_availability_config: Optional["_models.HighAvailabilityConfiguration"] = None, - **kwargs - ): + storage_configuration: Optional["_models.StorageConfiguration"] = None, + custom_resource_names: Optional["_models.ThreeTierCustomResourceNames"] = None, + **kwargs: Any + ) -> None: """ :keyword app_resource_group: The application resource group where SAP system resources will be deployed. Required. @@ -5978,6 +5536,11 @@ def __init__( :paramtype database_server: ~azure.mgmt.workloads.models.DatabaseConfiguration :keyword high_availability_config: The high availability configuration. :paramtype high_availability_config: ~azure.mgmt.workloads.models.HighAvailabilityConfiguration + :keyword storage_configuration: The storage configuration. + :paramtype storage_configuration: ~azure.mgmt.workloads.models.StorageConfiguration + :keyword custom_resource_names: The set of custom names to be used for underlying azure + resources that are part of the SAP system. + :paramtype custom_resource_names: ~azure.mgmt.workloads.models.ThreeTierCustomResourceNames """ super().__init__(app_resource_group=app_resource_group, **kwargs) self.deployment_type: str = "ThreeTier" @@ -5986,6 +5549,103 @@ def __init__( self.application_server = application_server self.database_server = database_server self.high_availability_config = high_availability_config + self.storage_configuration = storage_configuration + self.custom_resource_names = custom_resource_names + + +class ThreeTierCustomResourceNames(_serialization.Model): + """The resource-names input to specify custom names for underlying azure resources that are part + of a three tier SAP system. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ThreeTierFullResourceNames + + All required parameters must be populated in order to send to Azure. + + :ivar naming_pattern_type: The pattern type to be used for resource naming. Required. + "FullResourceName" + :vartype naming_pattern_type: str or ~azure.mgmt.workloads.models.NamingPatternType + """ + + _validation = { + "naming_pattern_type": {"required": True}, + } + + _attribute_map = { + "naming_pattern_type": {"key": "namingPatternType", "type": "str"}, + } + + _subtype_map = {"naming_pattern_type": {"FullResourceName": "ThreeTierFullResourceNames"}} + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.naming_pattern_type: Optional[str] = None + + +class ThreeTierFullResourceNames(ThreeTierCustomResourceNames): + """The resource name object where the specified values will be full resource names of the + corresponding resources in a three tier SAP system. + + All required parameters must be populated in order to send to Azure. + + :ivar naming_pattern_type: The pattern type to be used for resource naming. Required. + "FullResourceName" + :vartype naming_pattern_type: str or ~azure.mgmt.workloads.models.NamingPatternType + :ivar central_server: The full resource names object for central server layer resources. + :vartype central_server: ~azure.mgmt.workloads.models.CentralServerFullResourceNames + :ivar application_server: The full resource names object for application layer resources. The + number of entries in this list should be equal to the number VMs to be created for application + layer. + :vartype application_server: ~azure.mgmt.workloads.models.ApplicationServerFullResourceNames + :ivar database_server: The full resource names object for database layer resources. The number + of entries in this list should be equal to the number VMs to be created for database layer. + :vartype database_server: ~azure.mgmt.workloads.models.DatabaseServerFullResourceNames + :ivar shared_storage: The resource names object for shared storage. + :vartype shared_storage: ~azure.mgmt.workloads.models.SharedStorageResourceNames + """ + + _validation = { + "naming_pattern_type": {"required": True}, + } + + _attribute_map = { + "naming_pattern_type": {"key": "namingPatternType", "type": "str"}, + "central_server": {"key": "centralServer", "type": "CentralServerFullResourceNames"}, + "application_server": {"key": "applicationServer", "type": "ApplicationServerFullResourceNames"}, + "database_server": {"key": "databaseServer", "type": "DatabaseServerFullResourceNames"}, + "shared_storage": {"key": "sharedStorage", "type": "SharedStorageResourceNames"}, + } + + def __init__( + self, + *, + central_server: Optional["_models.CentralServerFullResourceNames"] = None, + application_server: Optional["_models.ApplicationServerFullResourceNames"] = None, + database_server: Optional["_models.DatabaseServerFullResourceNames"] = None, + shared_storage: Optional["_models.SharedStorageResourceNames"] = None, + **kwargs: Any + ) -> None: + """ + :keyword central_server: The full resource names object for central server layer resources. + :paramtype central_server: ~azure.mgmt.workloads.models.CentralServerFullResourceNames + :keyword application_server: The full resource names object for application layer resources. + The number of entries in this list should be equal to the number VMs to be created for + application layer. + :paramtype application_server: ~azure.mgmt.workloads.models.ApplicationServerFullResourceNames + :keyword database_server: The full resource names object for database layer resources. The + number of entries in this list should be equal to the number VMs to be created for database + layer. + :paramtype database_server: ~azure.mgmt.workloads.models.DatabaseServerFullResourceNames + :keyword shared_storage: The resource names object for shared storage. + :paramtype shared_storage: ~azure.mgmt.workloads.models.SharedStorageResourceNames + """ + super().__init__(**kwargs) + self.naming_pattern_type: str = "FullResourceName" + self.central_server = central_server + self.application_server = application_server + self.database_server = database_server + self.shared_storage = shared_storage class ThreeTierRecommendationResult(SAPSizingRecommendationResult): @@ -6033,8 +5693,8 @@ def __init__( central_server_instance_count: Optional[int] = None, application_server_vm_sku: Optional[str] = None, application_server_instance_count: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword db_vm_sku: The database VM SKU. :paramtype db_vm_sku: str @@ -6078,8 +5738,8 @@ def __init__( *, tags: Optional[Dict[str, str]] = None, identity: Optional["_models.UserAssignedServiceIdentity"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Gets or sets the Resource tags. :paramtype tags: dict[str, str] @@ -6102,7 +5762,7 @@ class UpdateSAPApplicationInstanceRequest(_serialization.Model): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Gets or sets the Resource tags. :paramtype tags: dict[str, str] @@ -6122,7 +5782,7 @@ class UpdateSAPCentralInstanceRequest(_serialization.Model): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Gets or sets the Resource tags. :paramtype tags: dict[str, str] @@ -6142,7 +5802,7 @@ class UpdateSAPDatabaseInstanceRequest(_serialization.Model): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Gets or sets the Resource tags. :paramtype tags: dict[str, str] @@ -6170,8 +5830,8 @@ def __init__( *, tags: Optional[Dict[str, str]] = None, identity: Optional["_models.UserAssignedServiceIdentity"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Gets or sets the Resource tags. :paramtype tags: dict[str, str] @@ -6204,44 +5864,50 @@ class UserAssignedIdentity(_serialization.Model): "client_id": {"key": "clientId", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.principal_id = None self.client_id = None -class UserProfile(_serialization.Model): - """User profile to configure on a compute resources such as VM, VMSS. +class UserAssignedServiceIdentity(_serialization.Model): + """Managed service identity (user assigned identities). All required parameters must be populated in order to send to Azure. - :ivar user_name: User name. Required. - :vartype user_name: str - :ivar ssh_public_key: SSH public key data. Required. - :vartype ssh_public_key: str + :ivar type: Type of manage identity. Required. Known values are: "None" and "UserAssigned". + :vartype type: str or ~azure.mgmt.workloads.models.ManagedServiceIdentityType + :ivar user_assigned_identities: User assigned identities dictionary. + :vartype user_assigned_identities: dict[str, ~azure.mgmt.workloads.models.UserAssignedIdentity] """ _validation = { - "user_name": {"required": True}, - "ssh_public_key": {"required": True}, + "type": {"required": True}, } _attribute_map = { - "user_name": {"key": "userName", "type": "str"}, - "ssh_public_key": {"key": "sshPublicKey", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentity}"}, } - def __init__(self, *, user_name: str, ssh_public_key: str, **kwargs): + def __init__( + self, + *, + type: Union[str, "_models.ManagedServiceIdentityType"], + user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, + **kwargs: Any + ) -> None: """ - :keyword user_name: User name. Required. - :paramtype user_name: str - :keyword ssh_public_key: SSH public key data. Required. - :paramtype ssh_public_key: str + :keyword type: Type of manage identity. Required. Known values are: "None" and "UserAssigned". + :paramtype type: str or ~azure.mgmt.workloads.models.ManagedServiceIdentityType + :keyword user_assigned_identities: User assigned identities dictionary. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.workloads.models.UserAssignedIdentity] """ super().__init__(**kwargs) - self.user_name = user_name - self.ssh_public_key = ssh_public_key + self.type = type + self.user_assigned_identities = user_assigned_identities class VirtualMachineConfiguration(_serialization.Model): @@ -6270,8 +5936,8 @@ class VirtualMachineConfiguration(_serialization.Model): } def __init__( - self, *, vm_size: str, image_reference: "_models.ImageReference", os_profile: "_models.OSProfile", **kwargs - ): + self, *, vm_size: str, image_reference: "_models.ImageReference", os_profile: "_models.OSProfile", **kwargs: Any + ) -> None: """ :keyword vm_size: The virtual machine size. Required. :paramtype vm_size: str @@ -6286,84 +5952,87 @@ def __init__( self.os_profile = os_profile -class VmssNodesProfile(NodeProfile): - """VMSS profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar name: VM or VMSS name. - :vartype name: str - :ivar node_sku: VM SKU for node(s). Required. - :vartype node_sku: str - :ivar os_image: OS image used for creating the nodes. Required. - :vartype os_image: ~azure.mgmt.workloads.models.OsImageProfile - :ivar os_disk: OS disk details. Required. - :vartype os_disk: ~azure.mgmt.workloads.models.DiskInfo - :ivar data_disks: Data disks details. This property is not in use right now. - :vartype data_disks: list[~azure.mgmt.workloads.models.DiskInfo] - :ivar node_resource_ids: VM/VMSS resource ARM Ids. - :vartype node_resource_ids: list[str] - :ivar auto_scale_min_count: Minimum number of nodes for autoscale. - :vartype auto_scale_min_count: int - :ivar auto_scale_max_count: Maximum number of nodes for autoscale. - :vartype auto_scale_max_count: int +class VirtualMachineResourceNames(_serialization.Model): + """The resource names object for virtual machine and related resources. + + :ivar vm_name: The full name for virtual machine. The length of this field can be upto 64 + characters. If name is not provided, service uses a default name based on the deployment type. + For SingleServer, default name is {SID}vm. In case of HA-AvZone systems, default name will be + {SID}{app/ascs/db}z{a/b}vm with an incrementor at the end in case of more than 1 vm per layer. + For distributed and HA-AvSet systems, default name will be {SID}{app/ascs/db}vm with an + incrementor at the end in case of more than 1 vm per layer. + :vartype vm_name: str + :ivar host_name: The full name for virtual-machine's host (computer name). Currently, ACSS only + supports host names which are less than or equal to 13 characters long. If this value is not + provided, vmName will be used as host name. + :vartype host_name: str + :ivar network_interfaces: The list of network interface name objects for the selected virtual + machine. Currently, only one network interface is supported per virtual machine. + :vartype network_interfaces: list[~azure.mgmt.workloads.models.NetworkInterfaceResourceNames] + :ivar os_disk_name: The full name for OS disk attached to the VM. If this value is not + provided, it will be named by ARM as per its default naming standards (prefixed with vm name). + There is only one OS disk attached per Virtual Machine. + :vartype os_disk_name: str + :ivar data_disk_names: The full resource names for virtual machine data disks. This is a + dictionary containing list of names of data disks per volume. Currently supported volumes for + database layer are ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. For + application and cs layers, only 'default' volume is supported. + :vartype data_disk_names: dict[str, list[str]] """ _validation = { - "node_sku": {"required": True}, - "os_image": {"required": True}, - "os_disk": {"required": True}, - "node_resource_ids": {"readonly": True}, - "auto_scale_min_count": {"minimum": 1}, - "auto_scale_max_count": {"minimum": 1}, + "network_interfaces": {"max_items": 1, "min_items": 0}, } _attribute_map = { - "name": {"key": "name", "type": "str"}, - "node_sku": {"key": "nodeSku", "type": "str"}, - "os_image": {"key": "osImage", "type": "OsImageProfile"}, - "os_disk": {"key": "osDisk", "type": "DiskInfo"}, - "data_disks": {"key": "dataDisks", "type": "[DiskInfo]"}, - "node_resource_ids": {"key": "nodeResourceIds", "type": "[str]"}, - "auto_scale_min_count": {"key": "autoScaleMinCount", "type": "int"}, - "auto_scale_max_count": {"key": "autoScaleMaxCount", "type": "int"}, + "vm_name": {"key": "vmName", "type": "str"}, + "host_name": {"key": "hostName", "type": "str"}, + "network_interfaces": {"key": "networkInterfaces", "type": "[NetworkInterfaceResourceNames]"}, + "os_disk_name": {"key": "osDiskName", "type": "str"}, + "data_disk_names": {"key": "dataDiskNames", "type": "{[str]}"}, } def __init__( self, *, - node_sku: str, - os_image: "_models.OsImageProfile", - os_disk: "_models.DiskInfo", - name: Optional[str] = None, - data_disks: Optional[List["_models.DiskInfo"]] = None, - auto_scale_min_count: Optional[int] = None, - auto_scale_max_count: Optional[int] = None, - **kwargs - ): + vm_name: Optional[str] = None, + host_name: Optional[str] = None, + network_interfaces: Optional[List["_models.NetworkInterfaceResourceNames"]] = None, + os_disk_name: Optional[str] = None, + data_disk_names: Optional[Dict[str, List[str]]] = None, + **kwargs: Any + ) -> None: + """ + :keyword vm_name: The full name for virtual machine. The length of this field can be upto 64 + characters. If name is not provided, service uses a default name based on the deployment type. + For SingleServer, default name is {SID}vm. In case of HA-AvZone systems, default name will be + {SID}{app/ascs/db}z{a/b}vm with an incrementor at the end in case of more than 1 vm per layer. + For distributed and HA-AvSet systems, default name will be {SID}{app/ascs/db}vm with an + incrementor at the end in case of more than 1 vm per layer. + :paramtype vm_name: str + :keyword host_name: The full name for virtual-machine's host (computer name). Currently, ACSS + only supports host names which are less than or equal to 13 characters long. If this value is + not provided, vmName will be used as host name. + :paramtype host_name: str + :keyword network_interfaces: The list of network interface name objects for the selected + virtual machine. Currently, only one network interface is supported per virtual machine. + :paramtype network_interfaces: list[~azure.mgmt.workloads.models.NetworkInterfaceResourceNames] + :keyword os_disk_name: The full name for OS disk attached to the VM. If this value is not + provided, it will be named by ARM as per its default naming standards (prefixed with vm name). + There is only one OS disk attached per Virtual Machine. + :paramtype os_disk_name: str + :keyword data_disk_names: The full resource names for virtual machine data disks. This is a + dictionary containing list of names of data disks per volume. Currently supported volumes for + database layer are ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. For + application and cs layers, only 'default' volume is supported. + :paramtype data_disk_names: dict[str, list[str]] """ - :keyword name: VM or VMSS name. - :paramtype name: str - :keyword node_sku: VM SKU for node(s). Required. - :paramtype node_sku: str - :keyword os_image: OS image used for creating the nodes. Required. - :paramtype os_image: ~azure.mgmt.workloads.models.OsImageProfile - :keyword os_disk: OS disk details. Required. - :paramtype os_disk: ~azure.mgmt.workloads.models.DiskInfo - :keyword data_disks: Data disks details. This property is not in use right now. - :paramtype data_disks: list[~azure.mgmt.workloads.models.DiskInfo] - :keyword auto_scale_min_count: Minimum number of nodes for autoscale. - :paramtype auto_scale_min_count: int - :keyword auto_scale_max_count: Maximum number of nodes for autoscale. - :paramtype auto_scale_max_count: int - """ - super().__init__( - name=name, node_sku=node_sku, os_image=os_image, os_disk=os_disk, data_disks=data_disks, **kwargs - ) - self.auto_scale_min_count = auto_scale_min_count - self.auto_scale_max_count = auto_scale_max_count + super().__init__(**kwargs) + self.vm_name = vm_name + self.host_name = host_name + self.network_interfaces = network_interfaces + self.os_disk_name = os_disk_name + self.data_disk_names = data_disk_names class WindowsConfiguration(OSConfiguration): @@ -6383,113 +6052,7 @@ class WindowsConfiguration(OSConfiguration): "os_type": {"key": "osType", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.os_type: str = "Windows" - - -class WordpressInstanceResource(ProxyResource): - """WordPress instance resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.workloads.models.SystemData - :ivar version: Application version. Known values are: "5.4.3", "5.4.2", "5.4.1", and "5.4". - :vartype version: str or ~azure.mgmt.workloads.models.WordpressVersions - :ivar database_name: Database name used by the application. - :vartype database_name: str - :ivar database_user: User name used by the application to connect to database. - :vartype database_user: str - :ivar site_url: Site Url to access the WordPress application. - :vartype site_url: str - :ivar provisioning_state: WordPress instance provisioning state. Known values are: - "NotSpecified", "Accepted", "Created", "Succeeded", "Failed", "Canceled", and "Installing". - :vartype provisioning_state: str or ~azure.mgmt.workloads.models.ApplicationProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "site_url": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "version": {"key": "properties.version", "type": "str"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "database_user": {"key": "properties.databaseUser", "type": "str"}, - "site_url": {"key": "properties.siteUrl", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - version: Optional[Union[str, "_models.WordpressVersions"]] = None, - database_name: Optional[str] = None, - database_user: Optional[str] = None, - **kwargs - ): - """ - :keyword version: Application version. Known values are: "5.4.3", "5.4.2", "5.4.1", and "5.4". - :paramtype version: str or ~azure.mgmt.workloads.models.WordpressVersions - :keyword database_name: Database name used by the application. - :paramtype database_name: str - :keyword database_user: User name used by the application to connect to database. - :paramtype database_user: str - """ - super().__init__(**kwargs) - self.version = version - self.database_name = database_name - self.database_user = database_user - self.site_url = None - self.provisioning_state = None - - -class WordpressInstanceResourceList(_serialization.Model): - """WordPress instance resource list. - - :ivar value: List of resources in current page. - :vartype value: list[~azure.mgmt.workloads.models.WordpressInstanceResource] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[WordpressInstanceResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.WordpressInstanceResource"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - """ - :keyword value: List of resources in current page. - :paramtype value: list[~azure.mgmt.workloads.models.WordpressInstanceResource] - :keyword next_link: Link to next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/models/_workloads_client_enums.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/models/_workloads_client_enums.py index 3673c7b9e582..200b2a8996f7 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/models/_workloads_client_enums.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/models/_workloads_client_enums.py @@ -16,23 +16,12 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): INTERNAL = "Internal" -class ApplicationProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """WordPress instance provisioning state.""" +class ApplicationServerVirtualMachineType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Defines the type of application server VM.""" - NOT_SPECIFIED = "NotSpecified" - ACCEPTED = "Accepted" - CREATED = "Created" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - INSTALLING = "Installing" - - -class AzureFrontDoorEnabled(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether to enable Azure front door.""" - - ENABLED = "Enabled" - DISABLED = "Disabled" + ACTIVE = "Active" + STANDBY = "Standby" + UNKNOWN = "Unknown" class CentralServerVirtualMachineType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -47,6 +36,14 @@ class CentralServerVirtualMachineType(str, Enum, metaclass=CaseInsensitiveEnumMe STANDBY = "Standby" +class ConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of file share config.""" + + SKIP = "Skip" + CREATE_AND_MOUNT = "CreateAndMount" + MOUNT = "Mount" + + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of identity that created the resource.""" @@ -56,40 +53,16 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): KEY = "Key" -class DatabaseTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Tier of the server SKU.""" +class DiskSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Defines the disk sku name.""" - BURSTABLE = "Burstable" - GENERAL_PURPOSE = "GeneralPurpose" - MEMORY_OPTIMIZED = "MemoryOptimized" - - -class DatabaseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Database type.""" - - MY_SQL = "MySql" - - -class DiskStorageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Storage type.""" - - PREMIUM_LRS = "Premium_LRS" STANDARD_LRS = "Standard_LRS" + PREMIUM_LRS = "Premium_LRS" STANDARD_SSD_LRS = "StandardSSD_LRS" - - -class EnableBackup(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether to enable Azure backup for the workload.""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - - -class EnableSslEnforcement(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether to enable SSL enforcement on the database.""" - - ENABLED = "Enabled" - DISABLED = "Disabled" + ULTRA_SSD_LRS = "UltraSSD_LRS" + PREMIUM_ZRS = "Premium_ZRS" + STANDARD_SSD_ZRS = "StandardSSD_ZRS" + PREMIUM_V2_LRS = "PremiumV2_LRS" class EnqueueReplicationServerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -99,43 +72,6 @@ class EnqueueReplicationServerType(str, Enum, metaclass=CaseInsensitiveEnumMeta) ENQUEUE_REPLICATOR2 = "EnqueueReplicator2" -class FileShareStorageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """File share backing storage type.""" - - STANDARD_LRS = "Standard_LRS" - STANDARD_GRS = "Standard_GRS" - STANDARD_ZRS = "Standard_ZRS" - PREMIUM_LRS = "Premium_LRS" - - -class FileShareType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Share type.""" - - NFS_ON_CONTROLLER = "NfsOnController" - AZURE_FILES = "AzureFiles" - - -class HAEnabled(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether to enable HA for the server.""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - - -class LoadBalancerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Load balancer type.""" - - APPLICATION_GATEWAY = "ApplicationGateway" - LOAD_BALANCER = "LoadBalancer" - - -class LocationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the extended location.""" - - REGION = "Region" - EDGE_ZONE = "EdgeZone" - - class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of managed service identity (only None, UserAssigned types are allowed).""" @@ -143,6 +79,12 @@ class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): USER_ASSIGNED = "UserAssigned" +class NamingPatternType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The pattern type to be used for resource naming.""" + + FULL_RESOURCE_NAME = "FullResourceName" + + class OperationProperties(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Defines the workload operation origin.""" @@ -161,31 +103,6 @@ class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): USER_SYSTEM = "user,system" -class OSImageOffer(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """OS image offer.""" - - UBUNTU_SERVER = "UbuntuServer" - - -class OSImagePublisher(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """OS image publisher.""" - - CANONICAL = "Canonical" - - -class OSImageSku(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """OS image sku.""" - - EIGHTEEN04_LTS = "18.04-LTS" - SIXTEEN04_LTS = "16.04-LTS" - - -class OSImageVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """OS image version.""" - - LATEST = "latest" - - class OSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The OS Type.""" @@ -193,34 +110,6 @@ class OSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): WINDOWS = "Windows" -class PHPVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """PHP version.""" - - SEVEN2 = "7.2" - SEVEN3 = "7.3" - SEVEN4 = "7.4" - - -class PhpWorkloadProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Php workload resource provisioning state.""" - - NOT_SPECIFIED = "NotSpecified" - ACCEPTED = "Accepted" - CREATED = "Created" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - PROVISIONING = "Provisioning" - DELETING = "Deleting" - - -class RedisCacheFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Cache family.""" - - C = "C" - P = "P" - - class RoutingPreference(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Sets the routing preference of the SAP monitor. By default only RFC1918 traffic is routed to the customer VNET. @@ -283,6 +172,16 @@ class SAPHighAvailabilityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): AVAILABILITY_ZONE = "AvailabilityZone" +class SapLandscapeMonitorProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of provisioning of the SAP monitor.""" + + ACCEPTED = "Accepted" + CREATED = "Created" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + CANCELED = "Canceled" + + class SAPProductType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Defines the SAP Product type.""" @@ -335,47 +234,7 @@ class SAPVirtualInstanceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): OFFLINE = "Offline" PARTIALLY_RUNNING = "PartiallyRunning" UNAVAILABLE = "Unavailable" - - -class SearchType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Search type.""" - - ELASTIC = "Elastic" - - -class SkuRestrictionReasonCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The SKU restriction reason code.""" - - NOT_SPECIFIED = "NotSpecified" - QUOTA_ID = "QuotaId" - NOT_AVAILABLE_FOR_SUBSCRIPTION = "NotAvailableForSubscription" - - -class SkuRestrictionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The SKU restriction type.""" - - NOT_SPECIFIED = "NotSpecified" - LOCATION = "Location" - ZONE = "Zone" - - -class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Scale type of the SKU capacity.""" - - NONE = "None" - MANUAL = "Manual" - AUTOMATIC = "Automatic" - - -class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """This field is required to be implemented by the Resource Provider if the service has more than - one tier, but is not required on a PUT. - """ - - FREE = "Free" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" + SOFT_SHUTDOWN = "SoftShutdown" class SslPreference(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -386,21 +245,6 @@ class SslPreference(str, Enum, metaclass=CaseInsensitiveEnumMeta): SERVER_CERTIFICATE = "ServerCertificate" -class WordpressVersions(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Application version.""" - - FIVE4_3 = "5.4.3" - FIVE4_2 = "5.4.2" - FIVE4_1 = "5.4.1" - FIVE4 = "5.4" - - -class WorkloadKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates which kind of php workload this resource represent e.g WordPress.""" - - WORD_PRESS = "WordPress" - - class WorkloadMonitorActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Defines the action type of workload operation.""" diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/__init__.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/__init__.py index 9ec296484c8e..fe951707c6a1 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/__init__.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/__init__.py @@ -6,34 +6,30 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._php_workloads_operations import PhpWorkloadsOperations -from ._wordpress_instances_operations import WordpressInstancesOperations from ._workloads_client_operations import WorkloadsClientOperationsMixin from ._sap_virtual_instances_operations import SAPVirtualInstancesOperations from ._sap_central_instances_operations import SAPCentralInstancesOperations from ._sap_database_instances_operations import SAPDatabaseInstancesOperations from ._sap_application_server_instances_operations import SAPApplicationServerInstancesOperations -from ._operations import Operations from ._monitors_operations import MonitorsOperations from ._provider_instances_operations import ProviderInstancesOperations -from ._skus_operations import SkusOperations +from ._sap_landscape_monitor_operations import SapLandscapeMonitorOperations +from ._operations import Operations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ - "PhpWorkloadsOperations", - "WordpressInstancesOperations", "WorkloadsClientOperationsMixin", "SAPVirtualInstancesOperations", "SAPCentralInstancesOperations", "SAPDatabaseInstancesOperations", "SAPApplicationServerInstancesOperations", - "Operations", "MonitorsOperations", "ProviderInstancesOperations", - "SkusOperations", + "SapLandscapeMonitorOperations", + "Operations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_monitors_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_monitors_operations.py index eb00d2a8bd85..0730f289605c 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_monitors_operations.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_monitors_operations.py @@ -47,8 +47,8 @@ def build_list_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: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -73,8 +73,8 @@ 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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -105,8 +105,8 @@ 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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -140,8 +140,8 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -178,8 +178,8 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -213,8 +213,8 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -279,7 +279,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Monitor"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.MonitorListResult] = kwargs.pop("cls", None) @@ -366,7 +366,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-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.MonitorListResult] = kwargs.pop("cls", None) @@ -467,7 +467,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-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.Monitor] = kwargs.pop("cls", None) @@ -520,7 +520,7 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -683,7 +683,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -746,7 +746,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) @@ -816,7 +816,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) @@ -960,7 +960,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_operations.py index 821f5aee0b9c..76351375256f 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_operations.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_operations.py @@ -45,8 +45,8 @@ 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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -93,7 +93,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-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_php_workloads_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_php_workloads_operations.py deleted file mode 100644 index 9169bc725e73..000000000000 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_php_workloads_operations.py +++ /dev/null @@ -1,1011 +0,0 @@ -# pylint: disable=too-many-lines -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import WorkloadsClientMixinABC, _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]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_subscription_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: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/phpWorkloads") - 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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request(resource_group_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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads", - ) # 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 - ), - } - - _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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, php_workload_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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}", - ) # 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 - ), - "phpWorkloadName": _SERIALIZER.url("php_workload_name", php_workload_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, php_workload_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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") - ) - 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/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}", - ) # 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 - ), - "phpWorkloadName": _SERIALIZER.url("php_workload_name", php_workload_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, php_workload_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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") - ) - 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/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}", - ) # 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 - ), - "phpWorkloadName": _SERIALIZER.url("php_workload_name", php_workload_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, - php_workload_name: str, - subscription_id: str, - *, - delete_infra: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}", - ) # 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 - ), - "phpWorkloadName": _SERIALIZER.url("php_workload_name", php_workload_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") - if delete_infra is not None: - _params["delete-infra"] = _SERIALIZER.query("delete_infra", delete_infra, "str", min_length=1) - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class PhpWorkloadsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.workloads.WorkloadsClient`'s - :attr:`php_workloads` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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 list_by_subscription(self, **kwargs: Any) -> Iterable["_models.PhpWorkloadResource"]: - """Lists PHP workload resources for a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PhpWorkloadResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.workloads.models.PhpWorkloadResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[_models.PhpWorkloadResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PhpWorkloadResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - 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) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/phpWorkloads" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.PhpWorkloadResource"]: - """Lists PHP workload resources in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PhpWorkloadResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.workloads.models.PhpWorkloadResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[_models.PhpWorkloadResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PhpWorkloadResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - 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) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads" - } - - @distributed_trace - def get(self, resource_group_name: str, php_workload_name: str, **kwargs: Any) -> _models.PhpWorkloadResource: - """Gets the PHP workload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PhpWorkloadResource or the result of cls(response) - :rtype: ~azure.mgmt.workloads.models.PhpWorkloadResource - :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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[_models.PhpWorkloadResource] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.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("PhpWorkloadResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}" - } - - def _create_or_update_initial( - self, - resource_group_name: str, - php_workload_name: str, - php_workload_resource: Union[_models.PhpWorkloadResource, IO], - **kwargs: Any - ) -> _models.PhpWorkloadResource: - 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-12-01-preview"] = 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.PhpWorkloadResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(php_workload_resource, (IO, bytes)): - _content = php_workload_resource - else: - _json = self._serialize.body(php_workload_resource, "PhpWorkloadResource") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.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, 201]: - 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) - - if response.status_code == 200: - deserialized = self._deserialize("PhpWorkloadResource", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("PhpWorkloadResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}" - } - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - php_workload_name: str, - php_workload_resource: _models.PhpWorkloadResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhpWorkloadResource]: - """Create or updated PHP workload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param php_workload_resource: Resource create or update request payload. Required. - :type php_workload_resource: ~azure.mgmt.workloads.models.PhpWorkloadResource - :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 - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either PhpWorkloadResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.PhpWorkloadResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - php_workload_name: str, - php_workload_resource: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhpWorkloadResource]: - """Create or updated PHP workload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param php_workload_resource: Resource create or update request payload. Required. - :type php_workload_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 - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either PhpWorkloadResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.PhpWorkloadResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - php_workload_name: str, - php_workload_resource: Union[_models.PhpWorkloadResource, IO], - **kwargs: Any - ) -> LROPoller[_models.PhpWorkloadResource]: - """Create or updated PHP workload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param php_workload_resource: Resource create or update request payload. Is either a model type - or a IO type. Required. - :type php_workload_resource: ~azure.mgmt.workloads.models.PhpWorkloadResource 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 - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either PhpWorkloadResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.PhpWorkloadResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-12-01-preview"] = 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.PhpWorkloadResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - php_workload_resource=php_workload_resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhpWorkloadResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}" - } - - @overload - def update( - self, - resource_group_name: str, - php_workload_name: str, - resource_patch_request_body: _models.PatchResourceRequestBody, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PhpWorkloadResource: - """Update PHP workload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param resource_patch_request_body: Workload resource update data. Required. - :type resource_patch_request_body: ~azure.mgmt.workloads.models.PatchResourceRequestBody - :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: PhpWorkloadResource or the result of cls(response) - :rtype: ~azure.mgmt.workloads.models.PhpWorkloadResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - php_workload_name: str, - resource_patch_request_body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PhpWorkloadResource: - """Update PHP workload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param resource_patch_request_body: Workload resource update data. Required. - :type resource_patch_request_body: 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: PhpWorkloadResource or the result of cls(response) - :rtype: ~azure.mgmt.workloads.models.PhpWorkloadResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - php_workload_name: str, - resource_patch_request_body: Union[_models.PatchResourceRequestBody, IO], - **kwargs: Any - ) -> _models.PhpWorkloadResource: - """Update PHP workload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param resource_patch_request_body: Workload resource update data. Is either a model type or a - IO type. Required. - :type resource_patch_request_body: ~azure.mgmt.workloads.models.PatchResourceRequestBody 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: PhpWorkloadResource or the result of cls(response) - :rtype: ~azure.mgmt.workloads.models.PhpWorkloadResource - :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-12-01-preview"] = 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.PhpWorkloadResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource_patch_request_body, (IO, bytes)): - _content = resource_patch_request_body - else: - _json = self._serialize.body(resource_patch_request_body, "PatchResourceRequestBody") - - request = build_update_request( - resource_group_name=resource_group_name, - php_workload_name=php_workload_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("PhpWorkloadResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, php_workload_name: str, delete_infra: Optional[str] = None, **kwargs: Any - ) -> None: - 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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - subscription_id=self._config.subscription_id, - delete_infra=delete_infra, - api_version=api_version, - template_url=self._delete_initial.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, 202, 204]: - 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) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}" - } - - @distributed_trace - def begin_delete( - self, resource_group_name: str, php_workload_name: str, delete_infra: Optional[str] = None, **kwargs: Any - ) -> LROPoller[None]: - """Delete PHP workload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param delete_infra: Whether to delete infra along with workload resource. Default value is - None. - :type delete_infra: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-12-01-preview"] = 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - delete_infra=delete_infra, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}" - } diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_provider_instances_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_provider_instances_operations.py index 27bee9349468..d5f64a29df29 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_provider_instances_operations.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_provider_instances_operations.py @@ -47,8 +47,8 @@ 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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -82,8 +82,8 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -118,8 +118,8 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -157,8 +157,8 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -226,7 +226,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-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ProviderInstanceListResult] = kwargs.pop("cls", None) @@ -332,7 +332,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ProviderInstance] = kwargs.pop("cls", None) @@ -391,7 +391,7 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -574,7 +574,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -638,7 +638,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) @@ -712,7 +712,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_application_server_instances_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_application_server_instances_operations.py index 47e043be7d78..e4cea6f2df5c 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_application_server_instances_operations.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_application_server_instances_operations.py @@ -53,8 +53,8 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -93,8 +93,8 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -136,8 +136,8 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -179,8 +179,8 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -215,8 +215,8 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -244,6 +244,89 @@ def build_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_start_instance_request( + resource_group_name: str, + sap_virtual_instance_name: str, + application_instance_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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/start", + ) # 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 + ), + "sapVirtualInstanceName": _SERIALIZER.url("sap_virtual_instance_name", sap_virtual_instance_name, "str"), + "applicationInstanceName": _SERIALIZER.url("application_instance_name", application_instance_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_stop_instance_request( + resource_group_name: str, + sap_virtual_instance_name: str, + application_instance_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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") + ) + 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/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/stop", + ) # 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 + ), + "sapVirtualInstanceName": _SERIALIZER.url("sap_virtual_instance_name", sap_virtual_instance_name, "str"), + "applicationInstanceName": _SERIALIZER.url("application_instance_name", application_instance_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + class SAPApplicationServerInstancesOperations: """ .. warning:: @@ -295,7 +378,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPApplicationServerInstance] = kwargs.pop("cls", None) @@ -354,7 +437,7 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -543,7 +626,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -612,7 +695,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -798,7 +881,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -862,7 +945,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) @@ -936,7 +1019,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) @@ -1005,7 +1088,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPApplicationServerInstanceList] = kwargs.pop("cls", None) @@ -1078,3 +1161,387 @@ def get_next(next_link=None): list.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances" } + + def _start_instance_initial( + self, resource_group_name: str, sap_virtual_instance_name: str, application_instance_name: str, **kwargs: Any + ) -> Optional[_models.OperationStatusResult]: + 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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) + + request = build_start_instance_request( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + application_instance_name=application_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._start_instance_initial.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, 202]: + 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 = None + if response.status_code == 200: + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _start_instance_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/start" + } + + @distributed_trace + def begin_start_instance( + self, resource_group_name: str, sap_virtual_instance_name: str, application_instance_name: str, **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Starts the SAP Application Server Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param application_instance_name: The name of SAP Application Server instance resource. + Required. + :type application_instance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatusResult or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_instance_initial( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + application_instance_name=application_instance_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_start_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/start" + } + + def _stop_instance_initial( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + application_instance_name: str, + body: Optional[Union[_models.StopRequest, IO]] = None, + **kwargs: Any + ) -> Optional[_models.OperationStatusResult]: + 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["2022-11-01-preview"] = 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[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "StopRequest") + else: + _json = None + + request = build_stop_instance_request( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + application_instance_name=application_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._stop_instance_initial.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, 202]: + 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 = None + if response.status_code == 200: + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _stop_instance_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/stop" + } + + @overload + def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + application_instance_name: str, + body: Optional[_models.StopRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Stops the SAP Application Server Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param application_instance_name: The name of SAP Application Server instance resource. + Required. + :type application_instance_name: str + :param body: SAP Application server instance stop request body. Default value is None. + :type body: ~azure.mgmt.workloads.models.StopRequest + :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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatusResult or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + application_instance_name: str, + body: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Stops the SAP Application Server Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param application_instance_name: The name of SAP Application Server instance resource. + Required. + :type application_instance_name: str + :param body: SAP Application server instance stop request body. Default value is None. + :type body: 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatusResult or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + application_instance_name: str, + body: Optional[Union[_models.StopRequest, IO]] = None, + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Stops the SAP Application Server Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param application_instance_name: The name of SAP Application Server instance resource. + Required. + :type application_instance_name: str + :param body: SAP Application server instance stop request body. Is either a model type or a IO + type. Default value is None. + :type body: ~azure.mgmt.workloads.models.StopRequest 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatusResult or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-01-preview"] = 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.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._stop_instance_initial( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + application_instance_name=application_instance_name, + body=body, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_stop_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/stop" + } diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_central_instances_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_central_instances_operations.py index 4f5d77e0c9d3..d968c49d7ee3 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_central_instances_operations.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_central_instances_operations.py @@ -53,8 +53,8 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -93,8 +93,8 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -136,8 +136,8 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -179,8 +179,8 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -215,8 +215,8 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -244,6 +244,89 @@ def build_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_start_instance_request( + resource_group_name: str, + sap_virtual_instance_name: str, + central_instance_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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/start", + ) # 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 + ), + "sapVirtualInstanceName": _SERIALIZER.url("sap_virtual_instance_name", sap_virtual_instance_name, "str"), + "centralInstanceName": _SERIALIZER.url("central_instance_name", central_instance_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_stop_instance_request( + resource_group_name: str, + sap_virtual_instance_name: str, + central_instance_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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") + ) + 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/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/stop", + ) # 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 + ), + "sapVirtualInstanceName": _SERIALIZER.url("sap_virtual_instance_name", sap_virtual_instance_name, "str"), + "centralInstanceName": _SERIALIZER.url("central_instance_name", central_instance_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + class SAPCentralInstancesOperations: """ .. warning:: @@ -294,7 +377,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPCentralServerInstance] = kwargs.pop("cls", None) @@ -353,7 +436,7 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -539,7 +622,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -608,7 +691,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -794,7 +877,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -858,7 +941,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) @@ -934,7 +1017,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) @@ -1003,7 +1086,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPCentralInstanceList] = kwargs.pop("cls", None) @@ -1076,3 +1159,387 @@ def get_next(next_link=None): list.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances" } + + def _start_instance_initial( + self, resource_group_name: str, sap_virtual_instance_name: str, central_instance_name: str, **kwargs: Any + ) -> Optional[_models.OperationStatusResult]: + 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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) + + request = build_start_instance_request( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + central_instance_name=central_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._start_instance_initial.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, 202]: + 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 = None + if response.status_code == 200: + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _start_instance_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/start" + } + + @distributed_trace + def begin_start_instance( + self, resource_group_name: str, sap_virtual_instance_name: str, central_instance_name: str, **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Starts the SAP Central Services Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param central_instance_name: Central Services Instance resource name string modeled as + parameter for auto generation to work correctly. Required. + :type central_instance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatusResult or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_instance_initial( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + central_instance_name=central_instance_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_start_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/start" + } + + def _stop_instance_initial( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + central_instance_name: str, + body: Optional[Union[_models.StopRequest, IO]] = None, + **kwargs: Any + ) -> Optional[_models.OperationStatusResult]: + 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["2022-11-01-preview"] = 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[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "StopRequest") + else: + _json = None + + request = build_stop_instance_request( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + central_instance_name=central_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._stop_instance_initial.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, 202]: + 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 = None + if response.status_code == 200: + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _stop_instance_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/stop" + } + + @overload + def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + central_instance_name: str, + body: Optional[_models.StopRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Stops the SAP Central Services Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param central_instance_name: Central Services Instance resource name string modeled as + parameter for auto generation to work correctly. Required. + :type central_instance_name: str + :param body: SAP Central Services instance stop request body. Default value is None. + :type body: ~azure.mgmt.workloads.models.StopRequest + :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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatusResult or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + central_instance_name: str, + body: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Stops the SAP Central Services Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param central_instance_name: Central Services Instance resource name string modeled as + parameter for auto generation to work correctly. Required. + :type central_instance_name: str + :param body: SAP Central Services instance stop request body. Default value is None. + :type body: 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatusResult or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + central_instance_name: str, + body: Optional[Union[_models.StopRequest, IO]] = None, + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Stops the SAP Central Services Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param central_instance_name: Central Services Instance resource name string modeled as + parameter for auto generation to work correctly. Required. + :type central_instance_name: str + :param body: SAP Central Services instance stop request body. Is either a model type or a IO + type. Default value is None. + :type body: ~azure.mgmt.workloads.models.StopRequest 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatusResult or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-01-preview"] = 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.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._stop_instance_initial( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + central_instance_name=central_instance_name, + body=body, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_stop_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/stop" + } diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_database_instances_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_database_instances_operations.py index 97252fcb1c25..314123bfee4b 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_database_instances_operations.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_database_instances_operations.py @@ -53,8 +53,8 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -93,8 +93,8 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -136,8 +136,8 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -179,8 +179,8 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -215,8 +215,8 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -244,6 +244,89 @@ def build_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_start_instance_request( + resource_group_name: str, + sap_virtual_instance_name: str, + database_instance_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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/start", + ) # 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 + ), + "sapVirtualInstanceName": _SERIALIZER.url("sap_virtual_instance_name", sap_virtual_instance_name, "str"), + "databaseInstanceName": _SERIALIZER.url("database_instance_name", database_instance_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_stop_instance_request( + resource_group_name: str, + sap_virtual_instance_name: str, + database_instance_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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") + ) + 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/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/stop", + ) # 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 + ), + "sapVirtualInstanceName": _SERIALIZER.url("sap_virtual_instance_name", sap_virtual_instance_name, "str"), + "databaseInstanceName": _SERIALIZER.url("database_instance_name", database_instance_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + class SAPDatabaseInstancesOperations: """ .. warning:: @@ -294,7 +377,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPDatabaseInstance] = kwargs.pop("cls", None) @@ -353,7 +436,7 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -542,7 +625,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -611,7 +694,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -794,7 +877,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -858,7 +941,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) @@ -933,7 +1016,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) @@ -1000,7 +1083,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPDatabaseInstanceList] = kwargs.pop("cls", None) @@ -1073,3 +1156,387 @@ def get_next(next_link=None): list.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances" } + + def _start_instance_initial( + self, resource_group_name: str, sap_virtual_instance_name: str, database_instance_name: str, **kwargs: Any + ) -> Optional[_models.OperationStatusResult]: + 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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) + + request = build_start_instance_request( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + database_instance_name=database_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._start_instance_initial.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, 202]: + 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 = None + if response.status_code == 200: + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _start_instance_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/start" + } + + @distributed_trace + def begin_start_instance( + self, resource_group_name: str, sap_virtual_instance_name: str, database_instance_name: str, **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Starts the database instance of the SAP system. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param database_instance_name: Database resource name string modeled as parameter for auto + generation to work correctly. Required. + :type database_instance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatusResult or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_instance_initial( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + database_instance_name=database_instance_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_start_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/start" + } + + def _stop_instance_initial( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + database_instance_name: str, + body: Optional[Union[_models.StopRequest, IO]] = None, + **kwargs: Any + ) -> Optional[_models.OperationStatusResult]: + 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["2022-11-01-preview"] = 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[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "StopRequest") + else: + _json = None + + request = build_stop_instance_request( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + database_instance_name=database_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._stop_instance_initial.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, 202]: + 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 = None + if response.status_code == 200: + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _stop_instance_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/stop" + } + + @overload + def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + database_instance_name: str, + body: Optional[_models.StopRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Stops the database instance of the SAP system. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param database_instance_name: Database resource name string modeled as parameter for auto + generation to work correctly. Required. + :type database_instance_name: str + :param body: Stop request for the database instance of the SAP system. Default value is None. + :type body: ~azure.mgmt.workloads.models.StopRequest + :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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatusResult or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + database_instance_name: str, + body: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Stops the database instance of the SAP system. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param database_instance_name: Database resource name string modeled as parameter for auto + generation to work correctly. Required. + :type database_instance_name: str + :param body: Stop request for the database instance of the SAP system. Default value is None. + :type body: 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatusResult or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_stop_instance( + self, + resource_group_name: str, + sap_virtual_instance_name: str, + database_instance_name: str, + body: Optional[Union[_models.StopRequest, IO]] = None, + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Stops the database instance of the SAP system. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sap_virtual_instance_name: The name of the Virtual Instances for SAP solutions resource. + Required. + :type sap_virtual_instance_name: str + :param database_instance_name: Database resource name string modeled as parameter for auto + generation to work correctly. Required. + :type database_instance_name: str + :param body: Stop request for the database instance of the SAP system. Is either a model type + or a IO type. Default value is None. + :type body: ~azure.mgmt.workloads.models.StopRequest 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatusResult or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-01-preview"] = 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.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._stop_instance_initial( + resource_group_name=resource_group_name, + sap_virtual_instance_name=sap_virtual_instance_name, + database_instance_name=database_instance_name, + body=body, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_stop_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/stop" + } diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_landscape_monitor_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_landscape_monitor_operations.py new file mode 100644 index 000000000000..0dd370d3fd21 --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_landscape_monitor_operations.py @@ -0,0 +1,749 @@ +# pylint: disable=too-many-lines +# 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. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer +from .._vendor import WorkloadsClientMixinABC, _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]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default", + ) # 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="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") + ) + 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/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default", + ) # 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 + 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="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default", + ) # 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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") + ) + 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/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default", + ) # 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 + 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_list_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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor", + ) # 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="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class SapLandscapeMonitorOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.workloads.WorkloadsClient`'s + :attr:`sap_landscape_monitor` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + 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(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> _models.SapLandscapeMonitor: + """Gets configuration values for Single Pane Of Glass for SAP monitor. + + Gets configuration values for Single Pane Of Glass for SAP monitor for the specified + subscription, resource group, and resource name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SapLandscapeMonitor or the result of cls(response) + :rtype: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.SapLandscapeMonitor] = kwargs.pop("cls", None) + + request = build_get_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.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("SapLandscapeMonitor", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default" + } + + @overload + def create( + self, + resource_group_name: str, + monitor_name: str, + sap_landscape_monitor_parameter: _models.SapLandscapeMonitor, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SapLandscapeMonitor: + """Creates a SAP Landscape Monitor Dashboard. + + Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and + resource name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :param sap_landscape_monitor_parameter: Request body representing a configuration for Sap + Landscape Monitor Dashboard. Required. + :type sap_landscape_monitor_parameter: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :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: SapLandscapeMonitor or the result of cls(response) + :rtype: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + resource_group_name: str, + monitor_name: str, + sap_landscape_monitor_parameter: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SapLandscapeMonitor: + """Creates a SAP Landscape Monitor Dashboard. + + Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and + resource name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :param sap_landscape_monitor_parameter: Request body representing a configuration for Sap + Landscape Monitor Dashboard. Required. + :type sap_landscape_monitor_parameter: 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: SapLandscapeMonitor or the result of cls(response) + :rtype: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create( + self, + resource_group_name: str, + monitor_name: str, + sap_landscape_monitor_parameter: Union[_models.SapLandscapeMonitor, IO], + **kwargs: Any + ) -> _models.SapLandscapeMonitor: + """Creates a SAP Landscape Monitor Dashboard. + + Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and + resource name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :param sap_landscape_monitor_parameter: Request body representing a configuration for Sap + Landscape Monitor Dashboard. Is either a model type or a IO type. Required. + :type sap_landscape_monitor_parameter: ~azure.mgmt.workloads.models.SapLandscapeMonitor 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: SapLandscapeMonitor or the result of cls(response) + :rtype: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :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["2022-11-01-preview"] = 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.SapLandscapeMonitor] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(sap_landscape_monitor_parameter, (IO, bytes)): + _content = sap_landscape_monitor_parameter + else: + _json = self._serialize.body(sap_landscape_monitor_parameter, "SapLandscapeMonitor") + + request = build_create_request( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.create.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, 201]: + 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) + + if response.status_code == 200: + deserialized = self._deserialize("SapLandscapeMonitor", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SapLandscapeMonitor", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default" + } + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, monitor_name: str, **kwargs: Any + ) -> None: + """Deletes a SAP Landscape Monitor Dashboard. + + Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and + SAP monitor name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.delete.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, 204]: + 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) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default" + } + + @overload + def update( + self, + resource_group_name: str, + monitor_name: str, + sap_landscape_monitor_parameter: _models.SapLandscapeMonitor, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SapLandscapeMonitor: + """Patches the SAP Landscape Monitor Dashboard. + + Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and + SAP monitor name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :param sap_landscape_monitor_parameter: Request body representing a configuration for Sap + Landscape Monitor Dashboard. Required. + :type sap_landscape_monitor_parameter: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :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: SapLandscapeMonitor or the result of cls(response) + :rtype: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + monitor_name: str, + sap_landscape_monitor_parameter: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SapLandscapeMonitor: + """Patches the SAP Landscape Monitor Dashboard. + + Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and + SAP monitor name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :param sap_landscape_monitor_parameter: Request body representing a configuration for Sap + Landscape Monitor Dashboard. Required. + :type sap_landscape_monitor_parameter: 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: SapLandscapeMonitor or the result of cls(response) + :rtype: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + monitor_name: str, + sap_landscape_monitor_parameter: Union[_models.SapLandscapeMonitor, IO], + **kwargs: Any + ) -> _models.SapLandscapeMonitor: + """Patches the SAP Landscape Monitor Dashboard. + + Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and + SAP monitor name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :param sap_landscape_monitor_parameter: Request body representing a configuration for Sap + Landscape Monitor Dashboard. Is either a model type or a IO type. Required. + :type sap_landscape_monitor_parameter: ~azure.mgmt.workloads.models.SapLandscapeMonitor 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: SapLandscapeMonitor or the result of cls(response) + :rtype: ~azure.mgmt.workloads.models.SapLandscapeMonitor + :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["2022-11-01-preview"] = 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.SapLandscapeMonitor] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(sap_landscape_monitor_parameter, (IO, bytes)): + _content = sap_landscape_monitor_parameter + else: + _json = self._serialize.body(sap_landscape_monitor_parameter, "SapLandscapeMonitor") + + request = build_update_request( + resource_group_name=resource_group_name, + monitor_name=monitor_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("SapLandscapeMonitor", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default" + } + + @distributed_trace + def list(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> _models.SapLandscapeMonitorListResult: + """Gets configuration values for Single Pane Of Glass for SAP monitor. + + Gets configuration values for Single Pane Of Glass for SAP monitor for the specified + subscription, resource group, and resource name. + + :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 SAP monitor resource. Required. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SapLandscapeMonitorListResult or the result of cls(response) + :rtype: ~azure.mgmt.workloads.models.SapLandscapeMonitorListResult + :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["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.SapLandscapeMonitorListResult] = kwargs.pop("cls", None) + + request = build_list_request( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.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("SapLandscapeMonitorListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor" + } diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_virtual_instances_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_virtual_instances_operations.py index 51ccaa31c3ec..c3e300a68ce2 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_virtual_instances_operations.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_sap_virtual_instances_operations.py @@ -49,8 +49,8 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -87,8 +87,8 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -122,8 +122,8 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -160,8 +160,8 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -193,8 +193,8 @@ 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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -225,8 +225,8 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -255,8 +255,8 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) accept = _headers.pop("Accept", "application/json") @@ -290,8 +290,8 @@ def build_stop_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -359,7 +359,7 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -529,7 +529,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -606,7 +606,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPVirtualInstance] = kwargs.pop("cls", None) @@ -743,7 +743,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -811,7 +811,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) @@ -881,7 +881,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) @@ -942,7 +942,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-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPVirtualInstanceList] = kwargs.pop("cls", None) @@ -1027,7 +1027,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SAPVirtualIns _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SAPVirtualInstanceList] = kwargs.pop("cls", None) @@ -1113,7 +1113,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.OperationStatusResult]] = kwargs.pop("cls", None) @@ -1183,7 +1183,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) @@ -1247,7 +1247,7 @@ def _stop_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -1420,7 +1420,7 @@ def begin_stop( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_skus_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_skus_operations.py deleted file mode 100644 index b336577f78ba..000000000000 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_skus_operations.py +++ /dev/null @@ -1,169 +0,0 @@ -# pylint: disable=too-many-lines -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import WorkloadsClientMixinABC, _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]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_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: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/skus") - 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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class SkusOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.workloads.WorkloadsClient`'s - :attr:`skus` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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 list(self, **kwargs: Any) -> Iterable["_models.SkuDefinition"]: - """Lists all the available SKUs under this PR. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuDefinition or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.workloads.models.SkuDefinition] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[_models.SkusListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkusListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - 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) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/skus"} diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_wordpress_instances_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_wordpress_instances_operations.py deleted file mode 100644 index 4fcefaa8dcbe..000000000000 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_wordpress_instances_operations.py +++ /dev/null @@ -1,657 +0,0 @@ -# pylint: disable=too-many-lines -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import WorkloadsClientMixinABC, _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]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, php_workload_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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances", - ) # 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 - ), - "phpWorkloadName": _SERIALIZER.url("php_workload_name", php_workload_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, php_workload_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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances/default", - ) # 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 - ), - "phpWorkloadName": _SERIALIZER.url("php_workload_name", php_workload_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, php_workload_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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") - ) - 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/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances/default", - ) # 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 - ), - "phpWorkloadName": _SERIALIZER.url("php_workload_name", php_workload_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, php_workload_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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances/default", - ) # 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 - ), - "phpWorkloadName": _SERIALIZER.url("php_workload_name", php_workload_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class WordpressInstancesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.workloads.WorkloadsClient`'s - :attr:`wordpress_instances` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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 list( - self, resource_group_name: str, php_workload_name: str, **kwargs: Any - ) -> Iterable["_models.WordpressInstanceResource"]: - """Lists WordPress instance resources under a phpWorkload resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WordpressInstanceResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.workloads.models.WordpressInstanceResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[_models.WordpressInstanceResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WordpressInstanceResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - 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) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances" - } - - @distributed_trace - def get(self, resource_group_name: str, php_workload_name: str, **kwargs: Any) -> _models.WordpressInstanceResource: - """Gets the WordPress instance resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WordpressInstanceResource or the result of cls(response) - :rtype: ~azure.mgmt.workloads.models.WordpressInstanceResource - :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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[_models.WordpressInstanceResource] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.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("WordpressInstanceResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances/default" - } - - def _create_or_update_initial( - self, - resource_group_name: str, - php_workload_name: str, - wordpress_instance_resource: Union[_models.WordpressInstanceResource, IO], - **kwargs: Any - ) -> _models.WordpressInstanceResource: - 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-12-01-preview"] = 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.WordpressInstanceResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(wordpress_instance_resource, (IO, bytes)): - _content = wordpress_instance_resource - else: - _json = self._serialize.body(wordpress_instance_resource, "WordpressInstanceResource") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.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, 201]: - 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) - - if response.status_code == 200: - deserialized = self._deserialize("WordpressInstanceResource", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("WordpressInstanceResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances/default" - } - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - php_workload_name: str, - wordpress_instance_resource: _models.WordpressInstanceResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.WordpressInstanceResource]: - """Create or updated WordPress instance resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param wordpress_instance_resource: Resource create or update request payload. Required. - :type wordpress_instance_resource: ~azure.mgmt.workloads.models.WordpressInstanceResource - :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 - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either WordpressInstanceResource or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.WordpressInstanceResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - php_workload_name: str, - wordpress_instance_resource: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.WordpressInstanceResource]: - """Create or updated WordPress instance resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param wordpress_instance_resource: Resource create or update request payload. Required. - :type wordpress_instance_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 - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either WordpressInstanceResource or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.WordpressInstanceResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - php_workload_name: str, - wordpress_instance_resource: Union[_models.WordpressInstanceResource, IO], - **kwargs: Any - ) -> LROPoller[_models.WordpressInstanceResource]: - """Create or updated WordPress instance resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :param wordpress_instance_resource: Resource create or update request payload. Is either a - model type or a IO type. Required. - :type wordpress_instance_resource: ~azure.mgmt.workloads.models.WordpressInstanceResource 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 - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either WordpressInstanceResource or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.workloads.models.WordpressInstanceResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2021-12-01-preview"] = 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.WordpressInstanceResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - wordpress_instance_resource=wordpress_instance_resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WordpressInstanceResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances/default" - } - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, php_workload_name: str, **kwargs: Any - ) -> None: - """Delete WordPress instance resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param php_workload_name: Php workload name. Required. - :type php_workload_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :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-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - php_workload_name=php_workload_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.delete.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, 204]: - 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) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/phpWorkloads/{phpWorkloadName}/wordpressInstances/default" - } diff --git a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_workloads_client_operations.py b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_workloads_client_operations.py index 949fe008b422..94c2f60fa02a 100644 --- a/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_workloads_client_operations.py +++ b/sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/operations/_workloads_client_operations.py @@ -43,8 +43,8 @@ def build_sap_sizing_recommendations_request(location: str, subscription_id: str _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -76,8 +76,8 @@ def build_sap_supported_sku_request(location: str, subscription_id: str, **kwarg _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -109,8 +109,8 @@ def build_sap_disk_configurations_request(location: str, subscription_id: str, * _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -142,8 +142,8 @@ def build_sap_availability_zone_details_request(location: str, subscription_id: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-12-01-preview") + api_version: Literal["2022-11-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-01-preview") ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -259,7 +259,7 @@ def sap_sizing_recommendations( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -393,7 +393,7 @@ def sap_supported_sku( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -527,7 +527,7 @@ def sap_disk_configurations( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) @@ -665,7 +665,7 @@ def sap_availability_zone_details( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01-preview"] = kwargs.pop( + api_version: Literal["2022-11-01-preview"] = 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)) diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/db2_provider_instances_create.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/db2_provider_instances_create.py index 0f74e71f9b50..c34407109636 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/db2_provider_instances_create.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/db2_provider_instances_create.py @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/Db2ProviderInstances_Create.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/Db2ProviderInstances_Create.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/db2_provider_instances_create_root_certificate.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/db2_provider_instances_create_root_certificate.py index 572337e35bfd..d12965eb1fc1 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/db2_provider_instances_create_root_certificate.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/db2_provider_instances_create_root_certificate.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/Db2ProviderInstances_Create_Root_Certificate.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/Db2ProviderInstances_Create_Root_Certificate.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/db2_provider_instances_get.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/db2_provider_instances_get.py index efc8e0fad64e..e9eef3ff6598 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/db2_provider_instances_get.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/db2_provider_instances_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/Db2ProviderInstances_Get.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/Db2ProviderInstances_Get.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_delete.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_delete.py index 41cc5bc10d7a..75229d453aa5 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_delete.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_delete.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_Delete.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/monitors_Delete.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_get.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_get.py index 9a6437cccf5b..d19a763b9a2c 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_get.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_Get.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/monitors_Get.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_list.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_list.py index 5b819a2c9ecb..43ebf5ed1c6f 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_list.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_List.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/monitors_List.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_list_by_rg.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_list_by_rg.py index f3227bc61d6f..82a4b28f5b98 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_list_by_rg.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_list_by_rg.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_ListByRG.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/monitors_ListByRG.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_patch_tags.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_patch_tags.py index b2c13114e391..169a26d455ab 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_patch_tags.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_patch_tags.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_PatchTags.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/monitors_PatchTags.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_patch_tags_delete.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_patch_tags_delete.py index b8eb2aef12a4..f3fa16c4c492 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_patch_tags_delete.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/monitors_patch_tags_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_PatchTags_Delete.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/monitors_PatchTags_Delete.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/ms_sql_server_provider_instance_create.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/ms_sql_server_provider_instance_create.py index 647ffd5a4b19..644e7dd082f7 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/ms_sql_server_provider_instance_create.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/ms_sql_server_provider_instance_create.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/MsSqlServerProviderInstance_Create.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/MsSqlServerProviderInstance_Create.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/ms_sql_server_provider_instance_create_root_certificate.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/ms_sql_server_provider_instance_create_root_certificate.py index 27516e9c2602..06ea2f54f6ba 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/ms_sql_server_provider_instance_create_root_certificate.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/ms_sql_server_provider_instance_create_root_certificate.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/MsSqlServerProviderInstance_Create_Root_Certificate.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/MsSqlServerProviderInstance_Create_Root_Certificate.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/ms_sql_server_provider_instance_get.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/ms_sql_server_provider_instance_get.py index 78ac93963e22..4aa0287c8f56 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/ms_sql_server_provider_instance_get.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/ms_sql_server_provider_instance_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/MsSqlServerProviderInstance_Get.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/MsSqlServerProviderInstance_Get.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/net_weaver_provider_instances_create.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/net_weaver_provider_instances_create.py index 6d116380370a..5c3e83df3997 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/net_weaver_provider_instances_create.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/net_weaver_provider_instances_create.py @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/NetWeaverProviderInstances_Create.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/NetWeaverProviderInstances_Create.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/net_weaver_provider_instances_create_root_certificate.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/net_weaver_provider_instances_create_root_certificate.py index 6ad1c46da699..635b656bd5fb 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/net_weaver_provider_instances_create_root_certificate.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/net_weaver_provider_instances_create_root_certificate.py @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/NetWeaverProviderInstances_Create_Root_Certificate.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/NetWeaverProviderInstances_Create_Root_Certificate.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/net_weaver_provider_instances_get.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/net_weaver_provider_instances_get.py index b595173374aa..2d3593340ff5 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/net_weaver_provider_instances_get.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/net_weaver_provider_instances_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/NetWeaverProviderInstances_Get.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/NetWeaverProviderInstances_Get.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/operations_list.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/operations_list.py index 7440c1a129f2..0657077d4729 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/operations_list.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/operations_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/Operations_List.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_create_or_update.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_create_or_update.py deleted file mode 100644 index c5a807368ba8..000000000000 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_create_or_update.py +++ /dev/null @@ -1,111 +0,0 @@ -# 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.workloads import WorkloadsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloads -# USAGE - python php_workloads_create_or_update.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 = WorkloadsClient( - credential=DefaultAzureCredential(), - subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", - ) - - response = client.php_workloads.begin_create_or_update( - resource_group_name="test-rg", - php_workload_name="wp39", - php_workload_resource={ - "kind": "WordPress", - "location": "eastus2", - "properties": { - "adminUserProfile": {"sshPublicKey": "===SSH=PUBLIC=KEY===", "userName": "wpadmin"}, - "appLocation": "eastus", - "backupProfile": {"backupEnabled": "Disabled"}, - "cacheProfile": {"capacity": 0, "family": "C", "name": "wp-cache", "skuName": "Basic"}, - "controllerProfile": { - "dataDisks": [{"sizeInGB": 100, "storageType": "Premium_LRS"}], - "name": "contoller-vm", - "nodeSku": "Standard_DS2_v2", - "osDisk": {"storageType": "Premium_LRS"}, - "osImage": { - "offer": "UbuntuServer", - "publisher": "Canonical", - "sku": "18.0-LTS", - "version": "latest", - }, - }, - "databaseProfile": { - "backupRetentionDays": 7, - "haEnabled": "Disabled", - "serverName": "wp-db-server", - "sku": "Standard_D32s_v4", - "sslEnforcementEnabled": "Enabled", - "storageInGB": 128, - "storageIops": 200, - "storageSku": "Premium_LRS", - "tier": "GeneralPurpose", - "type": "MySql", - "version": "5.7", - }, - "fileshareProfile": {"shareSizeInGB": 100, "shareType": "AzureFiles", "storageType": "Premium_LRS"}, - "managedResourceGroupConfiguration": {"name": "php-mrg-wp39"}, - "networkProfile": { - "azureFrontDoorEnabled": "Enabled", - "loadBalancerSku": "Standard", - "loadBalancerType": "LoadBalancer", - }, - "phpProfile": {"version": "7.3"}, - "searchProfile": { - "nodeSku": "Standard_DS2_v2", - "osDisk": {"storageType": "Premium_LRS"}, - "osImage": { - "offer": "UbuntuServer", - "publisher": "Canonical", - "sku": "18.0-LTS", - "version": "latest", - }, - "searchType": "Elastic", - }, - "siteProfile": {"domainName": "www.example.com"}, - "webNodesProfile": { - "autoScaleMaxCount": 1, - "autoScaleMinCount": 1, - "name": "web-server", - "nodeSku": "Standard_DS2_v2", - "osDisk": {"storageType": "Premium_LRS"}, - "osImage": { - "offer": "UbuntuServer", - "publisher": "Canonical", - "sku": "18.0-LTS", - "version": "latest", - }, - }, - }, - "sku": {"name": "Large"}, - "tags": {}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_list_by_resource_group.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_list_by_resource_group.py deleted file mode 100644 index 77b5c36b6782..000000000000 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_list_by_resource_group.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.workloads import WorkloadsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloads -# USAGE - python php_workloads_list_by_resource_group.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 = WorkloadsClient( - credential=DefaultAzureCredential(), - subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", - ) - - response = client.php_workloads.list_by_resource_group( - resource_group_name="test-rg", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_ListByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_list_by_subscription.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_list_by_subscription.py deleted file mode 100644 index b53e7bc20872..000000000000 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_list_by_subscription.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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.workloads import WorkloadsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloads -# USAGE - python php_workloads_list_by_subscription.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 = WorkloadsClient( - credential=DefaultAzureCredential(), - subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", - ) - - response = client.php_workloads.list_by_subscription() - for item in response: - print(item) - - -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_ListBySubscription.json -if __name__ == "__main__": - main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_ha_cluster_provider_instances_create.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_ha_cluster_provider_instances_create.py index 95cf781e3c48..1fe6a23be33c 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_ha_cluster_provider_instances_create.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_ha_cluster_provider_instances_create.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Create.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Create.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_ha_cluster_provider_instances_create_root_certificate.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_ha_cluster_provider_instances_create_root_certificate.py index 65f6ca37464b..243489623b50 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_ha_cluster_provider_instances_create_root_certificate.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_ha_cluster_provider_instances_create_root_certificate.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Create_Root_Certificate.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Create_Root_Certificate.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_ha_cluster_provider_instances_get.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_ha_cluster_provider_instances_get.py index a2e8f71335d9..f1fad5ec0c08 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_ha_cluster_provider_instances_get.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_ha_cluster_provider_instances_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Get.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Get.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_os_provider_instances_create.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_os_provider_instances_create.py index 9e987faa23f0..1d5376578dd9 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_os_provider_instances_create.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_os_provider_instances_create.py @@ -38,6 +38,7 @@ def main(): "providerSettings": { "prometheusUrl": "http://192.168.0.0:9090/metrics", "providerType": "PrometheusOS", + "sapSid": "SID", "sslCertificateUri": "https://storageaccount.blob.core.windows.net/containername/filename", "sslPreference": "ServerCertificate", } @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/PrometheusOSProviderInstances_Create.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/PrometheusOSProviderInstances_Create.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_os_provider_instances_create_root_certificate.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_os_provider_instances_create_root_certificate.py index e3f0edd11577..ad3d9c03d1a0 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_os_provider_instances_create_root_certificate.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_os_provider_instances_create_root_certificate.py @@ -38,6 +38,7 @@ def main(): "providerSettings": { "prometheusUrl": "http://192.168.0.0:9090/metrics", "providerType": "PrometheusOS", + "sapSid": "SID", "sslPreference": "RootCertificate", } } @@ -46,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/PrometheusOSProviderInstances_Create_Root_Certificate.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/PrometheusOSProviderInstances_Create_Root_Certificate.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_os_provider_instances_get.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_os_provider_instances_get.py index f230d350892a..ddd59a5822b1 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_os_provider_instances_get.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/prometheus_os_provider_instances_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/PrometheusOSProviderInstances_Get.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/PrometheusOSProviderInstances_Get.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_create.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_create.py index a0519faa0bfa..db4fd49e73ca 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_create.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_create.py @@ -43,6 +43,7 @@ def main(): "hostname": "name", "instanceNumber": "00", "providerType": "SapHana", + "sapSid": "SID", "sqlPort": "0000", "sslCertificateUri": "https://storageaccount.blob.core.windows.net/containername/filename", "sslHostNameInCertificate": "xyz.domain.com", @@ -54,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/ProviderInstances_Create.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/ProviderInstances_Create.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_create_root_certificate.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_create_root_certificate.py index 594a96e92c2b..96b287ee7627 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_create_root_certificate.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_create_root_certificate.py @@ -43,6 +43,7 @@ def main(): "hostname": "name", "instanceNumber": "00", "providerType": "SapHana", + "sapSid": "SID", "sqlPort": "0000", "sslHostNameInCertificate": "xyz.domain.com", "sslPreference": "RootCertificate", @@ -53,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/ProviderInstances_Create_Root_Certificate.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/ProviderInstances_Create_Root_Certificate.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_delete.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_delete.py index 17cc646b22f0..856bf83c6041 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_delete.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/ProviderInstances_Delete.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/ProviderInstances_Delete.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_get.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_get.py index 60c01da622f1..8460b827a7ad 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_get.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/ProviderInstances_Get.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/ProviderInstances_Get.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_list.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_list.py index cff282efc35e..421c0230a671 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_list.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/provider_instances_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/ProviderInstances_List.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/ProviderInstances_List.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_create.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_create.py index ebf680b7aab9..f8b4addd1668 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_create.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_create.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Create.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Create.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_create_ha_av_set.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_create_ha_av_set.py new file mode 100644 index 000000000000..e748038a516e --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_create_ha_av_set.py @@ -0,0 +1,42 @@ +# 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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_application_server_instances_create_ha_av_set.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="6d875e77-e412-4d7d-9af4-8895278b4443", + ) + + response = client.sap_application_server_instances.begin_create( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + application_instance_name="app01", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Create_HA_AvSet.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_delete.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_delete.py index 456d14959ba2..385273fdbbd6 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_delete.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Delete.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Delete.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_get.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_get.py index bd5f6393b759..03379711e02a 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_get.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Get.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Get.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_list.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_list.py index dad88556390e..18c19059e751 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_list.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_List.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_List.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_start_instance.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_start_instance.py new file mode 100644 index 000000000000..27d28ffe301a --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_start_instance.py @@ -0,0 +1,42 @@ +# 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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_application_server_instances_start_instance.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", + ) + + response = client.sap_application_server_instances.begin_start_instance( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + application_instance_name="app01", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_StartInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_stop_instance.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_stop_instance.py new file mode 100644 index 000000000000..a28648cdc30f --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_stop_instance.py @@ -0,0 +1,42 @@ +# 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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_application_server_instances_stop_instance.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", + ) + + response = client.sap_application_server_instances.begin_stop_instance( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + application_instance_name="app01", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_StopInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_update.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_update.py index 46270ab2298b..1049da1f858b 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_update.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_application_server_instances_update.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Update.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Update.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_availability_zone_details_eastus.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_availability_zone_details_eastus.py index 131c96c30eab..7810daf2b4ed 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_availability_zone_details_eastus.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_availability_zone_details_eastus.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_eastus.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_eastus.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_availability_zone_details_northeurope.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_availability_zone_details_northeurope.py index 3b18f535756e..177fb9e336cb 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_availability_zone_details_northeurope.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_availability_zone_details_northeurope.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_northeurope.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_northeurope.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_create.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_create.py index 524241615232..43134b3c1808 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_create.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_create.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Create.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Create.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_create_ha_av_set.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_create_ha_av_set.py new file mode 100644 index 000000000000..eb74a1a295cf --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_create_ha_av_set.py @@ -0,0 +1,42 @@ +# 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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_central_instances_create_ha_av_set.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="6d875e77-e412-4d7d-9af4-8895278b4443", + ) + + response = client.sap_central_instances.begin_create( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + central_instance_name="centralServer", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Create_HA_AvSet.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_delete.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_delete.py index 20d13349c92d..f1f47e83be79 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_delete.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Delete.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Delete.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_get.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_get.py index 0543b8a215cd..dbe64e7f2f2b 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_get.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Get.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Get.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_list.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_list.py index 0cd9d3bc4c17..463ca63ad3e0 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_list.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPCentralInstances_List.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPCentralInstances_List.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_start_instance.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_start_instance.py new file mode 100644 index 000000000000..ff13a214c7ee --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_start_instance.py @@ -0,0 +1,42 @@ +# 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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_central_instances_start_instance.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", + ) + + response = client.sap_central_instances.begin_start_instance( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + central_instance_name="centralServer", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPCentralInstances_StartInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_stop_instance.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_stop_instance.py new file mode 100644 index 000000000000..64fd7a6e0488 --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_stop_instance.py @@ -0,0 +1,42 @@ +# 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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_central_instances_stop_instance.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", + ) + + response = client.sap_central_instances.begin_stop_instance( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + central_instance_name="centralServer", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPCentralInstances_StopInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_update.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_update.py index 006cbe58fbc0..bc8b958b6a2b 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_update.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_central_instances_update.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Update.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Update.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_create.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_create.py index 66909457ec27..264b48183303 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_create.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_create.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Create.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Create.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_create_ha_av_set.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_create_ha_av_set.py new file mode 100644 index 000000000000..a4bd785df19c --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_create_ha_av_set.py @@ -0,0 +1,42 @@ +# 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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_database_instances_create_ha_av_set.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="6d875e77-e412-4d7d-9af4-8895278b4443", + ) + + response = client.sap_database_instances.begin_create( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + database_instance_name="databaseServer", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Create_HA_AvSet.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_delete.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_delete.py index 115f1c28c309..e2da40b1464c 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_delete.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Delete.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Delete.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_get.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_get.py index d37dc3ca4f90..aca9820052e4 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_get.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Get.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Get.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_list.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_list.py index 1e9b35810b79..1b15962ebf43 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_list.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_List.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_List.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_start_instance.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_start_instance.py new file mode 100644 index 000000000000..cf8297349c8a --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_start_instance.py @@ -0,0 +1,42 @@ +# 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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_database_instances_start_instance.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", + ) + + response = client.sap_database_instances.begin_start_instance( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + database_instance_name="db0", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_StartInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_stop_instance.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_stop_instance.py new file mode 100644 index 000000000000..b5461858b431 --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_stop_instance.py @@ -0,0 +1,42 @@ +# 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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_database_instances_stop_instance.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", + ) + + response = client.sap_database_instances.begin_stop_instance( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + database_instance_name="db0", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_StopInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_update.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_update.py index dd8b70b797b3..a6990dc07b3c 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_update.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_database_instances_update.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Update.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Update.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_disk_configurations_non_prod.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_disk_configurations_non_prod.py index 1bb38627feb7..4348bf7dd8f4 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_disk_configurations_non_prod.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_disk_configurations_non_prod.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPDiskConfigurations_NonProd.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDiskConfigurations_NonProd.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_disk_configurations_prod.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_disk_configurations_prod.py index 36b3fb59117c..a5935405288e 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_disk_configurations_prod.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_disk_configurations_prod.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPDiskConfigurations_Prod.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDiskConfigurations_Prod.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/wordpress_instances_create_or_update.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_create.py similarity index 62% rename from sdk/workloads/azure-mgmt-workloads/generated_samples/wordpress_instances_create_or_update.py rename to sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_create.py index 5d138ca3eefc..0b9b155213ce 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/wordpress_instances_create_or_update.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-workloads # USAGE - python wordpress_instances_create_or_update.py + python sap_landscape_monitor_create.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,19 +26,25 @@ def main(): client = WorkloadsClient( credential=DefaultAzureCredential(), - subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", + subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.wordpress_instances.begin_create_or_update( - resource_group_name="test-rg", - php_workload_name="wp39", - wordpress_instance_resource={ - "properties": {"databaseName": "wpdb", "databaseUser": "wpuser", "version": "5.4.2"} + response = client.sap_landscape_monitor.create( + resource_group_name="myResourceGroup", + monitor_name="mySapMonitor", + sap_landscape_monitor_parameter={ + "properties": { + "grouping": { + "landscape": [{"name": "Prod", "topSid": ["SID1", "SID2"]}], + "sapApplication": [{"name": "ERP1", "topSid": ["SID1", "SID2"]}], + }, + "topMetricsThresholds": [{"green": 90, "name": "Instance Availability", "red": 50, "yellow": 75}], + } }, - ).result() + ) print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_CreateOrUpdate.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/SapLandscapeMonitor_Create.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_delete.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_delete.py new file mode 100644 index 000000000000..fc006a833dba --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_delete.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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_landscape_monitor_delete.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.sap_landscape_monitor.delete( + resource_group_name="myResourceGroup", + monitor_name="mySapMonitor", + ) + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/SapLandscapeMonitor_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_get.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_get.py new file mode 100644 index 000000000000..2718fdbec531 --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_get.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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_landscape_monitor_get.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.sap_landscape_monitor.get( + resource_group_name="myResourceGroup", + monitor_name="mySapMonitor", + ) + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/SapLandscapeMonitor_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_list.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_list.py new file mode 100644 index 000000000000..b8e550fcae76 --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_list.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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_landscape_monitor_list.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.sap_landscape_monitor.list( + resource_group_name="myResourceGroup", + monitor_name="mySapMonitor", + ) + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/SapLandscapeMonitor_List.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_update.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_update.py new file mode 100644 index 000000000000..42ef1a0c8cc3 --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_landscape_monitor_update.py @@ -0,0 +1,50 @@ +# 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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_landscape_monitor_update.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.sap_landscape_monitor.update( + resource_group_name="myResourceGroup", + monitor_name="mySapMonitor", + sap_landscape_monitor_parameter={ + "properties": { + "grouping": { + "landscape": [{"name": "Prod", "topSid": ["SID1", "SID2"]}], + "sapApplication": [{"name": "ERP1", "topSid": ["SID1", "SID2"]}], + }, + "topMetricsThresholds": [{"green": 90, "name": "Instance Availability", "red": 50, "yellow": 75}], + } + }, + ) + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/SapLandscapeMonitor_Update.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_sizing_recommendations_s4_hana_distributed.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_sizing_recommendations_s4_hana_distributed.py index 25e02449b542..b6d97d8fd3a7 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_sizing_recommendations_s4_hana_distributed.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_sizing_recommendations_s4_hana_distributed.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_Distributed.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_Distributed.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_sizing_recommendations_s4_hana_ha_av_set.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_sizing_recommendations_s4_hana_ha_av_set.py index 7ba744a080c1..a3c6535d6133 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_sizing_recommendations_s4_hana_ha_av_set.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_sizing_recommendations_s4_hana_ha_av_set.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvSet.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvSet.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_sizing_recommendations_s4_hana_ha_av_zone.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_sizing_recommendations_s4_hana_ha_av_zone.py index 7e7ce36677f5..2b6d9385459f 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_sizing_recommendations_s4_hana_ha_av_zone.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_sizing_recommendations_s4_hana_ha_av_zone.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvZone.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvZone.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_sizing_recommendations_s4_hana_single_server.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_sizing_recommendations_s4_hana_single_server.py index 0e0e6dfa461f..fcb20c35aab9 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_sizing_recommendations_s4_hana_single_server.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_sizing_recommendations_s4_hana_single_server.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_SingleServer.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_SingleServer.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_supported_skus_distributed.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_supported_skus_distributed.py index 0f77bb216f4f..b544f8492df0 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_supported_skus_distributed.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_supported_skus_distributed.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_Distributed.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_Distributed.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_supported_skus_distributed_ha_av_set.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_supported_skus_distributed_ha_av_set.py index aa95ea0eea13..0d18b9ce1eca 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_supported_skus_distributed_ha_av_set.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_supported_skus_distributed_ha_av_set.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvSet.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvSet.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_supported_skus_distributed_ha_av_zone.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_supported_skus_distributed_ha_av_zone.py index 240bfc16a0d0..2a7f049504b8 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_supported_skus_distributed_ha_av_zone.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_supported_skus_distributed_ha_av_zone.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvZone.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvZone.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_supported_skus_single_server.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_supported_skus_single_server.py index 39c3beeaaf24..a4fb928d8646 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_supported_skus_single_server.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_supported_skus_single_server.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_SingleServer.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_SingleServer.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_custom_full_resource_names_distributed.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_custom_full_resource_names_distributed.py new file mode 100644 index 000000000000..35f0e4df2aec --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_custom_full_resource_names_distributed.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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_virtual_instances_create_custom_full_resource_names_distributed.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", + ) + + response = client.sap_virtual_instances.begin_create( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_Distributed.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_custom_full_resource_names_ha_av_set.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_custom_full_resource_names_ha_av_set.py new file mode 100644 index 000000000000..b245cdc447ca --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_custom_full_resource_names_ha_av_set.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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_virtual_instances_create_custom_full_resource_names_ha_av_set.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", + ) + + response = client.sap_virtual_instances.begin_create( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvSet.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_custom_full_resource_names_ha_av_zone.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_custom_full_resource_names_ha_av_zone.py new file mode 100644 index 000000000000..9e7764a0f64a --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_custom_full_resource_names_ha_av_zone.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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_virtual_instances_create_custom_full_resource_names_ha_av_zone.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", + ) + + response = client.sap_virtual_instances.begin_create( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvZone.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_custom_full_resource_names_single_server.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_custom_full_resource_names_single_server.py new file mode 100644 index 000000000000..41347a7a8c4c --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_custom_full_resource_names_single_server.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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_virtual_instances_create_custom_full_resource_names_single_server.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", + ) + + response = client.sap_virtual_instances.begin_create( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_SingleServer.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_discover.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_discover.py index c39878c9ddd7..efb637681569 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_discover.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_discover.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_discover_custom_mrg_storage_account_name.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_discover_custom_mrg_storage_account_name.py new file mode 100644 index 000000000000..7fd2a599020b --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_discover_custom_mrg_storage_account_name.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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_virtual_instances_create_discover_custom_mrg_storage_account_name.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", + ) + + response = client.sap_virtual_instances.begin_create( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover_CustomMrgStorageAccountName.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/wordpress_instances_delete.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_disk_details_distributed.py similarity index 81% rename from sdk/workloads/azure-mgmt-workloads/generated_samples/wordpress_instances_delete.py rename to sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_disk_details_distributed.py index 6404f2fc5b4c..a3b9c792416a 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/wordpress_instances_delete.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_disk_details_distributed.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-workloads # USAGE - python wordpress_instances_delete.py + python sap_virtual_instances_create_disk_details_distributed.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,13 +29,13 @@ def main(): subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", ) - response = client.wordpress_instances.delete( + response = client.sap_virtual_instances.begin_create( resource_group_name="test-rg", - php_workload_name="wp39", - ) + sap_virtual_instance_name="X00", + ).result() print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_Delete.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_Distributed.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_delete.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_disk_details_ha_av_set.py similarity index 82% rename from sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_delete.py rename to sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_disk_details_ha_av_set.py index 4026df0e4d95..03928e9b0ea0 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_delete.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_disk_details_ha_av_set.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-workloads # USAGE - python php_workloads_delete.py + python sap_virtual_instances_create_disk_details_ha_av_set.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,13 +29,13 @@ def main(): subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", ) - response = client.php_workloads.begin_delete( + response = client.sap_virtual_instances.begin_create( resource_group_name="test-rg", - php_workload_name="wp39", + sap_virtual_instance_name="X00", ).result() print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_Delete.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvSet.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_get.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_disk_details_ha_av_zone.py similarity index 81% rename from sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_get.py rename to sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_disk_details_ha_av_zone.py index 4d9fa0d5e14b..21f4ba9206a9 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/php_workloads_get.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_disk_details_ha_av_zone.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-workloads # USAGE - python php_workloads_get.py + python sap_virtual_instances_create_disk_details_ha_av_zone.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,13 +29,13 @@ def main(): subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", ) - response = client.php_workloads.get( + response = client.sap_virtual_instances.begin_create( resource_group_name="test-rg", - php_workload_name="wp39", - ) + sap_virtual_instance_name="X00", + ).result() print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_Get.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvZone.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_disk_details_single_server.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_disk_details_single_server.py new file mode 100644 index 000000000000..37850e84111e --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_disk_details_single_server.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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_virtual_instances_create_disk_details_single_server.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", + ) + + response = client.sap_virtual_instances.begin_create( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_SingleServer.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_distributed.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_distributed.py index a23d53ece112..38da31525170 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_distributed.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_distributed.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_distributed_create_trans.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_distributed_create_trans.py new file mode 100644 index 000000000000..02c76681f5df --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_distributed_create_trans.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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_virtual_instances_create_distributed_create_trans.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", + ) + + response = client.sap_virtual_instances.begin_create( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_CreateTrans.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/wordpress_instances_get.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_distributed_mount_trans.py similarity index 81% rename from sdk/workloads/azure-mgmt-workloads/generated_samples/wordpress_instances_get.py rename to sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_distributed_mount_trans.py index 95c869318892..bc58db421892 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/wordpress_instances_get.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_distributed_mount_trans.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-workloads # USAGE - python wordpress_instances_get.py + python sap_virtual_instances_create_distributed_mount_trans.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,13 +29,13 @@ def main(): subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", ) - response = client.wordpress_instances.get( + response = client.sap_virtual_instances.begin_create( resource_group_name="test-rg", - php_workload_name="wp39", - ) + sap_virtual_instance_name="X00", + ).result() print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_Get.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_MountTrans.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_distributed_skip_trans_mount.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_distributed_skip_trans_mount.py new file mode 100644 index 000000000000..3bd6579ba15e --- /dev/null +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_distributed_skip_trans_mount.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.workloads import WorkloadsClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-workloads +# USAGE + python sap_virtual_instances_create_distributed_skip_trans_mount.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 = WorkloadsClient( + credential=DefaultAzureCredential(), + subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", + ) + + response = client.sap_virtual_instances.begin_create( + resource_group_name="test-rg", + sap_virtual_instance_name="X00", + ).result() + print(response) + + +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_SkipTransMount.json +if __name__ == "__main__": + main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_ha_av_set.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_ha_av_set.py index ba0cd9973a25..b6e1b8080eb5 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_ha_av_set.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_ha_av_set.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvSet.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvSet.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_ha_av_zone.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_ha_av_zone.py index 9c16a5ad61f7..bc763bdb7037 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_ha_av_zone.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_ha_av_zone.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvZone.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvZone.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_single_server.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_single_server.py index 9ae62e09c61b..78b4f2f583e3 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_single_server.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_single_server.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_SingleServer.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_SingleServer.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_with_os_config_distributed.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_with_os_config_distributed.py index a44d64aa9bf8..527b50e53160 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_with_os_config_distributed.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_with_os_config_distributed.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_Distributed.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_Distributed.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_with_os_config_ha_av_set.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_with_os_config_ha_av_set.py index ef49bbfd083a..863c1a5f554b 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_with_os_config_ha_av_set.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_with_os_config_ha_av_set.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvSet.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvSet.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_with_os_config_ha_av_zone.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_with_os_config_ha_av_zone.py index 0c0b5e3ba874..7217670fe525 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_with_os_config_ha_av_zone.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_with_os_config_ha_av_zone.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvZone.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvZone.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_with_os_config_single_server.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_with_os_config_single_server.py index b3fba554c78b..ad931b081741 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_with_os_config_single_server.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_create_with_os_config_single_server.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_SingleServer.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_SingleServer.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_delete.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_delete.py index 1a541c693bc4..90f6aa0d4133 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_delete.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_delete.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Delete.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Delete.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_detect_installation_distributed.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_detect_installation_distributed.py index d5ff27081cca..472956b6c380 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_detect_installation_distributed.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_detect_installation_distributed.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_Distributed.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_Distributed.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_detect_installation_ha_av_set.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_detect_installation_ha_av_set.py index 7ec97e9cd623..c24eeb11bd88 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_detect_installation_ha_av_set.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_detect_installation_ha_av_set.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvSet.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvSet.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_detect_installation_ha_av_zone.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_detect_installation_ha_av_zone.py index bcb3039739d7..9478f64a8856 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_detect_installation_ha_av_zone.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_detect_installation_ha_av_zone.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvZone.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvZone.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_detect_installation_single_server.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_detect_installation_single_server.py index d35f8eb72324..fd407118156b 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_detect_installation_single_server.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_detect_installation_single_server.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_SingleServer.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_SingleServer.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_get.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_get.py index ae49c19da633..421850dfdd16 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_get.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Get.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Get.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_install_distributed.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_install_distributed.py index 8a2ca605dc39..4336982a2234 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_install_distributed.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_install_distributed.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Install_Distributed.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Install_Distributed.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_install_single_server.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_install_single_server.py index 3c040a39c1cb..3f72bb4a9500 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_install_single_server.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_install_single_server.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Install_SingleServer.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Install_SingleServer.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_list_by_resource_group.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_list_by_resource_group.py index 7c5a2792fcd7..bf40f6ca06ee 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_list_by_resource_group.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_list_by_resource_group.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_ListByResourceGroup.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_list_by_subscription.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_list_by_subscription.py index d9b14667ec0c..ee70f824c6fb 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_list_by_subscription.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_list_by_subscription.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_ListBySubscription.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_start.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_start.py index 2a8bde724127..618437299aa6 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_start.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_start.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Start.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Start.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_stop.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_stop.py index 5a7edc38ad15..3885e89e10fc 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_stop.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_stop.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Stop.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Stop.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_update.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_update.py index 6ff47e40ead8..fa28b953f35b 100644 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_update.py +++ b/sdk/workloads/azure-mgmt-workloads/generated_samples/sap_virtual_instances_update.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Update.json +# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Update.json if __name__ == "__main__": main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/skus_list.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/skus_list.py deleted file mode 100644 index c053028277cb..000000000000 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/skus_list.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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.workloads import WorkloadsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloads -# USAGE - python skus_list.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 = WorkloadsClient( - credential=DefaultAzureCredential(), - subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", - ) - - response = client.skus.list() - for item in response: - print(item) - - -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/Skus_List.json -if __name__ == "__main__": - main() diff --git a/sdk/workloads/azure-mgmt-workloads/generated_samples/wordpress_instances_list.py b/sdk/workloads/azure-mgmt-workloads/generated_samples/wordpress_instances_list.py deleted file mode 100644 index 94faa062476c..000000000000 --- a/sdk/workloads/azure-mgmt-workloads/generated_samples/wordpress_instances_list.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.workloads import WorkloadsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-workloads -# USAGE - python wordpress_instances_list.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 = WorkloadsClient( - credential=DefaultAzureCredential(), - subscription_id="8e17e36c-42e9-4cd5-a078-7b44883414e0", - ) - - response = client.wordpress_instances.list( - resource_group_name="test-rg", - php_workload_name="wp39", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_List.json -if __name__ == "__main__": - main()