diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/_meta.json b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/_meta.json index ffe5c9c60d7a..d47ec2949ccd 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/_meta.json +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/_meta.json @@ -1,11 +1,11 @@ { - "commit": "9a8af2acfafc4d7a23eff41b859d2d332f51b0bc", + "commit": "251962de7f23c412bc3857b89a586c9dd572077a", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ - "@autorest/python@6.19.0", + "@autorest/python@6.26.4", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/servicefabricmanagedclusters/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "autorest_command": "autorest specification/servicefabricmanagedclusters/resource-manager/readme.md --generate-sample=True --generate-test=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.26.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/servicefabricmanagedclusters/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/__init__.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/__init__.py index 97445631e51c..8d17b8644f25 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/__init__.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._service_fabric_managed_clusters_management_client import ServiceFabricManagedClustersManagementClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._service_fabric_managed_clusters_management_client import ServiceFabricManagedClustersManagementClient # type: ignore from ._version import VERSION __version__ = VERSION try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -21,6 +27,6 @@ __all__ = [ "ServiceFabricManagedClustersManagementClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_configuration.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_configuration.py index cf2118e8b4b5..32eefdd5d72c 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_configuration.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_configuration.py @@ -14,7 +14,6 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -28,13 +27,13 @@ class ServiceFabricManagedClustersManagementClientConfiguration: # pylint: disa :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The customer subscription identifier. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-06-01-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2024-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: - api_version: str = kwargs.pop("api_version", "2024-06-01-preview") + api_version: str = kwargs.pop("api_version", "2024-11-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_serialization.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_serialization.py index 8139854b97bb..ce17d1798ce7 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_serialization.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_serialization.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. @@ -24,7 +25,6 @@ # # -------------------------------------------------------------------------- -# pylint: skip-file # pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode @@ -52,7 +52,6 @@ MutableMapping, Type, List, - Mapping, ) try: @@ -91,6 +90,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: :param data: Input, could be bytes or stream (will be decoded with UTF8) or text :type data: str or bytes or IO :param str content_type: The content type. + :return: The deserialized data. + :rtype: object """ if hasattr(data, "read"): # Assume a stream @@ -112,7 +113,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: try: return json.loads(data_as_str) except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) + raise DeserializationError("JSON is invalid: {}".format(err), err) from err elif "xml" in (content_type or []): try: @@ -155,6 +156,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], Use bytes and headers to NOT use any requests/aiohttp or whatever specific implementation. Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object """ # Try to use content-type from headers if available content_type = None @@ -184,15 +190,30 @@ class UTC(datetime.tzinfo): """Time Zone info for handling UTC""" def utcoffset(self, dt): - """UTF offset for UTC is 0.""" + """UTF offset for UTC is 0. + + :param datetime.datetime dt: The datetime + :returns: The offset + :rtype: datetime.timedelta + """ return datetime.timedelta(0) def tzname(self, dt): - """Timestamp representation.""" + """Timestamp representation. + + :param datetime.datetime dt: The datetime + :returns: The timestamp representation + :rtype: str + """ return "Z" def dst(self, dt): - """No daylight saving for UTC.""" + """No daylight saving for UTC. + + :param datetime.datetime dt: The datetime + :returns: The daylight saving time + :rtype: datetime.timedelta + """ return datetime.timedelta(hours=1) @@ -206,7 +227,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore :param datetime.timedelta offset: offset in timedelta format """ - def __init__(self, offset): + def __init__(self, offset) -> None: self.__offset = offset def utcoffset(self, dt): @@ -235,24 +256,26 @@ def __getinitargs__(self): _FLATTEN = re.compile(r"(? None: self.additional_properties: Optional[Dict[str, Any]] = {} - for k in kwargs: + for k in kwargs: # pylint: disable=consider-using-dict-items 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__) elif k in self._validation and self._validation[k].get("readonly", False): @@ -300,13 +330,23 @@ def __init__(self, **kwargs: Any) -> None: setattr(self, k, kwargs[k]) def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ return not self.__eq__(other) def __str__(self) -> str: @@ -326,7 +366,11 @@ def is_xml_model(cls) -> bool: @classmethod def _create_xml_node(cls): - """Create XML node.""" + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ try: xml_map = cls._xml_map # type: ignore except AttributeError: @@ -346,7 +390,9 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) def as_dict( self, @@ -380,12 +426,15 @@ def my_key_transformer(key, attr_desc, value): If you want XML serialization, you can pass the kwargs is_xml=True. + :param bool keep_readonly: If you want to serialize the readonly attributes :param function key_transformer: A key transformer function. :returns: A dict JSON compatible object :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) @classmethod def _infer_class_models(cls): @@ -395,7 +444,7 @@ def _infer_class_models(cls): client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} if cls.__name__ not in client_models: raise ValueError("Not Autorest generated code") - except Exception: + except Exception: # pylint: disable=broad-exception-caught # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. client_models = {cls.__name__: cls} return client_models @@ -408,6 +457,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong + :rtype: ModelType """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @@ -426,9 +476,11 @@ def from_dict( and last_rest_key_case_insensitive_extractor) :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong + :rtype: ModelType """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -448,21 +500,25 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access return result @classmethod def _classify(cls, response, objects): """Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class """ for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): subtype_value = None if not isinstance(response, ET.Element): rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -501,11 +557,13 @@ def _decode_attribute_map_key(key): inside the received data. :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str """ return key.replace("\\.", ".") -class Serializer(object): +class Serializer(object): # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -540,7 +598,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -560,13 +618,16 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None): self.key_transformer = full_restapi_key_transformer self.client_side_validation = True - def _serialize(self, target_obj, data_type=None, **kwargs): + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): """Serialize data into a string according to type. - :param target_obj: The data to be serialized. + :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict :raises: SerializationError if serialization fails. + :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) keep_readonly = kwargs.get("keep_readonly", False) @@ -592,12 +653,14 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized = {} if is_xml_model_serialization: - serialized = target_obj._create_xml_node() + serialized = target_obj._create_xml_node() # pylint: disable=protected-access try: - attributes = target_obj._attribute_map + attributes = target_obj._attribute_map # pylint: disable=protected-access for attr, attr_desc in attributes.items(): attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): continue if attr_name == "additional_properties" and attr_desc["key"] == "": @@ -633,7 +696,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if isinstance(new_attr, list): serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): - # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): splitted_tag = new_attr.tag.split("}") if len(splitted_tag) == 2: # Namespace @@ -664,17 +728,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs): except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) raise SerializationError(msg) from err - else: - return serialized + return serialized def body(self, data, data_type, **kwargs): """Serialize data intended for a request body. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict :raises: SerializationError if serialization fails. :raises: ValueError if data is None + :returns: The serialized request body """ # Just in case this is a dict @@ -703,7 +767,7 @@ def body(self, data, data_type, **kwargs): attribute_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, ] - data = deserializer._deserialize(data_type, data) + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access except DeserializationError as err: raise SerializationError("Unable to build a model: " + str(err)) from err @@ -712,9 +776,11 @@ def body(self, data, data_type, **kwargs): def url(self, name, data, data_type, **kwargs): """Serialize data intended for a URL path. - :param data: The data to be serialized. + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str + :returns: The serialized URL path :raises: TypeError if serialization fails. :raises: ValueError if data is None """ @@ -728,21 +794,20 @@ def url(self, name, data, data_type, **kwargs): output = output.replace("{", quote("{")).replace("}", quote("}")) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return output + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output def query(self, name, data, data_type, **kwargs): """Serialize data intended for a URL query. - :param data: The data to be serialized. + :param str name: The name of the query parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :keyword bool skip_quote: Whether to skip quote the serialized result. - Defaults to False. :rtype: str, list :raises: TypeError if serialization fails. :raises: ValueError if data is None + :returns: The serialized query parameter """ try: # Treat the list aside, since we don't want to encode the div separator @@ -759,19 +824,20 @@ def query(self, name, data, data_type, **kwargs): output = str(output) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def header(self, name, data, data_type, **kwargs): """Serialize data intended for a request header. - :param data: The data to be serialized. + :param str name: The name of the header. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None + :returns: The serialized header """ try: if data_type in ["[str]"]: @@ -780,21 +846,20 @@ def header(self, name, data, data_type, **kwargs): output = self.serialize_data(data, data_type, **kwargs) if data_type == "bool": output = json.dumps(output) - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def serialize_data(self, data, data_type, **kwargs): """Serialize generic data according to supplied data type. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :param bool required: Whether it's essential that the data not be - empty or None :raises: AttributeError if required data is None. :raises: ValueError if data is None :raises: SerializationError if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list """ if data is None: raise ValueError("No value for given attribute") @@ -805,7 +870,7 @@ def serialize_data(self, data, data_type, **kwargs): if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) - elif data_type in self.serialize_type: + if data_type in self.serialize_type: return self.serialize_type[data_type](data, **kwargs) # If dependencies is empty, try with current data class @@ -821,11 +886,10 @@ def serialize_data(self, data, data_type, **kwargs): except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." raise SerializationError(msg.format(data, data_type)) from err - else: - return self._serialize(data, **kwargs) + return self._serialize(data, **kwargs) @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) if custom_serializer: return custom_serializer @@ -841,23 +905,26 @@ def serialize_basic(cls, data, data_type, **kwargs): - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - is_xml bool : If set, use xml_basic_types_serializers - :param data: Object to be serialized. + :param obj data: Object to be serialized. :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec + return eval(data_type)(data) # nosec # pylint: disable=eval-used @classmethod def serialize_unicode(cls, data): """Special handling for serializing unicode strings in Py2. Encode to UTF-8 if unicode, otherwise handle as a str. - :param data: Object to be serialized. + :param str data: Object to be serialized. :rtype: str + :return: serialized object """ try: # If I received an enum, return its value return data.value @@ -871,8 +938,7 @@ def serialize_unicode(cls, data): return data except NameError: return str(data) - else: - return str(data) + return str(data) def serialize_iter(self, data, iter_type, div=None, **kwargs): """Serialize iterable. @@ -882,15 +948,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): serialization_ctxt['type'] should be same as data_type. - is_xml bool : If set, serialize as XML - :param list attr: Object to be serialized. + :param list data: Object to be serialized. :param str iter_type: Type of object in the iterable. - :param bool required: Whether the objects in the iterable must - not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. - :keyword bool do_quote: Whether to quote the serialized result of each iterable element. Defaults to False. :rtype: list, str + :return: serialized iterable """ if isinstance(data, str): raise SerializationError("Refuse str type as a valid iter type.") @@ -945,9 +1009,8 @@ def serialize_dict(self, attr, dict_type, **kwargs): :param dict attr: Object to be serialized. :param str dict_type: Type of object in the dictionary. - :param bool required: Whether the objects in the dictionary must - not be None or empty. :rtype: dict + :return: serialized dictionary """ serialization_ctxt = kwargs.get("serialization_ctxt", {}) serialized = {} @@ -971,7 +1034,7 @@ def serialize_dict(self, attr, dict_type, **kwargs): return serialized - def serialize_object(self, attr, **kwargs): + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Serialize a generic object. This will be handled as a dictionary. If object passed in is not a basic type (str, int, float, dict, list) it will simply be @@ -979,6 +1042,7 @@ def serialize_object(self, attr, **kwargs): :param dict attr: Object to be serialized. :rtype: dict or str + :return: serialized object """ if attr is None: return None @@ -1003,7 +1067,7 @@ def serialize_object(self, attr, **kwargs): return self.serialize_decimal(attr) # If it's a model or I know this dependency, serialize as a Model - elif obj_type in self.dependencies.values() or isinstance(attr, Model): + if obj_type in self.dependencies.values() or isinstance(attr, Model): return self._serialize(attr) if obj_type == dict: @@ -1034,56 +1098,61 @@ def serialize_enum(attr, enum_obj=None): try: enum_obj(result) # type: ignore return result - except ValueError: + except ValueError as exc: for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" - raise SerializationError(error.format(attr, enum_obj)) + raise SerializationError(error.format(attr, enum_obj)) from exc @staticmethod - def serialize_bytearray(attr, **kwargs): + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument """Serialize bytearray into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ return b64encode(attr).decode() @staticmethod - def serialize_base64(attr, **kwargs): + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument """Serialize str into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ encoded = b64encode(attr).decode("ascii") return encoded.strip("=").replace("+", "-").replace("/", "_") @staticmethod - def serialize_decimal(attr, **kwargs): + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument """Serialize Decimal object to float. - :param attr: Object to be serialized. + :param decimal attr: Object to be serialized. :rtype: float + :return: serialized decimal """ return float(attr) @staticmethod - def serialize_long(attr, **kwargs): + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument """Serialize long (Py2) or int (Py3). - :param attr: Object to be serialized. + :param int attr: Object to be serialized. :rtype: int/long + :return: serialized long """ return _long_type(attr) @staticmethod - def serialize_date(attr, **kwargs): + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument """Serialize Date object into ISO-8601 formatted string. :param Date attr: Object to be serialized. :rtype: str + :return: serialized date """ if isinstance(attr, str): attr = isodate.parse_date(attr) @@ -1091,11 +1160,12 @@ def serialize_date(attr, **kwargs): return t @staticmethod - def serialize_time(attr, **kwargs): + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument """Serialize Time object into ISO-8601 formatted string. :param datetime.time attr: Object to be serialized. :rtype: str + :return: serialized time """ if isinstance(attr, str): attr = isodate.parse_time(attr) @@ -1105,30 +1175,32 @@ def serialize_time(attr, **kwargs): return t @staticmethod - def serialize_duration(attr, **kwargs): + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument """Serialize TimeDelta object into ISO-8601 formatted string. :param TimeDelta attr: Object to be serialized. :rtype: str + :return: serialized duration """ if isinstance(attr, str): attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) @staticmethod - def serialize_rfc(attr, **kwargs): + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. :param Datetime attr: Object to be serialized. :rtype: str :raises: TypeError if format invalid. + :return: serialized rfc """ try: if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") utc = attr.utctimetuple() - except AttributeError: - raise TypeError("RFC1123 object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( Serializer.days[utc.tm_wday], @@ -1141,12 +1213,13 @@ def serialize_rfc(attr, **kwargs): ) @staticmethod - def serialize_iso(attr, **kwargs): + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into ISO-8601 formatted string. :param Datetime attr: Object to be serialized. :rtype: str :raises: SerializationError if format invalid. + :return: serialized iso """ if isinstance(attr, str): attr = isodate.parse_datetime(attr) @@ -1172,13 +1245,14 @@ def serialize_iso(attr, **kwargs): raise TypeError(msg) from err @staticmethod - def serialize_unix(attr, **kwargs): + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into IntTime format. This is represented as seconds. :param Datetime attr: Object to be serialized. :rtype: int :raises: SerializationError if format invalid + :return: serialied unix """ if isinstance(attr, int): return attr @@ -1186,11 +1260,11 @@ def serialize_unix(attr, **kwargs): if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") return int(calendar.timegm(attr.utctimetuple())) - except AttributeError: - raise TypeError("Unix time object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc -def rest_key_extractor(attr, attr_desc, data): +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument key = attr_desc["key"] working_data = data @@ -1211,7 +1285,9 @@ def rest_key_extractor(attr, attr_desc, data): return working_data.get(key) -def rest_key_case_insensitive_extractor(attr, attr_desc, data): +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): key = attr_desc["key"] working_data = data @@ -1232,17 +1308,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): return attribute_key_case_insensitive_extractor(key, None, working_data) -def last_rest_key_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key.""" +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) return attribute_key_extractor(dict_keys[-1], None, data) -def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument """Extract the attribute in "data" based on the last part of the JSON path key. This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) @@ -1279,7 +1367,7 @@ def _extract_name_from_internal_type(internal_type): return xml_name -def xml_key_extractor(attr, attr_desc, data): +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements if isinstance(data, dict): return None @@ -1331,22 +1419,21 @@ def xml_key_extractor(attr, attr_desc, data): if is_iter_type: if is_wrapped: return None # is_wrapped no node, we want None - else: - return [] # not wrapped, assume empty list + return [] # not wrapped, assume empty list return None # Assume it's not there, maybe an optional node. # If is_iter_type and not wrapped, return all found children if is_iter_type: if not is_wrapped: return children - else: # Iter and wrapped, should have found one node only (the wrap one) - if len(children) != 1: - raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( - xml_name - ) + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long + xml_name ) - return list(children[0]) # Might be empty list and that's ok. + ) + return list(children[0]) # Might be empty list and that's ok. # Here it's not a itertype, we should have found one element only or empty if len(children) > 1: @@ -1363,9 +1450,9 @@ class Deserializer(object): basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - 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}]?") + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1403,11 +1490,12 @@ def __call__(self, target_obj, response_data, content_type=None): :param str content_type: Swagger "produces" if available. :raises: DeserializationError if deserialization fails. :return: Deserialized object. + :rtype: object """ data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) - def _deserialize(self, target_obj, data): + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements """Call the deserializer on a model. Data needs to be already deserialized as JSON or XML ElementTree @@ -1416,12 +1504,13 @@ def _deserialize(self, target_obj, data): :param object data: Object to deserialize. :raises: DeserializationError if deserialization fails. :return: Deserialized object. + :rtype: object """ # This is already a model, go recursive just in case if hasattr(data, "_attribute_map"): constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] try: - for attr, mapconfig in data._attribute_map.items(): + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access if attr in constants: continue value = getattr(data, attr) @@ -1440,13 +1529,13 @@ def _deserialize(self, target_obj, data): if isinstance(response, str): return self.deserialize_data(data, response) - elif isinstance(response, type) and issubclass(response, Enum): + if isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) if data is None or data is CoreNull: return data try: - attributes = response._attribute_map # type: ignore + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1476,9 +1565,8 @@ def _deserialize(self, target_obj, data): except (AttributeError, TypeError, KeyError) as err: msg = "Unable to deserialize to object: " + class_name # type: ignore raise DeserializationError(msg) from err - else: - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) def _build_additional_properties(self, attribute_map, data): if not self.additional_properties_detection: @@ -1505,6 +1593,8 @@ def _classify_target(self, target, data): :param str target: The target object type to deserialize to. :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple """ if target is None: return None, None @@ -1516,7 +1606,7 @@ def _classify_target(self, target, data): return target, target try: - target = target._classify(data, self.dependencies) # type: ignore + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access except AttributeError: pass # Target is not a Model, no classify return target, target.__class__.__name__ # type: ignore @@ -1531,10 +1621,12 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): :param str target_obj: The target object type to deserialize to. :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object """ try: return self(target_obj, data, content_type=content_type) - except: + except: # pylint: disable=bare-except _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -1552,10 +1644,12 @@ def _unpack_content(raw_data, content_type=None): If raw_data is something else, bypass all logic and return it directly. - :param raw_data: Data to be processed. - :param content_type: How to parse if raw_data is a string/bytes. + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. :raises JSONDecodeError: If JSON is requested and parsing is impossible. :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. """ # Assume this is enough to detect a Pipeline Response without importing it context = getattr(raw_data, "context", {}) @@ -1579,14 +1673,21 @@ def _unpack_content(raw_data, content_type=None): def _instantiate_model(self, response, attrs, additional_properties=None): """Instantiate a response model passing in deserialized args. - :param response: The response model class. - :param d_attrs: The deserialized response attributes. + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. """ if callable(response): subtype = getattr(response, "_subtype_map", {}) try: - readonly = [k for k, v in response._validation.items() if v.get("readonly")] - const = [k for k, v in response._validation.items() if v.get("constant")] + readonly = [ + k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access + ] + const = [ + k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access + ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: @@ -1596,7 +1697,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None): return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) + raise DeserializationError(msg + str(err)) from err else: try: for attr, value in attrs.items(): @@ -1605,15 +1706,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None): except Exception as exp: msg = "Unable to populate response model. " msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) + raise DeserializationError(msg) from exp - def deserialize_data(self, data, data_type): + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements """Process data for deserialization according to data type. :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. :raises: DeserializationError if deserialization fails. :return: Deserialized object. + :rtype: object """ if data is None: return data @@ -1627,7 +1729,11 @@ def deserialize_data(self, data, data_type): if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): return data - is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: return None data_val = self.deserialize_type[data_type](data) @@ -1647,14 +1753,14 @@ def deserialize_data(self, data, data_type): msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) raise DeserializationError(msg) from err - else: - return self._deserialize(obj_type, data) + return self._deserialize(obj_type, data) def deserialize_iter(self, attr, iter_type): """Deserialize an iterable. :param list attr: Iterable to be deserialized. :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. :rtype: list """ if attr is None: @@ -1671,6 +1777,7 @@ def deserialize_dict(self, attr, dict_type): :param dict/list attr: Dictionary to be deserialized. Also accepts a list of key, value pairs. :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. :rtype: dict """ if isinstance(attr, list): @@ -1681,11 +1788,12 @@ def deserialize_dict(self, attr, dict_type): attr = {el.tag: el.text for el in attr} return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} - def deserialize_object(self, attr, **kwargs): + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Deserialize a generic object. This will be handled as a dictionary. :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. :rtype: dict :raises: TypeError if non-builtin datatype encountered. """ @@ -1720,11 +1828,10 @@ def deserialize_object(self, attr, **kwargs): pass return deserialized - else: - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) - def deserialize_basic(self, attr, data_type): + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements """Deserialize basic builtin data type from string. Will attempt to convert to str, int, float and bool. This function will also accept '1', '0', 'true' and 'false' as @@ -1732,6 +1839,7 @@ def deserialize_basic(self, attr, data_type): :param str attr: response string to be deserialized. :param str data_type: deserialization data type. + :return: Deserialized basic type. :rtype: str, int, float or bool :raises: TypeError if string format is not valid. """ @@ -1743,24 +1851,23 @@ def deserialize_basic(self, attr, data_type): if data_type == "str": # None or '', node is empty string. return "" - else: - # None or '', node with a strong type is None. - # Don't try to model "empty bool" or "empty int" - return None + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None if data_type == "bool": if attr in [True, False, 1, 0]: return bool(attr) - elif isinstance(attr, str): + if isinstance(attr, str): if attr.lower() in ["true", "1"]: return True - elif attr.lower() in ["false", "0"]: + if attr.lower() in ["false", "0"]: return False raise TypeError("Invalid boolean value: {}".format(attr)) if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec + return eval(data_type)(attr) # nosec # pylint: disable=eval-used @staticmethod def deserialize_unicode(data): @@ -1768,6 +1875,7 @@ def deserialize_unicode(data): as a string. :param str data: response string to be deserialized. + :return: Deserialized string. :rtype: str or unicode """ # We might be here because we have an enum modeled as string, @@ -1781,8 +1889,7 @@ def deserialize_unicode(data): return data except NameError: return str(data) - else: - return str(data) + return str(data) @staticmethod def deserialize_enum(data, enum_obj): @@ -1794,6 +1901,7 @@ def deserialize_enum(data, enum_obj): :param str data: Response string to be deserialized. If this value is None or invalid it will be returned as-is. :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. :rtype: Enum """ if isinstance(data, enum_obj) or data is None: @@ -1804,9 +1912,9 @@ def deserialize_enum(data, enum_obj): # Workaround. We might consider remove it in the future. try: return list(enum_obj.__members__.values())[data] - except IndexError: + except IndexError as exc: error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) + raise DeserializationError(error.format(data, enum_obj)) from exc try: return enum_obj(str(data)) except ValueError: @@ -1822,6 +1930,7 @@ def deserialize_bytearray(attr): """Deserialize string into bytearray. :param str attr: response string to be deserialized. + :return: Deserialized bytearray :rtype: bytearray :raises: TypeError if string format invalid. """ @@ -1834,6 +1943,7 @@ def deserialize_base64(attr): """Deserialize base64 encoded string into string. :param str attr: response string to be deserialized. + :return: Deserialized base64 string :rtype: bytearray :raises: TypeError if string format invalid. """ @@ -1849,8 +1959,9 @@ def deserialize_decimal(attr): """Deserialize string into Decimal object. :param str attr: response string to be deserialized. - :rtype: Decimal + :return: Deserialized decimal :raises: DeserializationError if string format invalid. + :rtype: decimal """ if isinstance(attr, ET.Element): attr = attr.text @@ -1865,6 +1976,7 @@ def deserialize_long(attr): """Deserialize string into long (Py2) or int (Py3). :param str attr: response string to be deserialized. + :return: Deserialized int :rtype: long or int :raises: ValueError if string format invalid. """ @@ -1877,6 +1989,7 @@ def deserialize_duration(attr): """Deserialize ISO-8601 formatted string into TimeDelta object. :param str attr: response string to be deserialized. + :return: Deserialized duration :rtype: TimeDelta :raises: DeserializationError if string format invalid. """ @@ -1887,14 +2000,14 @@ def deserialize_duration(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." raise DeserializationError(msg) from err - else: - return duration + return duration @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. :param str attr: response string to be deserialized. + :return: Deserialized date :rtype: Date :raises: DeserializationError if string format invalid. """ @@ -1910,6 +2023,7 @@ def deserialize_time(attr): """Deserialize ISO-8601 formatted string into time object. :param str attr: response string to be deserialized. + :return: Deserialized time :rtype: datetime.time :raises: DeserializationError if string format invalid. """ @@ -1924,6 +2038,7 @@ def deserialize_rfc(attr): """Deserialize RFC-1123 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime :rtype: Datetime :raises: DeserializationError if string format invalid. """ @@ -1939,14 +2054,14 @@ def deserialize_rfc(attr): except ValueError as err: msg = "Cannot deserialize to rfc datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_iso(attr): """Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime :rtype: Datetime :raises: DeserializationError if string format invalid. """ @@ -1976,8 +2091,7 @@ def deserialize_iso(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_unix(attr): @@ -1985,6 +2099,7 @@ def deserialize_unix(attr): This is represented as seconds. :param int attr: Object to be serialized. + :return: Deserialized datetime :rtype: Datetime :raises: DeserializationError if format invalid """ @@ -1996,5 +2111,4 @@ def deserialize_unix(attr): except ValueError as err: msg = "Cannot deserialize to unix datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_service_fabric_managed_clusters_management_client.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_service_fabric_managed_clusters_management_client.py index b61627a9e445..249c1e029624 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_service_fabric_managed_clusters_management_client.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_service_fabric_managed_clusters_management_client.py @@ -37,11 +37,10 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class ServiceFabricManagedClustersManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes,name-too-long +class ServiceFabricManagedClustersManagementClient: # pylint: disable=too-many-instance-attributes,name-too-long """Service Fabric Managed Clusters Management Client. :ivar application_types: ApplicationTypesOperations operations @@ -92,7 +91,7 @@ class ServiceFabricManagedClustersManagementClient: # pylint: disable=client-ac :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 "2024-06-01-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2024-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 diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_version.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_version.py index b82e03a368ff..eae7c95b6fbd 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_version.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.1.0b1" +VERSION = "0.1.0" diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/__init__.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/__init__.py index bbd691a3802f..fdbc1bd233a2 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/__init__.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/__init__.py @@ -5,12 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._service_fabric_managed_clusters_management_client import ServiceFabricManagedClustersManagementClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._service_fabric_managed_clusters_management_client import ServiceFabricManagedClustersManagementClient # type: ignore try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -18,6 +24,6 @@ __all__ = [ "ServiceFabricManagedClustersManagementClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/_configuration.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/_configuration.py index 8c9a6ffd504f..961ce4343792 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/_configuration.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/_configuration.py @@ -14,7 +14,6 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -28,13 +27,13 @@ class ServiceFabricManagedClustersManagementClientConfiguration: # pylint: disa :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The customer subscription identifier. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-06-01-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2024-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: - api_version: str = kwargs.pop("api_version", "2024-06-01-preview") + api_version: str = kwargs.pop("api_version", "2024-11-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/_service_fabric_managed_clusters_management_client.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/_service_fabric_managed_clusters_management_client.py index 18b5f4cf268f..c9598be8a0a8 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/_service_fabric_managed_clusters_management_client.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/_service_fabric_managed_clusters_management_client.py @@ -37,11 +37,10 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class ServiceFabricManagedClustersManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes,name-too-long +class ServiceFabricManagedClustersManagementClient: # pylint: disable=too-many-instance-attributes,name-too-long """Service Fabric Managed Clusters Management Client. :ivar application_types: ApplicationTypesOperations operations @@ -92,7 +91,7 @@ class ServiceFabricManagedClustersManagementClient: # pylint: disable=client-ac :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 "2024-06-01-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2024-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 diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/__init__.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/__init__.py index 9510cbbfb9c2..87179ac04eb7 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/__init__.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/__init__.py @@ -5,25 +5,31 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._application_types_operations import ApplicationTypesOperations -from ._application_type_versions_operations import ApplicationTypeVersionsOperations -from ._applications_operations import ApplicationsOperations -from ._services_operations import ServicesOperations -from ._managed_clusters_operations import ManagedClustersOperations -from ._managed_az_resiliency_status_operations import ManagedAzResiliencyStatusOperations -from ._managed_maintenance_window_status_operations import ManagedMaintenanceWindowStatusOperations -from ._managed_apply_maintenance_window_operations import ManagedApplyMaintenanceWindowOperations -from ._managed_cluster_version_operations import ManagedClusterVersionOperations -from ._managed_unsupported_vm_sizes_operations import ManagedUnsupportedVMSizesOperations -from ._operation_status_operations import OperationStatusOperations -from ._operation_results_operations import OperationResultsOperations -from ._operations import Operations -from ._node_types_operations import NodeTypesOperations -from ._node_type_skus_operations import NodeTypeSkusOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._application_types_operations import ApplicationTypesOperations # type: ignore +from ._application_type_versions_operations import ApplicationTypeVersionsOperations # type: ignore +from ._applications_operations import ApplicationsOperations # type: ignore +from ._services_operations import ServicesOperations # type: ignore +from ._managed_clusters_operations import ManagedClustersOperations # type: ignore +from ._managed_az_resiliency_status_operations import ManagedAzResiliencyStatusOperations # type: ignore +from ._managed_maintenance_window_status_operations import ManagedMaintenanceWindowStatusOperations # type: ignore +from ._managed_apply_maintenance_window_operations import ManagedApplyMaintenanceWindowOperations # type: ignore +from ._managed_cluster_version_operations import ManagedClusterVersionOperations # type: ignore +from ._managed_unsupported_vm_sizes_operations import ManagedUnsupportedVMSizesOperations # type: ignore +from ._operation_status_operations import OperationStatusOperations # type: ignore +from ._operation_results_operations import OperationResultsOperations # type: ignore +from ._operations import Operations # type: ignore +from ._node_types_operations import NodeTypesOperations # type: ignore +from ._node_type_skus_operations import NodeTypeSkusOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -43,5 +49,5 @@ "NodeTypesOperations", "NodeTypeSkusOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_application_type_versions_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_application_type_versions_operations.py index 6aaed829c2d5..60a50d0817eb 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_application_type_versions_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_application_type_versions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -43,7 +42,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +87,7 @@ async def get( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ApplicationTypeVersionResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -142,7 +141,7 @@ async def _create_or_update_initial( parameters: Union[_models.ApplicationTypeVersionResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -223,6 +222,7 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationTypeVersionResource]: + # pylint: disable=line-too-long """Creates or updates a Service Fabric managed application type version resource. Create or update a Service Fabric managed application type version resource with the specified @@ -261,6 +261,7 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationTypeVersionResource]: + # pylint: disable=line-too-long """Creates or updates a Service Fabric managed application type version resource. Create or update a Service Fabric managed application type version resource with the specified @@ -296,6 +297,7 @@ async def begin_create_or_update( parameters: Union[_models.ApplicationTypeVersionResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationTypeVersionResource]: + # pylint: disable=line-too-long """Creates or updates a Service Fabric managed application type version resource. Create or update a Service Fabric managed application type version resource with the specified @@ -470,7 +472,7 @@ async def update( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ApplicationTypeVersionResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +532,7 @@ async def update( async def _delete_initial( self, resource_group_name: str, cluster_name: str, application_type_name: str, version: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -655,6 +657,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def list_by_application_types( self, resource_group_name: str, cluster_name: str, application_type_name: str, **kwargs: Any ) -> AsyncIterable["_models.ApplicationTypeVersionResource"]: + # pylint: disable=line-too-long """Gets the list of application type version resources created in the specified Service Fabric managed application type name resource. @@ -679,7 +682,7 @@ def list_by_application_types( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ApplicationTypeVersionResourceList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_application_types_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_application_types_operations.py index b67cdb968293..8e0c83c14d5a 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_application_types_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_application_types_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -43,7 +42,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +85,7 @@ async def get( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ApplicationTypeResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +221,7 @@ async def create_or_update( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ApplicationTypeResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -368,7 +367,7 @@ async def update( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ApplicationTypeResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -427,7 +426,7 @@ async def update( async def _delete_initial( self, resource_group_name: str, cluster_name: str, application_type_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -541,6 +540,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def list( self, resource_group_name: str, cluster_name: str, **kwargs: Any ) -> AsyncIterable["_models.ApplicationTypeResource"]: + # pylint: disable=line-too-long """Gets the list of application type name resources created in the specified Service Fabric managed cluster resource. @@ -563,7 +563,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ApplicationTypeResourceList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_applications_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_applications_operations.py index 1811d46eef68..4d40d3272863 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_applications_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_applications_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -46,7 +46,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -73,7 +73,7 @@ def __init__(self, *args, **kwargs) -> None: async def _read_upgrade_initial( self, resource_group_name: str, cluster_name: str, application_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -193,7 +193,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_rollback_initial( self, resource_group_name: str, cluster_name: str, application_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -318,7 +318,7 @@ async def _resume_upgrade_initial( parameters: Union[_models.RuntimeResumeApplicationUpgradeParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -544,7 +544,7 @@ async def get( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ApplicationResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +596,7 @@ async def _create_or_update_initial( parameters: Union[_models.ApplicationResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -898,7 +898,7 @@ async def update( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ApplicationResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -957,7 +957,7 @@ async def update( async def _delete_initial( self, resource_group_name: str, cluster_name: str, application_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1099,7 +1099,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ApplicationResourceList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_apply_maintenance_window_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_apply_maintenance_window_operations.py index fcdd550386a6..5b8594cf8e9c 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_apply_maintenance_window_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_apply_maintenance_window_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -54,9 +53,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def post( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> None: + async def post(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> None: """Action to Apply Maintenance window on the Service Fabric Managed Clusters, right now. Any pending update will be applied. @@ -71,7 +68,7 @@ async def post( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_az_resiliency_status_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_az_resiliency_status_operations.py index fa5aba0e9e7c..7dac5853fc9a 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_az_resiliency_status_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_az_resiliency_status_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +70,7 @@ async def get( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ManagedAzResiliencyStatus :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_cluster_version_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_cluster_version_operations.py index 0abf99af0766..22044eb4db52 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_cluster_version_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_cluster_version_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union +from typing import Any, Callable, Dict, List, Optional, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -34,7 +33,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +73,7 @@ async def get(self, location: str, cluster_version: str, **kwargs: Any) -> _mode :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ManagedClusterCodeVersionResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +142,7 @@ async def get_by_environment( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ManagedClusterCodeVersionResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -200,7 +199,7 @@ async def list(self, location: str, **kwargs: Any) -> List[_models.ManagedCluste :rtype: list[~azure.mgmt.servicefabricmanagedclusters.models.ManagedClusterCodeVersionResult] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -261,7 +260,7 @@ async def list_by_environment( :rtype: list[~azure.mgmt.servicefabricmanagedclusters.models.ManagedClusterCodeVersionResult] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_clusters_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_clusters_operations.py index 60cfde9d3758..be6046daabbc 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_clusters_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_clusters_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -35,16 +35,20 @@ from ...operations._managed_clusters_operations import ( build_create_or_update_request, build_delete_request, + build_get_fault_simulation_request, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, + build_list_fault_simulation_request, + build_start_fault_simulation_request, + build_stop_fault_simulation_request, build_update_request, ) if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,6 +72,657 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + async def _start_fault_simulation_initial( + self, + resource_group_name: str, + cluster_name: str, + parameters: Union[_models.FaultSimulationParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FaultSimulationParameters") + + _request = build_start_fault_simulation_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_start_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: _models.FaultSimulationParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FaultSimulation]: + """Starts a fault simulation on the node type. + + Starts a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameters describing the fault simulation. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_start_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FaultSimulation]: + """Starts a fault simulation on the node type. + + Starts a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameters describing the fault simulation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_start_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: Union[_models.FaultSimulationParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FaultSimulation]: + """Starts a fault simulation on the node type. + + Starts a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameters describing the fault simulation. Is either a + FaultSimulationParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FaultSimulation] = 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_fault_simulation_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("FaultSimulation", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + 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[_models.FaultSimulation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FaultSimulation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _stop_fault_simulation_initial( + self, + resource_group_name: str, + cluster_name: str, + parameters: Union[_models.FaultSimulationIdParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FaultSimulationIdParameters") + + _request = build_stop_fault_simulation_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_stop_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: _models.FaultSimulationIdParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FaultSimulation]: + """Stops a fault simulation on the node type. + + Stops a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameter with fault simulation id. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationIdParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_stop_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FaultSimulation]: + """Stops a fault simulation on the node type. + + Stops a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameter with fault simulation id. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_stop_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: Union[_models.FaultSimulationIdParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FaultSimulation]: + """Stops a fault simulation on the node type. + + Stops a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameter with fault simulation id. Is either a FaultSimulationIdParameters + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationIdParameters + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FaultSimulation] = 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_fault_simulation_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("FaultSimulation", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + 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[_models.FaultSimulation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FaultSimulation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def get_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: _models.FaultSimulationIdParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FaultSimulation: + """Gets a fault simulation byt the simulationId. + + Gets a fault simulation byt the simulationId. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameter with fault simulation id. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationIdParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FaultSimulation or the result of cls(response) + :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def get_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FaultSimulation: + """Gets a fault simulation byt the simulationId. + + Gets a fault simulation byt the simulationId. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameter with fault simulation id. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: FaultSimulation or the result of cls(response) + :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def get_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: Union[_models.FaultSimulationIdParameters, IO[bytes]], + **kwargs: Any + ) -> _models.FaultSimulation: + """Gets a fault simulation byt the simulationId. + + Gets a fault simulation byt the simulationId. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameter with fault simulation id. Is either a FaultSimulationIdParameters + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationIdParameters + or IO[bytes] + :return: FaultSimulation or the result of cls(response) + :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FaultSimulation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FaultSimulationIdParameters") + + _request = build_get_fault_simulation_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FaultSimulation", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_fault_simulation( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncIterable["_models.FaultSimulation"]: + """Gets a fault simulation byt the simulationId. + + Gets a fault simulation byt the simulationId. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :return: An iterator like instance of either FaultSimulation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.FaultSimulationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 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_fault_simulation_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FaultSimulationListResult", 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) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any @@ -90,7 +745,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +825,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ManagedC api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -246,7 +901,7 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -296,7 +951,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -578,7 +1233,7 @@ async def update( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -634,7 +1289,7 @@ async def update( return deserialized # type: ignore async def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_maintenance_window_status_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_maintenance_window_status_operations.py index 21bfbe0503e3..b08a8c55758e 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_maintenance_window_status_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_maintenance_window_status_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +68,7 @@ async def get( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ManagedMaintenanceWindowStatus :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_unsupported_vm_sizes_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_unsupported_vm_sizes_operations.py index 0045c36c58e2..3555160fba10 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_unsupported_vm_sizes_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_managed_unsupported_vm_sizes_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -32,7 +31,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +75,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.ManagedVM api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedVMSizesResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -153,7 +152,7 @@ async def get(self, location: str, vm_size: str, **kwargs: Any) -> _models.Manag :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ManagedVMSize :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_node_type_skus_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_node_type_skus_operations.py index af35daf0a86d..559caf67546f 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_node_type_skus_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_node_type_skus_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +80,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.NodeTypeListSkuResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_node_types_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_node_types_operations.py index fe5ea6617210..9d3cec4d9dfd 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_node_types_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_node_types_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,24 +34,31 @@ from ... import models as _models from ...operations._node_types_operations import ( build_create_or_update_request, + build_deallocate_request, build_delete_node_request, build_delete_request, + build_get_fault_simulation_request, build_get_request, build_list_by_managed_clusters_request, + build_list_fault_simulation_request, + build_redeploy_request, build_reimage_request, build_restart_request, + build_start_fault_simulation_request, + build_start_request, + build_stop_fault_simulation_request, build_update_request, ) if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class NodeTypesOperations: +class NodeTypesOperations: # pylint: disable=too-many-public-methods """ .. warning:: **DO NOT** instantiate this class directly. @@ -70,92 +77,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list_by_managed_clusters( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncIterable["_models.NodeType"]: - """Gets the list of Node types of the specified managed cluster. - - Gets all Node types of the specified managed cluster. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. Required. - :type cluster_name: str - :return: An iterator like instance of either NodeType or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicefabricmanagedclusters.models.NodeType] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NodeTypeListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_managed_clusters_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NodeTypeListResult", 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) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - async def _restart_initial( self, resource_group_name: str, @@ -164,7 +85,7 @@ async def _restart_initial( parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +299,7 @@ async def _reimage_initial( parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -592,7 +513,7 @@ async def _delete_node_initial( parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -798,77 +719,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_name: str, node_type_name: str, **kwargs: Any - ) -> _models.NodeType: - """Gets a Service Fabric node type. - - Get a Service Fabric node type of a given managed cluster. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. Required. - :type cluster_name: str - :param node_type_name: The name of the node type. Required. - :type node_type_name: str - :return: NodeType or the result of cls(response) - :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.NodeType - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NodeType] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - node_type_name=node_type_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("NodeType", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( + async def _deallocate_initial( self, resource_group_name: str, cluster_name: str, node_type_name: str, - parameters: Union[_models.NodeType, IO[bytes]], + parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -889,9 +748,9 @@ async def _create_or_update_initial( if isinstance(parameters, (IOBase, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, "NodeType") + _json = self._serialize.body(parameters, "NodeTypeActionParameters") - _request = build_create_or_update_request( + _request = build_deallocate_request( resource_group_name=resource_group_name, cluster_name=cluster_name, node_type_name=node_type_name, @@ -937,19 +796,20 @@ async def _create_or_update_initial( return deserialized # type: ignore @overload - async def begin_create_or_update( + async def begin_deallocate( self, resource_group_name: str, cluster_name: str, node_type_name: str, - parameters: _models.NodeType, + parameters: _models.NodeTypeActionParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NodeType]: - """Creates or updates a Service Fabric node type. + ) -> AsyncLROPoller[None]: + """Deallocates one or more nodes on the node type. - Create or update a Service Fabric node type of a given managed cluster. + Deallocates one or more nodes on the node type. It will disable the fabric nodes, trigger a + shutdown on the VMs and release them from the cluster. :param resource_group_name: The name of the resource group. Required. :type resource_group_name: str @@ -957,20 +817,18 @@ async def begin_create_or_update( :type cluster_name: str :param node_type_name: The name of the node type. Required. :type node_type_name: str - :param parameters: The node type resource. Required. - :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeType + :param parameters: parameters for deallocate action. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeActionParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either NodeType or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.NodeType] + :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: """ @overload - async def begin_create_or_update( + async def begin_deallocate( self, resource_group_name: str, cluster_name: str, @@ -979,10 +837,11 @@ async def begin_create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NodeType]: - """Creates or updates a Service Fabric node type. + ) -> AsyncLROPoller[None]: + """Deallocates one or more nodes on the node type. - Create or update a Service Fabric node type of a given managed cluster. + Deallocates one or more nodes on the node type. It will disable the fabric nodes, trigger a + shutdown on the VMs and release them from the cluster. :param resource_group_name: The name of the resource group. Required. :type resource_group_name: str @@ -990,30 +849,29 @@ async def begin_create_or_update( :type cluster_name: str :param node_type_name: The name of the node type. Required. :type node_type_name: str - :param parameters: The node type resource. Required. + :param parameters: parameters for deallocate action. Required. :type parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either NodeType or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.NodeType] + :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: """ @distributed_trace_async - async def begin_create_or_update( + async def begin_deallocate( self, resource_group_name: str, cluster_name: str, node_type_name: str, - parameters: Union[_models.NodeType, IO[bytes]], + parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.NodeType]: - """Creates or updates a Service Fabric node type. + ) -> AsyncLROPoller[None]: + """Deallocates one or more nodes on the node type. - Create or update a Service Fabric node type of a given managed cluster. + Deallocates one or more nodes on the node type. It will disable the fabric nodes, trigger a + shutdown on the VMs and release them from the cluster. :param resource_group_name: The name of the resource group. Required. :type resource_group_name: str @@ -1021,13 +879,12 @@ async def begin_create_or_update( :type cluster_name: str :param node_type_name: The name of the node type. Required. :type node_type_name: str - :param parameters: The node type resource. Is either a NodeType type or a IO[bytes] type. - Required. - :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeType or IO[bytes] - :return: An instance of AsyncLROPoller that returns either NodeType or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.NodeType] + :param parameters: parameters for deallocate action. Is either a NodeTypeActionParameters type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeActionParameters or + IO[bytes] + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1035,12 +892,12 @@ async def begin_create_or_update( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NodeType] = kwargs.pop("cls", None) + 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._create_or_update_initial( + raw_result = await self._deallocate_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, node_type_name=node_type_name, @@ -1055,11 +912,9 @@ async def begin_create_or_update( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NodeType", pipeline_response.http_response) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1070,61 +925,1401 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.NodeType].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.NodeType]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @overload - async def update( + async def _start_initial( self, resource_group_name: str, cluster_name: str, node_type_name: str, - parameters: _models.NodeTypeUpdateParameters, - *, - content_type: str = "application/json", + parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], **kwargs: Any - ) -> _models.NodeType: - """Update the tags of a node type resource of a given managed cluster. + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - Update the configuration of a node type of a given managed cluster, only updating tags. + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. Required. - :type cluster_name: str - :param node_type_name: The name of the node type. Required. - :type node_type_name: str - :param parameters: The parameters to update the node type configuration. Required. - :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NodeType or the result of cls(response) - :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.NodeType - :raises ~azure.core.exceptions.HttpResponseError: - """ + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - @overload - async def update( - self, - resource_group_name: str, - cluster_name: str, - node_type_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NodeTypeActionParameters") + + _request = build_start_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_start( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: _models.NodeTypeActionParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Starts one or more nodes on the node type. + + Starts one or more nodes on the node type. It will trigger an allocation of the fabric node if + needed and activate them. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters for start action. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeActionParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @overload + async def begin_start( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Starts one or more nodes on the node type. + + Starts one or more nodes on the node type. It will trigger an allocation of the fabric node if + needed and activate them. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters for start action. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @distributed_trace_async + async def begin_start( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Starts one or more nodes on the node type. + + Starts one or more nodes on the node type. It will trigger an allocation of the fabric node if + needed and activate them. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters for start action. Is either a NodeTypeActionParameters type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeActionParameters or + IO[bytes] + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._start_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _redeploy_initial( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NodeTypeActionParameters") + + _request = build_redeploy_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_redeploy( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: _models.NodeTypeActionParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Redeploys one or more nodes on the node type. + + Redeploys one or more nodes on the node type. It will disable the fabric nodes, trigger a shut + down on the VMs, move them to a new node, and power them back on. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters for redeploy action. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeActionParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @overload + async def begin_redeploy( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Redeploys one or more nodes on the node type. + + Redeploys one or more nodes on the node type. It will disable the fabric nodes, trigger a shut + down on the VMs, move them to a new node, and power them back on. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters for redeploy action. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @distributed_trace_async + async def begin_redeploy( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Redeploys one or more nodes on the node type. + + Redeploys one or more nodes on the node type. It will disable the fabric nodes, trigger a shut + down on the VMs, move them to a new node, and power them back on. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters for redeploy action. Is either a NodeTypeActionParameters type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeActionParameters or + IO[bytes] + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._redeploy_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _start_fault_simulation_initial( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.FaultSimulationParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FaultSimulationParameters") + + _request = build_start_fault_simulation_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_start_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: _models.FaultSimulationParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FaultSimulation]: + """Starts a fault simulation on the node type. + + Starts a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters describing the fault simulation. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_start_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FaultSimulation]: + """Starts a fault simulation on the node type. + + Starts a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters describing the fault simulation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_start_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.FaultSimulationParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FaultSimulation]: + """Starts a fault simulation on the node type. + + Starts a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters describing the fault simulation. Is either a + FaultSimulationParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FaultSimulation] = 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_fault_simulation_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("FaultSimulation", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + 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[_models.FaultSimulation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FaultSimulation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _stop_fault_simulation_initial( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.FaultSimulationIdParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FaultSimulationIdParameters") + + _request = build_stop_fault_simulation_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_stop_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: _models.FaultSimulationIdParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FaultSimulation]: + """Stops a fault simulation on the node type. + + Stops a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameter with fault simulation id. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationIdParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_stop_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FaultSimulation]: + """Stops a fault simulation on the node type. + + Stops a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameter with fault simulation id. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_stop_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.FaultSimulationIdParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FaultSimulation]: + """Stops a fault simulation on the node type. + + Stops a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameter with fault simulation id. Is either a FaultSimulationIdParameters + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationIdParameters + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FaultSimulation] = 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_fault_simulation_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("FaultSimulation", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + 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[_models.FaultSimulation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FaultSimulation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def get_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: _models.FaultSimulationIdParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FaultSimulation: + """Gets a fault simulation byt the simulationId. + + Gets a fault simulation byt the simulationId. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameter with fault simulation id. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationIdParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FaultSimulation or the result of cls(response) + :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def get_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FaultSimulation: + """Gets a fault simulation byt the simulationId. + + Gets a fault simulation byt the simulationId. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameter with fault simulation id. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: FaultSimulation or the result of cls(response) + :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def get_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.FaultSimulationIdParameters, IO[bytes]], + **kwargs: Any + ) -> _models.FaultSimulation: + """Gets a fault simulation byt the simulationId. + + Gets a fault simulation byt the simulationId. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameter with fault simulation id. Is either a FaultSimulationIdParameters + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationIdParameters + or IO[bytes] + :return: FaultSimulation or the result of cls(response) + :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FaultSimulation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FaultSimulationIdParameters") + + _request = build_get_fault_simulation_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FaultSimulation", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_fault_simulation( + self, resource_group_name: str, cluster_name: str, node_type_name: str, **kwargs: Any + ) -> AsyncIterable["_models.FaultSimulation"]: + """Gets a fault simulation byt the simulationId. + + Gets a fault simulation byt the simulationId. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :return: An iterator like instance of either FaultSimulation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.FaultSimulationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 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_fault_simulation_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FaultSimulationListResult", 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) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_managed_clusters( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NodeType"]: + """Gets the list of Node types of the specified managed cluster. + + Gets all Node types of the specified managed cluster. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :return: An iterator like instance of either NodeType or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicefabricmanagedclusters.models.NodeType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NodeTypeListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 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_managed_clusters_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NodeTypeListResult", 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) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, node_type_name: str, **kwargs: Any + ) -> _models.NodeType: + """Gets a Service Fabric node type. + + Get a Service Fabric node type of a given managed cluster. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :return: NodeType or the result of cls(response) + :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.NodeType + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NodeType] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NodeType", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.NodeType, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NodeType") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: _models.NodeType, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NodeType]: + """Creates or updates a Service Fabric node type. + + Create or update a Service Fabric node type of a given managed cluster. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: The node type resource. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeType + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NodeType or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.NodeType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any - ) -> _models.NodeType: - """Update the tags of a node type resource of a given managed cluster. + ) -> AsyncLROPoller[_models.NodeType]: + """Creates or updates a Service Fabric node type. - Update the configuration of a node type of a given managed cluster, only updating tags. + Create or update a Service Fabric node type of a given managed cluster. :param resource_group_name: The name of the resource group. Required. :type resource_group_name: str @@ -1132,28 +2327,30 @@ async def update( :type cluster_name: str :param node_type_name: The name of the node type. Required. :type node_type_name: str - :param parameters: The parameters to update the node type configuration. Required. + :param parameters: The node type resource. Required. :type parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: NodeType or the result of cls(response) - :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.NodeType + :return: An instance of AsyncLROPoller that returns either NodeType or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.NodeType] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def update( + async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, node_type_name: str, - parameters: Union[_models.NodeTypeUpdateParameters, IO[bytes]], + parameters: Union[_models.NodeType, IO[bytes]], **kwargs: Any - ) -> _models.NodeType: - """Update the tags of a node type resource of a given managed cluster. + ) -> AsyncLROPoller[_models.NodeType]: + """Creates or updates a Service Fabric node type. - Update the configuration of a node type of a given managed cluster, only updating tags. + Create or update a Service Fabric node type of a given managed cluster. :param resource_group_name: The name of the resource group. Required. :type resource_group_name: str @@ -1161,15 +2358,74 @@ async def update( :type cluster_name: str :param node_type_name: The name of the node type. Required. :type node_type_name: str - :param parameters: The parameters to update the node type configuration. Is either a - NodeTypeUpdateParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeUpdateParameters or - IO[bytes] - :return: NodeType or the result of cls(response) - :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.NodeType + :param parameters: The node type resource. Is either a NodeType type or a IO[bytes] type. + Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeType or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NodeType or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.NodeType] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NodeType] = 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, + cluster_name=cluster_name, + node_type_name=node_type_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NodeType", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + 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[_models.NodeType].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NodeType]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.NodeTypeUpdateParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1182,7 +2438,7 @@ async def update( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NodeType] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1206,29 +2462,186 @@ async def update( ) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("NodeType", pipeline_response.http_response) + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: _models.NodeTypeUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NodeType]: + """Update the tags of a node type resource of a given managed cluster. + + Update the configuration of a node type of a given managed cluster, only updating tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: The parameters to update the node type configuration. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeUpdateParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NodeType or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.NodeType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NodeType]: + """Update the tags of a node type resource of a given managed cluster. + + Update the configuration of a node type of a given managed cluster, only updating tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: The parameters to update the node type configuration. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either NodeType or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.NodeType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.NodeTypeUpdateParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NodeType]: + """Update the tags of a node type resource of a given managed cluster. + + Update the configuration of a node type of a given managed cluster, only updating tags. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: The parameters to update the node type configuration. Is either a + NodeTypeUpdateParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeUpdateParameters or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either NodeType or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicefabricmanagedclusters.models.NodeType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NodeType] = 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._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NodeType", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + 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[_models.NodeType].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NodeType]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + async def _delete_initial( self, resource_group_name: str, cluster_name: str, node_type_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_operation_results_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_operation_results_operations.py index cec5f1fb6cbc..33c0dfcf76f9 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_operation_results_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_operation_results_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -54,9 +53,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get( # pylint: disable=inconsistent-return-statements - self, location: str, operation_id: str, **kwargs: Any - ) -> None: + async def get(self, location: str, operation_id: str, **kwargs: Any) -> None: """Get long running operation result. Get long running operation result. @@ -70,7 +67,7 @@ async def get( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_operation_status_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_operation_status_operations.py index b9cf76acde36..de24e4418059 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_operation_status_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_operation_status_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +67,7 @@ async def get(self, location: str, operation_id: str, **kwargs: Any) -> _models. :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.LongRunningOperationResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_operations.py index 197f999db2c1..023eb1dbeb34 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationResult"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_services_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_services_operations.py index d618f95b2b0e..7bd7f401a340 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_services_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_services_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -43,7 +42,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +88,7 @@ async def get( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +142,7 @@ async def _create_or_update_initial( parameters: Union[_models.ServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -470,7 +469,7 @@ async def update( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +529,7 @@ async def update( async def _delete_initial( self, resource_group_name: str, cluster_name: str, application_name: str, service_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -679,7 +678,7 @@ def list_by_applications( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServiceResourceList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/models/__init__.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/models/__init__.py index 9e5b588e179c..d8000323cbcd 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/models/__init__.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/models/__init__.py @@ -5,151 +5,170 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models_py3 import AddRemoveIncrementalNamedPartitionScalingMechanism -from ._models_py3 import AdditionalNetworkInterfaceConfiguration -from ._models_py3 import ApplicationHealthPolicy -from ._models_py3 import ApplicationResource -from ._models_py3 import ApplicationResourceList -from ._models_py3 import ApplicationTypeResource -from ._models_py3 import ApplicationTypeResourceList -from ._models_py3 import ApplicationTypeUpdateParameters -from ._models_py3 import ApplicationTypeVersionResource -from ._models_py3 import ApplicationTypeVersionResourceList -from ._models_py3 import ApplicationTypeVersionUpdateParameters -from ._models_py3 import ApplicationTypeVersionsCleanupPolicy -from ._models_py3 import ApplicationUpdateParameters -from ._models_py3 import ApplicationUpgradePolicy -from ._models_py3 import ApplicationUserAssignedIdentity -from ._models_py3 import AvailableOperationDisplay -from ._models_py3 import AveragePartitionLoadScalingTrigger -from ._models_py3 import AverageServiceLoadScalingTrigger -from ._models_py3 import AzureActiveDirectory -from ._models_py3 import ClientCertificate -from ._models_py3 import ClusterHealthPolicy -from ._models_py3 import ClusterMonitoringPolicy -from ._models_py3 import ClusterUpgradeDeltaHealthPolicy -from ._models_py3 import ClusterUpgradePolicy -from ._models_py3 import EndpointRangeDescription -from ._models_py3 import ErrorModel -from ._models_py3 import ErrorModelError -from ._models_py3 import FrontendConfiguration -from ._models_py3 import IpConfiguration -from ._models_py3 import IpConfigurationPublicIPAddressConfiguration -from ._models_py3 import IpTag -from ._models_py3 import LoadBalancingRule -from ._models_py3 import LongRunningOperationResult -from ._models_py3 import ManagedAzResiliencyStatus -from ._models_py3 import ManagedCluster -from ._models_py3 import ManagedClusterCodeVersionResult -from ._models_py3 import ManagedClusterListResult -from ._models_py3 import ManagedClusterUpdateParameters -from ._models_py3 import ManagedIdentity -from ._models_py3 import ManagedMaintenanceWindowStatus -from ._models_py3 import ManagedProxyResource -from ._models_py3 import ManagedVMSize -from ._models_py3 import ManagedVMSizesResult -from ._models_py3 import NamedPartitionScheme -from ._models_py3 import NetworkSecurityRule -from ._models_py3 import NodeType -from ._models_py3 import NodeTypeActionParameters -from ._models_py3 import NodeTypeAvailableSku -from ._models_py3 import NodeTypeListResult -from ._models_py3 import NodeTypeListSkuResult -from ._models_py3 import NodeTypeNatConfig -from ._models_py3 import NodeTypeSku -from ._models_py3 import NodeTypeSkuCapacity -from ._models_py3 import NodeTypeSupportedSku -from ._models_py3 import NodeTypeUpdateParameters -from ._models_py3 import OperationListResult -from ._models_py3 import OperationResult -from ._models_py3 import Partition -from ._models_py3 import PartitionInstanceCountScaleMechanism -from ._models_py3 import ProxyResource -from ._models_py3 import Resource -from ._models_py3 import ResourceAzStatus -from ._models_py3 import RollingUpgradeMonitoringPolicy -from ._models_py3 import RuntimeResumeApplicationUpgradeParameters -from ._models_py3 import ScalingMechanism -from ._models_py3 import ScalingPolicy -from ._models_py3 import ScalingTrigger -from ._models_py3 import ServiceCorrelation -from ._models_py3 import ServiceEndpoint -from ._models_py3 import ServiceLoadMetric -from ._models_py3 import ServicePlacementInvalidDomainPolicy -from ._models_py3 import ServicePlacementNonPartiallyPlaceServicePolicy -from ._models_py3 import ServicePlacementPolicy -from ._models_py3 import ServicePlacementPreferPrimaryDomainPolicy -from ._models_py3 import ServicePlacementRequireDomainDistributionPolicy -from ._models_py3 import ServicePlacementRequiredDomainPolicy -from ._models_py3 import ServiceResource -from ._models_py3 import ServiceResourceList -from ._models_py3 import ServiceResourceProperties -from ._models_py3 import ServiceResourcePropertiesBase -from ._models_py3 import ServiceTypeHealthPolicy -from ._models_py3 import ServiceUpdateParameters -from ._models_py3 import SettingsParameterDescription -from ._models_py3 import SettingsSectionDescription -from ._models_py3 import SingletonPartitionScheme -from ._models_py3 import Sku -from ._models_py3 import StatefulServiceProperties -from ._models_py3 import StatelessServiceProperties -from ._models_py3 import SubResource -from ._models_py3 import Subnet -from ._models_py3 import SystemData -from ._models_py3 import UniformInt64RangePartitionScheme -from ._models_py3 import UserAssignedIdentity -from ._models_py3 import VMSSExtension -from ._models_py3 import VMSize -from ._models_py3 import VaultCertificate -from ._models_py3 import VaultSecretGroup -from ._models_py3 import VmApplication -from ._models_py3 import VmImagePlan -from ._models_py3 import VmManagedIdentity -from ._models_py3 import VmssDataDisk +from typing import TYPE_CHECKING -from ._service_fabric_managed_clusters_management_client_enums import Access -from ._service_fabric_managed_clusters_management_client_enums import AutoGeneratedDomainNameLabelScope -from ._service_fabric_managed_clusters_management_client_enums import ClusterState -from ._service_fabric_managed_clusters_management_client_enums import ClusterUpgradeCadence -from ._service_fabric_managed_clusters_management_client_enums import ClusterUpgradeMode -from ._service_fabric_managed_clusters_management_client_enums import Direction -from ._service_fabric_managed_clusters_management_client_enums import DiskType -from ._service_fabric_managed_clusters_management_client_enums import EvictionPolicyType -from ._service_fabric_managed_clusters_management_client_enums import FailureAction -from ._service_fabric_managed_clusters_management_client_enums import IPAddressType -from ._service_fabric_managed_clusters_management_client_enums import ManagedClusterAddOnFeature -from ._service_fabric_managed_clusters_management_client_enums import ManagedClusterVersionEnvironment -from ._service_fabric_managed_clusters_management_client_enums import ManagedIdentityType -from ._service_fabric_managed_clusters_management_client_enums import ManagedResourceProvisioningState -from ._service_fabric_managed_clusters_management_client_enums import MoveCost -from ._service_fabric_managed_clusters_management_client_enums import NodeTypeSkuScaleType -from ._service_fabric_managed_clusters_management_client_enums import NsgProtocol -from ._service_fabric_managed_clusters_management_client_enums import OsType -from ._service_fabric_managed_clusters_management_client_enums import PartitionScheme -from ._service_fabric_managed_clusters_management_client_enums import PrivateEndpointNetworkPolicies -from ._service_fabric_managed_clusters_management_client_enums import PrivateIPAddressVersion -from ._service_fabric_managed_clusters_management_client_enums import PrivateLinkServiceNetworkPolicies -from ._service_fabric_managed_clusters_management_client_enums import ProbeProtocol -from ._service_fabric_managed_clusters_management_client_enums import Protocol -from ._service_fabric_managed_clusters_management_client_enums import PublicIPAddressVersion -from ._service_fabric_managed_clusters_management_client_enums import RollingUpgradeMode -from ._service_fabric_managed_clusters_management_client_enums import SecurityType -from ._service_fabric_managed_clusters_management_client_enums import ServiceCorrelationScheme -from ._service_fabric_managed_clusters_management_client_enums import ServiceKind -from ._service_fabric_managed_clusters_management_client_enums import ServiceLoadMetricWeight -from ._service_fabric_managed_clusters_management_client_enums import ServicePackageActivationMode -from ._service_fabric_managed_clusters_management_client_enums import ServicePlacementPolicyType -from ._service_fabric_managed_clusters_management_client_enums import ServiceScalingMechanismKind -from ._service_fabric_managed_clusters_management_client_enums import ServiceScalingTriggerKind -from ._service_fabric_managed_clusters_management_client_enums import SkuName -from ._service_fabric_managed_clusters_management_client_enums import UpdateType -from ._service_fabric_managed_clusters_management_client_enums import UpgradeMode -from ._service_fabric_managed_clusters_management_client_enums import VmSetupAction -from ._service_fabric_managed_clusters_management_client_enums import VmssExtensionSetupOrder -from ._service_fabric_managed_clusters_management_client_enums import ZonalUpdateMode +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models_py3 import ( # type: ignore + AddRemoveIncrementalNamedPartitionScalingMechanism, + AdditionalNetworkInterfaceConfiguration, + ApplicationHealthPolicy, + ApplicationResource, + ApplicationResourceList, + ApplicationTypeResource, + ApplicationTypeResourceList, + ApplicationTypeUpdateParameters, + ApplicationTypeVersionResource, + ApplicationTypeVersionResourceList, + ApplicationTypeVersionUpdateParameters, + ApplicationTypeVersionsCleanupPolicy, + ApplicationUpdateParameters, + ApplicationUpgradePolicy, + ApplicationUserAssignedIdentity, + AvailableOperationDisplay, + AveragePartitionLoadScalingTrigger, + AverageServiceLoadScalingTrigger, + AzureActiveDirectory, + ClientCertificate, + ClusterHealthPolicy, + ClusterMonitoringPolicy, + ClusterUpgradeDeltaHealthPolicy, + ClusterUpgradePolicy, + EndpointRangeDescription, + ErrorModel, + ErrorModelError, + FaultSimulation, + FaultSimulationIdParameters, + FaultSimulationListResult, + FaultSimulationParameters, + FrontendConfiguration, + IpConfiguration, + IpConfigurationPublicIPAddressConfiguration, + IpTag, + LoadBalancingRule, + LongRunningOperationResult, + ManagedAzResiliencyStatus, + ManagedCluster, + ManagedClusterCodeVersionResult, + ManagedClusterListResult, + ManagedClusterUpdateParameters, + ManagedIdentity, + ManagedMaintenanceWindowStatus, + ManagedProxyResource, + ManagedVMSize, + ManagedVMSizesResult, + NamedPartitionScheme, + NetworkSecurityRule, + NodeType, + NodeTypeActionParameters, + NodeTypeAvailableSku, + NodeTypeFaultSimulation, + NodeTypeListResult, + NodeTypeListSkuResult, + NodeTypeNatConfig, + NodeTypeSku, + NodeTypeSkuCapacity, + NodeTypeSupportedSku, + NodeTypeUpdateParameters, + OperationListResult, + OperationResult, + Partition, + PartitionInstanceCountScaleMechanism, + ProxyResource, + Resource, + ResourceAzStatus, + RollingUpgradeMonitoringPolicy, + RuntimeResumeApplicationUpgradeParameters, + ScalingMechanism, + ScalingPolicy, + ScalingTrigger, + ServiceCorrelation, + ServiceEndpoint, + ServiceLoadMetric, + ServicePlacementInvalidDomainPolicy, + ServicePlacementNonPartiallyPlaceServicePolicy, + ServicePlacementPolicy, + ServicePlacementPreferPrimaryDomainPolicy, + ServicePlacementRequireDomainDistributionPolicy, + ServicePlacementRequiredDomainPolicy, + ServiceResource, + ServiceResourceList, + ServiceResourceProperties, + ServiceResourcePropertiesBase, + ServiceTypeHealthPolicy, + ServiceUpdateParameters, + SettingsParameterDescription, + SettingsSectionDescription, + SingletonPartitionScheme, + Sku, + StatefulServiceProperties, + StatelessServiceProperties, + SubResource, + Subnet, + SystemData, + UniformInt64RangePartitionScheme, + UserAssignedIdentity, + VMSSExtension, + VMSize, + VaultCertificate, + VaultSecretGroup, + VmApplication, + VmImagePlan, + VmManagedIdentity, + VmssDataDisk, + ZoneFaultSimulationParameters, +) + +from ._service_fabric_managed_clusters_management_client_enums import ( # type: ignore + Access, + AutoGeneratedDomainNameLabelScope, + ClusterState, + ClusterUpgradeCadence, + ClusterUpgradeMode, + Direction, + DiskType, + EvictionPolicyType, + FailureAction, + FaultKind, + FaultSimulationStatus, + IPAddressType, + ManagedClusterAddOnFeature, + ManagedClusterVersionEnvironment, + ManagedIdentityType, + ManagedResourceProvisioningState, + MoveCost, + NodeTypeSkuScaleType, + NsgProtocol, + OsType, + PartitionScheme, + PrivateEndpointNetworkPolicies, + PrivateIPAddressVersion, + PrivateLinkServiceNetworkPolicies, + ProbeProtocol, + Protocol, + PublicIPAddressVersion, + RollingUpgradeMode, + SecurityType, + ServiceCorrelationScheme, + ServiceKind, + ServiceLoadMetricWeight, + ServicePackageActivationMode, + ServicePlacementPolicyType, + ServiceScalingMechanismKind, + ServiceScalingTriggerKind, + SkuName, + UpdateType, + UpgradeMode, + VmSetupAction, + VmssExtensionSetupOrder, + ZonalUpdateMode, +) from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -180,6 +199,10 @@ "EndpointRangeDescription", "ErrorModel", "ErrorModelError", + "FaultSimulation", + "FaultSimulationIdParameters", + "FaultSimulationListResult", + "FaultSimulationParameters", "FrontendConfiguration", "IpConfiguration", "IpConfigurationPublicIPAddressConfiguration", @@ -201,6 +224,7 @@ "NodeType", "NodeTypeActionParameters", "NodeTypeAvailableSku", + "NodeTypeFaultSimulation", "NodeTypeListResult", "NodeTypeListSkuResult", "NodeTypeNatConfig", @@ -254,6 +278,7 @@ "VmImagePlan", "VmManagedIdentity", "VmssDataDisk", + "ZoneFaultSimulationParameters", "Access", "AutoGeneratedDomainNameLabelScope", "ClusterState", @@ -263,6 +288,8 @@ "DiskType", "EvictionPolicyType", "FailureAction", + "FaultKind", + "FaultSimulationStatus", "IPAddressType", "ManagedClusterAddOnFeature", "ManagedClusterVersionEnvironment", @@ -295,5 +322,5 @@ "VmssExtensionSetupOrder", "ZonalUpdateMode", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/models/_models_py3.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/models/_models_py3.py index 2db8d6240e93..645340cd626a 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/models/_models_py3.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/models/_models_py3.py @@ -1,5 +1,5 @@ -# coding=utf-8 # 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. @@ -16,10 +16,9 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -304,7 +303,7 @@ def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, s self.system_data = None -class ApplicationResource(ProxyResource): # pylint: disable=too-many-instance-attributes +class ApplicationResource(ProxyResource): """The application resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -1567,6 +1566,177 @@ def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, self.message = message +class FaultSimulation(_serialization.Model): + """Fault simulation object with status. + + :ivar cluster_id: Cluster identifier asociated to the fault simulation. + :vartype cluster_id: str + :ivar simulation_id: Simulation identifier. + :vartype simulation_id: str + :ivar operation_id: Current or latest asyncronos operation identifier on the fault simulation. + :vartype operation_id: str + :ivar start_time: The start time of the fault simulation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the fault simulation. + :vartype end_time: ~datetime.datetime + :ivar status: Fault simulation status. Known values are: "Starting", "Active", "Stopping", + "Done", "StartFailed", and "StopFailed". + :vartype status: str or ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationStatus + :ivar node_type_fault_simulation: List of node type simulations asociated with the cluster + fault simulation. + :vartype node_type_fault_simulation: + list[~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeFaultSimulation] + :ivar parameters: Fault simulation parameters. + :vartype parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationParameters + """ + + _attribute_map = { + "cluster_id": {"key": "clusterId", "type": "str"}, + "simulation_id": {"key": "simulationId", "type": "str"}, + "operation_id": {"key": "operationId", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "status": {"key": "status", "type": "str"}, + "node_type_fault_simulation": {"key": "nodeTypeFaultSimulation", "type": "[NodeTypeFaultSimulation]"}, + "parameters": {"key": "parameters", "type": "FaultSimulationParameters"}, + } + + def __init__( + self, + *, + cluster_id: Optional[str] = None, + simulation_id: Optional[str] = None, + operation_id: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + status: Optional[Union[str, "_models.FaultSimulationStatus"]] = None, + node_type_fault_simulation: Optional[List["_models.NodeTypeFaultSimulation"]] = None, + parameters: Optional["_models.FaultSimulationParameters"] = None, + **kwargs: Any + ) -> None: + """ + :keyword cluster_id: Cluster identifier asociated to the fault simulation. + :paramtype cluster_id: str + :keyword simulation_id: Simulation identifier. + :paramtype simulation_id: str + :keyword operation_id: Current or latest asyncronos operation identifier on the fault + simulation. + :paramtype operation_id: str + :keyword start_time: The start time of the fault simulation. + :paramtype start_time: ~datetime.datetime + :keyword end_time: The end time of the fault simulation. + :paramtype end_time: ~datetime.datetime + :keyword status: Fault simulation status. Known values are: "Starting", "Active", "Stopping", + "Done", "StartFailed", and "StopFailed". + :paramtype status: str or ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationStatus + :keyword node_type_fault_simulation: List of node type simulations asociated with the cluster + fault simulation. + :paramtype node_type_fault_simulation: + list[~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeFaultSimulation] + :keyword parameters: Fault simulation parameters. + :paramtype parameters: + ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationParameters + """ + super().__init__(**kwargs) + self.cluster_id = cluster_id + self.simulation_id = simulation_id + self.operation_id = operation_id + self.start_time = start_time + self.end_time = end_time + self.status = status + self.node_type_fault_simulation = node_type_fault_simulation + self.parameters = parameters + + +class FaultSimulationIdParameters(_serialization.Model): + """Parameters for Fault Simulation id. + + All required parameters must be populated in order to send to server. + + :ivar simulation_id: The fault simulation identifier. Required. + :vartype simulation_id: str + """ + + _validation = { + "simulation_id": {"required": True}, + } + + _attribute_map = { + "simulation_id": {"key": "simulationId", "type": "str"}, + } + + def __init__(self, *, simulation_id: str, **kwargs: Any) -> None: + """ + :keyword simulation_id: The fault simulation identifier. Required. + :paramtype simulation_id: str + """ + super().__init__(**kwargs) + self.simulation_id = simulation_id + + +class FaultSimulationListResult(_serialization.Model): + """Fault simulation list results. + + :ivar value: The list of fault simulations. + :vartype value: list[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :ivar next_link: The URL to use for getting the next set of results. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[FaultSimulation]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.FaultSimulation"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The list of fault simulations. + :paramtype value: list[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :keyword next_link: The URL to use for getting the next set of results. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class FaultSimulationParameters(_serialization.Model): + """Parameters for Fault Simulation action. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ZoneFaultSimulationParameters + + All required parameters must be populated in order to send to server. + + :ivar fault_kind: The kind of fault simulation. Required. "Zone" + :vartype fault_kind: str or ~azure.mgmt.servicefabricmanagedclusters.models.FaultKind + :ivar force: Force the action to go through without any check on the cluster. + :vartype force: bool + """ + + _validation = { + "fault_kind": {"required": True}, + } + + _attribute_map = { + "fault_kind": {"key": "faultKind", "type": "str"}, + "force": {"key": "force", "type": "bool"}, + } + + _subtype_map = {"fault_kind": {"Zone": "ZoneFaultSimulationParameters"}} + + def __init__(self, *, force: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword force: Force the action to go through without any check on the cluster. + :paramtype force: bool + """ + super().__init__(**kwargs) + self.fault_kind: Optional[str] = None + self.force = force + + class FrontendConfiguration(_serialization.Model): """Describes the frontend configurations for the node type. @@ -2060,7 +2230,7 @@ def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kw self.system_data = None -class ManagedCluster(Resource): # pylint: disable=too-many-instance-attributes +class ManagedCluster(Resource): """The managed cluster resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -2147,9 +2317,8 @@ class ManagedCluster(Resource): # pylint: disable=too-many-instance-attributes :ivar addon_features: List of add-on features to enable on the cluster. :vartype addon_features: list[str or ~azure.mgmt.servicefabricmanagedclusters.models.ManagedClusterAddOnFeature] - :ivar enable_auto_os_upgrade: Setting this to true enables automatic OS upgrade for the node - types that are created using any platform OS image with version 'latest'. The default value for - this setting is false. + :ivar enable_auto_os_upgrade: Enables automatic OS upgrade for node types created using OS + images with version 'latest'. The default value for this setting is false. :vartype enable_auto_os_upgrade: bool :ivar zonal_resiliency: Indicates if the cluster has zone resiliency. :vartype zonal_resiliency: bool @@ -2213,9 +2382,10 @@ class ManagedCluster(Resource): # pylint: disable=too-many-instance-attributes "SubscriptionReuse", "ResourceGroupReuse", and "NoReuse". :vartype auto_generated_domain_name_label_scope: str or ~azure.mgmt.servicefabricmanagedclusters.models.AutoGeneratedDomainNameLabelScope - :ivar custom_fqdn: If using autoGeneratedDomainNameLabelScope, this is the fully qualified - domain name using SFMC's domain, pointing to the public load balancer of the cluster. - :vartype custom_fqdn: str + :ivar allocated_outbound_ports: The number of outbound ports allocated for SNAT for each node + in the backend pool of the default load balancer. The default value is 0 which provides dynamic + port allocation based on pool size. + :vartype allocated_outbound_ports: int """ _validation = { @@ -2296,7 +2466,7 @@ class ManagedCluster(Resource): # pylint: disable=too-many-instance-attributes "key": "properties.autoGeneratedDomainNameLabelScope", "type": "str", }, - "custom_fqdn": {"key": "properties.customFqdn", "type": "str"}, + "allocated_outbound_ports": {"key": "properties.allocatedOutboundPorts", "type": "int"}, } def __init__( # pylint: disable=too-many-locals @@ -2340,7 +2510,7 @@ def __init__( # pylint: disable=too-many-locals auto_generated_domain_name_label_scope: Optional[ Union[str, "_models.AutoGeneratedDomainNameLabelScope"] ] = None, - custom_fqdn: Optional[str] = None, + allocated_outbound_ports: Optional[int] = None, **kwargs: Any ) -> None: """ @@ -2397,9 +2567,8 @@ def __init__( # pylint: disable=too-many-locals :keyword addon_features: List of add-on features to enable on the cluster. :paramtype addon_features: list[str or ~azure.mgmt.servicefabricmanagedclusters.models.ManagedClusterAddOnFeature] - :keyword enable_auto_os_upgrade: Setting this to true enables automatic OS upgrade for the node - types that are created using any platform OS image with version 'latest'. The default value for - this setting is false. + :keyword enable_auto_os_upgrade: Enables automatic OS upgrade for node types created using OS + images with version 'latest'. The default value for this setting is false. :paramtype enable_auto_os_upgrade: bool :keyword zonal_resiliency: Indicates if the cluster has zone resiliency. :paramtype zonal_resiliency: bool @@ -2461,9 +2630,10 @@ def __init__( # pylint: disable=too-many-locals "SubscriptionReuse", "ResourceGroupReuse", and "NoReuse". :paramtype auto_generated_domain_name_label_scope: str or ~azure.mgmt.servicefabricmanagedclusters.models.AutoGeneratedDomainNameLabelScope - :keyword custom_fqdn: If using autoGeneratedDomainNameLabelScope, this is the fully qualified - domain name using SFMC's domain, pointing to the public load balancer of the cluster. - :paramtype custom_fqdn: str + :keyword allocated_outbound_ports: The number of outbound ports allocated for SNAT for each + node in the backend pool of the default load balancer. The default value is 0 which provides + dynamic port allocation based on pool size. + :paramtype allocated_outbound_ports: int """ super().__init__(location=location, tags=tags, **kwargs) self.sku = sku @@ -2507,7 +2677,7 @@ def __init__( # pylint: disable=too-many-locals self.http_gateway_token_auth_connection_port = http_gateway_token_auth_connection_port self.enable_http_gateway_exclusive_auth_mode = enable_http_gateway_exclusive_auth_mode self.auto_generated_domain_name_label_scope = auto_generated_domain_name_label_scope - self.custom_fqdn = custom_fqdn + self.allocated_outbound_ports = allocated_outbound_ports class ManagedClusterCodeVersionResult(_serialization.Model): @@ -2911,7 +3081,7 @@ def __init__(self, *, names: List[str], **kwargs: Any) -> None: self.names = names -class NetworkSecurityRule(_serialization.Model): # pylint: disable=too-many-instance-attributes +class NetworkSecurityRule(_serialization.Model): """Describes a network security rule. All required parameters must be populated in order to send to server. @@ -3063,7 +3233,7 @@ def __init__( self.direction = direction -class NodeType(ManagedProxyResource): # pylint: disable=too-many-instance-attributes +class NodeType(ManagedProxyResource): """Describes a node type in the cluster, each node type represents sub set of nodes in the cluster. @@ -3092,7 +3262,8 @@ class NodeType(ManagedProxyResource): # pylint: disable=too-many-instance-attri GBs. :vartype data_disk_size_gb: int :ivar data_disk_type: Managed data disk type. Specifies the storage account type for the - managed disk. Known values are: "Standard_LRS", "StandardSSD_LRS", and "Premium_LRS". + managed disk. Known values are: "Standard_LRS", "StandardSSD_LRS", "Premium_LRS", + "PremiumV2_LRS", "StandardSSD_ZRS", and "Premium_ZRS". :vartype data_disk_type: str or ~azure.mgmt.servicefabricmanagedclusters.models.DiskType :ivar data_disk_letter: Managed data disk letter. It can not use the reserved letter C or D and it can not change after created. @@ -3399,7 +3570,8 @@ def __init__( # pylint: disable=too-many-locals in GBs. :paramtype data_disk_size_gb: int :keyword data_disk_type: Managed data disk type. Specifies the storage account type for the - managed disk. Known values are: "Standard_LRS", "StandardSSD_LRS", and "Premium_LRS". + managed disk. Known values are: "Standard_LRS", "StandardSSD_LRS", "Premium_LRS", + "PremiumV2_LRS", "StandardSSD_ZRS", and "Premium_ZRS". :paramtype data_disk_type: str or ~azure.mgmt.servicefabricmanagedclusters.models.DiskType :keyword data_disk_letter: Managed data disk letter. It can not use the reserved letter C or D and it can not change after created. @@ -3685,6 +3857,58 @@ def __init__(self, **kwargs: Any) -> None: self.capacity = None +class NodeTypeFaultSimulation(_serialization.Model): + """Node type fault simulation object with status. + + :ivar node_type_name: Node type name. + :vartype node_type_name: str + :ivar status: Fault simulation status. Known values are: "Starting", "Active", "Stopping", + "Done", "StartFailed", and "StopFailed". + :vartype status: str or ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationStatus + :ivar operation_id: Current or latest asyncronos operation identifier on the node type. + :vartype operation_id: str + :ivar operation_status: Current or latest asyncronos operation status on the node type. Known + values are: "Starting", "Active", "Stopping", "Done", "StartFailed", and "StopFailed". + :vartype operation_status: str or + ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationStatus + """ + + _attribute_map = { + "node_type_name": {"key": "nodeTypeName", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "operation_id": {"key": "operationId", "type": "str"}, + "operation_status": {"key": "operationStatus", "type": "str"}, + } + + def __init__( + self, + *, + node_type_name: Optional[str] = None, + status: Optional[Union[str, "_models.FaultSimulationStatus"]] = None, + operation_id: Optional[str] = None, + operation_status: Optional[Union[str, "_models.FaultSimulationStatus"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword node_type_name: Node type name. + :paramtype node_type_name: str + :keyword status: Fault simulation status. Known values are: "Starting", "Active", "Stopping", + "Done", "StartFailed", and "StopFailed". + :paramtype status: str or ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationStatus + :keyword operation_id: Current or latest asyncronos operation identifier on the node type. + :paramtype operation_id: str + :keyword operation_status: Current or latest asyncronos operation status on the node type. + Known values are: "Starting", "Active", "Stopping", "Done", "StartFailed", and "StopFailed". + :paramtype operation_status: str or + ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationStatus + """ + super().__init__(**kwargs) + self.node_type_name = node_type_name + self.status = status + self.operation_id = operation_id + self.operation_status = operation_status + + class NodeTypeListResult(_serialization.Model): """Node type list results. @@ -4813,7 +5037,7 @@ def __init__( self.scaling_policies = scaling_policies -class ServiceResourceProperties(ServiceResourcePropertiesBase): # pylint: disable=too-many-instance-attributes +class ServiceResourceProperties(ServiceResourcePropertiesBase): """The service resource properties. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -5213,7 +5437,7 @@ def __init__(self, *, name: Union[str, "_models.SkuName"], **kwargs: Any) -> Non self.name = name -class StatefulServiceProperties(ServiceResourceProperties): # pylint: disable=too-many-instance-attributes +class StatefulServiceProperties(ServiceResourceProperties): """The properties of a stateful service resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -5422,7 +5646,7 @@ def __init__( self.service_placement_time_limit = service_placement_time_limit -class StatelessServiceProperties(ServiceResourceProperties): # pylint: disable=too-many-instance-attributes +class StatelessServiceProperties(ServiceResourceProperties): """The properties of a stateless service resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -5848,11 +6072,7 @@ class VaultCertificate(_serialization.Model): :ivar certificate_url: This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see `Add a key or secret to the key vault - `_. In this case, your - certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded - in UTF-8: :code:`
`:code:`
` {:code:`
` - "data":":code:``",:code:`
` "dataType":"pfx",:code:`
` - "password":":code:``":code:`
`}. Required. + `_. Required. :vartype certificate_url: str :ivar certificate_store: For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly @@ -5878,11 +6098,7 @@ def __init__(self, *, certificate_url: str, certificate_store: str, **kwargs: An """ :keyword certificate_url: This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see `Add a key or secret to the key vault - `_. In this case, your - certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded - in UTF-8: :code:`
`:code:`
` {:code:`
` - "data":":code:``",:code:`
` "dataType":"pfx",:code:`
` - "password":":code:``":code:`
`}. Required. + `_. Required. :paramtype certificate_url: str :keyword certificate_store: For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly @@ -6133,7 +6349,8 @@ class VmssDataDisk(_serialization.Model): :ivar disk_size_gb: Disk size for each vm in the node type in GBs. Required. :vartype disk_size_gb: int :ivar disk_type: Managed data disk type. Specifies the storage account type for the managed - disk. Known values are: "Standard_LRS", "StandardSSD_LRS", and "Premium_LRS". + disk. Known values are: "Standard_LRS", "StandardSSD_LRS", "Premium_LRS", "PremiumV2_LRS", + "StandardSSD_ZRS", and "Premium_ZRS". :vartype disk_type: str or ~azure.mgmt.servicefabricmanagedclusters.models.DiskType :ivar disk_letter: Managed data disk letter. It can not use the reserved letter C or D and it can not change after created. Required. @@ -6171,7 +6388,8 @@ def __init__( :keyword disk_size_gb: Disk size for each vm in the node type in GBs. Required. :paramtype disk_size_gb: int :keyword disk_type: Managed data disk type. Specifies the storage account type for the managed - disk. Known values are: "Standard_LRS", "StandardSSD_LRS", and "Premium_LRS". + disk. Known values are: "Standard_LRS", "StandardSSD_LRS", "Premium_LRS", "PremiumV2_LRS", + "StandardSSD_ZRS", and "Premium_ZRS". :paramtype disk_type: str or ~azure.mgmt.servicefabricmanagedclusters.models.DiskType :keyword disk_letter: Managed data disk letter. It can not use the reserved letter C or D and it can not change after created. Required. @@ -6184,7 +6402,7 @@ def __init__( self.disk_letter = disk_letter -class VMSSExtension(_serialization.Model): # pylint: disable=too-many-instance-attributes +class VMSSExtension(_serialization.Model): """Specifies set of extensions that should be installed onto the virtual machines. Variables are only populated by the server, and will be ignored when sending a request. @@ -6309,3 +6527,38 @@ def __init__( self.provisioning_state = None self.enable_automatic_upgrade = enable_automatic_upgrade self.setup_order = setup_order + + +class ZoneFaultSimulationParameters(FaultSimulationParameters): + """Parameters for Zone Fault Simulation action. + + All required parameters must be populated in order to send to server. + + :ivar fault_kind: The kind of fault simulation. Required. "Zone" + :vartype fault_kind: str or ~azure.mgmt.servicefabricmanagedclusters.models.FaultKind + :ivar force: Force the action to go through without any check on the cluster. + :vartype force: bool + :ivar zone: Indicates the zone of the fault simulation. + :vartype zone: str + """ + + _validation = { + "fault_kind": {"required": True}, + } + + _attribute_map = { + "fault_kind": {"key": "faultKind", "type": "str"}, + "force": {"key": "force", "type": "bool"}, + "zone": {"key": "zone", "type": "str"}, + } + + def __init__(self, *, force: Optional[bool] = None, zone: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword force: Force the action to go through without any check on the cluster. + :paramtype force: bool + :keyword zone: Indicates the zone of the fault simulation. + :paramtype zone: str + """ + super().__init__(force=force, **kwargs) + self.fault_kind: str = "Zone" + self.zone = zone diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/models/_service_fabric_managed_clusters_management_client_enums.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/models/_service_fabric_managed_clusters_management_client_enums.py index 2f8ca6540c03..4efcea5ddeae 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/models/_service_fabric_managed_clusters_management_client_enums.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/models/_service_fabric_managed_clusters_management_client_enums.py @@ -21,7 +21,7 @@ class AutoGeneratedDomainNameLabelScope(str, Enum, metaclass=CaseInsensitiveEnum """This enum is the entrypoint to using a certificate from a public CA for your cluster. This property was introduced to solve the domain squatting problem with new domains. A domain name will be generated in the following - format: :code:``.:code:``.:code:``.:code:``. + format: :code:``.:code:``.:code:``.:code:``. The hash portion comes from Azure DNS' Deterministic Name Library. The library creates a hash using the cluster's Tenant, Subscription, Resource Group and Resource Name using the AutoGeneratedDomainNameLabelScope/reuse policy chosen. @@ -108,6 +108,15 @@ class DiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): applications and dev/test.""" PREMIUM_LRS = "Premium_LRS" """Premium SSD locally redundant storage. Best for production and performance sensitive workloads.""" + PREMIUM_V2_LRS = "PremiumV2_LRS" + """Premium SSD V2 locally redundant storage. Best for production and performance sensitive + workloads that consistently require low latency and high IOPS and throughput.""" + STANDARD_SSD_ZRS = "StandardSSD_ZRS" + """Standard SSD zone redundant storage. Best for web servers, lightly used enterprise applications + and dev/test that need storage resiliency against zone failures.""" + PREMIUM_ZRS = "Premium_ZRS" + """Premium SSD zone redundant storage. Best for production workloads that need storage resiliency + against zone failures.""" class EvictionPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -132,6 +141,36 @@ class FailureAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The upgrade will switch to UnmonitoredManual upgrade mode. The value is 1""" +class FaultKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of fault simulation.""" + + ZONE = "Zone" + """Simulates an availability zone down.""" + + +class FaultSimulationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Fault simulation status.""" + + STARTING = "Starting" + """Indicates the fault simulation is starting. The simulation will have this satus while the start + operation is in progress.""" + ACTIVE = "Active" + """Indicates the fault simulation is active. The simulation will have this satus after the start + operation has completed successfully.""" + STOPPING = "Stopping" + """Indicates the fault simulation is stopping. The simulation will have this satus while the stop + operation is in progress.""" + DONE = "Done" + """Indicates the fault simulation is done. The simulation will have this satus after the stop + operation has completed successfully.""" + START_FAILED = "StartFailed" + """Indicates the fault simulation has failed on start. The simulation will have this satus after + the start operation fails.""" + STOP_FAILED = "StopFailed" + """Indicates the fault simulation has failed on stop. The simulation will have this satus after + the stop operation fails.""" + + class IPAddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The IP address type.""" diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/__init__.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/__init__.py index 9510cbbfb9c2..87179ac04eb7 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/__init__.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/__init__.py @@ -5,25 +5,31 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._application_types_operations import ApplicationTypesOperations -from ._application_type_versions_operations import ApplicationTypeVersionsOperations -from ._applications_operations import ApplicationsOperations -from ._services_operations import ServicesOperations -from ._managed_clusters_operations import ManagedClustersOperations -from ._managed_az_resiliency_status_operations import ManagedAzResiliencyStatusOperations -from ._managed_maintenance_window_status_operations import ManagedMaintenanceWindowStatusOperations -from ._managed_apply_maintenance_window_operations import ManagedApplyMaintenanceWindowOperations -from ._managed_cluster_version_operations import ManagedClusterVersionOperations -from ._managed_unsupported_vm_sizes_operations import ManagedUnsupportedVMSizesOperations -from ._operation_status_operations import OperationStatusOperations -from ._operation_results_operations import OperationResultsOperations -from ._operations import Operations -from ._node_types_operations import NodeTypesOperations -from ._node_type_skus_operations import NodeTypeSkusOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._application_types_operations import ApplicationTypesOperations # type: ignore +from ._application_type_versions_operations import ApplicationTypeVersionsOperations # type: ignore +from ._applications_operations import ApplicationsOperations # type: ignore +from ._services_operations import ServicesOperations # type: ignore +from ._managed_clusters_operations import ManagedClustersOperations # type: ignore +from ._managed_az_resiliency_status_operations import ManagedAzResiliencyStatusOperations # type: ignore +from ._managed_maintenance_window_status_operations import ManagedMaintenanceWindowStatusOperations # type: ignore +from ._managed_apply_maintenance_window_operations import ManagedApplyMaintenanceWindowOperations # type: ignore +from ._managed_cluster_version_operations import ManagedClusterVersionOperations # type: ignore +from ._managed_unsupported_vm_sizes_operations import ManagedUnsupportedVMSizesOperations # type: ignore +from ._operation_status_operations import OperationStatusOperations # type: ignore +from ._operation_results_operations import OperationResultsOperations # type: ignore +from ._operations import Operations # type: ignore +from ._node_types_operations import NodeTypesOperations # type: ignore +from ._node_type_skus_operations import NodeTypeSkusOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -43,5 +49,5 @@ "NodeTypesOperations", "NodeTypeSkusOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_application_type_versions_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_application_type_versions_operations.py index 39b3d70df9d2..61cc8b9a553a 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_application_type_versions_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_application_type_versions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +35,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -55,7 +54,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,7 +92,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -134,7 +133,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -175,7 +174,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +207,7 @@ def build_list_by_application_types_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -274,7 +273,7 @@ def get( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ApplicationTypeVersionResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -328,7 +327,7 @@ def _create_or_update_initial( parameters: Union[_models.ApplicationTypeVersionResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -656,7 +655,7 @@ def update( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ApplicationTypeVersionResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +715,7 @@ def update( def _delete_initial( self, resource_group_name: str, cluster_name: str, application_type_name: str, version: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -865,7 +864,7 @@ def list_by_application_types( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ApplicationTypeVersionResourceList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_application_types_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_application_types_operations.py index ecc781746f1c..8ab0289f1dfa 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_application_types_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_application_types_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +35,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +49,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,7 +81,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -117,7 +116,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -152,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +181,7 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +244,7 @@ def get( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ApplicationTypeResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -381,7 +380,7 @@ def create_or_update( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ApplicationTypeResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -527,7 +526,7 @@ def update( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ApplicationTypeResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -586,7 +585,7 @@ def update( def _delete_initial( self, resource_group_name: str, cluster_name: str, application_type_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -722,7 +721,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ApplicationTypeResourceList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_applications_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_applications_operations.py index 5c368c8d4f5d..65b9e668e448 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_applications_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_applications_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +36,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +50,7 @@ def build_read_upgrade_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,7 +82,7 @@ def build_start_rollback_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,7 +114,7 @@ def build_resume_upgrade_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -149,7 +149,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +181,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -216,7 +216,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -251,7 +251,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -281,7 +281,7 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -328,7 +328,7 @@ def __init__(self, *args, **kwargs): def _read_upgrade_initial( self, resource_group_name: str, cluster_name: str, application_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -448,7 +448,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_rollback_initial( self, resource_group_name: str, cluster_name: str, application_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -573,7 +573,7 @@ def _resume_upgrade_initial( parameters: Union[_models.RuntimeResumeApplicationUpgradeParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -799,7 +799,7 @@ def get( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ApplicationResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -851,7 +851,7 @@ def _create_or_update_initial( parameters: Union[_models.ApplicationResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1153,7 +1153,7 @@ def update( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ApplicationResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1212,7 +1212,7 @@ def update( def _delete_initial( self, resource_group_name: str, cluster_name: str, application_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1354,7 +1354,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ApplicationResourceList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_apply_maintenance_window_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_apply_maintenance_window_operations.py index 87958ac4cd40..9c34454815d1 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_apply_maintenance_window_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_apply_maintenance_window_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +40,7 @@ def build_post_request(resource_group_name: str, cluster_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +102,7 @@ def post( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_az_resiliency_status_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_az_resiliency_status_operations.py index 6b85ad203a44..c5ca3627af57 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_az_resiliency_status_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_az_resiliency_status_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +40,7 @@ def build_get_request(resource_group_name: str, cluster_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,7 +100,7 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ManagedAzResiliencyStatus :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_cluster_version_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_cluster_version_operations.py index c0e75810f261..5b87548d1392 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_cluster_version_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_cluster_version_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union +from typing import Any, Callable, Dict, List, Optional, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +40,7 @@ def build_get_request(location: str, cluster_version: str, subscription_id: str, _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +75,7 @@ def build_get_by_environment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +105,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +138,7 @@ def build_list_by_environment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +198,7 @@ def get(self, location: str, cluster_version: str, **kwargs: Any) -> _models.Man :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ManagedClusterCodeVersionResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -268,7 +267,7 @@ def get_by_environment( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ManagedClusterCodeVersionResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +324,7 @@ def list(self, location: str, **kwargs: Any) -> List[_models.ManagedClusterCodeV :rtype: list[~azure.mgmt.servicefabricmanagedclusters.models.ManagedClusterCodeVersionResult] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +385,7 @@ def list_by_environment( :rtype: list[~azure.mgmt.servicefabricmanagedclusters.models.ManagedClusterCodeVersionResult] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_clusters_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_clusters_operations.py index 2bb736a89ba0..74c1e500e1fc 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_clusters_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_clusters_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +36,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,11 +44,144 @@ _SERIALIZER.client_side_validation = False +def build_start_fault_simulation_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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.ServiceFabric/managedClusters/{clusterName}/startFaultSimulation", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_stop_fault_simulation_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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.ServiceFabric/managedClusters/{clusterName}/stopFaultSimulation", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_fault_simulation_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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.ServiceFabric/managedClusters/{clusterName}/getFaultSimulation", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_fault_simulation_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/listFaultSimulation", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_list_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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +209,7 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +235,7 @@ def build_get_request(resource_group_name: str, cluster_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,7 +266,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -167,7 +300,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -201,7 +334,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,6 +378,657 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + def _start_fault_simulation_initial( + self, + resource_group_name: str, + cluster_name: str, + parameters: Union[_models.FaultSimulationParameters, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FaultSimulationParameters") + + _request = build_start_fault_simulation_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_start_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: _models.FaultSimulationParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FaultSimulation]: + """Starts a fault simulation on the node type. + + Starts a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameters describing the fault simulation. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_start_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FaultSimulation]: + """Starts a fault simulation on the node type. + + Starts a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameters describing the fault simulation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_start_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: Union[_models.FaultSimulationParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.FaultSimulation]: + """Starts a fault simulation on the node type. + + Starts a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameters describing the fault simulation. Is either a + FaultSimulationParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationParameters or + IO[bytes] + :return: An instance of LROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FaultSimulation] = 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_fault_simulation_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("FaultSimulation", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + 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[_models.FaultSimulation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FaultSimulation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _stop_fault_simulation_initial( + self, + resource_group_name: str, + cluster_name: str, + parameters: Union[_models.FaultSimulationIdParameters, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FaultSimulationIdParameters") + + _request = build_stop_fault_simulation_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_stop_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: _models.FaultSimulationIdParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FaultSimulation]: + """Stops a fault simulation on the node type. + + Stops a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameter with fault simulation id. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationIdParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_stop_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FaultSimulation]: + """Stops a fault simulation on the node type. + + Stops a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameter with fault simulation id. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_stop_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: Union[_models.FaultSimulationIdParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.FaultSimulation]: + """Stops a fault simulation on the node type. + + Stops a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameter with fault simulation id. Is either a FaultSimulationIdParameters + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationIdParameters + or IO[bytes] + :return: An instance of LROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FaultSimulation] = 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_fault_simulation_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("FaultSimulation", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + 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[_models.FaultSimulation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FaultSimulation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def get_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: _models.FaultSimulationIdParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FaultSimulation: + """Gets a fault simulation byt the simulationId. + + Gets a fault simulation byt the simulationId. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameter with fault simulation id. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationIdParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FaultSimulation or the result of cls(response) + :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def get_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FaultSimulation: + """Gets a fault simulation byt the simulationId. + + Gets a fault simulation byt the simulationId. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameter with fault simulation id. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: FaultSimulation or the result of cls(response) + :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def get_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + parameters: Union[_models.FaultSimulationIdParameters, IO[bytes]], + **kwargs: Any + ) -> _models.FaultSimulation: + """Gets a fault simulation byt the simulationId. + + Gets a fault simulation byt the simulationId. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param parameters: parameter with fault simulation id. Is either a FaultSimulationIdParameters + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationIdParameters + or IO[bytes] + :return: FaultSimulation or the result of cls(response) + :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FaultSimulation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FaultSimulationIdParameters") + + _request = build_get_fault_simulation_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FaultSimulation", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_fault_simulation( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> Iterable["_models.FaultSimulation"]: + """Gets a fault simulation byt the simulationId. + + Gets a fault simulation byt the simulationId. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :return: An iterator like instance of either FaultSimulation or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.FaultSimulationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 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_fault_simulation_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("FaultSimulationListResult", 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) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: """Gets the list of Service Fabric cluster resources created in the specified resource group. @@ -265,7 +1049,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -345,7 +1129,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ManagedCluste api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -421,7 +1205,7 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -471,7 +1255,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -753,7 +1537,7 @@ def update( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -809,7 +1593,7 @@ def update( return deserialized # type: ignore def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_maintenance_window_status_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_maintenance_window_status_operations.py index e780f4a14f44..aebf36a7291b 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_maintenance_window_status_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_maintenance_window_status_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +40,7 @@ def build_get_request(resource_group_name: str, cluster_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +98,7 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ManagedMaintenanceWindowStatus :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_unsupported_vm_sizes_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_unsupported_vm_sizes_operations.py index 162207a43a86..0dc88860edb1 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_unsupported_vm_sizes_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_managed_unsupported_vm_sizes_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +42,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +70,7 @@ def build_get_request(location: str, vm_size: str, subscription_id: str, **kwarg _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +134,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.ManagedVMSize" api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedVMSizesResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -212,7 +211,7 @@ def get(self, location: str, vm_size: str, **kwargs: Any) -> _models.ManagedVMSi :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ManagedVMSize :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_node_type_skus_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_node_type_skus_operations.py index 3fbe7429932b..b4c476203f55 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_node_type_skus_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_node_type_skus_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +44,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,7 +115,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.NodeTypeListSkuResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_node_types_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_node_types_operations.py index 83a10398b165..3f88e7f7ccad 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_node_types_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_node_types_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +36,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,24 +44,61 @@ _SERIALIZER.client_side_validation = False -def build_list_by_managed_clusters_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +def build_restart_request( + resource_group_name: str, cluster_name: str, node_type_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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.ServiceFabric/managedClusters/{clusterName}/nodeTypes", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/restart", ) # pylint: disable=line-too-long path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "nodeTypeName": _SERIALIZER.url("node_type_name", node_type_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_reimage_request( + resource_group_name: str, cluster_name: str, node_type_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/reimage", + ) # pylint: disable=line-too-long + path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "nodeTypeName": _SERIALIZER.url("node_type_name", node_type_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -70,25 +107,27 @@ def build_list_by_managed_clusters_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_restart_request( +def build_delete_node_request( resource_group_name: str, cluster_name: str, node_type_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/restart", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deleteNode", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -110,20 +149,20 @@ def build_restart_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_reimage_request( +def build_deallocate_request( resource_group_name: str, cluster_name: str, node_type_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/reimage", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deallocate", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -145,20 +184,160 @@ def build_reimage_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_node_request( +def build_start_request( resource_group_name: str, cluster_name: str, node_type_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deleteNode", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/start", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "nodeTypeName": _SERIALIZER.url("node_type_name", node_type_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_redeploy_request( + resource_group_name: str, cluster_name: str, node_type_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/redeploy", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "nodeTypeName": _SERIALIZER.url("node_type_name", node_type_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_start_fault_simulation_request( + resource_group_name: str, cluster_name: str, node_type_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/startFaultSimulation", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "nodeTypeName": _SERIALIZER.url("node_type_name", node_type_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_stop_fault_simulation_request( + resource_group_name: str, cluster_name: str, node_type_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/stopFaultSimulation", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "nodeTypeName": _SERIALIZER.url("node_type_name", node_type_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_fault_simulation_request( + resource_group_name: str, cluster_name: str, node_type_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/getFaultSimulation", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -180,13 +359,76 @@ def build_delete_node_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_list_fault_simulation_request( + resource_group_name: str, cluster_name: str, node_type_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/listFaultSimulation", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "nodeTypeName": _SERIALIZER.url("node_type_name", node_type_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_by_managed_clusters_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**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, cluster_name: str, node_type_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +460,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -253,7 +495,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -288,7 +530,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -314,7 +556,7 @@ def build_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -class NodeTypesOperations: +class NodeTypesOperations: # pylint: disable=too-many-public-methods """ .. warning:: **DO NOT** instantiate this class directly. @@ -333,91 +575,6 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list_by_managed_clusters( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> Iterable["_models.NodeType"]: - """Gets the list of Node types of the specified managed cluster. - - Gets all Node types of the specified managed cluster. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. Required. - :type cluster_name: str - :return: An iterator like instance of either NodeType or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicefabricmanagedclusters.models.NodeType] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NodeTypeListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_managed_clusters_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NodeTypeListResult", 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) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - def _restart_initial( self, resource_group_name: str, @@ -426,7 +583,7 @@ def _restart_initial( parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -640,7 +797,7 @@ def _reimage_initial( parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -854,7 +1011,7 @@ def _delete_node_initial( parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -997,68 +1154,1483 @@ def begin_delete_node( ) -> LROPoller[None]: """Deletes one or more nodes on the node type. - Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete - on the VMs and removes the state from the cluster. + Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete + on the VMs and removes the state from the cluster. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters for delete action. Is either a NodeTypeActionParameters type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeActionParameters or + IO[bytes] + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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_node_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _deallocate_initial( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NodeTypeActionParameters") + + _request = build_deallocate_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_deallocate( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: _models.NodeTypeActionParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deallocates one or more nodes on the node type. + + Deallocates one or more nodes on the node type. It will disable the fabric nodes, trigger a + shutdown on the VMs and release them from the cluster. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters for deallocate action. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeActionParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @overload + def begin_deallocate( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deallocates one or more nodes on the node type. + + Deallocates one or more nodes on the node type. It will disable the fabric nodes, trigger a + shutdown on the VMs and release them from the cluster. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters for deallocate action. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @distributed_trace + def begin_deallocate( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Deallocates one or more nodes on the node type. + + Deallocates one or more nodes on the node type. It will disable the fabric nodes, trigger a + shutdown on the VMs and release them from the cluster. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters for deallocate action. Is either a NodeTypeActionParameters type + or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeActionParameters or + IO[bytes] + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._deallocate_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _start_initial( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NodeTypeActionParameters") + + _request = build_start_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_start( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: _models.NodeTypeActionParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Starts one or more nodes on the node type. + + Starts one or more nodes on the node type. It will trigger an allocation of the fabric node if + needed and activate them. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters for start action. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeActionParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @overload + def begin_start( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Starts one or more nodes on the node type. + + Starts one or more nodes on the node type. It will trigger an allocation of the fabric node if + needed and activate them. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters for start action. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @distributed_trace + def begin_start( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Starts one or more nodes on the node type. + + Starts one or more nodes on the node type. It will trigger an allocation of the fabric node if + needed and activate them. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters for start action. Is either a NodeTypeActionParameters type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeActionParameters or + IO[bytes] + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._start_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _redeploy_initial( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NodeTypeActionParameters") + + _request = build_redeploy_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_redeploy( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: _models.NodeTypeActionParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Redeploys one or more nodes on the node type. + + Redeploys one or more nodes on the node type. It will disable the fabric nodes, trigger a shut + down on the VMs, move them to a new node, and power them back on. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters for redeploy action. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeActionParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @overload + def begin_redeploy( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Redeploys one or more nodes on the node type. + + Redeploys one or more nodes on the node type. It will disable the fabric nodes, trigger a shut + down on the VMs, move them to a new node, and power them back on. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters for redeploy action. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @distributed_trace + def begin_redeploy( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.NodeTypeActionParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Redeploys one or more nodes on the node type. + + Redeploys one or more nodes on the node type. It will disable the fabric nodes, trigger a shut + down on the VMs, move them to a new node, and power them back on. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters for redeploy action. Is either a NodeTypeActionParameters type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeActionParameters or + IO[bytes] + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._redeploy_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _start_fault_simulation_initial( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.FaultSimulationParameters, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FaultSimulationParameters") + + _request = build_start_fault_simulation_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_start_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: _models.FaultSimulationParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FaultSimulation]: + """Starts a fault simulation on the node type. + + Starts a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters describing the fault simulation. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_start_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FaultSimulation]: + """Starts a fault simulation on the node type. + + Starts a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters describing the fault simulation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_start_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.FaultSimulationParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.FaultSimulation]: + """Starts a fault simulation on the node type. + + Starts a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameters describing the fault simulation. Is either a + FaultSimulationParameters type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationParameters or + IO[bytes] + :return: An instance of LROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FaultSimulation] = 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_fault_simulation_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("FaultSimulation", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + 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[_models.FaultSimulation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FaultSimulation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _stop_fault_simulation_initial( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.FaultSimulationIdParameters, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FaultSimulationIdParameters") + + _request = build_stop_fault_simulation_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_stop_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: _models.FaultSimulationIdParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FaultSimulation]: + """Stops a fault simulation on the node type. + + Stops a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameter with fault simulation id. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationIdParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_stop_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FaultSimulation]: + """Stops a fault simulation on the node type. + + Stops a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameter with fault simulation id. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_stop_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.FaultSimulationIdParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.FaultSimulation]: + """Stops a fault simulation on the node type. + + Stops a fault simulation on the node type. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameter with fault simulation id. Is either a FaultSimulationIdParameters + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationIdParameters + or IO[bytes] + :return: An instance of LROPoller that returns either FaultSimulation or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FaultSimulation] = 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_fault_simulation_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("FaultSimulation", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + 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[_models.FaultSimulation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FaultSimulation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def get_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: _models.FaultSimulationIdParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FaultSimulation: + """Gets a fault simulation byt the simulationId. + + Gets a fault simulation byt the simulationId. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameter with fault simulation id. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationIdParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FaultSimulation or the result of cls(response) + :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def get_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FaultSimulation: + """Gets a fault simulation byt the simulationId. + + Gets a fault simulation byt the simulationId. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameter with fault simulation id. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: FaultSimulation or the result of cls(response) + :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def get_fault_simulation( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.FaultSimulationIdParameters, IO[bytes]], + **kwargs: Any + ) -> _models.FaultSimulation: + """Gets a fault simulation byt the simulationId. + + Gets a fault simulation byt the simulationId. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :param parameters: parameter with fault simulation id. Is either a FaultSimulationIdParameters + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulationIdParameters + or IO[bytes] + :return: FaultSimulation or the result of cls(response) + :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FaultSimulation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "FaultSimulationIdParameters") + + _request = build_get_fault_simulation_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("FaultSimulation", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_fault_simulation( + self, resource_group_name: str, cluster_name: str, node_type_name: str, **kwargs: Any + ) -> Iterable["_models.FaultSimulation"]: + """Gets a fault simulation byt the simulationId. + + Gets a fault simulation byt the simulationId. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :param node_type_name: The name of the node type. Required. + :type node_type_name: str + :return: An iterator like instance of either FaultSimulation or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.servicefabricmanagedclusters.models.FaultSimulation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.FaultSimulationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 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_fault_simulation_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("FaultSimulationListResult", 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) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_managed_clusters( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> Iterable["_models.NodeType"]: + """Gets the list of Node types of the specified managed cluster. + + Gets all Node types of the specified managed cluster. + + :param resource_group_name: The name of the resource group. Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster resource. Required. + :type cluster_name: str + :return: An iterator like instance of either NodeType or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicefabricmanagedclusters.models.NodeType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NodeTypeListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 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_managed_clusters_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NodeTypeListResult", 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) - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster resource. Required. - :type cluster_name: str - :param node_type_name: The name of the node type. Required. - :type node_type_name: str - :param parameters: parameters for delete action. Is either a NodeTypeActionParameters type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeActionParameters or - IO[bytes] - :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def get_next(next_link=None): + _request = prepare_request(next_link) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[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_node_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - node_type_name=node_type_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + response = pipeline_response.http_response - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + 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.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return pipeline_response + + return ItemPaged(get_next, extract_data) @distributed_trace def get(self, resource_group_name: str, cluster_name: str, node_type_name: str, **kwargs: Any) -> _models.NodeType: @@ -1076,7 +2648,7 @@ def get(self, resource_group_name: str, cluster_name: str, node_type_name: str, :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.NodeType :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1128,7 +2700,7 @@ def _create_or_update_initial( parameters: Union[_models.NodeType, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1334,8 +2906,84 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + node_type_name: str, + parameters: Union[_models.NodeTypeUpdateParameters, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NodeTypeUpdateParameters") + + _request = build_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorModel, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @overload - def update( + def begin_update( self, resource_group_name: str, cluster_name: str, @@ -1344,7 +2992,7 @@ def update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.NodeType: + ) -> LROPoller[_models.NodeType]: """Update the tags of a node type resource of a given managed cluster. Update the configuration of a node type of a given managed cluster, only updating tags. @@ -1360,13 +3008,13 @@ def update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: NodeType or the result of cls(response) - :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.NodeType + :return: An instance of LROPoller that returns either NodeType or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicefabricmanagedclusters.models.NodeType] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def update( + def begin_update( self, resource_group_name: str, cluster_name: str, @@ -1375,7 +3023,7 @@ def update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.NodeType: + ) -> LROPoller[_models.NodeType]: """Update the tags of a node type resource of a given managed cluster. Update the configuration of a node type of a given managed cluster, only updating tags. @@ -1391,20 +3039,20 @@ def update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: NodeType or the result of cls(response) - :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.NodeType + :return: An instance of LROPoller that returns either NodeType or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicefabricmanagedclusters.models.NodeType] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def update( + def begin_update( self, resource_group_name: str, cluster_name: str, node_type_name: str, parameters: Union[_models.NodeTypeUpdateParameters, IO[bytes]], **kwargs: Any - ) -> _models.NodeType: + ) -> LROPoller[_models.NodeType]: """Update the tags of a node type resource of a given managed cluster. Update the configuration of a node type of a given managed cluster, only updating tags. @@ -1419,70 +3067,64 @@ def update( NodeTypeUpdateParameters type or a IO[bytes] type. Required. :type parameters: ~azure.mgmt.servicefabricmanagedclusters.models.NodeTypeUpdateParameters or IO[bytes] - :return: NodeType or the result of cls(response) - :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.NodeType + :return: An instance of LROPoller that returns either NodeType or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicefabricmanagedclusters.models.NodeType] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.NodeType] = 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._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + node_type_name=node_type_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "NodeTypeUpdateParameters") - - _request = build_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - node_type_name=node_type_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NodeType", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + 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[_models.NodeType].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NodeType]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - 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.ErrorModel, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("NodeType", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - def _delete_initial( self, resource_group_name: str, cluster_name: str, node_type_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_operation_results_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_operation_results_operations.py index ef0a4c0baadd..819b6af6a0c4 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_operation_results_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_operation_results_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +40,7 @@ def build_get_request(location: str, operation_id: str, subscription_id: str, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +101,7 @@ def get( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_operation_status_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_operation_status_operations.py index 38b0efa76332..b67440539f91 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_operation_status_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_operation_status_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +40,7 @@ def build_get_request(location: str, operation_id: str, subscription_id: str, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +99,7 @@ def get(self, location: str, operation_id: str, **kwargs: Any) -> _models.LongRu :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.LongRunningOperationResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_operations.py index 5adc14baa327..c16afd9b29c1 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +42,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationResult"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_services_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_services_operations.py index ac11e015006b..510f68d13dcd 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_services_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/operations/_services_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +35,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -55,7 +54,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,7 +92,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -134,7 +133,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -175,7 +174,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +207,7 @@ def build_list_by_applications_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-06-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -275,7 +274,7 @@ def get( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -329,7 +328,7 @@ def _create_or_update_initial( parameters: Union[_models.ServiceResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -656,7 +655,7 @@ def update( :rtype: ~azure.mgmt.servicefabricmanagedclusters.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +715,7 @@ def update( def _delete_initial( self, resource_group_name: str, cluster_name: str, application_name: str, service_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -865,7 +864,7 @@ def list_by_applications( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServiceResourceList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_action_get_upgrade_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_action_get_upgrade_example.py index 3387e3a8a5e9..50f42a42b754 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_action_get_upgrade_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_action_get_upgrade_example.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationActionGetUpgrade_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationActionGetUpgrade_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_action_resume_upgrade_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_action_resume_upgrade_example.py index fc2149890a97..9cb104dff5c6 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_action_resume_upgrade_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_action_resume_upgrade_example.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationActionResumeUpgrade_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationActionResumeUpgrade_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_action_start_rollback_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_action_start_rollback_example.py index e2d091fc0055..f4362f0b5856 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_action_start_rollback_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_action_start_rollback_example.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationActionStartRollback_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationActionStartRollback_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_delete_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_delete_operation_example.py index 7053810a2a5c..6a4c15c3e7f6 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_delete_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_delete_operation_example.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationDeleteOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationDeleteOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_get_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_get_operation_example.py index b3c9aba62561..f46e82a77c21 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_get_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_get_operation_example.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationGetOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationGetOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_list_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_list_operation_example.py index aec4797e2bf6..4b2e309d0251 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_list_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_list_operation_example.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationListOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationListOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_patch_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_patch_operation_example.py index 5e7a60380ab2..97470fe9a418 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_patch_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_patch_operation_example.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationPatchOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationPatchOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_put_operation_example_max.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_put_operation_example_max.py index 7b4a40b2cc6a..fc456989f0d8 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_put_operation_example_max.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_put_operation_example_max.py @@ -77,6 +77,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationPutOperation_example_max.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationPutOperation_example_max.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_put_operation_example_min.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_put_operation_example_min.py index b5ff5f85058c..51f569bb8524 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_put_operation_example_min.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_put_operation_example_min.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationPutOperation_example_min.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationPutOperation_example_min.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_delete_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_delete_operation_example.py index 4550bcf9ec73..b4e08ae4c808 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_delete_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_delete_operation_example.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeNameDeleteOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationTypeNameDeleteOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_get_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_get_operation_example.py index 37a2cce5fcc3..9974323cb82f 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_get_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_get_operation_example.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeNameGetOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationTypeNameGetOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_list_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_list_operation_example.py index e670ed916743..c9a25c8b1fb6 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_list_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_list_operation_example.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeNameListOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationTypeNameListOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_patch_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_patch_operation_example.py index bc4dd157aea9..c0e3264ac30b 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_patch_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_patch_operation_example.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeNamePatchOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationTypeNamePatchOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_put_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_put_operation_example.py index 6d7cae87de6a..24212fdfe0ef 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_put_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_name_put_operation_example.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeNamePutOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationTypeNamePutOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_delete_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_delete_operation_example.py index 32782704e447..37407f199394 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_delete_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_delete_operation_example.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeVersionDeleteOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationTypeVersionDeleteOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_get_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_get_operation_example.py index c0c18ce514de..7676b9b6bf83 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_get_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_get_operation_example.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeVersionGetOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationTypeVersionGetOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_list_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_list_operation_example.py index 5f7577e75b53..faa69a951ebf 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_list_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_list_operation_example.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeVersionListOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationTypeVersionListOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_patch_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_patch_operation_example.py index 6ec412aa4b99..60d7ab6be817 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_patch_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_patch_operation_example.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeVersionPatchOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationTypeVersionPatchOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_put_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_put_operation_example.py index abf1f343b80d..03d74871ba82 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_put_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/application_type_version_put_operation_example.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeVersionPutOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ApplicationTypeVersionPutOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/deallocate_nodes_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/deallocate_nodes_example.py new file mode 100644 index 000000000000..5ea3d340e4a6 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/deallocate_nodes_example.py @@ -0,0 +1,43 @@ +# 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.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-servicefabricmanagedclusters +# USAGE + python deallocate_nodes_example.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 = ServiceFabricManagedClustersManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.node_types.begin_deallocate( + resource_group_name="resRg", + cluster_name="myCluster", + node_type_name="BE", + parameters={"nodes": ["BE_0", "BE_1"]}, + ).result() + + +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/DeallocateNodes_example.json +if __name__ == "__main__": + main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/delete_nodes_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/delete_nodes_example.py index 8ef6ceaf778d..6592a19e7ef6 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/delete_nodes_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/delete_nodes_example.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/DeleteNodes_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/DeleteNodes_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/managed_cluster_list_fault_simulation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/managed_cluster_list_fault_simulation_example.py new file mode 100644 index 000000000000..ce4e27bd4790 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/managed_cluster_list_fault_simulation_example.py @@ -0,0 +1,43 @@ +# 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.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-servicefabricmanagedclusters +# USAGE + python managed_cluster_list_fault_simulation_example.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 = ServiceFabricManagedClustersManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_clusters.list_fault_simulation( + resource_group_name="resRg", + cluster_name="myCluster", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/faultSimulation/ManagedClusterListFaultSimulation_example.json +if __name__ == "__main__": + main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/managed_cluster_start_fault_simulation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/managed_cluster_start_fault_simulation_example.py new file mode 100644 index 000000000000..411742b376ee --- /dev/null +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/managed_cluster_start_fault_simulation_example.py @@ -0,0 +1,43 @@ +# 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.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-servicefabricmanagedclusters +# USAGE + python managed_cluster_start_fault_simulation_example.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 = ServiceFabricManagedClustersManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_clusters.begin_start_fault_simulation( + resource_group_name="resRg", + cluster_name="myCluster", + parameters={"faultKind": "Zone", "zones": ["2"]}, + ).result() + print(response) + + +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/faultSimulation/ManagedClusterStartFaultSimulation_example.json +if __name__ == "__main__": + main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/managed_cluster_stop_fault_simulation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/managed_cluster_stop_fault_simulation_example.py new file mode 100644 index 000000000000..66ac979abd73 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/managed_cluster_stop_fault_simulation_example.py @@ -0,0 +1,43 @@ +# 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.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-servicefabricmanagedclusters +# USAGE + python managed_cluster_stop_fault_simulation_example.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 = ServiceFabricManagedClustersManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_clusters.begin_stop_fault_simulation( + resource_group_name="resRg", + cluster_name="myCluster", + parameters={"SimulationId": "1bb61ba9-8a41-4d73-b5f0-7fc93b1edfe3"}, + ).result() + print(response) + + +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/faultSimulation/ManagedClusterStopFaultSimulation_example.json +if __name__ == "__main__": + main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/node_type_list_fault_simulation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/node_type_list_fault_simulation_example.py new file mode 100644 index 000000000000..9e4cc1f9a2e0 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/node_type_list_fault_simulation_example.py @@ -0,0 +1,44 @@ +# 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.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-servicefabricmanagedclusters +# USAGE + python node_type_list_fault_simulation_example.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 = ServiceFabricManagedClustersManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.node_types.list_fault_simulation( + resource_group_name="resRg", + cluster_name="myCluster", + node_type_name="BE", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/faultSimulation/NodeTypeListFaultSimulation_example.json +if __name__ == "__main__": + main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/node_type_start_fault_simulation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/node_type_start_fault_simulation_example.py new file mode 100644 index 000000000000..c93ca015ae1e --- /dev/null +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/node_type_start_fault_simulation_example.py @@ -0,0 +1,44 @@ +# 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.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-servicefabricmanagedclusters +# USAGE + python node_type_start_fault_simulation_example.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 = ServiceFabricManagedClustersManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.node_types.begin_start_fault_simulation( + resource_group_name="resRg", + cluster_name="myCluster", + node_type_name="BE", + parameters={"faultKind": "Zone", "zones": ["2"]}, + ).result() + print(response) + + +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/faultSimulation/NodeTypeStartFaultSimulation_example.json +if __name__ == "__main__": + main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/node_type_stop_fault_simulation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/node_type_stop_fault_simulation_example.py new file mode 100644 index 000000000000..80d2d2fe9179 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/fault_simulation/node_type_stop_fault_simulation_example.py @@ -0,0 +1,44 @@ +# 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.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-servicefabricmanagedclusters +# USAGE + python node_type_stop_fault_simulation_example.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 = ServiceFabricManagedClustersManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.node_types.begin_stop_fault_simulation( + resource_group_name="resRg", + cluster_name="myCluster", + node_type_name="BE", + parameters={"SimulationId": "1bb61ba9-8a41-4d73-b5f0-7fc93b1edfe3"}, + ).result() + print(response) + + +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/faultSimulation/NodeTypeStopFaultSimulation_example.json +if __name__ == "__main__": + main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/long_running_operation_result.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/long_running_operation_result.py index 34733bc72c25..f59e4d8dffee 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/long_running_operation_result.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/long_running_operation_result.py @@ -36,6 +36,6 @@ def main(): ) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/Long_running_operation_result.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/Long_running_operation_result.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/long_running_operation_status_failed.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/long_running_operation_status_failed.py index e5a3b1ac0853..cc82f37d4a72 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/long_running_operation_status_failed.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/long_running_operation_status_failed.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/Long_running_operation_status_failed.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/Long_running_operation_status_failed.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/long_running_operation_status_succeeded.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/long_running_operation_status_succeeded.py index 242328a0e00b..7fefb9164a68 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/long_running_operation_status_succeeded.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/long_running_operation_status_succeeded.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/Long_running_operation_status_succeeded.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/Long_running_operation_status_succeeded.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_apply_maintenance_window_post_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_apply_maintenance_window_post_example.py index eeac32e23e43..ca41c2381c86 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_apply_maintenance_window_post_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_apply_maintenance_window_post_example.py @@ -36,6 +36,6 @@ def main(): ) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedApplyMaintenanceWindowPost_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ManagedApplyMaintenanceWindowPost_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_az_resiliency_status_get_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_az_resiliency_status_get_example.py index 40dec09b4f0f..705a8ebf3cac 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_az_resiliency_status_get_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_az_resiliency_status_get_example.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/managedAzResiliencyStatusGet_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/managedAzResiliencyStatusGet_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_delete_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_delete_operation_example.py index 335ded6319f3..58cc14f6cad5 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_delete_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_delete_operation_example.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterDeleteOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ManagedClusterDeleteOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_get_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_get_operation_example.py index 8f0ea8deaba5..f7d0aa05954c 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_get_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_get_operation_example.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterGetOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ManagedClusterGetOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_list_by_resource_group_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_list_by_resource_group_operation_example.py index 6a29530e3247..f3c765d7bc37 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_list_by_resource_group_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_list_by_resource_group_operation_example.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterListByResourceGroupOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ManagedClusterListByResourceGroupOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_list_by_subscription_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_list_by_subscription_operation_example.py index 937ac859143f..0c0863394877 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_list_by_subscription_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_list_by_subscription_operation_example.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterListBySubscriptionOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ManagedClusterListBySubscriptionOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_patch_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_patch_operation_example.py index dd8c326fac19..3d6e8543eb73 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_patch_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_patch_operation_example.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterPatchOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ManagedClusterPatchOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_put_operation_example_max.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_put_operation_example_max.py index 263c47c20786..203cf4468c0f 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_put_operation_example_max.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_put_operation_example_max.py @@ -39,6 +39,7 @@ def main(): "addonFeatures": ["DnsService", "BackupRestoreService", "ResourceMonitorService"], "adminPassword": "{vm-password}", "adminUserName": "vmadmin", + "allocatedOutboundPorts": 0, "allowRdpAccess": True, "applicationTypeVersionsCleanupPolicy": {"maxUnusedVersionsToKeep": 3}, "autoGeneratedDomainNameLabelScope": "SubscriptionReuse", @@ -144,6 +145,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterPutOperation_example_max.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ManagedClusterPutOperation_example_max.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_put_operation_example_min.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_put_operation_example_min.py index 8c1454d976c7..36b42d26c7a4 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_put_operation_example_min.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_put_operation_example_min.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterPutOperation_example_min.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ManagedClusterPutOperation_example_min.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_version_get_by_environment_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_version_get_by_environment_example.py index f535dd77d6b6..295d663423d6 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_version_get_by_environment_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_version_get_by_environment_example.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterVersionGetByEnvironment_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ManagedClusterVersionGetByEnvironment_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_version_get_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_version_get_example.py index bb84ce5d0792..8e08937ad116 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_version_get_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_version_get_example.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterVersionGet_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ManagedClusterVersionGet_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_version_list_by_environment.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_version_list_by_environment.py index 50393e9462ee..6a0729b662eb 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_version_list_by_environment.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_version_list_by_environment.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterVersionListByEnvironment.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ManagedClusterVersionListByEnvironment.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_version_list_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_version_list_example.py index 79a32ba612d1..a18cda133403 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_version_list_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_cluster_version_list_example.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterVersionList_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ManagedClusterVersionList_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_maintenance_window_status_get_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_maintenance_window_status_get_example.py index 4df68b5d57f5..1bf9fc8e26c3 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_maintenance_window_status_get_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_maintenance_window_status_get_example.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedMaintenanceWindowStatusGet_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ManagedMaintenanceWindowStatusGet_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_unsupported_vm_sizes_get_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_unsupported_vm_sizes_get_example.py index dcf3dcdbca03..118876b1c5ce 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_unsupported_vm_sizes_get_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_unsupported_vm_sizes_get_example.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/managedUnsupportedVMSizesGet_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/managedUnsupportedVMSizesGet_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_unsupported_vm_sizes_list_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_unsupported_vm_sizes_list_example.py index f0b26b2c2e81..2bdee76ca56d 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_unsupported_vm_sizes_list_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/managed_unsupported_vm_sizes_list_example.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/managedUnsupportedVMSizesList_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/managedUnsupportedVMSizesList_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_delete_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_delete_operation_example.py index 7fd0297e0798..bd301839fd2b 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_delete_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_delete_operation_example.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypeDeleteOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/NodeTypeDeleteOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_get_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_get_operation_example.py index f457ae4a0704..7b0507894023 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_get_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_get_operation_example.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypeGetOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/NodeTypeGetOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_list_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_list_operation_example.py index a0081b04d7d7..dcfd5d5a1c9d 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_list_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_list_operation_example.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypeListOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/NodeTypeListOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_patch_operation_auto_scale_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_patch_operation_auto_scale_example.py index b85afc41c3ba..ab6af38f62ee 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_patch_operation_auto_scale_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_patch_operation_auto_scale_example.py @@ -30,15 +30,15 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.node_types.update( + response = client.node_types.begin_update( resource_group_name="resRg", cluster_name="myCluster", node_type_name="BE", parameters={"sku": {"capacity": 10, "name": "Standard_S0", "tier": "Standard"}, "tags": {"a": "b"}}, - ) + ).result() print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePatchOperationAutoScale_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/NodeTypePatchOperationAutoScale_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_patch_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_patch_operation_example.py index a0bc2b38f993..bd8243f8fd99 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_patch_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_patch_operation_example.py @@ -30,15 +30,15 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.node_types.update( + response = client.node_types.begin_update( resource_group_name="resRg", cluster_name="myCluster", node_type_name="BE", parameters={"tags": {"a": "b"}}, - ) + ).result() print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePatchOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/NodeTypePatchOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_auto_scale_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_auto_scale_example.py index 3139a4b61d4b..2729b356483e 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_auto_scale_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_auto_scale_example.py @@ -86,6 +86,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePutOperationAutoScale_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/NodeTypePutOperationAutoScale_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_custom_image_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_custom_image_example.py index a85cc4c660d6..40a79de1b249 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_custom_image_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_custom_image_example.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePutOperationCustomImage_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/NodeTypePutOperationCustomImage_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_custom_shared_galleries_image_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_custom_shared_galleries_image_example.py index e16a1672b0ea..7792bd3ee7f8 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_custom_shared_galleries_image_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_custom_shared_galleries_image_example.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePutOperationCustomSharedGalleriesImage_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/NodeTypePutOperationCustomSharedGalleriesImage_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_dedicated_host_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_dedicated_host_example.py index 059034aac9aa..ac7bd469efaa 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_dedicated_host_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_dedicated_host_example.py @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePutOperationDedicatedHost_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/NodeTypePutOperationDedicatedHost_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_example_max.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_example_max.py index 21bd8bc403b8..73f05f0351cd 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_example_max.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_example_max.py @@ -167,6 +167,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePutOperation_example_max.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/NodeTypePutOperation_example_max.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_example_min.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_example_min.py index 76947aabd654..2bf7d7f78a74 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_example_min.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_example_min.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePutOperation_example_min.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/NodeTypePutOperation_example_min.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_stateless_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_stateless_example.py index 8cb0cf89b43e..7d72e40fb4af 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_stateless_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_stateless_example.py @@ -65,6 +65,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePutOperationStateless_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/NodeTypePutOperationStateless_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_vm_image_plan_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_vm_image_plan_example.py index b19e814a1311..53f356cb3f98 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_vm_image_plan_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_put_operation_vm_image_plan_example.py @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePutOperationVmImagePlan_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/NodeTypePutOperationVmImagePlan_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_skus_list_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_skus_list_operation_example.py index eec1fb44c423..49e6c7432d9d 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_skus_list_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/node_type_skus_list_operation_example.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypeSkusListOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/NodeTypeSkusListOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/operations_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/operations_example.py index 96dc2c9034ba..834cfa921423 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/operations_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/operations_example.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/Operations_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/Operations_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/redeploy_nodes_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/redeploy_nodes_example.py new file mode 100644 index 000000000000..2adc15f15457 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/redeploy_nodes_example.py @@ -0,0 +1,43 @@ +# 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.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-servicefabricmanagedclusters +# USAGE + python redeploy_nodes_example.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 = ServiceFabricManagedClustersManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.node_types.begin_redeploy( + resource_group_name="resRg", + cluster_name="myCluster", + node_type_name="BE", + parameters={"nodes": ["BE_0", "BE_1"]}, + ).result() + + +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/RedeployNodes_example.json +if __name__ == "__main__": + main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/redeploy_nodes_ud_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/redeploy_nodes_ud_example.py new file mode 100644 index 000000000000..8f7bbb49c019 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/redeploy_nodes_ud_example.py @@ -0,0 +1,43 @@ +# 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.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-servicefabricmanagedclusters +# USAGE + python redeploy_nodes_ud_example.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 = ServiceFabricManagedClustersManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.node_types.begin_redeploy( + resource_group_name="resRg", + cluster_name="myCluster", + node_type_name="BE", + parameters={"updateType": "ByUpgradeDomain"}, + ).result() + + +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/RedeployNodes_UD_example.json +if __name__ == "__main__": + main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/reimage_nodes_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/reimage_nodes_example.py index f34afa1525a6..6fd73e14830c 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/reimage_nodes_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/reimage_nodes_example.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ReimageNodes_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ReimageNodes_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/reimage_nodes_ud_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/reimage_nodes_ud_example.py index d85f6cef01e2..5d373dcd22f6 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/reimage_nodes_ud_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/reimage_nodes_ud_example.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ReimageNodes_UD_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ReimageNodes_UD_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/restart_nodes_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/restart_nodes_example.py index 3cf86f0d33f1..59dcc50d8eb7 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/restart_nodes_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/restart_nodes_example.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/RestartNodes_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/RestartNodes_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_delete_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_delete_operation_example.py index cb50880555e7..6ac7d6cda1db 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_delete_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_delete_operation_example.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ServiceDeleteOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ServiceDeleteOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_get_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_get_operation_example.py index 6c36ad90e1f8..bd24c963a0c6 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_get_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_get_operation_example.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ServiceGetOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ServiceGetOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_list_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_list_operation_example.py index 0a5b77952148..8472431c8c9d 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_list_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_list_operation_example.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ServiceListOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ServiceListOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_patch_operation_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_patch_operation_example.py index 030b2e2c2780..8f005f27c66d 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_patch_operation_example.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_patch_operation_example.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ServicePatchOperation_example.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ServicePatchOperation_example.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_put_operation_example_max.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_put_operation_example_max.py index 1095f4947518..1be53441aec2 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_put_operation_example_max.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_put_operation_example_max.py @@ -80,6 +80,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ServicePutOperation_example_max.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ServicePutOperation_example_max.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_put_operation_example_min.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_put_operation_example_min.py index 3848592fa90a..77bfbc49bbfa 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_put_operation_example_min.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/service_put_operation_example_min.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ServicePutOperation_example_min.json +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/ServicePutOperation_example_min.json if __name__ == "__main__": main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/start_nodes_example.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/start_nodes_example.py new file mode 100644 index 000000000000..fc2c3e4428cb --- /dev/null +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_samples/start_nodes_example.py @@ -0,0 +1,43 @@ +# 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.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-servicefabricmanagedclusters +# USAGE + python start_nodes_example.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 = ServiceFabricManagedClustersManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.node_types.begin_start( + resource_group_name="resRg", + cluster_name="myCluster", + node_type_name="BE", + parameters={"nodes": ["BE_0", "BE_1"]}, + ).result() + + +# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/examples/StartNodes_example.json +if __name__ == "__main__": + main() diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/conftest.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/conftest.py index 6b2cf362851d..b996bb4dab29 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/conftest.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/conftest.py @@ -18,7 +18,7 @@ load_dotenv() -# aovid record sensitive identity information in recordings +# For security, please avoid record sensitive identity information in recordings @pytest.fixture(scope="session", autouse=True) def add_sanitizers(test_proxy): servicefabricmanagedclustersmanagement_subscription_id = os.environ.get( diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_application_type_versions_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_application_type_versions_operations.py index 56493cfd2a78..9d40301df7ad 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_application_type_versions_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_application_type_versions_operations.py @@ -20,13 +20,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_application_type_versions_get(self, resource_group): response = self.client.application_type_versions.get( resource_group_name=resource_group.name, cluster_name="str", application_type_name="str", version="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -34,7 +34,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_application_type_versions_begin_create_or_update(self, resource_group): response = self.client.application_type_versions.begin_create_or_update( resource_group_name=resource_group.name, cluster_name="str", @@ -57,7 +57,7 @@ def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -65,14 +65,14 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_application_type_versions_update(self, resource_group): response = self.client.application_type_versions.update( resource_group_name=resource_group.name, cluster_name="str", application_type_name="str", version="str", parameters={"tags": {"str": "str"}}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -80,13 +80,13 @@ def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_application_type_versions_begin_delete(self, resource_group): response = self.client.application_type_versions.begin_delete( resource_group_name=resource_group.name, cluster_name="str", application_type_name="str", version="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -94,12 +94,12 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_application_types(self, resource_group): + def test_application_type_versions_list_by_application_types(self, resource_group): response = self.client.application_type_versions.list_by_application_types( resource_group_name=resource_group.name, cluster_name="str", application_type_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_application_type_versions_operations_async.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_application_type_versions_operations_async.py index 73f076d8d8af..69b5692449af 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_application_type_versions_operations_async.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_application_type_versions_operations_async.py @@ -21,13 +21,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_application_type_versions_get(self, resource_group): response = await self.client.application_type_versions.get( resource_group_name=resource_group.name, cluster_name="str", application_type_name="str", version="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -35,7 +35,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_application_type_versions_begin_create_or_update(self, resource_group): response = await ( await self.client.application_type_versions.begin_create_or_update( resource_group_name=resource_group.name, @@ -59,7 +59,7 @@ async def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -68,14 +68,14 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_application_type_versions_update(self, resource_group): response = await self.client.application_type_versions.update( resource_group_name=resource_group.name, cluster_name="str", application_type_name="str", version="str", parameters={"tags": {"str": "str"}}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -83,14 +83,14 @@ async def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_application_type_versions_begin_delete(self, resource_group): response = await ( await self.client.application_type_versions.begin_delete( resource_group_name=resource_group.name, cluster_name="str", application_type_name="str", version="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -99,12 +99,12 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_application_types(self, resource_group): + async def test_application_type_versions_list_by_application_types(self, resource_group): response = self.client.application_type_versions.list_by_application_types( resource_group_name=resource_group.name, cluster_name="str", application_type_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_application_types_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_application_types_operations.py index e1cdd875f97e..a697427174a3 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_application_types_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_application_types_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_application_types_get(self, resource_group): response = self.client.application_types.get( resource_group_name=resource_group.name, cluster_name="str", application_type_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_application_types_create_or_update(self, resource_group): response = self.client.application_types.create_or_update( resource_group_name=resource_group.name, cluster_name="str", @@ -54,7 +54,7 @@ def test_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -62,13 +62,13 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_application_types_update(self, resource_group): response = self.client.application_types.update( resource_group_name=resource_group.name, cluster_name="str", application_type_name="str", parameters={"tags": {"str": "str"}}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -76,12 +76,12 @@ def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_application_types_begin_delete(self, resource_group): response = self.client.application_types.begin_delete( resource_group_name=resource_group.name, cluster_name="str", application_type_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -89,11 +89,11 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_application_types_list(self, resource_group): response = self.client.application_types.list( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_application_types_operations_async.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_application_types_operations_async.py index d99c5c5e1c4d..e07706bc91fe 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_application_types_operations_async.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_application_types_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_application_types_get(self, resource_group): response = await self.client.application_types.get( resource_group_name=resource_group.name, cluster_name="str", application_type_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_application_types_create_or_update(self, resource_group): response = await self.client.application_types.create_or_update( resource_group_name=resource_group.name, cluster_name="str", @@ -55,7 +55,7 @@ async def test_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -63,13 +63,13 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_application_types_update(self, resource_group): response = await self.client.application_types.update( resource_group_name=resource_group.name, cluster_name="str", application_type_name="str", parameters={"tags": {"str": "str"}}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -77,13 +77,13 @@ async def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_application_types_begin_delete(self, resource_group): response = await ( await self.client.application_types.begin_delete( resource_group_name=resource_group.name, cluster_name="str", application_type_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -92,11 +92,11 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_application_types_list(self, resource_group): response = self.client.application_types.list( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_applications_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_applications_operations.py index 29855df4cac1..730ca86e7d27 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_applications_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_applications_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_read_upgrade(self, resource_group): + def test_applications_begin_read_upgrade(self, resource_group): response = self.client.applications.begin_read_upgrade( resource_group_name=resource_group.name, cluster_name="str", application_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -33,12 +33,12 @@ def test_begin_read_upgrade(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_start_rollback(self, resource_group): + def test_applications_begin_start_rollback(self, resource_group): response = self.client.applications.begin_start_rollback( resource_group_name=resource_group.name, cluster_name="str", application_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -46,13 +46,13 @@ def test_begin_start_rollback(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_resume_upgrade(self, resource_group): + def test_applications_begin_resume_upgrade(self, resource_group): response = self.client.applications.begin_resume_upgrade( resource_group_name=resource_group.name, cluster_name="str", application_name="str", parameters={"upgradeDomainName": "str"}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -60,12 +60,12 @@ def test_begin_resume_upgrade(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_applications_get(self, resource_group): response = self.client.applications.get( resource_group_name=resource_group.name, cluster_name="str", application_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -73,7 +73,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_applications_begin_create_or_update(self, resource_group): response = self.client.applications.begin_create_or_update( resource_group_name=resource_group.name, cluster_name="str", @@ -134,7 +134,7 @@ def test_begin_create_or_update(self, resource_group): }, "version": "str", }, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -142,13 +142,13 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_applications_update(self, resource_group): response = self.client.applications.update( resource_group_name=resource_group.name, cluster_name="str", application_name="str", parameters={"tags": {"str": "str"}}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -156,12 +156,12 @@ def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_applications_begin_delete(self, resource_group): response = self.client.applications.begin_delete( resource_group_name=resource_group.name, cluster_name="str", application_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -169,11 +169,11 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_applications_list(self, resource_group): response = self.client.applications.list( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_applications_operations_async.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_applications_operations_async.py index 3283f105a77f..55b7f51f0d02 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_applications_operations_async.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_applications_operations_async.py @@ -21,13 +21,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_read_upgrade(self, resource_group): + async def test_applications_begin_read_upgrade(self, resource_group): response = await ( await self.client.applications.begin_read_upgrade( resource_group_name=resource_group.name, cluster_name="str", application_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -36,13 +36,13 @@ async def test_begin_read_upgrade(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_start_rollback(self, resource_group): + async def test_applications_begin_start_rollback(self, resource_group): response = await ( await self.client.applications.begin_start_rollback( resource_group_name=resource_group.name, cluster_name="str", application_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -51,14 +51,14 @@ async def test_begin_start_rollback(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_resume_upgrade(self, resource_group): + async def test_applications_begin_resume_upgrade(self, resource_group): response = await ( await self.client.applications.begin_resume_upgrade( resource_group_name=resource_group.name, cluster_name="str", application_name="str", parameters={"upgradeDomainName": "str"}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -67,12 +67,12 @@ async def test_begin_resume_upgrade(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_applications_get(self, resource_group): response = await self.client.applications.get( resource_group_name=resource_group.name, cluster_name="str", application_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -80,7 +80,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_applications_begin_create_or_update(self, resource_group): response = await ( await self.client.applications.begin_create_or_update( resource_group_name=resource_group.name, @@ -142,7 +142,7 @@ async def test_begin_create_or_update(self, resource_group): }, "version": "str", }, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -151,13 +151,13 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_applications_update(self, resource_group): response = await self.client.applications.update( resource_group_name=resource_group.name, cluster_name="str", application_name="str", parameters={"tags": {"str": "str"}}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -165,13 +165,13 @@ async def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_applications_begin_delete(self, resource_group): response = await ( await self.client.applications.begin_delete( resource_group_name=resource_group.name, cluster_name="str", application_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -180,11 +180,11 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_applications_list(self, resource_group): response = self.client.applications.list( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_apply_maintenance_window_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_apply_maintenance_window_operations.py index 625ae8a638d5..9156dfc503ec 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_apply_maintenance_window_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_apply_maintenance_window_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_post(self, resource_group): + def test_managed_apply_maintenance_window_post(self, resource_group): response = self.client.managed_apply_maintenance_window.post( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_apply_maintenance_window_operations_async.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_apply_maintenance_window_operations_async.py index 6a45ba4ad8e7..a63335ebed87 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_apply_maintenance_window_operations_async.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_apply_maintenance_window_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_post(self, resource_group): + async def test_managed_apply_maintenance_window_post(self, resource_group): response = await self.client.managed_apply_maintenance_window.post( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_az_resiliency_status_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_az_resiliency_status_operations.py index 6263d96c3fbf..2a534fb4c833 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_az_resiliency_status_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_az_resiliency_status_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_managed_az_resiliency_status_get(self, resource_group): response = self.client.managed_az_resiliency_status.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_az_resiliency_status_operations_async.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_az_resiliency_status_operations_async.py index 4c2ff0ccb776..501517e84ec4 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_az_resiliency_status_operations_async.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_az_resiliency_status_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_managed_az_resiliency_status_get(self, resource_group): response = await self.client.managed_az_resiliency_status.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_cluster_version_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_cluster_version_operations.py index e0407e48babb..b98d004b2b5d 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_cluster_version_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_cluster_version_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_managed_cluster_version_get(self, resource_group): response = self.client.managed_cluster_version.get( location="str", cluster_version="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_by_environment(self, resource_group): + def test_managed_cluster_version_get_by_environment(self, resource_group): response = self.client.managed_cluster_version.get_by_environment( location="str", environment="str", cluster_version="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -45,10 +45,10 @@ def test_get_by_environment(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_managed_cluster_version_list(self, resource_group): response = self.client.managed_cluster_version.list( location="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -56,11 +56,11 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_environment(self, resource_group): + def test_managed_cluster_version_list_by_environment(self, resource_group): response = self.client.managed_cluster_version.list_by_environment( location="str", environment="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_cluster_version_operations_async.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_cluster_version_operations_async.py index 03404581705e..98565fb09eac 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_cluster_version_operations_async.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_cluster_version_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_managed_cluster_version_get(self, resource_group): response = await self.client.managed_cluster_version.get( location="str", cluster_version="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_by_environment(self, resource_group): + async def test_managed_cluster_version_get_by_environment(self, resource_group): response = await self.client.managed_cluster_version.get_by_environment( location="str", environment="str", cluster_version="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -46,10 +46,10 @@ async def test_get_by_environment(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_managed_cluster_version_list(self, resource_group): response = await self.client.managed_cluster_version.list( location="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -57,11 +57,11 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_environment(self, resource_group): + async def test_managed_cluster_version_list_by_environment(self, resource_group): response = await self.client.managed_cluster_version.list_by_environment( location="str", environment="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_clusters_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_clusters_operations.py index c8eee823ab94..6a9eb3e64839 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_clusters_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_clusters_operations.py @@ -20,10 +20,61 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_managed_clusters_begin_start_fault_simulation(self, resource_group): + response = self.client.managed_clusters.begin_start_fault_simulation( + resource_group_name=resource_group.name, + cluster_name="str", + parameters={"faultKind": "Zone", "force": bool, "zone": "str"}, + api_version="2024-11-01-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_clusters_begin_stop_fault_simulation(self, resource_group): + response = self.client.managed_clusters.begin_stop_fault_simulation( + resource_group_name=resource_group.name, + cluster_name="str", + parameters={"simulationId": "str"}, + api_version="2024-11-01-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_clusters_get_fault_simulation(self, resource_group): + response = self.client.managed_clusters.get_fault_simulation( + resource_group_name=resource_group.name, + cluster_name="str", + parameters={"simulationId": "str"}, + api_version="2024-11-01-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_clusters_list_fault_simulation(self, resource_group): + response = self.client.managed_clusters.list_fault_simulation( + resource_group_name=resource_group.name, + cluster_name="str", + api_version="2024-11-01-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_clusters_list_by_resource_group(self, resource_group): response = self.client.managed_clusters.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -31,9 +82,9 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): + def test_managed_clusters_list_by_subscription(self, resource_group): response = self.client.managed_clusters.list_by_subscription( - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,11 +92,11 @@ def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_managed_clusters_get(self, resource_group): response = self.client.managed_clusters.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -53,7 +104,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_managed_clusters_begin_create_or_update(self, resource_group): response = self.client.managed_clusters.begin_create_or_update( resource_group_name=resource_group.name, cluster_name="str", @@ -63,6 +114,7 @@ def test_begin_create_or_update(self, resource_group): "addonFeatures": ["str"], "adminPassword": "str", "adminUserName": "str", + "allocatedOutboundPorts": 0, "allowRdpAccess": bool, "applicationTypeVersionsCleanupPolicy": {"maxUnusedVersionsToKeep": 0}, "autoGeneratedDomainNameLabelScope": "str", @@ -84,7 +136,6 @@ def test_begin_create_or_update(self, resource_group): "clusterState": "str", "clusterUpgradeCadence": "str", "clusterUpgradeMode": "Automatic", - "customFqdn": "str", "ddosProtectionPlanId": "str", "dnsName": "str", "enableAutoOSUpgrade": bool, @@ -166,7 +217,7 @@ def test_begin_create_or_update(self, resource_group): "zonalResiliency": False, "zonalUpdateMode": "str", }, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -174,12 +225,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_managed_clusters_update(self, resource_group): response = self.client.managed_clusters.update( resource_group_name=resource_group.name, cluster_name="str", parameters={"tags": {"str": "str"}}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -187,11 +238,11 @@ def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_managed_clusters_begin_delete(self, resource_group): response = self.client.managed_clusters.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_clusters_operations_async.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_clusters_operations_async.py index d07893a63168..b743fa15e990 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_clusters_operations_async.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_clusters_operations_async.py @@ -21,10 +21,65 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_managed_clusters_begin_start_fault_simulation(self, resource_group): + response = await ( + await self.client.managed_clusters.begin_start_fault_simulation( + resource_group_name=resource_group.name, + cluster_name="str", + parameters={"faultKind": "Zone", "force": bool, "zone": "str"}, + api_version="2024-11-01-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_clusters_begin_stop_fault_simulation(self, resource_group): + response = await ( + await self.client.managed_clusters.begin_stop_fault_simulation( + resource_group_name=resource_group.name, + cluster_name="str", + parameters={"simulationId": "str"}, + api_version="2024-11-01-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_clusters_get_fault_simulation(self, resource_group): + response = await self.client.managed_clusters.get_fault_simulation( + resource_group_name=resource_group.name, + cluster_name="str", + parameters={"simulationId": "str"}, + api_version="2024-11-01-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_clusters_list_fault_simulation(self, resource_group): + response = self.client.managed_clusters.list_fault_simulation( + resource_group_name=resource_group.name, + cluster_name="str", + api_version="2024-11-01-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_clusters_list_by_resource_group(self, resource_group): response = self.client.managed_clusters.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -32,9 +87,9 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): + async def test_managed_clusters_list_by_subscription(self, resource_group): response = self.client.managed_clusters.list_by_subscription( - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,11 +97,11 @@ async def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_managed_clusters_get(self, resource_group): response = await self.client.managed_clusters.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -54,7 +109,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_managed_clusters_begin_create_or_update(self, resource_group): response = await ( await self.client.managed_clusters.begin_create_or_update( resource_group_name=resource_group.name, @@ -65,6 +120,7 @@ async def test_begin_create_or_update(self, resource_group): "addonFeatures": ["str"], "adminPassword": "str", "adminUserName": "str", + "allocatedOutboundPorts": 0, "allowRdpAccess": bool, "applicationTypeVersionsCleanupPolicy": {"maxUnusedVersionsToKeep": 0}, "autoGeneratedDomainNameLabelScope": "str", @@ -90,7 +146,6 @@ async def test_begin_create_or_update(self, resource_group): "clusterState": "str", "clusterUpgradeCadence": "str", "clusterUpgradeMode": "Automatic", - "customFqdn": "str", "ddosProtectionPlanId": "str", "dnsName": "str", "enableAutoOSUpgrade": bool, @@ -172,7 +227,7 @@ async def test_begin_create_or_update(self, resource_group): "zonalResiliency": False, "zonalUpdateMode": "str", }, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -181,12 +236,12 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_managed_clusters_update(self, resource_group): response = await self.client.managed_clusters.update( resource_group_name=resource_group.name, cluster_name="str", parameters={"tags": {"str": "str"}}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -194,12 +249,12 @@ async def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_managed_clusters_begin_delete(self, resource_group): response = await ( await self.client.managed_clusters.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_maintenance_window_status_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_maintenance_window_status_operations.py index da25d1e9aaf5..03aa9f36d13f 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_maintenance_window_status_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_maintenance_window_status_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_managed_maintenance_window_status_get(self, resource_group): response = self.client.managed_maintenance_window_status.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_maintenance_window_status_operations_async.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_maintenance_window_status_operations_async.py index 272641ea18bc..2b3b1e55eed8 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_maintenance_window_status_operations_async.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_maintenance_window_status_operations_async.py @@ -23,11 +23,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_managed_maintenance_window_status_get(self, resource_group): response = await self.client.managed_maintenance_window_status.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_unsupported_vm_sizes_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_unsupported_vm_sizes_operations.py index faa88e13fd0c..62b479cc4add 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_unsupported_vm_sizes_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_unsupported_vm_sizes_operations.py @@ -20,10 +20,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_managed_unsupported_vm_sizes_list(self, resource_group): response = self.client.managed_unsupported_vm_sizes.list( location="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -31,11 +31,11 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_managed_unsupported_vm_sizes_get(self, resource_group): response = self.client.managed_unsupported_vm_sizes.get( location="str", vm_size="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_unsupported_vm_sizes_operations_async.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_unsupported_vm_sizes_operations_async.py index e9f19cb4828d..bc94096155d0 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_unsupported_vm_sizes_operations_async.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_managed_unsupported_vm_sizes_operations_async.py @@ -21,10 +21,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_managed_unsupported_vm_sizes_list(self, resource_group): response = self.client.managed_unsupported_vm_sizes.list( location="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -32,11 +32,11 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_managed_unsupported_vm_sizes_get(self, resource_group): response = await self.client.managed_unsupported_vm_sizes.get( location="str", vm_size="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_node_type_skus_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_node_type_skus_operations.py index 7d83446f0596..75a8f158d771 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_node_type_skus_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_node_type_skus_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_node_type_skus_list(self, resource_group): response = self.client.node_type_skus.list( resource_group_name=resource_group.name, cluster_name="str", node_type_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_node_type_skus_operations_async.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_node_type_skus_operations_async.py index 6c4a6923e040..6f6e8b7fa149 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_node_type_skus_operations_async.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_node_type_skus_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_node_type_skus_list(self, resource_group): response = self.client.node_type_skus.list( resource_group_name=resource_group.name, cluster_name="str", node_type_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_node_types_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_node_types_operations.py index b32c6f79ffb2..4d647c380792 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_node_types_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_node_types_operations.py @@ -20,25 +20,27 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_managed_clusters(self, resource_group): - response = self.client.node_types.list_by_managed_clusters( + def test_node_types_begin_restart(self, resource_group): + response = self.client.node_types.begin_restart( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-06-01-preview", - ) - result = [r for r in response] + node_type_name="str", + parameters={"force": bool, "nodes": ["str"], "updateType": "str"}, + api_version="2024-11-01-preview", + ).result() # call '.result()' to poll until service return final result + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_restart(self, resource_group): - response = self.client.node_types.begin_restart( + def test_node_types_begin_reimage(self, resource_group): + response = self.client.node_types.begin_reimage( resource_group_name=resource_group.name, cluster_name="str", node_type_name="str", parameters={"force": bool, "nodes": ["str"], "updateType": "str"}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -46,13 +48,13 @@ def test_begin_restart(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_reimage(self, resource_group): - response = self.client.node_types.begin_reimage( + def test_node_types_begin_delete_node(self, resource_group): + response = self.client.node_types.begin_delete_node( resource_group_name=resource_group.name, cluster_name="str", node_type_name="str", parameters={"force": bool, "nodes": ["str"], "updateType": "str"}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -60,13 +62,41 @@ def test_begin_reimage(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete_node(self, resource_group): - response = self.client.node_types.begin_delete_node( + def test_node_types_begin_deallocate(self, resource_group): + response = self.client.node_types.begin_deallocate( + resource_group_name=resource_group.name, + cluster_name="str", + node_type_name="str", + parameters={"force": bool, "nodes": ["str"], "updateType": "str"}, + api_version="2024-11-01-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_node_types_begin_start(self, resource_group): + response = self.client.node_types.begin_start( + resource_group_name=resource_group.name, + cluster_name="str", + node_type_name="str", + parameters={"force": bool, "nodes": ["str"], "updateType": "str"}, + api_version="2024-11-01-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_node_types_begin_redeploy(self, resource_group): + response = self.client.node_types.begin_redeploy( resource_group_name=resource_group.name, cluster_name="str", node_type_name="str", parameters={"force": bool, "nodes": ["str"], "updateType": "str"}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -74,12 +104,79 @@ def test_begin_delete_node(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_node_types_begin_start_fault_simulation(self, resource_group): + response = self.client.node_types.begin_start_fault_simulation( + resource_group_name=resource_group.name, + cluster_name="str", + node_type_name="str", + parameters={"faultKind": "Zone", "force": bool, "zone": "str"}, + api_version="2024-11-01-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_node_types_begin_stop_fault_simulation(self, resource_group): + response = self.client.node_types.begin_stop_fault_simulation( + resource_group_name=resource_group.name, + cluster_name="str", + node_type_name="str", + parameters={"simulationId": "str"}, + api_version="2024-11-01-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_node_types_get_fault_simulation(self, resource_group): + response = self.client.node_types.get_fault_simulation( + resource_group_name=resource_group.name, + cluster_name="str", + node_type_name="str", + parameters={"simulationId": "str"}, + api_version="2024-11-01-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_node_types_list_fault_simulation(self, resource_group): + response = self.client.node_types.list_fault_simulation( + resource_group_name=resource_group.name, + cluster_name="str", + node_type_name="str", + api_version="2024-11-01-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_node_types_list_by_managed_clusters(self, resource_group): + response = self.client.node_types.list_by_managed_clusters( + resource_group_name=resource_group.name, + cluster_name="str", + api_version="2024-11-01-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_node_types_get(self, resource_group): response = self.client.node_types.get( resource_group_name=resource_group.name, cluster_name="str", node_type_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -87,7 +184,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_node_types_begin_create_or_update(self, resource_group): response = self.client.node_types.begin_create_or_update( resource_group_name=resource_group.name, cluster_name="str", @@ -233,7 +330,7 @@ def test_begin_create_or_update(self, resource_group): "vmSize": "str", "zones": ["str"], }, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -241,26 +338,26 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): - response = self.client.node_types.update( + def test_node_types_begin_update(self, resource_group): + response = self.client.node_types.begin_update( resource_group_name=resource_group.name, cluster_name="str", node_type_name="str", parameters={"sku": {"capacity": 0, "name": "str", "tier": "str"}, "tags": {"str": "str"}}, - api_version="2024-06-01-preview", - ) + api_version="2024-11-01-preview", + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_node_types_begin_delete(self, resource_group): response = self.client.node_types.begin_delete( resource_group_name=resource_group.name, cluster_name="str", node_type_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_node_types_operations_async.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_node_types_operations_async.py index 99d0e74864f6..1661bd904637 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_node_types_operations_async.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_node_types_operations_async.py @@ -21,26 +21,30 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_managed_clusters(self, resource_group): - response = self.client.node_types.list_by_managed_clusters( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-06-01-preview", - ) - result = [r async for r in response] + async def test_node_types_begin_restart(self, resource_group): + response = await ( + await self.client.node_types.begin_restart( + resource_group_name=resource_group.name, + cluster_name="str", + node_type_name="str", + parameters={"force": bool, "nodes": ["str"], "updateType": "str"}, + api_version="2024-11-01-preview", + ) + ).result() # call '.result()' to poll until service return final result + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_restart(self, resource_group): + async def test_node_types_begin_reimage(self, resource_group): response = await ( - await self.client.node_types.begin_restart( + await self.client.node_types.begin_reimage( resource_group_name=resource_group.name, cluster_name="str", node_type_name="str", parameters={"force": bool, "nodes": ["str"], "updateType": "str"}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -49,14 +53,14 @@ async def test_begin_restart(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_reimage(self, resource_group): + async def test_node_types_begin_delete_node(self, resource_group): response = await ( - await self.client.node_types.begin_reimage( + await self.client.node_types.begin_delete_node( resource_group_name=resource_group.name, cluster_name="str", node_type_name="str", parameters={"force": bool, "nodes": ["str"], "updateType": "str"}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -65,14 +69,14 @@ async def test_begin_reimage(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete_node(self, resource_group): + async def test_node_types_begin_deallocate(self, resource_group): response = await ( - await self.client.node_types.begin_delete_node( + await self.client.node_types.begin_deallocate( resource_group_name=resource_group.name, cluster_name="str", node_type_name="str", parameters={"force": bool, "nodes": ["str"], "updateType": "str"}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -81,12 +85,115 @@ async def test_begin_delete_node(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_node_types_begin_start(self, resource_group): + response = await ( + await self.client.node_types.begin_start( + resource_group_name=resource_group.name, + cluster_name="str", + node_type_name="str", + parameters={"force": bool, "nodes": ["str"], "updateType": "str"}, + api_version="2024-11-01-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_node_types_begin_redeploy(self, resource_group): + response = await ( + await self.client.node_types.begin_redeploy( + resource_group_name=resource_group.name, + cluster_name="str", + node_type_name="str", + parameters={"force": bool, "nodes": ["str"], "updateType": "str"}, + api_version="2024-11-01-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_node_types_begin_start_fault_simulation(self, resource_group): + response = await ( + await self.client.node_types.begin_start_fault_simulation( + resource_group_name=resource_group.name, + cluster_name="str", + node_type_name="str", + parameters={"faultKind": "Zone", "force": bool, "zone": "str"}, + api_version="2024-11-01-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_node_types_begin_stop_fault_simulation(self, resource_group): + response = await ( + await self.client.node_types.begin_stop_fault_simulation( + resource_group_name=resource_group.name, + cluster_name="str", + node_type_name="str", + parameters={"simulationId": "str"}, + api_version="2024-11-01-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_node_types_get_fault_simulation(self, resource_group): + response = await self.client.node_types.get_fault_simulation( + resource_group_name=resource_group.name, + cluster_name="str", + node_type_name="str", + parameters={"simulationId": "str"}, + api_version="2024-11-01-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_node_types_list_fault_simulation(self, resource_group): + response = self.client.node_types.list_fault_simulation( + resource_group_name=resource_group.name, + cluster_name="str", + node_type_name="str", + api_version="2024-11-01-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_node_types_list_by_managed_clusters(self, resource_group): + response = self.client.node_types.list_by_managed_clusters( + resource_group_name=resource_group.name, + cluster_name="str", + api_version="2024-11-01-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_node_types_get(self, resource_group): response = await self.client.node_types.get( resource_group_name=resource_group.name, cluster_name="str", node_type_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -94,7 +201,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_node_types_begin_create_or_update(self, resource_group): response = await ( await self.client.node_types.begin_create_or_update( resource_group_name=resource_group.name, @@ -241,7 +348,7 @@ async def test_begin_create_or_update(self, resource_group): "vmSize": "str", "zones": ["str"], }, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -250,27 +357,29 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): - response = await self.client.node_types.update( - resource_group_name=resource_group.name, - cluster_name="str", - node_type_name="str", - parameters={"sku": {"capacity": 0, "name": "str", "tier": "str"}, "tags": {"str": "str"}}, - api_version="2024-06-01-preview", - ) + async def test_node_types_begin_update(self, resource_group): + response = await ( + await self.client.node_types.begin_update( + resource_group_name=resource_group.name, + cluster_name="str", + node_type_name="str", + parameters={"sku": {"capacity": 0, "name": "str", "tier": "str"}, "tags": {"str": "str"}}, + api_version="2024-11-01-preview", + ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_node_types_begin_delete(self, resource_group): response = await ( await self.client.node_types.begin_delete( resource_group_name=resource_group.name, cluster_name="str", node_type_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operation_results_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operation_results_operations.py index 4bcbd4b653d3..cef68d9801b8 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operation_results_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operation_results_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_operation_results_get(self, resource_group): response = self.client.operation_results.get( location="str", operation_id="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operation_results_operations_async.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operation_results_operations_async.py index 474aa8a73633..9424151379ae 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operation_results_operations_async.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operation_results_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_operation_results_get(self, resource_group): response = await self.client.operation_results.get( location="str", operation_id="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operation_status_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operation_status_operations.py index b39bcc376535..c0a6868566a8 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operation_status_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operation_status_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_operation_status_get(self, resource_group): response = self.client.operation_status.get( location="str", operation_id="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operation_status_operations_async.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operation_status_operations_async.py index 80f26cc68586..9818e329f9f1 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operation_status_operations_async.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operation_status_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_operation_status_get(self, resource_group): response = await self.client.operation_status.get( location="str", operation_id="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operations.py index 23d409ac3920..0fe35b1fb962 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operations_async.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operations_async.py index 516dcbd69cc9..c6efef4f36c5 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operations_async.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_services_operations.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_services_operations.py index 7ffd43319194..27e9e3ae7617 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_services_operations.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_services_operations.py @@ -20,13 +20,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_services_get(self, resource_group): response = self.client.services.get( resource_group_name=resource_group.name, cluster_name="str", application_name="str", service_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -34,7 +34,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_services_begin_create_or_update(self, resource_group): response = self.client.services.begin_create_or_update( resource_group_name=resource_group.name, cluster_name="str", @@ -56,7 +56,7 @@ def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -64,14 +64,14 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_services_update(self, resource_group): response = self.client.services.update( resource_group_name=resource_group.name, cluster_name="str", application_name="str", service_name="str", parameters={"tags": {"str": "str"}}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -79,13 +79,13 @@ def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_services_begin_delete(self, resource_group): response = self.client.services.begin_delete( resource_group_name=resource_group.name, cluster_name="str", application_name="str", service_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -93,12 +93,12 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_applications(self, resource_group): + def test_services_list_by_applications(self, resource_group): response = self.client.services.list_by_applications( resource_group_name=resource_group.name, cluster_name="str", application_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_services_operations_async.py b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_services_operations_async.py index 8d42016802d3..1978bc9f0960 100644 --- a/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_services_operations_async.py +++ b/sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/generated_tests/test_service_fabric_managed_clusters_management_services_operations_async.py @@ -21,13 +21,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_services_get(self, resource_group): response = await self.client.services.get( resource_group_name=resource_group.name, cluster_name="str", application_name="str", service_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -35,7 +35,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_services_begin_create_or_update(self, resource_group): response = await ( await self.client.services.begin_create_or_update( resource_group_name=resource_group.name, @@ -58,7 +58,7 @@ async def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -67,14 +67,14 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_services_update(self, resource_group): response = await self.client.services.update( resource_group_name=resource_group.name, cluster_name="str", application_name="str", service_name="str", parameters={"tags": {"str": "str"}}, - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) # please add some check logic here by yourself @@ -82,14 +82,14 @@ async def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_services_begin_delete(self, resource_group): response = await ( await self.client.services.begin_delete( resource_group_name=resource_group.name, cluster_name="str", application_name="str", service_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -98,12 +98,12 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_applications(self, resource_group): + async def test_services_list_by_applications(self, resource_group): response = self.client.services.list_by_applications( resource_group_name=resource_group.name, cluster_name="str", application_name="str", - api_version="2024-06-01-preview", + api_version="2024-11-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself