diff --git a/sdk/computefleet/azure-mgmt-computefleet/CHANGELOG.md b/sdk/computefleet/azure-mgmt-computefleet/CHANGELOG.md index 635e51cb43ab..b7fb325e2790 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/CHANGELOG.md +++ b/sdk/computefleet/azure-mgmt-computefleet/CHANGELOG.md @@ -1,5 +1,62 @@ # Release History +## 1.0.0 (2024-10-22) + +### Features Added + + - Model `ComputeProfile` added property `additional_virtual_machine_capabilities` + - Model `FleetProperties` added property `vm_attributes` + - Model `FleetProperties` added property `additional_locations_profile` + - Enum `DiskControllerTypes` added member `NV_ME` + - Enum `SecurityTypes` added member `CONFIDENTIAL_VM` + - Enum `WindowsVMGuestPatchMode` added member `AUTOMATIC_BY_OS` + - Added model `AdditionalCapabilities` + - Added model `AdditionalLocationsProfile` + - Added model `LocationProfile` + - Added model `VMAttributeMinMaxDouble` + - Added model `VMAttributeMinMaxInteger` + - Added model `VMAttributes` + - Added enum `AcceleratorManufacturer` + - Added enum `AcceleratorType` + - Added enum `ArchitectureType` + - Added enum `CpuManufacturer` + - Added enum `LocalStorageDiskType` + - Added enum `VMAttributeSupport` + - Added enum `VMCategory` + +### Breaking Changes + + - Model `LinuxConfiguration` renamed its instance variable `provision_v_m_agent` into `provision_vm_agent` + - Model `LinuxConfiguration` renamed its instance variable `enable_v_m_agent_platform_updates` into `enable_vm_agent_platform_updates` + - Model `SpotPriorityProfile` renamed its instance variable `max_price_per_v_m` into `max_price_per_vm` + - Model `VMSizeProperties` renamed its instance variable `v_c_p_us_available` into `v_cpus_available` + - Model `VMSizeProperties` renamed its instance variable `v_c_p_us_per_core` into `v_cpus_per_core` + - Model `VirtualMachineScaleSetDataDisk` renamed its instance variable `disk_size_g_b` into `disk_size_gb` + - Model `VirtualMachineScaleSetDataDisk` renamed its instance variable `disk_i_o_p_s_read_write` into `disk_iops_read_write` + - Model `VirtualMachineScaleSetIPConfigurationProperties` renamed its instance variable `public_i_p_address_configuration` into `public_ip_address_configuration` + - Model `VirtualMachineScaleSetIPConfigurationProperties` renamed its instance variable `private_i_p_address_version` into `private_ip_address_version` + - Model `VirtualMachineScaleSetNetworkConfigurationProperties` renamed its instance variable `enable_i_p_forwarding` into `enable_ip_forwarding` + - Model `VirtualMachineScaleSetOSDisk` renamed its instance variable `disk_size_g_b` into `disk_size_gb` + - Model `VirtualMachineScaleSetPublicIPAddressConfigurationProperties` renamed its instance variable `public_i_p_prefix` into `public_ip_prefix` + - Model `VirtualMachineScaleSetPublicIPAddressConfigurationProperties` renamed its instance variable `public_i_p_address_version` into `public_ip_address_version` + - Model `WindowsConfiguration` renamed its instance variable `provision_v_m_agent` into `provision_vm_agent` + - Model `WindowsConfiguration` renamed its instance variable `win_r_m` into `win_rm` + - Model `WindowsConfiguration` renamed its instance variable `enable_v_m_agent_platform_updates` into `enable_vm_agent_platform_updates` + - Deleted or renamed enum value `DiskControllerTypes.N_V_ME` + - Deleted or renamed enum value `NetworkApiVersion.ENUM_2020_11_01` + - Deleted or renamed enum value `SecurityEncryptionTypes.DISK_WITH_V_M_GUEST_STATE` + - Deleted or renamed enum value `SecurityEncryptionTypes.NON_PERSISTED_T_P_M` + - Deleted or renamed enum value `SecurityEncryptionTypes.V_M_GUEST_STATE_ONLY` + - Deleted or renamed enum value `SecurityTypes.CONFIDENTIAL_V_M` + - Deleted or renamed enum value `StorageAccountTypes.PREMIUM_L_R_S` + - Deleted or renamed enum value `StorageAccountTypes.PREMIUM_V2_L_R_S` + - Deleted or renamed enum value `StorageAccountTypes.PREMIUM_Z_R_S` + - Deleted or renamed enum value `StorageAccountTypes.STANDARD_L_R_S` + - Deleted or renamed enum value `StorageAccountTypes.STANDARD_S_S_D_L_R_S` + - Deleted or renamed enum value `StorageAccountTypes.STANDARD_S_S_D_Z_R_S` + - Deleted or renamed enum value `StorageAccountTypes.ULTRA_S_S_D_L_R_S` + - Deleted or renamed enum value `WindowsVMGuestPatchMode.AUTOMATIC_BY_O_S` + ## 1.0.0b1 (2024-07-22) ### Other Changes diff --git a/sdk/computefleet/azure-mgmt-computefleet/_meta.json b/sdk/computefleet/azure-mgmt-computefleet/_meta.json index 66649e3ac4f6..e8f721942b71 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/_meta.json +++ b/sdk/computefleet/azure-mgmt-computefleet/_meta.json @@ -1,6 +1,6 @@ { - "commit": "c1cea38fb7e5cec9afe223a2ed15cbe2fbeecbdb", + "commit": "fda3d5e4ae4c69aa72ddfdf5ca1b6d5795a03e71", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/azurefleet/AzureFleet.Management", - "@azure-tools/typespec-python": "0.26.0" + "@azure-tools/typespec-python": "0.35.1" } \ No newline at end of file diff --git a/sdk/computefleet/azure-mgmt-computefleet/assets.json b/sdk/computefleet/azure-mgmt-computefleet/assets.json deleted file mode 100644 index 9d038499da41..000000000000 --- a/sdk/computefleet/azure-mgmt-computefleet/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "python", - "TagPrefix": "python/computefleet/azure-mgmt-computefleet", - "Tag": "python/computefleet/azure-mgmt-computefleet_ea3fe1a9a5" -} diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_client.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_client.py index 1e79203618f3..6aff7c6f0d21 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_client.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_client.py @@ -20,11 +20,10 @@ from .operations import FleetsOperations, Operations if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class ComputeFleetMgmtClient: # pylint: disable=client-accepts-api-version-keyword +class ComputeFleetMgmtClient: """ComputeFleetMgmtClient. :ivar operations: Operations operations @@ -37,9 +36,8 @@ class ComputeFleetMgmtClient: # pylint: disable=client-accepts-api-version-keyw :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is - "2024-05-01-preview". Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Default value is "2024-11-01". + 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 Retry-After header is present. @@ -52,8 +50,9 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: + _endpoint = "{endpoint}" self._config = ComputeFleetMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs ) _policies = kwargs.pop("policies", None) if _policies is None: @@ -73,7 +72,7 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) self._serialize = Serializer() self._deserialize = Deserializer() @@ -100,7 +99,11 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_configuration.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_configuration.py index 3c1a02ec15fa..a207b596a4f6 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_configuration.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_configuration.py @@ -14,11 +14,10 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class ComputeFleetMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class ComputeFleetMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for ComputeFleetMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -28,14 +27,21 @@ class ComputeFleetMgmtClientConfiguration: # pylint: disable=too-many-instance- :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: The API version to use for this operation. Default value is - "2024-05-01-preview". Note that overriding this default value may result in unsupported - behavior. + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: The API version to use for this operation. Default value is "2024-11-01". + 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-05-01-preview") + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2024-11-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -44,6 +50,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-computefleet/{}".format(VERSION)) diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_model_base.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_model_base.py index 43fd8c7e9b1b..9d401b0cf012 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_model_base.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_model_base.py @@ -1,10 +1,11 @@ +# 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. # -------------------------------------------------------------------------- -# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except +# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except, too-many-lines import copy import calendar @@ -19,6 +20,7 @@ import email.utils from datetime import datetime, date, time, timedelta, timezone from json import JSONEncoder +import xml.etree.ElementTree as ET from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError @@ -123,7 +125,7 @@ def _serialize_datetime(o, format: typing.Optional[str] = None): def _is_readonly(p): try: - return p._visibility == ["read"] # pylint: disable=protected-access + return p._visibility == ["read"] except AttributeError: return False @@ -286,6 +288,12 @@ def _deserialize_decimal(attr): return decimal.Decimal(str(attr)) +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(attr) + + _DESERIALIZE_MAPPING = { datetime: _deserialize_datetime, date: _deserialize_date, @@ -307,9 +315,11 @@ def _deserialize_decimal(attr): def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str if rf and rf._format: return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) - return _DESERIALIZE_MAPPING.get(annotation) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore def _get_type_alias_type(module_name: str, alias_name: str): @@ -441,6 +451,10 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m return float(o) if isinstance(o, enum.Enum): return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o try: # First try datetime.datetime return _serialize_datetime(o, format) @@ -471,11 +485,16 @@ def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typin return value if rf._is_model: return _deserialize(rf._type, value) + if isinstance(value, ET.Element): + value = _deserialize(rf._type, value) return _serialize(value, rf._format) class Model(_MyMutableMapping): _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: typing.Set[str] = set() def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ @@ -486,10 +505,58 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: for rest_field in self._attr_to_rest_field.values() if rest_field._default is not _UNSET } - if args: - dict_to_pass.update( - {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} - ) + if args: # pylint: disable=too-many-nested-blocks + if isinstance(args[0], ET.Element): + existed_attr_keys = [] + model_meta = getattr(self, "_xml", {}) + + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + # unwrapped array could either use prop items meta/prop meta + if prop_meta.get("itemsName"): + xml_name = prop_meta.get("itemsName") + xml_ns = prop_meta.get("itemNs") + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = args[0].findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) + continue + + # text element is primitive type + if prop_meta.get("text", False): + if args[0].text is not None: + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) + continue + + # wrapped element could be normal property or array, it should only have one element + item = args[0].find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in args[0]: + if e.tag not in existed_attr_keys: + dict_to_pass[e.tag] = _convert_element(e) + else: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) else: non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] if non_attr_kwargs: @@ -508,24 +575,27 @@ def copy(self) -> "Model": return Model(self.__dict__) def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument - # we know the last three classes in mro are going to be 'Model', 'dict', and 'object' - mros = cls.__mro__[:-3][::-1] # ignore model, dict, and object parents, and reverse the mro order - attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property - k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") - } - annotations = { - k: v - for mro_class in mros - if hasattr(mro_class, "__annotations__") # pylint: disable=no-member - for k, v in mro_class.__annotations__.items() # pylint: disable=no-member - } - for attr, rf in attr_to_rest_field.items(): - rf._module = cls.__module__ - if not rf._type: - rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) - if not rf._rest_name_input: - rf._rest_name_input = attr - cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") # pylint: disable=no-member + for k, v in mro_class.__annotations__.items() # pylint: disable=no-member + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) # pylint: disable=no-value-for-parameter @@ -535,12 +605,10 @@ def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member @classmethod - def _get_discriminator(cls, exist_discriminators) -> typing.Optional[str]: + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: for v in cls.__dict__.values(): - if ( - isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators - ): # pylint: disable=protected-access - return v._rest_name # pylint: disable=protected-access + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v return None @classmethod @@ -548,14 +616,28 @@ def _deserialize(cls, data, exist_discriminators): if not hasattr(cls, "__mapping__"): # pylint: disable=no-member return cls(data) discriminator = cls._get_discriminator(exist_discriminators) - exist_discriminators.append(discriminator) - mapped_cls = cls.__mapping__.get(data.get(discriminator), cls) # pyright: ignore # pylint: disable=no-member - if mapped_cls == cls: + if discriminator is None: return cls(data) - return mapped_cls._deserialize(data, exist_discriminators) # pylint: disable=protected-access + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + return mapped_cls._deserialize(data, exist_discriminators) def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: - """Return a dict that can be JSONify using json.dump. + """Return a dict that can be turned into json using json.dump. :keyword bool exclude_readonly: Whether to remove the readonly properties. :returns: A dict JSON compatible object @@ -563,6 +645,7 @@ def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing. """ result = {} + readonly_props = [] if exclude_readonly: readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] for k, v in self.items(): @@ -617,6 +700,8 @@ def _deserialize_dict( ): if obj is None: return obj + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in obj} return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} @@ -637,6 +722,8 @@ def _deserialize_sequence( ): if obj is None: return obj + if isinstance(obj, ET.Element): + obj = list(obj) return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) @@ -647,12 +734,12 @@ def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.An ) -def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, R0912 +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None, ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: - if not annotation or annotation in [int, float]: + if not annotation: return None # is it a type alias? @@ -727,7 +814,6 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, try: if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore if len(annotation.__args__) > 1: # pyright: ignore - entry_deserializers = [ _get_deserialize_callable_from_annotation(dt, module, rf) for dt in annotation.__args__ # pyright: ignore @@ -762,12 +848,23 @@ def _deserialize_default( def _deserialize_with_callable( deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], value: typing.Any, -): +): # pylint: disable=too-many-return-statements try: if value is None or isinstance(value, _Null): return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None if deserializer is None: return value + if deserializer in [int, float, bool]: + return deserializer(value) if isinstance(deserializer, CaseInsensitiveEnumMeta): try: return deserializer(value) @@ -808,6 +905,7 @@ def __init__( default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, ): self._type = type self._rest_name_input = name @@ -818,6 +916,7 @@ def __init__( self._default = default self._format = format self._is_multipart_file_input = is_multipart_file_input + self._xml = xml if xml is not None else {} @property def _class_type(self) -> typing.Any: @@ -868,6 +967,7 @@ def rest_field( default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, ) -> typing.Any: return _RestField( name=name, @@ -876,6 +976,7 @@ def rest_field( default=default, format=format, is_multipart_file_input=is_multipart_file_input, + xml=xml, ) @@ -884,5 +985,175 @@ def rest_discriminator( name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin visibility: typing.Optional[typing.List[str]] = None, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, ) -> typing.Any: - return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility) + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, typing.List[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + wrapped_element = _create_xml_element( + model_meta.get("name", o.__class__.__name__), + model_meta.get("prefix"), + model_meta.get("ns"), + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # if no ns for prop, use model's + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + xml_name = prop_meta.get("name", k) + if prop_meta.get("ns"): + ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore + xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore + # attribute should be primitive type + wrapped_element.set(xml_name, _get_primitive_type_value(v)) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": parent_meta.get("ns") if parent_meta else None, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[typing.Dict[str, typing.Any]], +) -> ET.Element: + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _create_xml_element(tag, prefix=None, ns=None): + if prefix and ns: + ET.register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: typing.Dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: typing.List[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_serialization.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_serialization.py index 8139854b97bb..7b3074215a30 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_serialization.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_serialization.py @@ -24,7 +24,6 @@ # # -------------------------------------------------------------------------- -# pylint: skip-file # pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode @@ -52,7 +51,6 @@ MutableMapping, Type, List, - Mapping, ) try: @@ -91,6 +89,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 +112,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 +155,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 +189,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) @@ -235,24 +255,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 +329,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 +365,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 +389,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 +425,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 +443,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 +456,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 +475,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,7 +499,7 @@ 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 @@ -456,6 +507,11 @@ 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 @@ -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"} @@ -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,7 +1450,7 @@ 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): self.deserialize_type = { @@ -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/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_version.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_version.py index be71c81bd282..0ec13ea52bbf 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_version.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" +VERSION = "1.0.0" diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/_client.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/_client.py index 960611ab404e..4184cc33345c 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/_client.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/_client.py @@ -20,11 +20,10 @@ from .operations import FleetsOperations, Operations if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class ComputeFleetMgmtClient: # pylint: disable=client-accepts-api-version-keyword +class ComputeFleetMgmtClient: """ComputeFleetMgmtClient. :ivar operations: Operations operations @@ -37,9 +36,8 @@ class ComputeFleetMgmtClient: # pylint: disable=client-accepts-api-version-keyw :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is - "2024-05-01-preview". Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Default value is "2024-11-01". + 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 Retry-After header is present. @@ -52,8 +50,9 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: + _endpoint = "{endpoint}" self._config = ComputeFleetMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs ) _policies = kwargs.pop("policies", None) if _policies is None: @@ -73,7 +72,7 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) self._serialize = Serializer() self._deserialize = Deserializer() @@ -102,7 +101,11 @@ def send_request( """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/_configuration.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/_configuration.py index 57af14e52417..4f2f68b6609c 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/_configuration.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/_configuration.py @@ -14,11 +14,10 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class ComputeFleetMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class ComputeFleetMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for ComputeFleetMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -28,14 +27,21 @@ class ComputeFleetMgmtClientConfiguration: # pylint: disable=too-many-instance- :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: The API version to use for this operation. Default value is - "2024-05-01-preview". Note that overriding this default value may result in unsupported - behavior. + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: The API version to use for this operation. Default value is "2024-11-01". + 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-05-01-preview") + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2024-11-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -44,6 +50,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-computefleet/{}".format(VERSION)) diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/operations/_operations.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/operations/_operations.py index a2a09b821285..d32a7ad8db38 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/operations/_operations.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/operations/_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. @@ -9,21 +9,7 @@ from io import IOBase import json import sys -from typing import ( - Any, - AsyncIterable, - AsyncIterator, - Callable, - Dict, - IO, - List, - Optional, - Type, - TypeVar, - Union, - cast, - overload, -) +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -62,7 +48,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]] JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -92,30 +78,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: :return: An iterator like instance of Operation :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.computefleet.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "actionType": "str", - "display": { - "description": "str", - "operation": "str", - "provider": "str", - "resource": "str" - }, - "isDataAction": bool, - "name": "str", - "origin": "str" - } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -131,7 +100,12 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -146,7 +120,12 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request @@ -205,440 +184,8 @@ async def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> :return: Fleet. The Fleet is compatible with MutableMapping :rtype: ~azure.mgmt.computefleet.models.Fleet :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -659,7 +206,10 @@ async def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access @@ -691,7 +241,7 @@ async def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> async def _create_or_update_initial( self, resource_group_name: str, fleet_name: str, resource: Union[_models.Fleet, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -722,7 +272,10 @@ async def _create_or_update_initial( headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access @@ -741,13 +294,10 @@ async def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 200: - deserialized = response.iter_bytes() - if response.status_code == 201: response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -780,867 +330,6 @@ async def begin_create_or_update( MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - resource = { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } - - # response body for status code(s): 200, 201 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ @overload @@ -1669,438 +358,6 @@ async def begin_create_or_update( MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200, 201 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ @overload @@ -2129,438 +386,6 @@ async def begin_create_or_update( MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200, 201 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ @distributed_trace_async @@ -2581,867 +406,6 @@ async def begin_create_or_update( MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - resource = { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } - - # response body for status code(s): 200, 201 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} @@ -3472,8 +436,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3496,7 +466,7 @@ async def _update_initial( properties: Union[_models.FleetUpdate, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3527,7 +497,10 @@ async def _update_initial( headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access @@ -3546,14 +519,11 @@ async def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 200: - deserialized = response.iter_bytes() - if response.status_code == 202: response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3586,850 +556,6 @@ async def begin_update( MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - properties = { - "identity": { - "type": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "plan": { - "name": "str", - "product": "str", - "promotionCode": "str", - "publisher": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "tags": { - "str": "str" - } - } - - # response body for status code(s): 200, 202 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ @overload @@ -4458,438 +584,6 @@ async def begin_update( MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200, 202 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ @overload @@ -4918,438 +612,6 @@ async def begin_update( MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200, 202 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ @distributed_trace_async @@ -5374,850 +636,6 @@ async def begin_update( MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - properties = { - "identity": { - "type": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "plan": { - "name": "str", - "product": "str", - "promotionCode": "str", - "publisher": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "tags": { - "str": "str" - } - } - - # response body for status code(s): 200, 202 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} @@ -6248,8 +666,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -6266,7 +690,7 @@ def get_long_running_output(pipeline_response): ) async def _delete_initial(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6287,7 +711,10 @@ async def _delete_initial(self, resource_group_name: str, fleet_name: str, **kwa headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access @@ -6310,10 +737,7 @@ async def _delete_initial(self, resource_group_name: str, fleet_name: str, **kwa response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() - - if response.status_code == 204: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6356,8 +780,14 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- if cls: return cls(pipeline_response, None, {}) # type: ignore + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -6381,445 +811,13 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy :return: An iterator like instance of Fleet :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} cls: ClsType[List[_models.Fleet]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6837,7 +835,12 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -6852,7 +855,12 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request @@ -6888,445 +896,13 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Fleet"]: :return: An iterator like instance of Fleet :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} cls: ClsType[List[_models.Fleet]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7343,7 +919,12 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -7358,7 +939,12 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request @@ -7402,39 +988,13 @@ def list_virtual_machine_scale_sets( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.computefleet.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "id": "str", - "operationStatus": "str", - "error": { - "code": "str", - "details": [ - { - "code": "str", - "message": "str", - "target": "str" - } - ], - "innererror": { - "errorDetail": "str", - "exceptionType": "str" - }, - "message": "str", - "target": "str" - }, - "type": "str" - } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} cls: ClsType[List[_models.VirtualMachineScaleSet]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7453,7 +1013,12 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -7468,7 +1033,12 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/__init__.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/__init__.py index cd3010500b5a..4f5387c39f12 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/__init__.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/__init__.py @@ -6,6 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from ._models import AdditionalCapabilities +from ._models import AdditionalLocationsProfile from ._models import AdditionalUnattendContent from ._models import ApiEntityReference from ._models import ApiError @@ -31,6 +33,7 @@ from ._models import LinuxConfiguration from ._models import LinuxPatchSettings from ._models import LinuxVMGuestPatchAutomaticByPlatformSettings +from ._models import LocationProfile from ._models import ManagedServiceIdentity from ._models import ManagedServiceIdentityUpdate from ._models import OSImageNotificationProfile @@ -56,6 +59,9 @@ from ._models import TrackedResource from ._models import UefiSettings from ._models import UserAssignedIdentity +from ._models import VMAttributeMinMaxDouble +from ._models import VMAttributeMinMaxInteger +from ._models import VMAttributes from ._models import VMDiskSecurityProfile from ._models import VMGalleryApplication from ._models import VMSizeProperties @@ -88,8 +94,12 @@ from ._models import WindowsConfiguration from ._models import WindowsVMGuestPatchAutomaticByPlatformSettings +from ._enums import AcceleratorManufacturer +from ._enums import AcceleratorType from ._enums import ActionType +from ._enums import ArchitectureType from ._enums import CachingTypes +from ._enums import CpuManufacturer from ._enums import CreatedByType from ._enums import DeleteOptions from ._enums import DiffDiskOptions @@ -103,6 +113,7 @@ from ._enums import LinuxPatchAssessmentMode from ._enums import LinuxVMGuestPatchAutomaticByPlatformRebootSetting from ._enums import LinuxVMGuestPatchMode +from ._enums import LocalStorageDiskType from ._enums import ManagedServiceIdentityType from ._enums import Mode from ._enums import NetworkApiVersion @@ -120,6 +131,8 @@ from ._enums import SettingNames from ._enums import SpotAllocationStrategy from ._enums import StorageAccountTypes +from ._enums import VMAttributeSupport +from ._enums import VMCategory from ._enums import WindowsPatchAssessmentMode from ._enums import WindowsVMGuestPatchAutomaticByPlatformRebootSetting from ._enums import WindowsVMGuestPatchMode @@ -128,6 +141,8 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "AdditionalCapabilities", + "AdditionalLocationsProfile", "AdditionalUnattendContent", "ApiEntityReference", "ApiError", @@ -153,6 +168,7 @@ "LinuxConfiguration", "LinuxPatchSettings", "LinuxVMGuestPatchAutomaticByPlatformSettings", + "LocationProfile", "ManagedServiceIdentity", "ManagedServiceIdentityUpdate", "OSImageNotificationProfile", @@ -178,6 +194,9 @@ "TrackedResource", "UefiSettings", "UserAssignedIdentity", + "VMAttributeMinMaxDouble", + "VMAttributeMinMaxInteger", + "VMAttributes", "VMDiskSecurityProfile", "VMGalleryApplication", "VMSizeProperties", @@ -209,8 +228,12 @@ "WinRMListener", "WindowsConfiguration", "WindowsVMGuestPatchAutomaticByPlatformSettings", + "AcceleratorManufacturer", + "AcceleratorType", "ActionType", + "ArchitectureType", "CachingTypes", + "CpuManufacturer", "CreatedByType", "DeleteOptions", "DiffDiskOptions", @@ -224,6 +247,7 @@ "LinuxPatchAssessmentMode", "LinuxVMGuestPatchAutomaticByPlatformRebootSetting", "LinuxVMGuestPatchMode", + "LocalStorageDiskType", "ManagedServiceIdentityType", "Mode", "NetworkApiVersion", @@ -241,6 +265,8 @@ "SettingNames", "SpotAllocationStrategy", "StorageAccountTypes", + "VMAttributeSupport", + "VMCategory", "WindowsPatchAssessmentMode", "WindowsVMGuestPatchAutomaticByPlatformRebootSetting", "WindowsVMGuestPatchMode", diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_enums.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_enums.py index 5fdf63bfc764..dcfe49071def 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_enums.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_enums.py @@ -10,6 +10,26 @@ from azure.core import CaseInsensitiveEnumMeta +class AcceleratorManufacturer(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Accelerator manufacturers supported by Azure VMs.""" + + AMD = "AMD" + """AMD GpuType""" + NVIDIA = "Nvidia" + """Nvidia GpuType""" + XILINX = "Xilinx" + """Xilinx GpuType""" + + +class AcceleratorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Accelerator types supported by Azure VMs.""" + + GPU = "GPU" + """GPU Accelerator""" + FPGA = "FPGA" + """FPGA Accelerator""" + + class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -19,6 +39,15 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Actions are for internal-only APIs.""" +class ArchitectureType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Architecture types supported by Azure VMs.""" + + ARM64 = "ARM64" + """ARM64 Architecture""" + X64 = "X64" + """X64 Architecture""" + + class CachingTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the caching requirements.""" @@ -30,6 +59,19 @@ class CachingTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """'ReadWrite' is default for OS Disk""" +class CpuManufacturer(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Cpu Manufacturers supported by Azure VMs.""" + + INTEL = "Intel" + """Intel CPU.""" + AMD = "AMD" + """AMD CPU.""" + MICROSOFT = "Microsoft" + """Microsoft CPU.""" + AMPERE = "Ampere" + """Ampere CPU.""" + + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The kind of entity that created the resource.""" @@ -93,7 +135,7 @@ class DiskControllerTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): SCSI = "SCSI" """SCSI disk type""" - N_V_ME = "NVMe" + NV_ME = "NVMe" """NVMe disk type""" @@ -212,6 +254,15 @@ class LinuxVMGuestPatchMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): provisionVMAgent must be true.""" +class LocalStorageDiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Different kind of Local storage disk types supported by Azure VMs.""" + + HDD = "HDD" + """HDD DiskType.""" + SSD = "SSD" + """SDD DiskType.""" + + class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). @@ -246,7 +297,7 @@ class NetworkApiVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): with orchestration mode 'Flexible'. """ - ENUM_2020_11_01 = "2020-11-01" + V2020_11_01 = "2020-11-01" """Initial version supported. Later versions are supported as well.""" @@ -368,13 +419,13 @@ class SecurityEncryptionTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): **Note:** It can be set for only Confidential VMs. """ - V_M_GUEST_STATE_ONLY = "VMGuestStateOnly" + VM_GUEST_STATE_ONLY = "VMGuestStateOnly" """EncryptionType of the managed disk is set to VMGuestStateOnly for encryption of just the VMGuestState blob.""" - DISK_WITH_V_M_GUEST_STATE = "DiskWithVMGuestState" + DISK_WITH_VM_GUEST_STATE = "DiskWithVMGuestState" """EncryptionType of the managed disk is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob.""" - NON_PERSISTED_T_P_M = "NonPersistedTPM" + NON_PERSISTED_TPM = "NonPersistedTPM" """EncryptionType of the managed disk is set to NonPersistedTPM for not persisting firmware state in the VMGuestState blob.""" @@ -387,7 +438,7 @@ class SecurityTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): TRUSTED_LAUNCH = "TrustedLaunch" """TrustedLaunch security type""" - CONFIDENTIAL_V_M = "ConfidentialVM" + CONFIDENTIAL_VM = "ConfidentialVM" """ConfidentialVM security type""" @@ -428,22 +479,71 @@ class StorageAccountTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): https://docs.microsoft.com/azure/virtual-machines/linux/disks-types. """ - STANDARD_L_R_S = "Standard_LRS" + STANDARD_LRS = "Standard_LRS" """Standard_LRS option.""" - PREMIUM_L_R_S = "Premium_LRS" + PREMIUM_LRS = "Premium_LRS" """Premium_LRS option.""" - STANDARD_S_S_D_L_R_S = "StandardSSD_LRS" + STANDARD_SSD_LRS = "StandardSSD_LRS" """StandardSSD_LRS option.""" - ULTRA_S_S_D_L_R_S = "UltraSSD_LRS" + ULTRA_SSD_LRS = "UltraSSD_LRS" """UltraSSD_LRS option.""" - PREMIUM_Z_R_S = "Premium_ZRS" + PREMIUM_ZRS = "Premium_ZRS" """Premium_ZRS option.""" - STANDARD_S_S_D_Z_R_S = "StandardSSD_ZRS" + STANDARD_SSD_ZRS = "StandardSSD_ZRS" """StandardSSD_ZRS option.""" - PREMIUM_V2_L_R_S = "PremiumV2_LRS" + PREMIUM_V2_LRS = "PremiumV2_LRS" """PremiumV2_LRS option.""" +class VMAttributeSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """VMSizes supported by Azure VMs. Included is a union of Excluded and Required.""" + + EXCLUDED = "Excluded" + """All VMSizes having the feature support will be excluded.""" + INCLUDED = "Included" + """VMSizes that have the feature support and that do not have the feature support will be used. + Included is a union of Excluded and Required.""" + REQUIRED = "Required" + """Only the VMSizes having the feature support will be used.""" + + +class VMCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """VMCategories defined for Azure VMs. + See: + https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/overview?tabs=breakdownseries%2Cgeneralsizelist%2Ccomputesizelist%2Cmemorysizelist%2Cstoragesizelist%2Cgpusizelist%2Cfpgasizelist%2Chpcsizelist#general-purpose. + """ + + GENERAL_PURPOSE = "GeneralPurpose" + """General purpose VM sizes provide balanced CPU-to-memory ratio. Ideal for testing and + development, small to medium databases, and low to medium traffic web servers.""" + COMPUTE_OPTIMIZED = "ComputeOptimized" + """Compute optimized VM sizes have a high CPU-to-memory ratio. These sizes are good for medium + traffic web servers, network appliances, batch processes, and application servers.""" + MEMORY_OPTIMIZED = "MemoryOptimized" + """Memory optimized VM sizes offer a high memory-to-CPU ratio that is great for relational + database servers, medium to large caches, and in-memory analytics.""" + STORAGE_OPTIMIZED = "StorageOptimized" + """Storage optimized virtual machine (VM) sizes offer high disk throughput and IO, and are ideal + for Big Data, SQL, NoSQL databases, data warehousing, and large transactional databases. + Examples include Cassandra, MongoDB, Cloudera, and Redis.""" + GPU_ACCELERATED = "GpuAccelerated" + """GPU optimized VM sizes are specialized virtual machines available with single, multiple, or + fractional GPUs. + These sizes are designed for compute-intensive, graphics-intensive, and visualization + workloads.""" + FPGA_ACCELERATED = "FpgaAccelerated" + """FPGA optimized VM sizes are specialized virtual machines available with single or multiple + FPGA. + These sizes are designed for compute-intensive workloads. This article provides information + about the number and type of FPGA, vCPUs, data disks, and NICs. + Storage throughput and network bandwidth are also included for each size in this grouping.""" + HIGH_PERFORMANCE_COMPUTE = "HighPerformanceCompute" + """Azure High Performance Compute VMs are optimized for various HPC workloads such as + computational fluid dynamics, finite element analysis, frontend and backend EDA, + rendering, molecular dynamics, computational geo science, weather simulation, and financial + risk analysis.""" + + class WindowsPatchAssessmentMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the mode of VM Guest patch assessment for the IaaS virtual machine.""" @@ -478,7 +578,7 @@ class WindowsVMGuestPatchMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): You do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates must be false""" - AUTOMATIC_BY_O_S = "AutomaticByOS" + AUTOMATIC_BY_OS = "AutomaticByOS" """The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be true.""" AUTOMATIC_BY_PLATFORM = "AutomaticByPlatform" diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_models.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_models.py index fb90cf1120f2..55e1a980db89 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_models.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_models.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. @@ -14,10 +14,77 @@ from .._model_base import rest_field if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from .. import models as _models +class AdditionalCapabilities(_model_base.Model): + """AdditionalCapabilities for VM. + + :ivar ultra_ssd_enabled: The flag that enables or disables a capability to have one or more + managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. + Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or + virtual machine scale set only if this property is enabled. + :vartype ultra_ssd_enabled: bool + :ivar hibernation_enabled: The flag that enables or disables hibernation capability on the VM. + :vartype hibernation_enabled: bool + """ + + ultra_ssd_enabled: Optional[bool] = rest_field(name="ultraSSDEnabled") + """The flag that enables or disables a capability to have one or more managed data disks with + UltraSSD_LRS storage account type on the VM or VMSS. + Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or + virtual machine scale set only if this property is enabled.""" + hibernation_enabled: Optional[bool] = rest_field(name="hibernationEnabled") + """The flag that enables or disables hibernation capability on the VM.""" + + @overload + def __init__( + self, + *, + ultra_ssd_enabled: Optional[bool] = None, + hibernation_enabled: Optional[bool] = None, + ): ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AdditionalLocationsProfile(_model_base.Model): + """Represents the configuration for additional locations where Fleet resources may be deployed. + + + :ivar location_profiles: The list of location profiles. Required. + :vartype location_profiles: list[~azure.mgmt.computefleet.models.LocationProfile] + """ + + location_profiles: List["_models.LocationProfile"] = rest_field(name="locationProfiles") + """The list of location profiles. Required.""" + + @overload + def __init__( + self, + *, + location_profiles: List["_models.LocationProfile"], + ): ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + class AdditionalUnattendContent(_model_base.Model): """Specifies additional XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. Contents are defined by @@ -467,7 +534,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles class ComputeProfile(_model_base.Model): """Compute Profile to use for running user's workloads. - All required parameters must be populated in order to send to server. :ivar base_virtual_machine_profile: Base Virtual Machine Profile Properties to be specified according to @@ -487,6 +553,13 @@ class ComputeProfile(_model_base.Model): as possible). This property cannot be updated. :vartype platform_fault_domain_count: int + :ivar additional_virtual_machine_capabilities: Specifies VMSS and VM API entity models support + two additional capabilities as of today: ultraSSDEnabled and hibernationEnabled. + ultraSSDEnabled: Enables UltraSSD_LRS storage account type on the VMSS VMs. + hibernationEnabled: Enables the hibernation capability on the VMSS VMs. + Default value is null if not specified. This property cannot be updated once set. + :vartype additional_virtual_machine_capabilities: + ~azure.mgmt.computefleet.models.AdditionalCapabilities """ base_virtual_machine_profile: "_models.BaseVirtualMachineProfile" = rest_field(name="baseVirtualMachineProfile") @@ -504,6 +577,14 @@ class ComputeProfile(_model_base.Model): If not specified, defaults to 1, which represents \"Max Spreading\" (using as many fault domains as possible). This property cannot be updated.""" + additional_virtual_machine_capabilities: Optional["_models.AdditionalCapabilities"] = rest_field( + name="additionalVirtualMachineCapabilities" + ) + """Specifies VMSS and VM API entity models support two additional capabilities as of today: + ultraSSDEnabled and hibernationEnabled. + ultraSSDEnabled: Enables UltraSSD_LRS storage account type on the VMSS VMs. + hibernationEnabled: Enables the hibernation capability on the VMSS VMs. + Default value is null if not specified. This property cannot be updated once set.""" @overload def __init__( @@ -512,6 +593,7 @@ def __init__( base_virtual_machine_profile: "_models.BaseVirtualMachineProfile", compute_api_version: Optional[str] = None, platform_fault_domain_count: Optional[int] = None, + additional_virtual_machine_capabilities: Optional["_models.AdditionalCapabilities"] = None, ): ... @overload @@ -784,7 +866,6 @@ class TrackedResource(Resource): Readonly variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long @@ -832,7 +913,6 @@ class Fleet(TrackedResource): Readonly variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long @@ -896,7 +976,6 @@ class FleetProperties(_model_base.Model): Readonly variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting", and "Migrating". @@ -907,6 +986,12 @@ class FleetProperties(_model_base.Model): :vartype regular_priority_profile: ~azure.mgmt.computefleet.models.RegularPriorityProfile :ivar vm_sizes_profile: List of VM sizes supported for Compute Fleet. Required. :vartype vm_sizes_profile: list[~azure.mgmt.computefleet.models.VmSizeProfile] + :ivar vm_attributes: Attribute based Fleet. + :vartype vm_attributes: ~azure.mgmt.computefleet.models.VMAttributes + :ivar additional_locations_profile: Represents the configuration for additional locations where + Fleet resources may be deployed. + :vartype additional_locations_profile: + ~azure.mgmt.computefleet.models.AdditionalLocationsProfile :ivar compute_profile: Compute Profile to use for running user's workloads. Required. :vartype compute_profile: ~azure.mgmt.computefleet.models.ComputeProfile :ivar time_created: Specifies the time at which the Compute Fleet is created. @@ -926,6 +1011,12 @@ class FleetProperties(_model_base.Model): """Configuration Options for Regular instances in Compute Fleet.""" vm_sizes_profile: List["_models.VmSizeProfile"] = rest_field(name="vmSizesProfile") """List of VM sizes supported for Compute Fleet. Required.""" + vm_attributes: Optional["_models.VMAttributes"] = rest_field(name="vmAttributes") + """Attribute based Fleet.""" + additional_locations_profile: Optional["_models.AdditionalLocationsProfile"] = rest_field( + name="additionalLocationsProfile" + ) + """Represents the configuration for additional locations where Fleet resources may be deployed.""" compute_profile: "_models.ComputeProfile" = rest_field(name="computeProfile") """Compute Profile to use for running user's workloads. Required.""" time_created: Optional[datetime.datetime] = rest_field(name="timeCreated", visibility=["read"], format="rfc3339") @@ -941,6 +1032,8 @@ def __init__( compute_profile: "_models.ComputeProfile", spot_priority_profile: Optional["_models.SpotPriorityProfile"] = None, regular_priority_profile: Optional["_models.RegularPriorityProfile"] = None, + vm_attributes: Optional["_models.VMAttributes"] = None, + additional_locations_profile: Optional["_models.AdditionalLocationsProfile"] = None, ): ... @overload @@ -1131,7 +1224,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles class KeyVaultSecretReference(_model_base.Model): """Describes a reference to Key Vault Secret. - All required parameters must be populated in order to send to server. :ivar secret_url: The URL referencing a secret in a Key Vault. Required. :vartype secret_url: str @@ -1173,33 +1265,33 @@ class LinuxConfiguration(_model_base.Model): :vartype disable_password_authentication: bool :ivar ssh: Specifies the ssh key configuration for a Linux OS. :vartype ssh: ~azure.mgmt.computefleet.models.SshConfiguration - :ivar provision_v_m_agent: Indicates whether virtual machine agent should be provisioned on the + :ivar provision_vm_agent: Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. - :vartype provision_v_m_agent: bool + :vartype provision_vm_agent: bool :ivar patch_settings: [Preview Feature] Specifies settings related to VM Guest Patching on Linux. :vartype patch_settings: ~azure.mgmt.computefleet.models.LinuxPatchSettings - :ivar enable_v_m_agent_platform_updates: Indicates whether VMAgent Platform Updates is enabled + :ivar enable_vm_agent_platform_updates: Indicates whether VMAgent Platform Updates is enabled for the Linux virtual machine. Default value is false. - :vartype enable_v_m_agent_platform_updates: bool + :vartype enable_vm_agent_platform_updates: bool """ disable_password_authentication: Optional[bool] = rest_field(name="disablePasswordAuthentication") """Specifies whether password authentication should be disabled.""" ssh: Optional["_models.SshConfiguration"] = rest_field() """Specifies the ssh key configuration for a Linux OS.""" - provision_v_m_agent: Optional[bool] = rest_field(name="provisionVMAgent") + provision_vm_agent: Optional[bool] = rest_field(name="provisionVMAgent") """Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later.""" patch_settings: Optional["_models.LinuxPatchSettings"] = rest_field(name="patchSettings") """[Preview Feature] Specifies settings related to VM Guest Patching on Linux.""" - enable_v_m_agent_platform_updates: Optional[bool] = rest_field(name="enableVMAgentPlatformUpdates") + enable_vm_agent_platform_updates: Optional[bool] = rest_field(name="enableVMAgentPlatformUpdates") """Indicates whether VMAgent Platform Updates is enabled for the Linux virtual machine. Default value is false.""" @@ -1209,9 +1301,9 @@ def __init__( *, disable_password_authentication: Optional[bool] = None, ssh: Optional["_models.SshConfiguration"] = None, - provision_v_m_agent: Optional[bool] = None, + provision_vm_agent: Optional[bool] = None, patch_settings: Optional["_models.LinuxPatchSettings"] = None, - enable_v_m_agent_platform_updates: Optional[bool] = None, + enable_vm_agent_platform_updates: Optional[bool] = None, ): ... @overload @@ -1338,12 +1430,56 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles super().__init__(*args, **kwargs) +class LocationProfile(_model_base.Model): + """Represents the profile for a single additional location in the Fleet. The location and the + virtualMachineProfileOverride (optional). + + + :ivar location: The ARM location name of the additional region. If LocationProfile is + specified, then location is required. Required. + :vartype location: str + :ivar virtual_machine_profile_override: An override for + computeProfile.baseVirtualMachineProfile specific to this region. + This override is merged with the base virtual machine profile to define the final virtual + machine profile for the resources deployed in this location. + :vartype virtual_machine_profile_override: + ~azure.mgmt.computefleet.models.BaseVirtualMachineProfile + """ + + location: str = rest_field() + """The ARM location name of the additional region. If LocationProfile is specified, then location + is required. Required.""" + virtual_machine_profile_override: Optional["_models.BaseVirtualMachineProfile"] = rest_field( + name="virtualMachineProfileOverride" + ) + """An override for computeProfile.baseVirtualMachineProfile specific to this region. + This override is merged with the base virtual machine profile to define the final virtual + machine profile for the resources deployed in this location.""" + + @overload + def __init__( + self, + *, + location: str, + virtual_machine_profile_override: Optional["_models.BaseVirtualMachineProfile"] = None, + ): ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + class ManagedServiceIdentity(_model_base.Model): """Managed service identity (system assigned and/or user assigned identities). Readonly variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. :ivar principal_id: The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. @@ -1654,7 +1790,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles class Plan(_model_base.Model): """Plan for the resource. - All required parameters must be populated in order to send to server. :ivar name: A user defined name of the 3rd Party Artifact that is being procured. Required. :vartype name: str @@ -2084,8 +2219,8 @@ class SpotPriorityProfile(_model_base.Model): :ivar min_capacity: Minimum capacity to achieve which cannot be updated. If we will not be able to "guarantee" minimum capacity, we will reject the request in the sync path itself. :vartype min_capacity: int - :ivar max_price_per_v_m: Price per hour of each Spot VM will never exceed this. - :vartype max_price_per_v_m: float + :ivar max_price_per_vm: Price per hour of each Spot VM will never exceed this. + :vartype max_price_per_vm: float :ivar eviction_policy: Eviction Policy to follow when evicting Spot VMs. Known values are: "Delete" and "Deallocate". :vartype eviction_policy: str or ~azure.mgmt.computefleet.models.EvictionPolicy @@ -2108,7 +2243,7 @@ class SpotPriorityProfile(_model_base.Model): min_capacity: Optional[int] = rest_field(name="minCapacity") """Minimum capacity to achieve which cannot be updated. If we will not be able to \"guarantee\" minimum capacity, we will reject the request in the sync path itself.""" - max_price_per_v_m: Optional[float] = rest_field(name="maxPricePerVM") + max_price_per_vm: Optional[float] = rest_field(name="maxPricePerVM") """Price per hour of each Spot VM will never exceed this.""" eviction_policy: Optional[Union[str, "_models.EvictionPolicy"]] = rest_field(name="evictionPolicy") """Eviction Policy to follow when evicting Spot VMs. Known values are: \"Delete\" and @@ -2131,7 +2266,7 @@ def __init__( *, capacity: Optional[int] = None, min_capacity: Optional[int] = None, - max_price_per_v_m: Optional[float] = None, + max_price_per_vm: Optional[float] = None, eviction_policy: Optional[Union[str, "_models.EvictionPolicy"]] = None, allocation_strategy: Optional[Union[str, "_models.SpotAllocationStrategy"]] = None, maintain: Optional[bool] = None, @@ -2545,7 +2680,6 @@ class VirtualMachineScaleSet(_model_base.Model): Readonly variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. :ivar id: The compute RP resource id of the virtualMachineScaleSet "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}". @@ -2578,7 +2712,6 @@ class VirtualMachineScaleSet(_model_base.Model): class VirtualMachineScaleSetDataDisk(_model_base.Model): """Describes a virtual machine scale set data disk. - All required parameters must be populated in order to send to server. :ivar name: The disk name. :vartype name: str @@ -2597,20 +2730,20 @@ class VirtualMachineScaleSetDataDisk(_model_base.Model): :ivar create_option: The create option. Required. Known values are: "FromImage", "Empty", "Attach", "Copy", and "Restore". :vartype create_option: str or ~azure.mgmt.computefleet.models.DiskCreateOptionTypes - :ivar disk_size_g_b: Specifies the size of an empty data disk in gigabytes. This element can be + :ivar disk_size_gb: Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023. - :vartype disk_size_g_b: int + :vartype disk_size_gb: int :ivar managed_disk: The managed disk parameters. :vartype managed_disk: ~azure.mgmt.computefleet.models.VirtualMachineScaleSetManagedDiskParameters - :ivar disk_i_o_p_s_read_write: Specifies the Read-Write IOPS for the managed disk. Should be - used only when + :ivar disk_iops_read_write: Specifies the Read-Write IOPS for the managed disk. Should be used + only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. - :vartype disk_i_o_p_s_read_write: int + :vartype disk_iops_read_write: int :ivar disk_m_bps_read_write: Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value @@ -2643,14 +2776,14 @@ class VirtualMachineScaleSetDataDisk(_model_base.Model): create_option: Union[str, "_models.DiskCreateOptionTypes"] = rest_field(name="createOption") """The create option. Required. Known values are: \"FromImage\", \"Empty\", \"Attach\", \"Copy\", and \"Restore\".""" - disk_size_g_b: Optional[int] = rest_field(name="diskSizeGB") + disk_size_gb: Optional[int] = rest_field(name="diskSizeGB") """Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023.""" managed_disk: Optional["_models.VirtualMachineScaleSetManagedDiskParameters"] = rest_field(name="managedDisk") """The managed disk parameters.""" - disk_i_o_p_s_read_write: Optional[int] = rest_field(name="diskIOPSReadWrite") + disk_iops_read_write: Optional[int] = rest_field(name="diskIOPSReadWrite") """Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB.""" @@ -2677,9 +2810,9 @@ def __init__( name: Optional[str] = None, caching: Optional[Union[str, "_models.CachingTypes"]] = None, write_accelerator_enabled: Optional[bool] = None, - disk_size_g_b: Optional[int] = None, + disk_size_gb: Optional[int] = None, managed_disk: Optional["_models.VirtualMachineScaleSetManagedDiskParameters"] = None, - disk_i_o_p_s_read_write: Optional[int] = None, + disk_iops_read_write: Optional[int] = None, disk_m_bps_read_write: Optional[int] = None, delete_option: Optional[Union[str, "_models.DiskDeleteOptionTypes"]] = None, ): ... @@ -2929,7 +3062,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles class VirtualMachineScaleSetIPConfiguration(_model_base.Model): """Describes a virtual machine scale set network profile's IP configuration. - All required parameters must be populated in order to send to server. :ivar name: The IP configuration name. Required. :vartype name: str @@ -2973,14 +3105,14 @@ class VirtualMachineScaleSetIPConfigurationProperties(_model_base.Model): # pyl :ivar primary: Specifies the primary network interface in case the virtual machine has more than 1 network interface. :vartype primary: bool - :ivar public_i_p_address_configuration: The publicIPAddressConfiguration. - :vartype public_i_p_address_configuration: + :ivar public_ip_address_configuration: The publicIPAddressConfiguration. + :vartype public_ip_address_configuration: ~azure.mgmt.computefleet.models.VirtualMachineScaleSetPublicIPAddressConfiguration - :ivar private_i_p_address_version: Available from Api-Version 2017-03-30 onwards, it represents + :ivar private_ip_address_version: Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Known values are: "IPv4" and "IPv6". - :vartype private_i_p_address_version: str or ~azure.mgmt.computefleet.models.IPVersion + :vartype private_ip_address_version: str or ~azure.mgmt.computefleet.models.IPVersion :ivar application_gateway_backend_address_pools: Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address pools of multiple @@ -3008,11 +3140,11 @@ class VirtualMachineScaleSetIPConfigurationProperties(_model_base.Model): # pyl primary: Optional[bool] = rest_field() """Specifies the primary network interface in case the virtual machine has more than 1 network interface.""" - public_i_p_address_configuration: Optional["_models.VirtualMachineScaleSetPublicIPAddressConfiguration"] = ( + public_ip_address_configuration: Optional["_models.VirtualMachineScaleSetPublicIPAddressConfiguration"] = ( rest_field(name="publicIPAddressConfiguration") ) """The publicIPAddressConfiguration.""" - private_i_p_address_version: Optional[Union[str, "_models.IPVersion"]] = rest_field(name="privateIPAddressVersion") + private_ip_address_version: Optional[Union[str, "_models.IPVersion"]] = rest_field(name="privateIPAddressVersion") """Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Known values are: \"IPv4\" and \"IPv6\".""" @@ -3044,8 +3176,8 @@ def __init__( *, subnet: Optional["_models.ApiEntityReference"] = None, primary: Optional[bool] = None, - public_i_p_address_configuration: Optional["_models.VirtualMachineScaleSetPublicIPAddressConfiguration"] = None, - private_i_p_address_version: Optional[Union[str, "_models.IPVersion"]] = None, + public_ip_address_configuration: Optional["_models.VirtualMachineScaleSetPublicIPAddressConfiguration"] = None, + private_ip_address_version: Optional[Union[str, "_models.IPVersion"]] = None, application_gateway_backend_address_pools: Optional[List["_models.SubResource"]] = None, application_security_groups: Optional[List["_models.SubResource"]] = None, load_balancer_backend_address_pools: Optional[List["_models.SubResource"]] = None, @@ -3147,7 +3279,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles class VirtualMachineScaleSetNetworkConfiguration(_model_base.Model): # pylint: disable=name-too-long """Describes a virtual machine scale set network profile's network configurations. - All required parameters must be populated in order to send to server. :ivar name: The network configuration name. Required. :vartype name: str @@ -3213,7 +3344,6 @@ class VirtualMachineScaleSetNetworkConfigurationProperties( ): # pylint: disable=too-many-instance-attributes,name-too-long """Describes a virtual machine scale set network profile's IP configuration. - All required parameters must be populated in order to send to server. :ivar primary: Specifies the primary network interface in case the virtual machine has more than 1 network interface. @@ -3234,8 +3364,8 @@ class VirtualMachineScaleSetNetworkConfigurationProperties( :ivar ip_configurations: Specifies the IP configurations of the network interface. Required. :vartype ip_configurations: list[~azure.mgmt.computefleet.models.VirtualMachineScaleSetIPConfiguration] - :ivar enable_i_p_forwarding: Whether IP forwarding enabled on this NIC. - :vartype enable_i_p_forwarding: bool + :ivar enable_ip_forwarding: Whether IP forwarding enabled on this NIC. + :vartype enable_ip_forwarding: bool :ivar delete_option: Specify what happens to the network interface when the VM is deleted. Known values are: "Delete" and "Detach". :vartype delete_option: str or ~azure.mgmt.computefleet.models.DeleteOptions @@ -3264,7 +3394,7 @@ class VirtualMachineScaleSetNetworkConfigurationProperties( """The dns settings to be applied on the network interfaces.""" ip_configurations: List["_models.VirtualMachineScaleSetIPConfiguration"] = rest_field(name="ipConfigurations") """Specifies the IP configurations of the network interface. Required.""" - enable_i_p_forwarding: Optional[bool] = rest_field(name="enableIPForwarding") + enable_ip_forwarding: Optional[bool] = rest_field(name="enableIPForwarding") """Whether IP forwarding enabled on this NIC.""" delete_option: Optional[Union[str, "_models.DeleteOptions"]] = rest_field(name="deleteOption") """Specify what happens to the network interface when the VM is deleted. Known values are: @@ -3287,7 +3417,7 @@ def __init__( enable_fpga: Optional[bool] = None, network_security_group: Optional["_models.SubResource"] = None, dns_settings: Optional["_models.VirtualMachineScaleSetNetworkConfigurationDnsSettings"] = None, - enable_i_p_forwarding: Optional[bool] = None, + enable_ip_forwarding: Optional[bool] = None, delete_option: Optional[Union[str, "_models.DeleteOptions"]] = None, auxiliary_mode: Optional[Union[str, "_models.NetworkInterfaceAuxiliaryMode"]] = None, auxiliary_sku: Optional[Union[str, "_models.NetworkInterfaceAuxiliarySku"]] = None, @@ -3357,7 +3487,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles class VirtualMachineScaleSetOSDisk(_model_base.Model): # pylint: disable=too-many-instance-attributes """Describes a virtual machine scale set operating system disk. - All required parameters must be populated in order to send to server. :ivar name: The disk name. :vartype name: str @@ -3381,12 +3510,12 @@ class VirtualMachineScaleSetOSDisk(_model_base.Model): # pylint: disable=too-ma used by the virtual machine scale set. :vartype diff_disk_settings: ~azure.mgmt.computefleet.models.DiffDiskSettings - :ivar disk_size_g_b: Specifies the size of an empty data disk in gigabytes. This element can be + :ivar disk_size_gb: Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023. - :vartype disk_size_g_b: int + :vartype disk_size_gb: int :ivar os_type: This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. Possible values are: **Windows,** **Linux.**. Known values are: "Windows" and "Linux". @@ -3432,7 +3561,7 @@ class VirtualMachineScaleSetOSDisk(_model_base.Model): # pylint: disable=too-ma diff_disk_settings: Optional["_models.DiffDiskSettings"] = rest_field(name="diffDiskSettings") """Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set.""" - disk_size_g_b: Optional[int] = rest_field(name="diskSizeGB") + disk_size_gb: Optional[int] = rest_field(name="diskSizeGB") """Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot @@ -3468,7 +3597,7 @@ def __init__( caching: Optional[Union[str, "_models.CachingTypes"]] = None, write_accelerator_enabled: Optional[bool] = None, diff_disk_settings: Optional["_models.DiffDiskSettings"] = None, - disk_size_g_b: Optional[int] = None, + disk_size_gb: Optional[int] = None, os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, image: Optional["_models.VirtualHardDisk"] = None, vhd_containers: Optional[List[str]] = None, @@ -3641,7 +3770,6 @@ class VirtualMachineScaleSetPublicIPAddressConfiguration(_model_base.Model): # """Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. - All required parameters must be populated in order to send to server. :ivar name: The publicIP address configuration name. Required. :vartype name: str @@ -3686,7 +3814,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles class VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings(_model_base.Model): # pylint: disable=name-too-long """Describes a virtual machines scale sets network configuration's DNS settings. - All required parameters must be populated in order to send to server. :ivar domain_name_label: The Domain name label.The concatenation of the domain name label and vm index @@ -3746,13 +3873,13 @@ class VirtualMachineScaleSetPublicIPAddressConfigurationProperties(_model_base.M ~azure.mgmt.computefleet.models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings :ivar ip_tags: The list of IP tags associated with the public IP address. :vartype ip_tags: list[~azure.mgmt.computefleet.models.VirtualMachineScaleSetIpTag] - :ivar public_i_p_prefix: The PublicIPPrefix from which to allocate publicIP addresses. - :vartype public_i_p_prefix: ~azure.mgmt.computefleet.models.SubResource - :ivar public_i_p_address_version: Available from Api-Version 2019-07-01 onwards, it represents + :ivar public_ip_prefix: The PublicIPPrefix from which to allocate publicIP addresses. + :vartype public_ip_prefix: ~azure.mgmt.computefleet.models.SubResource + :ivar public_ip_address_version: Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Known values are: "IPv4" and "IPv6". - :vartype public_i_p_address_version: str or ~azure.mgmt.computefleet.models.IPVersion + :vartype public_ip_address_version: str or ~azure.mgmt.computefleet.models.IPVersion :ivar delete_option: Specify what happens to the public IP when the VM is deleted. Known values are: "Delete" and "Detach". :vartype delete_option: str or ~azure.mgmt.computefleet.models.DeleteOptions @@ -3766,9 +3893,9 @@ class VirtualMachineScaleSetPublicIPAddressConfigurationProperties(_model_base.M """The dns settings to be applied on the publicIP addresses .""" ip_tags: Optional[List["_models.VirtualMachineScaleSetIpTag"]] = rest_field(name="ipTags") """The list of IP tags associated with the public IP address.""" - public_i_p_prefix: Optional["_models.SubResource"] = rest_field(name="publicIPPrefix") + public_ip_prefix: Optional["_models.SubResource"] = rest_field(name="publicIPPrefix") """The PublicIPPrefix from which to allocate publicIP addresses.""" - public_i_p_address_version: Optional[Union[str, "_models.IPVersion"]] = rest_field(name="publicIPAddressVersion") + public_ip_address_version: Optional[Union[str, "_models.IPVersion"]] = rest_field(name="publicIPAddressVersion") """Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Known values are: \"IPv4\" and \"IPv6\".""" @@ -3783,8 +3910,8 @@ def __init__( idle_timeout_in_minutes: Optional[int] = None, dns_settings: Optional["_models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings"] = None, ip_tags: Optional[List["_models.VirtualMachineScaleSetIpTag"]] = None, - public_i_p_prefix: Optional["_models.SubResource"] = None, - public_i_p_address_version: Optional[Union[str, "_models.IPVersion"]] = None, + public_ip_prefix: Optional["_models.SubResource"] = None, + public_ip_address_version: Optional[Union[str, "_models.IPVersion"]] = None, delete_option: Optional[Union[str, "_models.DeleteOptions"]] = None, ): ... @@ -3864,6 +3991,259 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles super().__init__(*args, **kwargs) +class VMAttributeMinMaxDouble(_model_base.Model): + """VMAttributes using double values. + + :ivar min: Minimum value. default 0. Double.MinValue(). + :vartype min: float + :ivar max: Maximum value. Double.MaxValue(1.7976931348623157E+308). + :vartype max: float + """ + + min: Optional[float] = rest_field() + """Minimum value. default 0. Double.MinValue().""" + max: Optional[float] = rest_field() + """Maximum value. Double.MaxValue(1.7976931348623157E+308).""" + + @overload + def __init__( + self, + *, + min: Optional[float] = None, # pylint: disable=redefined-builtin + max: Optional[float] = None, # pylint: disable=redefined-builtin + ): ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class VMAttributeMinMaxInteger(_model_base.Model): + """While retrieving VMSizes from CRS, Min = 0 (uint.MinValue) if not specified, Max = 4294967295 + (uint.MaxValue) if not specified. This allows to filter VMAttributes on all available VMSizes. + + :ivar min: Min VMSize from CRS, Min = 0 (uint.MinValue) if not specified. + :vartype min: int + :ivar max: Max VMSize from CRS, Max = 4294967295 (uint.MaxValue) if not specified. + :vartype max: int + """ + + min: Optional[int] = rest_field() + """Min VMSize from CRS, Min = 0 (uint.MinValue) if not specified.""" + max: Optional[int] = rest_field() + """Max VMSize from CRS, Max = 4294967295 (uint.MaxValue) if not specified.""" + + @overload + def __init__( + self, + *, + min: Optional[int] = None, # pylint: disable=redefined-builtin + max: Optional[int] = None, # pylint: disable=redefined-builtin + ): ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class VMAttributes(_model_base.Model): # pylint: disable=too-many-instance-attributes + """VMAttributes that will be used to filter VMSizes which will be used to build Fleet. + + + :ivar v_cpu_count: The range of vCpuCount specified from Min to Max. Must be specified if + VMAttributes are specified, either Min or Max is required if specified. Required. + :vartype v_cpu_count: ~azure.mgmt.computefleet.models.VMAttributeMinMaxInteger + :ivar memory_in_gi_b: The range of memory specified from Min to Max. Must be specified if + VMAttributes are specified, either Min or Max is required if specified. Required. + :vartype memory_in_gi_b: ~azure.mgmt.computefleet.models.VMAttributeMinMaxDouble + :ivar memory_in_gi_b_per_v_cpu: The range of memory in GiB per vCPU specified from min to max. + Optional parameter. Either Min or Max is required if specified. + :vartype memory_in_gi_b_per_v_cpu: ~azure.mgmt.computefleet.models.VMAttributeMinMaxDouble + :ivar local_storage_support: Specifies whether the VMSize supporting local storage should be + used to build Fleet or not. Known values are: "Excluded", "Included", and "Required". + :vartype local_storage_support: str or ~azure.mgmt.computefleet.models.VMAttributeSupport + :ivar local_storage_in_gi_b: LocalStorageSupport should be set to "Included" or "Required" to + use this VMAttribute. + If localStorageSupport is "Excluded", this VMAttribute can not be used. + :vartype local_storage_in_gi_b: ~azure.mgmt.computefleet.models.VMAttributeMinMaxDouble + :ivar local_storage_disk_types: The local storage disk types specified as a list. + LocalStorageSupport should be set to "Included" or "Required" to use this VMAttribute. + If localStorageSupport is "Excluded", this VMAttribute can not be used. + :vartype local_storage_disk_types: list[str or + ~azure.mgmt.computefleet.models.LocalStorageDiskType] + :ivar data_disk_count: The range of data disk count specified from Min to Max. Optional + parameter. Either Min or Max is required if specified. + :vartype data_disk_count: ~azure.mgmt.computefleet.models.VMAttributeMinMaxInteger + :ivar network_interface_count: The range of network interface count specified from Min to Max. + Optional parameter. Either Min or Max is required if specified. + :vartype network_interface_count: ~azure.mgmt.computefleet.models.VMAttributeMinMaxInteger + :ivar network_bandwidth_in_mbps: The range of network bandwidth in Mbps specified from Min to + Max. Optional parameter. Either Min or Max is required if specified. + :vartype network_bandwidth_in_mbps: ~azure.mgmt.computefleet.models.VMAttributeMinMaxDouble + :ivar rdma_support: Specifies whether the VMSize supporting RDMA (Remote Direct Memory Access) + should be used to build Fleet or not. Known values are: "Excluded", "Included", and "Required". + :vartype rdma_support: str or ~azure.mgmt.computefleet.models.VMAttributeSupport + :ivar rdma_network_interface_count: The range of RDMA (Remote Direct Memory Access) network + interface count specified from Min to Max. Optional parameter. Either Min or Max is required if + specified. + rdmaSupport should be set to "Included" or "Required" to use this VMAttribute. + If rdmaSupport is "Excluded", this VMAttribute can not be used. + :vartype rdma_network_interface_count: ~azure.mgmt.computefleet.models.VMAttributeMinMaxInteger + :ivar accelerator_support: Specifies whether the VMSize supporting accelerator should be used + to build Fleet or not. + acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. + If acceleratorSupport is "Excluded", this VMAttribute can not be used. Known values are: + "Excluded", "Included", and "Required". + :vartype accelerator_support: str or ~azure.mgmt.computefleet.models.VMAttributeSupport + :ivar accelerator_manufacturers: The accelerator manufacturers specified as a list. + acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. + If acceleratorSupport is "Excluded", this VMAttribute can not be used. + :vartype accelerator_manufacturers: list[str or + ~azure.mgmt.computefleet.models.AcceleratorManufacturer] + :ivar accelerator_types: The accelerator types specified as a list. acceleratorSupport should + be set to "Included" or "Required" to use this VMAttribute. + If acceleratorSupport is "Excluded", this VMAttribute can not be used. + :vartype accelerator_types: list[str or ~azure.mgmt.computefleet.models.AcceleratorType] + :ivar accelerator_count: The range of accelerator count specified from min to max. Optional + parameter. Either Min or Max is required if specified. + acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. + If acceleratorSupport is "Excluded", this VMAttribute can not be used. + :vartype accelerator_count: ~azure.mgmt.computefleet.models.VMAttributeMinMaxInteger + :ivar vm_categories: The VM category specified as a list. Optional parameter. + :vartype vm_categories: list[str or ~azure.mgmt.computefleet.models.VMCategory] + :ivar architecture_types: The VM architecture types specified as a list. Optional parameter. + :vartype architecture_types: list[str or ~azure.mgmt.computefleet.models.ArchitectureType] + :ivar cpu_manufacturers: The VM CPU manufacturers specified as a list. Optional parameter. + :vartype cpu_manufacturers: list[str or ~azure.mgmt.computefleet.models.CpuManufacturer] + :ivar burstable_support: Specifies whether the VMSize supporting burstable capability should be + used to build Fleet or not. Known values are: "Excluded", "Included", and "Required". + :vartype burstable_support: str or ~azure.mgmt.computefleet.models.VMAttributeSupport + :ivar excluded_vm_sizes: Specifies which VMSizes should be excluded while building Fleet. + Optional parameter. + :vartype excluded_vm_sizes: list[str] + """ + + v_cpu_count: "_models.VMAttributeMinMaxInteger" = rest_field(name="vCpuCount") + """The range of vCpuCount specified from Min to Max. Must be specified if VMAttributes are + specified, either Min or Max is required if specified. Required.""" + memory_in_gi_b: "_models.VMAttributeMinMaxDouble" = rest_field(name="memoryInGiB") + """The range of memory specified from Min to Max. Must be specified if VMAttributes are specified, + either Min or Max is required if specified. Required.""" + memory_in_gi_b_per_v_cpu: Optional["_models.VMAttributeMinMaxDouble"] = rest_field(name="memoryInGiBPerVCpu") + """The range of memory in GiB per vCPU specified from min to max. Optional parameter. Either Min + or Max is required if specified.""" + local_storage_support: Optional[Union[str, "_models.VMAttributeSupport"]] = rest_field(name="localStorageSupport") + """Specifies whether the VMSize supporting local storage should be used to build Fleet or not. + Known values are: \"Excluded\", \"Included\", and \"Required\".""" + local_storage_in_gi_b: Optional["_models.VMAttributeMinMaxDouble"] = rest_field(name="localStorageInGiB") + """LocalStorageSupport should be set to \"Included\" or \"Required\" to use this VMAttribute. + If localStorageSupport is \"Excluded\", this VMAttribute can not be used.""" + local_storage_disk_types: Optional[List[Union[str, "_models.LocalStorageDiskType"]]] = rest_field( + name="localStorageDiskTypes" + ) + """The local storage disk types specified as a list. LocalStorageSupport should be set to + \"Included\" or \"Required\" to use this VMAttribute. + If localStorageSupport is \"Excluded\", this VMAttribute can not be used.""" + data_disk_count: Optional["_models.VMAttributeMinMaxInteger"] = rest_field(name="dataDiskCount") + """The range of data disk count specified from Min to Max. Optional parameter. Either Min or Max + is required if specified.""" + network_interface_count: Optional["_models.VMAttributeMinMaxInteger"] = rest_field(name="networkInterfaceCount") + """The range of network interface count specified from Min to Max. Optional parameter. Either Min + or Max is required if specified.""" + network_bandwidth_in_mbps: Optional["_models.VMAttributeMinMaxDouble"] = rest_field(name="networkBandwidthInMbps") + """The range of network bandwidth in Mbps specified from Min to Max. Optional parameter. Either + Min or Max is required if specified.""" + rdma_support: Optional[Union[str, "_models.VMAttributeSupport"]] = rest_field(name="rdmaSupport") + """Specifies whether the VMSize supporting RDMA (Remote Direct Memory Access) should be used to + build Fleet or not. Known values are: \"Excluded\", \"Included\", and \"Required\".""" + rdma_network_interface_count: Optional["_models.VMAttributeMinMaxInteger"] = rest_field( + name="rdmaNetworkInterfaceCount" + ) + """The range of RDMA (Remote Direct Memory Access) network interface count specified from Min to + Max. Optional parameter. Either Min or Max is required if specified. + rdmaSupport should be set to \"Included\" or \"Required\" to use this VMAttribute. + If rdmaSupport is \"Excluded\", this VMAttribute can not be used.""" + accelerator_support: Optional[Union[str, "_models.VMAttributeSupport"]] = rest_field(name="acceleratorSupport") + """Specifies whether the VMSize supporting accelerator should be used to build Fleet or not. + acceleratorSupport should be set to \"Included\" or \"Required\" to use this VMAttribute. + If acceleratorSupport is \"Excluded\", this VMAttribute can not be used. Known values are: + \"Excluded\", \"Included\", and \"Required\".""" + accelerator_manufacturers: Optional[List[Union[str, "_models.AcceleratorManufacturer"]]] = rest_field( + name="acceleratorManufacturers" + ) + """The accelerator manufacturers specified as a list. + acceleratorSupport should be set to \"Included\" or \"Required\" to use this VMAttribute. + If acceleratorSupport is \"Excluded\", this VMAttribute can not be used.""" + accelerator_types: Optional[List[Union[str, "_models.AcceleratorType"]]] = rest_field(name="acceleratorTypes") + """The accelerator types specified as a list. acceleratorSupport should be set to \"Included\" or + \"Required\" to use this VMAttribute. + If acceleratorSupport is \"Excluded\", this VMAttribute can not be used.""" + accelerator_count: Optional["_models.VMAttributeMinMaxInteger"] = rest_field(name="acceleratorCount") + """The range of accelerator count specified from min to max. Optional parameter. Either Min or Max + is required if specified. + acceleratorSupport should be set to \"Included\" or \"Required\" to use this VMAttribute. + If acceleratorSupport is \"Excluded\", this VMAttribute can not be used.""" + vm_categories: Optional[List[Union[str, "_models.VMCategory"]]] = rest_field(name="vmCategories") + """The VM category specified as a list. Optional parameter.""" + architecture_types: Optional[List[Union[str, "_models.ArchitectureType"]]] = rest_field(name="architectureTypes") + """The VM architecture types specified as a list. Optional parameter.""" + cpu_manufacturers: Optional[List[Union[str, "_models.CpuManufacturer"]]] = rest_field(name="cpuManufacturers") + """The VM CPU manufacturers specified as a list. Optional parameter.""" + burstable_support: Optional[Union[str, "_models.VMAttributeSupport"]] = rest_field(name="burstableSupport") + """Specifies whether the VMSize supporting burstable capability should be used to build Fleet or + not. Known values are: \"Excluded\", \"Included\", and \"Required\".""" + excluded_vm_sizes: Optional[List[str]] = rest_field(name="excludedVMSizes") + """Specifies which VMSizes should be excluded while building Fleet. Optional parameter.""" + + @overload + def __init__( + self, + *, + v_cpu_count: "_models.VMAttributeMinMaxInteger", + memory_in_gi_b: "_models.VMAttributeMinMaxDouble", + memory_in_gi_b_per_v_cpu: Optional["_models.VMAttributeMinMaxDouble"] = None, + local_storage_support: Optional[Union[str, "_models.VMAttributeSupport"]] = None, + local_storage_in_gi_b: Optional["_models.VMAttributeMinMaxDouble"] = None, + local_storage_disk_types: Optional[List[Union[str, "_models.LocalStorageDiskType"]]] = None, + data_disk_count: Optional["_models.VMAttributeMinMaxInteger"] = None, + network_interface_count: Optional["_models.VMAttributeMinMaxInteger"] = None, + network_bandwidth_in_mbps: Optional["_models.VMAttributeMinMaxDouble"] = None, + rdma_support: Optional[Union[str, "_models.VMAttributeSupport"]] = None, + rdma_network_interface_count: Optional["_models.VMAttributeMinMaxInteger"] = None, + accelerator_support: Optional[Union[str, "_models.VMAttributeSupport"]] = None, + accelerator_manufacturers: Optional[List[Union[str, "_models.AcceleratorManufacturer"]]] = None, + accelerator_types: Optional[List[Union[str, "_models.AcceleratorType"]]] = None, + accelerator_count: Optional["_models.VMAttributeMinMaxInteger"] = None, + vm_categories: Optional[List[Union[str, "_models.VMCategory"]]] = None, + architecture_types: Optional[List[Union[str, "_models.ArchitectureType"]]] = None, + cpu_manufacturers: Optional[List[Union[str, "_models.CpuManufacturer"]]] = None, + burstable_support: Optional[Union[str, "_models.VMAttributeSupport"]] = None, + excluded_vm_sizes: Optional[List[str]] = None, + ): ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + class VMDiskSecurityProfile(_model_base.Model): """Specifies the security profile settings for the managed disk. **Note:** It can only be set for Confidential VMs. @@ -3920,7 +4300,6 @@ class VMGalleryApplication(_model_base.Model): """Specifies the required information to reference a compute gallery application version. - All required parameters must be populated in order to send to server. :ivar tags: Optional, Specifies a passthrough value for more generic context. :vartype tags: str @@ -3989,7 +4368,6 @@ class VmSizeProfile(_model_base.Model): """Specifications about a VM Size. This will also contain the corresponding rank and weight in future. - All required parameters must be populated in order to send to server. :ivar name: The Sku name (e.g. 'Standard_DS1_v2'). Required. :vartype name: str @@ -4027,30 +4405,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles class VMSizeProperties(_model_base.Model): """Specifies VM Size Property settings on the virtual machine. - :ivar v_c_p_us_available: Specifies the number of vCPUs available for the VM. When this - property is not + :ivar v_cpus_available: Specifies the number of vCPUs available for the VM. When this property + is not specified in the request body the default behavior is to set it to the value of vCPUs available for that VM size exposed in api response of `List all available virtual machine sizes in a region `_. - :vartype v_c_p_us_available: int - :ivar v_c_p_us_per_core: Specifies the vCPU to physical core ratio. When this property is not + :vartype v_cpus_available: int + :ivar v_cpus_per_core: Specifies the vCPU to physical core ratio. When this property is not specified in the request body the default behavior is set to the value of vCPUsPerCore for the VM Size exposed in api response of `List all available virtual machine sizes in a region `_. **Setting this property to 1 also means that hyper-threading is disabled.**. - :vartype v_c_p_us_per_core: int + :vartype v_cpus_per_core: int """ - v_c_p_us_available: Optional[int] = rest_field(name="vCPUsAvailable") + v_cpus_available: Optional[int] = rest_field(name="vCPUsAvailable") """Specifies the number of vCPUs available for the VM. When this property is not specified in the request body the default behavior is to set it to the value of vCPUs available for that VM size exposed in api response of `List all available virtual machine sizes in a region `_.""" - v_c_p_us_per_core: Optional[int] = rest_field(name="vCPUsPerCore") + v_cpus_per_core: Optional[int] = rest_field(name="vCPUsPerCore") """Specifies the vCPU to physical core ratio. When this property is not specified in the request body the default behavior is set to the value of vCPUsPerCore for the VM Size exposed in api response of `List all available virtual machine @@ -4062,8 +4440,8 @@ class VMSizeProperties(_model_base.Model): def __init__( self, *, - v_c_p_us_available: Optional[int] = None, - v_c_p_us_per_core: Optional[int] = None, + v_cpus_available: Optional[int] = None, + v_cpus_per_core: Optional[int] = None, ): ... @overload @@ -4080,12 +4458,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles class WindowsConfiguration(_model_base.Model): """Specifies Windows operating system settings on the virtual machine. - :ivar provision_v_m_agent: Indicates whether virtual machine agent should be provisioned on the + :ivar provision_vm_agent: Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified in the request body, it is set to true by default. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. - :vartype provision_v_m_agent: bool + :vartype provision_vm_agent: bool :ivar enable_automatic_updates: Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true. For virtual machine scale sets, this property can be @@ -4107,16 +4485,16 @@ class WindowsConfiguration(_model_base.Model): :ivar patch_settings: [Preview Feature] Specifies settings related to VM Guest Patching on Windows. :vartype patch_settings: ~azure.mgmt.computefleet.models.PatchSettings - :ivar win_r_m: Specifies the Windows Remote Management listeners. This enables remote Windows + :ivar win_rm: Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. - :vartype win_r_m: ~azure.mgmt.computefleet.models.WinRMConfiguration - :ivar enable_v_m_agent_platform_updates: Indicates whether VMAgent Platform Updates is enabled + :vartype win_rm: ~azure.mgmt.computefleet.models.WinRMConfiguration + :ivar enable_vm_agent_platform_updates: Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false. - :vartype enable_v_m_agent_platform_updates: bool + :vartype enable_vm_agent_platform_updates: bool """ - provision_v_m_agent: Optional[bool] = rest_field(name="provisionVMAgent") + provision_vm_agent: Optional[bool] = rest_field(name="provisionVMAgent") """Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified in the request body, it is set to true by default. This will ensure that VM Agent is installed on the VM so that @@ -4140,10 +4518,10 @@ class WindowsConfiguration(_model_base.Model): included in the Unattend.xml file, which is used by Windows Setup.""" patch_settings: Optional["_models.PatchSettings"] = rest_field(name="patchSettings") """[Preview Feature] Specifies settings related to VM Guest Patching on Windows.""" - win_r_m: Optional["_models.WinRMConfiguration"] = rest_field(name="winRM") + win_rm: Optional["_models.WinRMConfiguration"] = rest_field(name="winRM") """Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell.""" - enable_v_m_agent_platform_updates: Optional[bool] = rest_field(name="enableVMAgentPlatformUpdates") + enable_vm_agent_platform_updates: Optional[bool] = rest_field(name="enableVMAgentPlatformUpdates") """Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false.""" @@ -4151,13 +4529,13 @@ class WindowsConfiguration(_model_base.Model): def __init__( self, *, - provision_v_m_agent: Optional[bool] = None, + provision_vm_agent: Optional[bool] = None, enable_automatic_updates: Optional[bool] = None, time_zone: Optional[str] = None, additional_unattend_content: Optional[List["_models.AdditionalUnattendContent"]] = None, patch_settings: Optional["_models.PatchSettings"] = None, - win_r_m: Optional["_models.WinRMConfiguration"] = None, - enable_v_m_agent_platform_updates: Optional[bool] = None, + win_rm: Optional["_models.WinRMConfiguration"] = None, + enable_vm_agent_platform_updates: Optional[bool] = None, ): ... @overload diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/operations/_operations.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/operations/_operations.py index 7e0abfb829d1..c953d1c9303e 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/operations/_operations.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/operations/_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. @@ -9,7 +9,7 @@ from io import IOBase import json import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -38,7 +38,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]] JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -51,7 +51,7 @@ def build_operations_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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +72,7 @@ def build_fleets_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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,7 +101,7 @@ def build_fleets_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +132,7 @@ def build_fleets_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +162,7 @@ def build_fleets_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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -190,7 +190,7 @@ def build_fleets_list_by_resource_group_request( # pylint: disable=name-too-lon _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -217,7 +217,7 @@ def build_fleets_list_by_subscription_request( # pylint: disable=name-too-long _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +243,7 @@ def build_fleets_list_virtual_machine_scale_sets_request( # pylint: disable=nam _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -289,30 +289,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: :return: An iterator like instance of Operation :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.computefleet.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "actionType": "str", - "display": { - "description": "str", - "operation": "str", - "provider": "str", - "resource": "str" - }, - "isDataAction": bool, - "name": "str", - "origin": "str" - } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -328,7 +311,12 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -343,7 +331,12 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request @@ -402,440 +395,8 @@ def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> _mode :return: Fleet. The Fleet is compatible with MutableMapping :rtype: ~azure.mgmt.computefleet.models.Fleet :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -856,7 +417,10 @@ def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> _mode headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -888,7 +452,7 @@ def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> _mode def _create_or_update_initial( self, resource_group_name: str, fleet_name: str, resource: Union[_models.Fleet, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -919,7 +483,10 @@ def _create_or_update_initial( headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -938,13 +505,10 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 200: - deserialized = response.iter_bytes() - if response.status_code == 201: response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -977,867 +541,6 @@ def begin_create_or_update( MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - resource = { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } - - # response body for status code(s): 200, 201 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ @overload @@ -1866,438 +569,6 @@ def begin_create_or_update( MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200, 201 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ @overload @@ -2326,438 +597,6 @@ def begin_create_or_update( MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200, 201 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ @distributed_trace @@ -2778,867 +617,6 @@ def begin_create_or_update( MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - resource = { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } - - # response body for status code(s): 200, 201 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} @@ -3669,8 +647,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3693,7 +677,7 @@ def _update_initial( properties: Union[_models.FleetUpdate, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3724,7 +708,10 @@ def _update_initial( headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -3743,14 +730,11 @@ def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 200: - deserialized = response.iter_bytes() - if response.status_code == 202: response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3783,850 +767,6 @@ def begin_update( MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - properties = { - "identity": { - "type": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "plan": { - "name": "str", - "product": "str", - "promotionCode": "str", - "publisher": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "tags": { - "str": "str" - } - } - - # response body for status code(s): 200, 202 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ @overload @@ -4655,438 +795,6 @@ def begin_update( MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200, 202 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ @overload @@ -5115,438 +823,6 @@ def begin_update( MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200, 202 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ @distributed_trace @@ -5571,850 +847,6 @@ def begin_update( MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - properties = { - "identity": { - "type": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "plan": { - "name": "str", - "product": "str", - "promotionCode": "str", - "publisher": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "tags": { - "str": "str" - } - } - - # response body for status code(s): 200, 202 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} @@ -6445,8 +877,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -6463,7 +901,7 @@ def get_long_running_output(pipeline_response): ) def _delete_initial(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6484,7 +922,10 @@ def _delete_initial(self, resource_group_name: str, fleet_name: str, **kwargs: A headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -6507,10 +948,7 @@ def _delete_initial(self, resource_group_name: str, fleet_name: str, **kwargs: A response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() - - if response.status_code == 204: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6553,8 +991,14 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- if cls: return cls(pipeline_response, None, {}) # type: ignore + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -6578,445 +1022,13 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite :return: An iterator like instance of Fleet :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} cls: ClsType[List[_models.Fleet]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7034,7 +1046,12 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -7049,7 +1066,12 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request @@ -7085,445 +1107,13 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Fleet"]: :return: An iterator like instance of Fleet :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.computefleet.models.Fleet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": { - "str": { - "clientId": "str", - "principalId": "str" - } - } - }, - "name": "str", - "plan": { - "name": "str", - "product": "str", - "publisher": "str", - "promotionCode": "str", - "version": "str" - }, - "properties": { - "computeProfile": { - "baseVirtualMachineProfile": { - "applicationProfile": { - "galleryApplications": [ - { - "packageReferenceId": "str", - "configurationReference": - "str", - "enableAutomaticUpgrade": - bool, - "order": 0, - "tags": "str", - "treatFailureAsDeploymentFailure": bool - } - ] - }, - "capacityReservation": { - "capacityReservationGroup": { - "id": "str" - } - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": bool, - "storageUri": "str" - } - }, - "extensionProfile": { - "extensions": [ - { - "id": "str", - "name": "str", - "properties": { - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": - "str", - "protectedSettings": - { - "str": {} - }, - "protectedSettingsFromKeyVault": { - "secretUrl": - "str", - "sourceVault": { - "id": - "str" - } - }, - "provisionAfterExtensions": [ - "str" - ], - "provisioningState": - "str", - "publisher": "str", - "settings": { - "str": {} - }, - "suppressFailures": - bool, - "type": "str", - "typeHandlerVersion": - "str" - }, - "type": "str" - } - ], - "extensionsTimeBudget": "str" - }, - "hardwareProfile": { - "vmSizeProperties": { - "vCPUsAvailable": 0, - "vCPUsPerCore": 0 - } - }, - "licenseType": "str", - "networkProfile": { - "healthProbe": { - "id": "str" - }, - "networkApiVersion": "str", - "networkInterfaceConfigurations": [ - { - "name": "str", - "properties": { - "ipConfigurations": [ - { - "name": "str", - "properties": { - "applicationGatewayBackendAddressPools": - [ - { - "id": "str" - } - ], - "applicationSecurityGroups": [ - { - "id": "str" - } - ], - "loadBalancerBackendAddressPools": [ - { - "id": "str" - } - ], - "loadBalancerInboundNatPools": [ - { - "id": "str" - } - ], - "primary": bool, - "privateIPAddressVersion": "str", - "publicIPAddressConfiguration": { - "name": "str", - "properties": { - "deleteOption": "str", - "dnsSettings": { - "domainNameLabel": "str", - "domainNameLabelScope": "str" - }, - "idleTimeoutInMinutes": 0, - "ipTags": [ - { - "ipTagType": "str", - "tag": "str" - } - ], - "publicIPAddressVersion": "str", - "publicIPPrefix": { - "id": "str" - } - }, - "sku": { - "name": "str", - "tier": "str" - } - }, - "subnet": { - "id": "str" - } - } - } - ], - "auxiliaryMode": - "str", - "auxiliarySku": - "str", - "deleteOption": - "str", - "disableTcpStateTracking": bool, - "dnsSettings": { - "dnsServers": - [ - "str" - ] - }, - "enableAcceleratedNetworking": bool, - "enableFpga": bool, - "enableIPForwarding": - bool, - "networkSecurityGroup": { - "id": "str" - }, - "primary": bool - } - } - ] - }, - "osProfile": { - "adminPassword": "str", - "adminUsername": "str", - "allowExtensionOperations": bool, - "computerNamePrefix": "str", - "customData": "str", - "linuxConfiguration": { - "disablePasswordAuthentication": - bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "ssh": { - "publicKeys": [ - { - "keyData": - "str", - "path": "str" - } - ] - } - }, - "requireGuestProvisionSignal": bool, - "secrets": [ - { - "sourceVault": { - "id": "str" - }, - "vaultCertificates": [ - { - "certificateStore": "str", - "certificateUrl": "str" - } - ] - } - ], - "windowsConfiguration": { - "additionalUnattendContent": [ - { - "componentName": - "Microsoft-Windows-Shell-Setup", - "content": "str", - "passName": - "OobeSystem", - "settingName": "str" - } - ], - "enableAutomaticUpdates": bool, - "enableVMAgentPlatformUpdates": bool, - "patchSettings": { - "assessmentMode": "str", - "automaticByPlatformSettings": { - "bypassPlatformSafetyChecksOnUserSchedule": bool, - "rebootSetting": - "str" - }, - "enableHotpatching": bool, - "patchMode": "str" - }, - "provisionVMAgent": bool, - "timeZone": "str", - "winRM": { - "listeners": [ - { - "certificateUrl": "str", - "protocol": - "str" - } - ] - } - } - }, - "scheduledEventsProfile": { - "osImageNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - }, - "terminateNotificationProfile": { - "enable": bool, - "notBeforeTimeout": "str" - } - }, - "securityPostureReference": { - "excludeExtensions": [ - "str" - ], - "id": "str", - "isOverridable": bool - }, - "securityProfile": { - "encryptionAtHost": bool, - "encryptionIdentity": { - "userAssignedIdentityResourceId": - "str" - }, - "proxyAgentSettings": { - "enabled": bool, - "keyIncarnationId": 0, - "mode": "str" - }, - "securityType": "str", - "uefiSettings": { - "secureBootEnabled": bool, - "vTpmEnabled": bool - } - }, - "serviceArtifactReference": { - "id": "str" - }, - "storageProfile": { - "dataDisks": [ - { - "createOption": "str", - "lun": 0, - "caching": "str", - "deleteOption": "str", - "diskIOPSReadWrite": 0, - "diskMBpsReadWrite": 0, - "diskSizeGB": 0, - "managedDisk": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": { - "id": - "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": - "str" - }, - "name": "str", - "writeAcceleratorEnabled": - bool - } - ], - "diskControllerType": "str", - "imageReference": { - "communityGalleryImageId": "str", - "exactVersion": "str", - "id": "str", - "offer": "str", - "publisher": "str", - "sharedGalleryImageId": "str", - "sku": "str", - "version": "str" - }, - "osDisk": { - "createOption": "str", - "caching": "str", - "deleteOption": "str", - "diffDiskSettings": { - "option": "str", - "placement": "str" - }, - "diskSizeGB": 0, - "image": { - "uri": "str" - }, - "managedDisk": { - "diskEncryptionSet": { - "id": "str" - }, - "securityProfile": { - "diskEncryptionSet": - { - "id": "str" - }, - "securityEncryptionType": "str" - }, - "storageAccountType": "str" - }, - "name": "str", - "osType": "str", - "vhdContainers": [ - "str" - ], - "writeAcceleratorEnabled": bool - } - }, - "timeCreated": "2020-02-20 00:00:00", - "userData": "str" - }, - "computeApiVersion": "str", - "platformFaultDomainCount": 0 - }, - "vmSizesProfile": [ - { - "name": "str", - "rank": 0 - } - ], - "provisioningState": "str", - "regularPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "minCapacity": 0 - }, - "spotPriorityProfile": { - "allocationStrategy": "str", - "capacity": 0, - "evictionPolicy": "str", - "maintain": bool, - "maxPricePerVM": 0.0, - "minCapacity": 0 - }, - "timeCreated": "2020-02-20 00:00:00", - "uniqueId": "str" - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str" - }, - "tags": { - "str": "str" - }, - "type": "str", - "zones": [ - "str" - ] - } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} cls: ClsType[List[_models.Fleet]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7540,7 +1130,12 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -7555,7 +1150,12 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request @@ -7598,39 +1198,13 @@ def list_virtual_machine_scale_sets( :return: An iterator like instance of VirtualMachineScaleSet :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.computefleet.models.VirtualMachineScaleSet] :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "id": "str", - "operationStatus": "str", - "error": { - "code": "str", - "details": [ - { - "code": "str", - "message": "str", - "target": "str" - } - ], - "innererror": { - "errorDetail": "str", - "exceptionType": "str" - }, - "message": "str", - "target": "str" - }, - "type": "str" - } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} cls: ClsType[List[_models.VirtualMachineScaleSet]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7649,7 +1223,12 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -7664,7 +1243,12 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request diff --git a/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_create_or_update.py b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_create_or_update.py new file mode 100644 index 000000000000..3c182d5204c2 --- /dev/null +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_create_or_update.py @@ -0,0 +1,357 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import ComputeFleetMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-computefleet +# USAGE + python fleets_create_or_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ComputeFleetMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.fleets.begin_create_or_update( + resource_group_name="rgazurefleet", + fleet_name="testFleet", + resource={ + "identity": {"type": "UserAssigned", "userAssignedIdentities": {"key9851": {}}}, + "location": "westus", + "plan": { + "name": "jwgrcrnrtfoxn", + "product": "cgopbyvdyqikahwyxfpzwaqk", + "promotionCode": "naglezezplcaruqogtxnuizslqnnbr", + "publisher": "iozjbiqqckqm", + "version": "wa", + }, + "properties": { + "computeProfile": { + "baseVirtualMachineProfile": { + "applicationProfile": { + "galleryApplications": [ + { + "configurationReference": "ulztmiavpojpbpbddgnuuiimxcpau", + "enableAutomaticUpgrade": True, + "order": 5, + "packageReferenceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}", + "tags": "eyrqjbib", + "treatFailureAsDeploymentFailure": True, + } + ] + }, + "capacityReservation": { + "capacityReservationGroup": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" + } + }, + "diagnosticsProfile": { + "bootDiagnostics": { + "enabled": True, + "storageUri": "http://myStorageAccountName.blob.core.windows.net", + } + }, + "extensionProfile": { + "extensions": [ + { + "name": "bndxuxx", + "properties": { + "autoUpgradeMinorVersion": True, + "enableAutomaticUpgrade": True, + "forceUpdateTag": "yhgxw", + "protectedSettings": {}, + "protectedSettingsFromKeyVault": { + "secretUrl": "https://myvaultName.vault.azure.net/secrets/secret/mySecretName", + "sourceVault": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + }, + }, + "provisionAfterExtensions": ["nftzosroolbcwmpupujzqwqe"], + "publisher": "kpxtirxjfprhs", + "settings": {}, + "suppressFailures": True, + "type": "pgjilctjjwaa", + "typeHandlerVersion": "zevivcoilxmbwlrihhhibq", + }, + } + ], + "extensionsTimeBudget": "mbhjahtdygwgyszdwjtvlvtgchdwil", + }, + "hardwareProfile": {"vmSizeProperties": {"vCPUsAvailable": 16, "vCPUsPerCore": 23}}, + "licenseType": "v", + "networkProfile": { + "healthProbe": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}" + }, + "networkApiVersion": "2020-11-01", + "networkInterfaceConfigurations": [ + { + "name": "i", + "properties": { + "auxiliaryMode": "None", + "auxiliarySku": "None", + "deleteOption": "Delete", + "disableTcpStateTracking": True, + "dnsSettings": {"dnsServers": ["nxmmfolhclsesu"]}, + "enableAcceleratedNetworking": True, + "enableFpga": True, + "enableIPForwarding": True, + "ipConfigurations": [ + { + "name": "oezqhkidfhyywlfzwuotilrpbqnjg", + "properties": { + "applicationGatewayBackendAddressPools": [ + { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}" + } + ], + "applicationSecurityGroups": [ + { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + } + ], + "loadBalancerBackendAddressPools": [ + { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + } + ], + "loadBalancerInboundNatPools": [ + { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}" + } + ], + "primary": True, + "privateIPAddressVersion": "IPv4", + "publicIPAddressConfiguration": { + "name": "fvpqf", + "properties": { + "deleteOption": "Delete", + "dnsSettings": { + "domainNameLabel": "ukrddzvmorpmfsczjwtbvp", + "domainNameLabelScope": "TenantReuse", + }, + "idleTimeoutInMinutes": 9, + "ipTags": [ + { + "ipTagType": "sddgsoemnzgqizale", + "tag": "wufmhrjsakbiaetyara", + } + ], + "publicIPAddressVersion": "IPv4", + "publicIPPrefix": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}" + }, + }, + "sku": {"name": "Basic", "tier": "Regional"}, + }, + "subnet": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + }, + }, + } + ], + "networkSecurityGroup": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + }, + "primary": True, + }, + } + ], + }, + "osProfile": { + "adminPassword": "adfbrdxpv", + "adminUsername": "nrgzqciiaaxjrqldbmjbqkyhntp", + "allowExtensionOperations": True, + "computerNamePrefix": "o", + "customData": "xjjib", + "linuxConfiguration": { + "disablePasswordAuthentication": True, + "enableVMAgentPlatformUpdates": True, + "patchSettings": { + "assessmentMode": "ImageDefault", + "automaticByPlatformSettings": { + "bypassPlatformSafetyChecksOnUserSchedule": True, + "rebootSetting": "Unknown", + }, + "patchMode": "ImageDefault", + }, + "provisionVMAgent": True, + "ssh": {"publicKeys": [{"keyData": "kivgsubusvpprwqaqpjcmhsv", "path": "kmqz"}]}, + }, + "requireGuestProvisionSignal": True, + "secrets": [ + { + "sourceVault": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + }, + "vaultCertificates": [ + { + "certificateStore": "nlxrwavpzhueffxsshlun", + "certificateUrl": "https://myVaultName.vault.azure.net/secrets/myCertName", + } + ], + } + ], + "windowsConfiguration": { + "additionalUnattendContent": [ + { + "componentName": "Microsoft-Windows-Shell-Setup", + "content": "bubmqbxjkj", + "passName": "OobeSystem", + "settingName": "AutoLogon", + } + ], + "enableAutomaticUpdates": True, + "enableVMAgentPlatformUpdates": True, + "patchSettings": { + "assessmentMode": "ImageDefault", + "automaticByPlatformSettings": { + "bypassPlatformSafetyChecksOnUserSchedule": True, + "rebootSetting": "Unknown", + }, + "enableHotpatching": True, + "patchMode": "Manual", + }, + "provisionVMAgent": True, + "timeZone": "hlyjiqcfksgrpjrct", + "winRM": { + "listeners": [ + { + "certificateUrl": "https://myVaultName.vault.azure.net/secrets/myCertName", + "protocol": "Https", + } + ] + }, + }, + }, + "scheduledEventsProfile": { + "osImageNotificationProfile": { + "enable": True, + "notBeforeTimeout": "olbpadmevekyczfokodtfprxti", + }, + "terminateNotificationProfile": {"enable": True, "notBeforeTimeout": "iljppmmw"}, + }, + "securityPostureReference": { + "excludeExtensions": ["{securityPostureVMExtensionName}"], + "id": "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest", + "isOverridable": True, + }, + "securityProfile": { + "encryptionAtHost": True, + "encryptionIdentity": { + "userAssignedIdentityResourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}" + }, + "proxyAgentSettings": {"enabled": True, "keyIncarnationId": 20, "mode": "Audit"}, + "securityType": "TrustedLaunch", + "uefiSettings": {"secureBootEnabled": True, "vTpmEnabled": True}, + }, + "serviceArtifactReference": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}" + }, + "storageProfile": { + "dataDisks": [ + { + "caching": "None", + "createOption": "FromImage", + "deleteOption": "Delete", + "diskIOPSReadWrite": 27, + "diskMBpsReadWrite": 2, + "diskSizeGB": 6, + "lun": 14, + "managedDisk": { + "diskEncryptionSet": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + }, + "securityProfile": { + "diskEncryptionSet": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + }, + "securityEncryptionType": "VMGuestStateOnly", + }, + "storageAccountType": "Standard_LRS", + }, + "name": "eogiykmdmeikswxmigjws", + "writeAcceleratorEnabled": True, + } + ], + "diskControllerType": "uzb", + "imageReference": { + "communityGalleryImageId": "vlqe", + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}", + "offer": "isxgumkarlkomp", + "publisher": "mqxgwbiyjzmxavhbkd", + "sharedGalleryImageId": "kmkgihoxwlawuuhcinfirktdwkmx", + "sku": "eojmppqcrnpmxirtp", + "version": "wvpcqefgtmqdgltiuz", + }, + "osDisk": { + "caching": "None", + "createOption": "FromImage", + "deleteOption": "Delete", + "diffDiskSettings": {"option": "Local", "placement": "CacheDisk"}, + "diskSizeGB": 14, + "image": { + "uri": "https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd" + }, + "managedDisk": { + "diskEncryptionSet": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + }, + "securityProfile": { + "diskEncryptionSet": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + }, + "securityEncryptionType": "VMGuestStateOnly", + }, + "storageAccountType": "Standard_LRS", + }, + "name": "wfttw", + "osType": "Windows", + "vhdContainers": ["tkzcwddtinkfpnfklatw"], + "writeAcceleratorEnabled": True, + }, + }, + "userData": "s", + }, + "computeApiVersion": "2023-07-01", + "platformFaultDomainCount": 1, + }, + "regularPriorityProfile": {"allocationStrategy": "LowestPrice", "capacity": 20, "minCapacity": 10}, + "spotPriorityProfile": { + "allocationStrategy": "PriceCapacityOptimized", + "capacity": 20, + "evictionPolicy": "Delete", + "maintain": True, + "maxPricePerVM": 0.00865, + "minCapacity": 10, + }, + "vmSizesProfile": [{"name": "Standard_d1_v2", "rank": 19225}], + }, + "tags": {"key3518": "luvrnuvsgdpbuofdskkcoqhfh"}, + "zones": ["zone1", "zone2"], + }, + ).result() + print(response) + + +# x-ms-original-file: 2024-11-01/Fleets_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_create_or_update_minimum_set.py b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_create_or_update_minimum_set.py new file mode 100644 index 000000000000..4caaa75d683f --- /dev/null +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_create_or_update_minimum_set.py @@ -0,0 +1,116 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import ComputeFleetMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-computefleet +# USAGE + python fleets_create_or_update_minimum_set.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ComputeFleetMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.fleets.begin_create_or_update( + resource_group_name="rgazurefleet", + fleet_name="testFleet", + resource={ + "location": "eastus2euap", + "properties": { + "computeProfile": { + "baseVirtualMachineProfile": { + "networkProfile": { + "networkApiVersion": "2022-07-01", + "networkInterfaceConfigurations": [ + { + "name": "vmNameTest", + "properties": { + "enableAcceleratedNetworking": False, + "enableIPForwarding": True, + "ipConfigurations": [ + { + "name": "vmNameTest", + "properties": { + "loadBalancerBackendAddressPools": [ + { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + } + ], + "primary": True, + "subnet": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + }, + }, + } + ], + "primary": True, + }, + } + ], + }, + "osProfile": { + "adminPassword": "TestPassword$0", + "adminUsername": "azureuser", + "computerNamePrefix": "prefix", + "linuxConfiguration": {"disablePasswordAuthentication": False}, + }, + "storageProfile": { + "imageReference": { + "offer": "0001-com-ubuntu-server-focal", + "publisher": "canonical", + "sku": "20_04-lts-gen2", + "version": "latest", + }, + "osDisk": { + "caching": "ReadWrite", + "createOption": "FromImage", + "managedDisk": {"storageAccountType": "Standard_LRS"}, + "osType": "Linux", + }, + }, + }, + "computeApiVersion": "2023-09-01", + "platformFaultDomainCount": 1, + }, + "regularPriorityProfile": {"allocationStrategy": "LowestPrice", "capacity": 2, "minCapacity": 1}, + "spotPriorityProfile": { + "allocationStrategy": "PriceCapacityOptimized", + "capacity": 2, + "evictionPolicy": "Delete", + "maintain": True, + "minCapacity": 1, + }, + "vmSizesProfile": [ + {"name": "Standard_D2s_v3"}, + {"name": "Standard_D4s_v3"}, + {"name": "Standard_E2s_v3"}, + ], + }, + "tags": {"key": "fleets-test"}, + }, + ).result() + print(response) + + +# x-ms-original-file: 2024-11-01/Fleets_CreateOrUpdate_MinimumSet.json +if __name__ == "__main__": + main() diff --git a/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_delete.py b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_delete.py new file mode 100644 index 000000000000..72f38aaa8c07 --- /dev/null +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_delete.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import ComputeFleetMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-computefleet +# USAGE + python fleets_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ComputeFleetMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.fleets.begin_delete( + resource_group_name="rgazurefleet", + fleet_name="testFleet", + ).result() + + +# x-ms-original-file: 2024-11-01/Fleets_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_get.py b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_get.py new file mode 100644 index 000000000000..729d2cbddfb2 --- /dev/null +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import ComputeFleetMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-computefleet +# USAGE + python fleets_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ComputeFleetMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.fleets.get( + resource_group_name="rgazurefleet", + fleet_name="testFleet", + ) + print(response) + + +# x-ms-original-file: 2024-11-01/Fleets_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_list_by_resource_group.py b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_list_by_resource_group.py new file mode 100644 index 000000000000..35acdd0eb995 --- /dev/null +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_list_by_resource_group.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import ComputeFleetMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-computefleet +# USAGE + python fleets_list_by_resource_group.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ComputeFleetMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.fleets.list_by_resource_group( + resource_group_name="rgazurefleet", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2024-11-01/Fleets_ListByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_list_by_subscription.py b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_list_by_subscription.py new file mode 100644 index 000000000000..d62f64b526d3 --- /dev/null +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_list_by_subscription.py @@ -0,0 +1,40 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import ComputeFleetMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-computefleet +# USAGE + python fleets_list_by_subscription.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ComputeFleetMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.fleets.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: 2024-11-01/Fleets_ListBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_list_virtual_machine_scale_sets.py b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_list_virtual_machine_scale_sets.py new file mode 100644 index 000000000000..c2e600bcacae --- /dev/null +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_list_virtual_machine_scale_sets.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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import ComputeFleetMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-computefleet +# USAGE + python fleets_list_virtual_machine_scale_sets.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 = ComputeFleetMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.fleets.list_virtual_machine_scale_sets( + resource_group_name="rgazurefleet", + name="myFleet", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2024-11-01/Fleets_ListVirtualMachineScaleSets.json +if __name__ == "__main__": + main() diff --git a/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_update.py b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_update.py new file mode 100644 index 000000000000..34b882bfb2dd --- /dev/null +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/fleets_update.py @@ -0,0 +1,355 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import ComputeFleetMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-computefleet +# USAGE + python fleets_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ComputeFleetMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.fleets.begin_update( + resource_group_name="rgazurefleet", + fleet_name="testFleet", + properties={ + "identity": {"type": "UserAssigned", "userAssignedIdentities": {}}, + "plan": { + "name": "jwgrcrnrtfoxn", + "product": "cgopbyvdyqikahwyxfpzwaqk", + "promotionCode": "naglezezplcaruqogtxnuizslqnnbr", + "publisher": "iozjbiqqckqm", + "version": "wa", + }, + "properties": { + "computeProfile": { + "baseVirtualMachineProfile": { + "applicationProfile": { + "galleryApplications": [ + { + "configurationReference": "ulztmiavpojpbpbddgnuuiimxcpau", + "enableAutomaticUpgrade": True, + "order": 5, + "packageReferenceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}", + "tags": "eyrqjbib", + "treatFailureAsDeploymentFailure": True, + } + ] + }, + "capacityReservation": { + "capacityReservationGroup": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" + } + }, + "diagnosticsProfile": { + "bootDiagnostics": { + "enabled": True, + "storageUri": "http://myStorageAccountName.blob.core.windows.net", + } + }, + "extensionProfile": { + "extensions": [ + { + "name": "bndxuxx", + "properties": { + "autoUpgradeMinorVersion": True, + "enableAutomaticUpgrade": True, + "forceUpdateTag": "yhgxw", + "protectedSettings": {}, + "protectedSettingsFromKeyVault": { + "secretUrl": "https://myVaultName.vault.azure.net/secrets/secret/mySecretName", + "sourceVault": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + }, + }, + "provisionAfterExtensions": ["nftzosroolbcwmpupujzqwqe"], + "publisher": "kpxtirxjfprhs", + "settings": {}, + "suppressFailures": True, + "type": "pgjilctjjwaa", + "typeHandlerVersion": "zevivcoilxmbwlrihhhibq", + }, + } + ], + "extensionsTimeBudget": "mbhjahtdygwgyszdwjtvlvtgchdwil", + }, + "hardwareProfile": {"vmSizeProperties": {"vCPUsAvailable": 16, "vCPUsPerCore": 23}}, + "licenseType": "v", + "networkProfile": { + "healthProbe": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}" + }, + "networkApiVersion": "2020-11-01", + "networkInterfaceConfigurations": [ + { + "name": "i", + "properties": { + "auxiliaryMode": "None", + "auxiliarySku": "None", + "deleteOption": "Delete", + "disableTcpStateTracking": True, + "dnsSettings": {"dnsServers": ["nxmmfolhclsesu"]}, + "enableAcceleratedNetworking": True, + "enableFpga": True, + "enableIPForwarding": True, + "ipConfigurations": [ + { + "name": "oezqhkidfhyywlfzwuotilrpbqnjg", + "properties": { + "applicationGatewayBackendAddressPools": [ + { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}" + } + ], + "applicationSecurityGroups": [ + { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + } + ], + "loadBalancerBackendAddressPools": [ + { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + } + ], + "loadBalancerInboundNatPools": [ + { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}" + } + ], + "primary": True, + "privateIPAddressVersion": "IPv4", + "publicIPAddressConfiguration": { + "name": "fvpqf", + "properties": { + "deleteOption": "Delete", + "dnsSettings": { + "domainNameLabel": "ukrddzvmorpmfsczjwtbvp", + "domainNameLabelScope": "TenantReuse", + }, + "idleTimeoutInMinutes": 9, + "ipTags": [ + { + "ipTagType": "sddgsoemnzgqizale", + "tag": "wufmhrjsakbiaetyara", + } + ], + "publicIPAddressVersion": "IPv4", + "publicIPPrefix": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}" + }, + }, + "sku": {"name": "Basic", "tier": "Regional"}, + }, + "subnet": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + }, + }, + } + ], + "networkSecurityGroup": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + }, + "primary": True, + }, + } + ], + }, + "osProfile": { + "adminPassword": "adfbrdxpv", + "adminUsername": "nrgzqciiaaxjrqldbmjbqkyhntp", + "allowExtensionOperations": True, + "computerNamePrefix": "o", + "customData": "xjjib", + "linuxConfiguration": { + "disablePasswordAuthentication": True, + "enableVMAgentPlatformUpdates": True, + "patchSettings": { + "assessmentMode": "ImageDefault", + "automaticByPlatformSettings": { + "bypassPlatformSafetyChecksOnUserSchedule": True, + "rebootSetting": "Unknown", + }, + "patchMode": "ImageDefault", + }, + "provisionVMAgent": True, + "ssh": {"publicKeys": [{"keyData": "kivgsubusvpprwqaqpjcmhsv", "path": "kmqz"}]}, + }, + "requireGuestProvisionSignal": True, + "secrets": [ + { + "sourceVault": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}" + }, + "vaultCertificates": [ + { + "certificateStore": "nlxrwavpzhueffxsshlun", + "certificateUrl": "https://myVaultName.vault.azure.net/secrets/myCertName", + } + ], + } + ], + "windowsConfiguration": { + "additionalUnattendContent": [ + { + "componentName": "Microsoft-Windows-Shell-Setup", + "content": "bubmqbxjkj", + "passName": "OobeSystem", + "settingName": "AutoLogon", + } + ], + "enableAutomaticUpdates": True, + "enableVMAgentPlatformUpdates": True, + "patchSettings": { + "assessmentMode": "ImageDefault", + "automaticByPlatformSettings": { + "bypassPlatformSafetyChecksOnUserSchedule": True, + "rebootSetting": "Unknown", + }, + "enableHotpatching": True, + "patchMode": "Manual", + }, + "provisionVMAgent": True, + "timeZone": "hlyjiqcfksgrpjrct", + "winRM": { + "listeners": [ + { + "certificateUrl": "https://myVaultName.vault.azure.net/secrets/myCertName", + "protocol": "Http", + } + ] + }, + }, + }, + "scheduledEventsProfile": { + "osImageNotificationProfile": { + "enable": True, + "notBeforeTimeout": "olbpadmevekyczfokodtfprxti", + }, + "terminateNotificationProfile": {"enable": True, "notBeforeTimeout": "iljppmmw"}, + }, + "securityPostureReference": { + "excludeExtensions": ["{securityPostureVMExtensionName}"], + "id": "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest", + "isOverridable": True, + }, + "securityProfile": { + "encryptionAtHost": True, + "encryptionIdentity": { + "userAssignedIdentityResourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}" + }, + "proxyAgentSettings": {"enabled": True, "keyIncarnationId": 20, "mode": "Audit"}, + "securityType": "TrustedLaunch", + "uefiSettings": {"secureBootEnabled": True, "vTpmEnabled": True}, + }, + "serviceArtifactReference": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}" + }, + "storageProfile": { + "dataDisks": [ + { + "caching": "None", + "createOption": "FromImage", + "deleteOption": "Delete", + "diskIOPSReadWrite": 27, + "diskMBpsReadWrite": 2, + "diskSizeGB": 6, + "lun": 14, + "managedDisk": { + "diskEncryptionSet": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + }, + "securityProfile": { + "diskEncryptionSet": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + }, + "securityEncryptionType": "VMGuestStateOnly", + }, + "storageAccountType": "Standard_LRS", + }, + "name": "eogiykmdmeikswxmigjws", + "writeAcceleratorEnabled": True, + } + ], + "diskControllerType": "uzb", + "imageReference": { + "communityGalleryImageId": "vlqe", + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}", + "offer": "isxgumkarlkomp", + "publisher": "mqxgwbiyjzmxavhbkd", + "sharedGalleryImageId": "kmkgihoxwlawuuhcinfirktdwkmx", + "sku": "eojmppqcrnpmxirtp", + "version": "wvpcqefgtmqdgltiuz", + }, + "osDisk": { + "caching": "None", + "createOption": "FromImage", + "deleteOption": "Delete", + "diffDiskSettings": {"option": "Local", "placement": "CacheDisk"}, + "diskSizeGB": 14, + "image": { + "uri": "https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd" + }, + "managedDisk": { + "diskEncryptionSet": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + }, + "securityProfile": { + "diskEncryptionSet": { + "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" + }, + "securityEncryptionType": "VMGuestStateOnly", + }, + "storageAccountType": "Standard_LRS", + }, + "name": "wfttw", + "osType": "Windows", + "vhdContainers": ["tkzcwddtinkfpnfklatw"], + "writeAcceleratorEnabled": True, + }, + }, + "userData": "s", + }, + "computeApiVersion": "2023-07-01", + "platformFaultDomainCount": 1, + }, + "regularPriorityProfile": {"allocationStrategy": "LowestPrice", "capacity": 20, "minCapacity": 10}, + "spotPriorityProfile": { + "allocationStrategy": "PriceCapacityOptimized", + "capacity": 20, + "evictionPolicy": "Delete", + "maintain": True, + "maxPricePerVM": 0.00865, + "minCapacity": 10, + }, + "vmSizesProfile": [{"name": "Standard_d1_v2", "rank": 19225}], + }, + "tags": {}, + }, + ).result() + print(response) + + +# x-ms-original-file: 2024-11-01/Fleets_Update.json +if __name__ == "__main__": + main() diff --git a/sdk/computefleet/azure-mgmt-computefleet/generated_samples/operations_list.py b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/operations_list.py new file mode 100644 index 000000000000..f287fdb6b057 --- /dev/null +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_samples/operations_list.py @@ -0,0 +1,40 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import ComputeFleetMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-computefleet +# USAGE + python operations_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ComputeFleetMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.operations.list() + for item in response: + print(item) + + +# x-ms-original-file: 2024-11-01/Operations_List.json +if __name__ == "__main__": + main() diff --git a/sdk/computefleet/azure-mgmt-computefleet/generated_tests/conftest.py b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/conftest.py index 56f507f51ec9..7293be017790 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/generated_tests/conftest.py +++ b/sdk/computefleet/azure-mgmt-computefleet/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): computefleetmgmt_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") diff --git a/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_compute_fleet_mgmt_fleets_operations.py b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_compute_fleet_mgmt_fleets_operations.py index 64d6491137aa..a467cce5565f 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_compute_fleet_mgmt_fleets_operations.py +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_compute_fleet_mgmt_fleets_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -20,7 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_fleets_get(self, resource_group): response = self.client.fleets.get( resource_group_name=resource_group.name, fleet_name="str", @@ -31,7 +32,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_fleets_begin_create_or_update(self, resource_group): response = self.client.fleets.begin_create_or_update( resource_group_name=resource_group.name, fleet_name="str", @@ -268,10 +269,242 @@ def test_begin_create_or_update(self, resource_group): "timeCreated": "2020-02-20 00:00:00", "userData": "str", }, + "additionalVirtualMachineCapabilities": {"hibernationEnabled": bool, "ultraSSDEnabled": bool}, "computeApiVersion": "str", "platformFaultDomainCount": 0, }, "vmSizesProfile": [{"name": "str", "rank": 0}], + "additionalLocationsProfile": { + "locationProfiles": [ + { + "location": "str", + "virtualMachineProfileOverride": { + "applicationProfile": { + "galleryApplications": [ + { + "packageReferenceId": "str", + "configurationReference": "str", + "enableAutomaticUpgrade": bool, + "order": 0, + "tags": "str", + "treatFailureAsDeploymentFailure": bool, + } + ] + }, + "capacityReservation": {"capacityReservationGroup": {"id": "str"}}, + "diagnosticsProfile": {"bootDiagnostics": {"enabled": bool, "storageUri": "str"}}, + "extensionProfile": { + "extensions": [ + { + "id": "str", + "name": "str", + "properties": { + "autoUpgradeMinorVersion": bool, + "enableAutomaticUpgrade": bool, + "forceUpdateTag": "str", + "protectedSettings": {"str": {}}, + "protectedSettingsFromKeyVault": { + "secretUrl": "str", + "sourceVault": {"id": "str"}, + }, + "provisionAfterExtensions": ["str"], + "provisioningState": "str", + "publisher": "str", + "settings": {"str": {}}, + "suppressFailures": bool, + "type": "str", + "typeHandlerVersion": "str", + }, + "type": "str", + } + ], + "extensionsTimeBudget": "str", + }, + "hardwareProfile": {"vmSizeProperties": {"vCPUsAvailable": 0, "vCPUsPerCore": 0}}, + "licenseType": "str", + "networkProfile": { + "healthProbe": {"id": "str"}, + "networkApiVersion": "str", + "networkInterfaceConfigurations": [ + { + "name": "str", + "properties": { + "ipConfigurations": [ + { + "name": "str", + "properties": { + "applicationGatewayBackendAddressPools": [ + {"id": "str"} + ], + "applicationSecurityGroups": [{"id": "str"}], + "loadBalancerBackendAddressPools": [{"id": "str"}], + "loadBalancerInboundNatPools": [{"id": "str"}], + "primary": bool, + "privateIPAddressVersion": "str", + "publicIPAddressConfiguration": { + "name": "str", + "properties": { + "deleteOption": "str", + "dnsSettings": { + "domainNameLabel": "str", + "domainNameLabelScope": "str", + }, + "idleTimeoutInMinutes": 0, + "ipTags": [{"ipTagType": "str", "tag": "str"}], + "publicIPAddressVersion": "str", + "publicIPPrefix": {"id": "str"}, + }, + "sku": {"name": "str", "tier": "str"}, + }, + "subnet": {"id": "str"}, + }, + } + ], + "auxiliaryMode": "str", + "auxiliarySku": "str", + "deleteOption": "str", + "disableTcpStateTracking": bool, + "dnsSettings": {"dnsServers": ["str"]}, + "enableAcceleratedNetworking": bool, + "enableFpga": bool, + "enableIPForwarding": bool, + "networkSecurityGroup": {"id": "str"}, + "primary": bool, + }, + } + ], + }, + "osProfile": { + "adminPassword": "str", + "adminUsername": "str", + "allowExtensionOperations": bool, + "computerNamePrefix": "str", + "customData": "str", + "linuxConfiguration": { + "disablePasswordAuthentication": bool, + "enableVMAgentPlatformUpdates": bool, + "patchSettings": { + "assessmentMode": "str", + "automaticByPlatformSettings": { + "bypassPlatformSafetyChecksOnUserSchedule": bool, + "rebootSetting": "str", + }, + "patchMode": "str", + }, + "provisionVMAgent": bool, + "ssh": {"publicKeys": [{"keyData": "str", "path": "str"}]}, + }, + "requireGuestProvisionSignal": bool, + "secrets": [ + { + "sourceVault": {"id": "str"}, + "vaultCertificates": [ + {"certificateStore": "str", "certificateUrl": "str"} + ], + } + ], + "windowsConfiguration": { + "additionalUnattendContent": [ + { + "componentName": "Microsoft-Windows-Shell-Setup", + "content": "str", + "passName": "OobeSystem", + "settingName": "str", + } + ], + "enableAutomaticUpdates": bool, + "enableVMAgentPlatformUpdates": bool, + "patchSettings": { + "assessmentMode": "str", + "automaticByPlatformSettings": { + "bypassPlatformSafetyChecksOnUserSchedule": bool, + "rebootSetting": "str", + }, + "enableHotpatching": bool, + "patchMode": "str", + }, + "provisionVMAgent": bool, + "timeZone": "str", + "winRM": {"listeners": [{"certificateUrl": "str", "protocol": "str"}]}, + }, + }, + "scheduledEventsProfile": { + "osImageNotificationProfile": {"enable": bool, "notBeforeTimeout": "str"}, + "terminateNotificationProfile": {"enable": bool, "notBeforeTimeout": "str"}, + }, + "securityPostureReference": { + "excludeExtensions": ["str"], + "id": "str", + "isOverridable": bool, + }, + "securityProfile": { + "encryptionAtHost": bool, + "encryptionIdentity": {"userAssignedIdentityResourceId": "str"}, + "proxyAgentSettings": {"enabled": bool, "keyIncarnationId": 0, "mode": "str"}, + "securityType": "str", + "uefiSettings": {"secureBootEnabled": bool, "vTpmEnabled": bool}, + }, + "serviceArtifactReference": {"id": "str"}, + "storageProfile": { + "dataDisks": [ + { + "createOption": "str", + "lun": 0, + "caching": "str", + "deleteOption": "str", + "diskIOPSReadWrite": 0, + "diskMBpsReadWrite": 0, + "diskSizeGB": 0, + "managedDisk": { + "diskEncryptionSet": {"id": "str"}, + "securityProfile": { + "diskEncryptionSet": {"id": "str"}, + "securityEncryptionType": "str", + }, + "storageAccountType": "str", + }, + "name": "str", + "writeAcceleratorEnabled": bool, + } + ], + "diskControllerType": "str", + "imageReference": { + "communityGalleryImageId": "str", + "exactVersion": "str", + "id": "str", + "offer": "str", + "publisher": "str", + "sharedGalleryImageId": "str", + "sku": "str", + "version": "str", + }, + "osDisk": { + "createOption": "str", + "caching": "str", + "deleteOption": "str", + "diffDiskSettings": {"option": "str", "placement": "str"}, + "diskSizeGB": 0, + "image": {"uri": "str"}, + "managedDisk": { + "diskEncryptionSet": {"id": "str"}, + "securityProfile": { + "diskEncryptionSet": {"id": "str"}, + "securityEncryptionType": "str", + }, + "storageAccountType": "str", + }, + "name": "str", + "osType": "str", + "vhdContainers": ["str"], + "writeAcceleratorEnabled": bool, + }, + }, + "timeCreated": "2020-02-20 00:00:00", + "userData": "str", + }, + } + ] + }, "provisioningState": "str", "regularPriorityProfile": {"allocationStrategy": "str", "capacity": 0, "minCapacity": 0}, "spotPriorityProfile": { @@ -284,6 +517,28 @@ def test_begin_create_or_update(self, resource_group): }, "timeCreated": "2020-02-20 00:00:00", "uniqueId": "str", + "vmAttributes": { + "memoryInGiB": {"max": 0.0, "min": 0.0}, + "vCpuCount": {"max": 0, "min": 0}, + "acceleratorCount": {"max": 0, "min": 0}, + "acceleratorManufacturers": ["str"], + "acceleratorSupport": "str", + "acceleratorTypes": ["str"], + "architectureTypes": ["str"], + "burstableSupport": "str", + "cpuManufacturers": ["str"], + "dataDiskCount": {"max": 0, "min": 0}, + "excludedVMSizes": ["str"], + "localStorageDiskTypes": ["str"], + "localStorageInGiB": {"max": 0.0, "min": 0.0}, + "localStorageSupport": "str", + "memoryInGiBPerVCpu": {"max": 0.0, "min": 0.0}, + "networkBandwidthInMbps": {"max": 0.0, "min": 0.0}, + "networkInterfaceCount": {"max": 0, "min": 0}, + "rdmaNetworkInterfaceCount": {"max": 0, "min": 0}, + "rdmaSupport": "str", + "vmCategories": ["str"], + }, }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -304,7 +559,7 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_fleets_begin_update(self, resource_group): response = self.client.fleets.begin_update( resource_group_name=resource_group.name, fleet_name="str", @@ -536,10 +791,242 @@ def test_begin_update(self, resource_group): "timeCreated": "2020-02-20 00:00:00", "userData": "str", }, + "additionalVirtualMachineCapabilities": {"hibernationEnabled": bool, "ultraSSDEnabled": bool}, "computeApiVersion": "str", "platformFaultDomainCount": 0, }, "vmSizesProfile": [{"name": "str", "rank": 0}], + "additionalLocationsProfile": { + "locationProfiles": [ + { + "location": "str", + "virtualMachineProfileOverride": { + "applicationProfile": { + "galleryApplications": [ + { + "packageReferenceId": "str", + "configurationReference": "str", + "enableAutomaticUpgrade": bool, + "order": 0, + "tags": "str", + "treatFailureAsDeploymentFailure": bool, + } + ] + }, + "capacityReservation": {"capacityReservationGroup": {"id": "str"}}, + "diagnosticsProfile": {"bootDiagnostics": {"enabled": bool, "storageUri": "str"}}, + "extensionProfile": { + "extensions": [ + { + "id": "str", + "name": "str", + "properties": { + "autoUpgradeMinorVersion": bool, + "enableAutomaticUpgrade": bool, + "forceUpdateTag": "str", + "protectedSettings": {"str": {}}, + "protectedSettingsFromKeyVault": { + "secretUrl": "str", + "sourceVault": {"id": "str"}, + }, + "provisionAfterExtensions": ["str"], + "provisioningState": "str", + "publisher": "str", + "settings": {"str": {}}, + "suppressFailures": bool, + "type": "str", + "typeHandlerVersion": "str", + }, + "type": "str", + } + ], + "extensionsTimeBudget": "str", + }, + "hardwareProfile": {"vmSizeProperties": {"vCPUsAvailable": 0, "vCPUsPerCore": 0}}, + "licenseType": "str", + "networkProfile": { + "healthProbe": {"id": "str"}, + "networkApiVersion": "str", + "networkInterfaceConfigurations": [ + { + "name": "str", + "properties": { + "ipConfigurations": [ + { + "name": "str", + "properties": { + "applicationGatewayBackendAddressPools": [ + {"id": "str"} + ], + "applicationSecurityGroups": [{"id": "str"}], + "loadBalancerBackendAddressPools": [{"id": "str"}], + "loadBalancerInboundNatPools": [{"id": "str"}], + "primary": bool, + "privateIPAddressVersion": "str", + "publicIPAddressConfiguration": { + "name": "str", + "properties": { + "deleteOption": "str", + "dnsSettings": { + "domainNameLabel": "str", + "domainNameLabelScope": "str", + }, + "idleTimeoutInMinutes": 0, + "ipTags": [{"ipTagType": "str", "tag": "str"}], + "publicIPAddressVersion": "str", + "publicIPPrefix": {"id": "str"}, + }, + "sku": {"name": "str", "tier": "str"}, + }, + "subnet": {"id": "str"}, + }, + } + ], + "auxiliaryMode": "str", + "auxiliarySku": "str", + "deleteOption": "str", + "disableTcpStateTracking": bool, + "dnsSettings": {"dnsServers": ["str"]}, + "enableAcceleratedNetworking": bool, + "enableFpga": bool, + "enableIPForwarding": bool, + "networkSecurityGroup": {"id": "str"}, + "primary": bool, + }, + } + ], + }, + "osProfile": { + "adminPassword": "str", + "adminUsername": "str", + "allowExtensionOperations": bool, + "computerNamePrefix": "str", + "customData": "str", + "linuxConfiguration": { + "disablePasswordAuthentication": bool, + "enableVMAgentPlatformUpdates": bool, + "patchSettings": { + "assessmentMode": "str", + "automaticByPlatformSettings": { + "bypassPlatformSafetyChecksOnUserSchedule": bool, + "rebootSetting": "str", + }, + "patchMode": "str", + }, + "provisionVMAgent": bool, + "ssh": {"publicKeys": [{"keyData": "str", "path": "str"}]}, + }, + "requireGuestProvisionSignal": bool, + "secrets": [ + { + "sourceVault": {"id": "str"}, + "vaultCertificates": [ + {"certificateStore": "str", "certificateUrl": "str"} + ], + } + ], + "windowsConfiguration": { + "additionalUnattendContent": [ + { + "componentName": "Microsoft-Windows-Shell-Setup", + "content": "str", + "passName": "OobeSystem", + "settingName": "str", + } + ], + "enableAutomaticUpdates": bool, + "enableVMAgentPlatformUpdates": bool, + "patchSettings": { + "assessmentMode": "str", + "automaticByPlatformSettings": { + "bypassPlatformSafetyChecksOnUserSchedule": bool, + "rebootSetting": "str", + }, + "enableHotpatching": bool, + "patchMode": "str", + }, + "provisionVMAgent": bool, + "timeZone": "str", + "winRM": {"listeners": [{"certificateUrl": "str", "protocol": "str"}]}, + }, + }, + "scheduledEventsProfile": { + "osImageNotificationProfile": {"enable": bool, "notBeforeTimeout": "str"}, + "terminateNotificationProfile": {"enable": bool, "notBeforeTimeout": "str"}, + }, + "securityPostureReference": { + "excludeExtensions": ["str"], + "id": "str", + "isOverridable": bool, + }, + "securityProfile": { + "encryptionAtHost": bool, + "encryptionIdentity": {"userAssignedIdentityResourceId": "str"}, + "proxyAgentSettings": {"enabled": bool, "keyIncarnationId": 0, "mode": "str"}, + "securityType": "str", + "uefiSettings": {"secureBootEnabled": bool, "vTpmEnabled": bool}, + }, + "serviceArtifactReference": {"id": "str"}, + "storageProfile": { + "dataDisks": [ + { + "createOption": "str", + "lun": 0, + "caching": "str", + "deleteOption": "str", + "diskIOPSReadWrite": 0, + "diskMBpsReadWrite": 0, + "diskSizeGB": 0, + "managedDisk": { + "diskEncryptionSet": {"id": "str"}, + "securityProfile": { + "diskEncryptionSet": {"id": "str"}, + "securityEncryptionType": "str", + }, + "storageAccountType": "str", + }, + "name": "str", + "writeAcceleratorEnabled": bool, + } + ], + "diskControllerType": "str", + "imageReference": { + "communityGalleryImageId": "str", + "exactVersion": "str", + "id": "str", + "offer": "str", + "publisher": "str", + "sharedGalleryImageId": "str", + "sku": "str", + "version": "str", + }, + "osDisk": { + "createOption": "str", + "caching": "str", + "deleteOption": "str", + "diffDiskSettings": {"option": "str", "placement": "str"}, + "diskSizeGB": 0, + "image": {"uri": "str"}, + "managedDisk": { + "diskEncryptionSet": {"id": "str"}, + "securityProfile": { + "diskEncryptionSet": {"id": "str"}, + "securityEncryptionType": "str", + }, + "storageAccountType": "str", + }, + "name": "str", + "osType": "str", + "vhdContainers": ["str"], + "writeAcceleratorEnabled": bool, + }, + }, + "timeCreated": "2020-02-20 00:00:00", + "userData": "str", + }, + } + ] + }, "provisioningState": "str", "regularPriorityProfile": {"allocationStrategy": "str", "capacity": 0, "minCapacity": 0}, "spotPriorityProfile": { @@ -552,6 +1039,28 @@ def test_begin_update(self, resource_group): }, "timeCreated": "2020-02-20 00:00:00", "uniqueId": "str", + "vmAttributes": { + "memoryInGiB": {"max": 0.0, "min": 0.0}, + "vCpuCount": {"max": 0, "min": 0}, + "acceleratorCount": {"max": 0, "min": 0}, + "acceleratorManufacturers": ["str"], + "acceleratorSupport": "str", + "acceleratorTypes": ["str"], + "architectureTypes": ["str"], + "burstableSupport": "str", + "cpuManufacturers": ["str"], + "dataDiskCount": {"max": 0, "min": 0}, + "excludedVMSizes": ["str"], + "localStorageDiskTypes": ["str"], + "localStorageInGiB": {"max": 0.0, "min": 0.0}, + "localStorageSupport": "str", + "memoryInGiBPerVCpu": {"max": 0.0, "min": 0.0}, + "networkBandwidthInMbps": {"max": 0.0, "min": 0.0}, + "networkInterfaceCount": {"max": 0, "min": 0}, + "rdmaNetworkInterfaceCount": {"max": 0, "min": 0}, + "rdmaSupport": "str", + "vmCategories": ["str"], + }, }, "tags": {"str": "str"}, }, @@ -562,7 +1071,7 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_fleets_begin_delete(self, resource_group): response = self.client.fleets.begin_delete( resource_group_name=resource_group.name, fleet_name="str", @@ -573,7 +1082,7 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_fleets_list_by_resource_group(self, resource_group): response = self.client.fleets.list_by_resource_group( resource_group_name=resource_group.name, ) @@ -583,7 +1092,7 @@ 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_fleets_list_by_subscription(self, resource_group): response = self.client.fleets.list_by_subscription() result = [r for r in response] # please add some check logic here by yourself @@ -591,7 +1100,7 @@ def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_virtual_machine_scale_sets(self, resource_group): + def test_fleets_list_virtual_machine_scale_sets(self, resource_group): response = self.client.fleets.list_virtual_machine_scale_sets( resource_group_name=resource_group.name, name="str", diff --git a/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_compute_fleet_mgmt_fleets_operations_async.py b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_compute_fleet_mgmt_fleets_operations_async.py index 90ef13763cdd..c32cf8dfa392 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_compute_fleet_mgmt_fleets_operations_async.py +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_compute_fleet_mgmt_fleets_operations_async.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -21,7 +22,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_fleets_get(self, resource_group): response = await self.client.fleets.get( resource_group_name=resource_group.name, fleet_name="str", @@ -32,7 +33,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_fleets_begin_create_or_update(self, resource_group): response = await ( await self.client.fleets.begin_create_or_update( resource_group_name=resource_group.name, @@ -276,10 +277,255 @@ async def test_begin_create_or_update(self, resource_group): "timeCreated": "2020-02-20 00:00:00", "userData": "str", }, + "additionalVirtualMachineCapabilities": { + "hibernationEnabled": bool, + "ultraSSDEnabled": bool, + }, "computeApiVersion": "str", "platformFaultDomainCount": 0, }, "vmSizesProfile": [{"name": "str", "rank": 0}], + "additionalLocationsProfile": { + "locationProfiles": [ + { + "location": "str", + "virtualMachineProfileOverride": { + "applicationProfile": { + "galleryApplications": [ + { + "packageReferenceId": "str", + "configurationReference": "str", + "enableAutomaticUpgrade": bool, + "order": 0, + "tags": "str", + "treatFailureAsDeploymentFailure": bool, + } + ] + }, + "capacityReservation": {"capacityReservationGroup": {"id": "str"}}, + "diagnosticsProfile": { + "bootDiagnostics": {"enabled": bool, "storageUri": "str"} + }, + "extensionProfile": { + "extensions": [ + { + "id": "str", + "name": "str", + "properties": { + "autoUpgradeMinorVersion": bool, + "enableAutomaticUpgrade": bool, + "forceUpdateTag": "str", + "protectedSettings": {"str": {}}, + "protectedSettingsFromKeyVault": { + "secretUrl": "str", + "sourceVault": {"id": "str"}, + }, + "provisionAfterExtensions": ["str"], + "provisioningState": "str", + "publisher": "str", + "settings": {"str": {}}, + "suppressFailures": bool, + "type": "str", + "typeHandlerVersion": "str", + }, + "type": "str", + } + ], + "extensionsTimeBudget": "str", + }, + "hardwareProfile": { + "vmSizeProperties": {"vCPUsAvailable": 0, "vCPUsPerCore": 0} + }, + "licenseType": "str", + "networkProfile": { + "healthProbe": {"id": "str"}, + "networkApiVersion": "str", + "networkInterfaceConfigurations": [ + { + "name": "str", + "properties": { + "ipConfigurations": [ + { + "name": "str", + "properties": { + "applicationGatewayBackendAddressPools": [ + {"id": "str"} + ], + "applicationSecurityGroups": [{"id": "str"}], + "loadBalancerBackendAddressPools": [{"id": "str"}], + "loadBalancerInboundNatPools": [{"id": "str"}], + "primary": bool, + "privateIPAddressVersion": "str", + "publicIPAddressConfiguration": { + "name": "str", + "properties": { + "deleteOption": "str", + "dnsSettings": { + "domainNameLabel": "str", + "domainNameLabelScope": "str", + }, + "idleTimeoutInMinutes": 0, + "ipTags": [ + {"ipTagType": "str", "tag": "str"} + ], + "publicIPAddressVersion": "str", + "publicIPPrefix": {"id": "str"}, + }, + "sku": {"name": "str", "tier": "str"}, + }, + "subnet": {"id": "str"}, + }, + } + ], + "auxiliaryMode": "str", + "auxiliarySku": "str", + "deleteOption": "str", + "disableTcpStateTracking": bool, + "dnsSettings": {"dnsServers": ["str"]}, + "enableAcceleratedNetworking": bool, + "enableFpga": bool, + "enableIPForwarding": bool, + "networkSecurityGroup": {"id": "str"}, + "primary": bool, + }, + } + ], + }, + "osProfile": { + "adminPassword": "str", + "adminUsername": "str", + "allowExtensionOperations": bool, + "computerNamePrefix": "str", + "customData": "str", + "linuxConfiguration": { + "disablePasswordAuthentication": bool, + "enableVMAgentPlatformUpdates": bool, + "patchSettings": { + "assessmentMode": "str", + "automaticByPlatformSettings": { + "bypassPlatformSafetyChecksOnUserSchedule": bool, + "rebootSetting": "str", + }, + "patchMode": "str", + }, + "provisionVMAgent": bool, + "ssh": {"publicKeys": [{"keyData": "str", "path": "str"}]}, + }, + "requireGuestProvisionSignal": bool, + "secrets": [ + { + "sourceVault": {"id": "str"}, + "vaultCertificates": [ + {"certificateStore": "str", "certificateUrl": "str"} + ], + } + ], + "windowsConfiguration": { + "additionalUnattendContent": [ + { + "componentName": "Microsoft-Windows-Shell-Setup", + "content": "str", + "passName": "OobeSystem", + "settingName": "str", + } + ], + "enableAutomaticUpdates": bool, + "enableVMAgentPlatformUpdates": bool, + "patchSettings": { + "assessmentMode": "str", + "automaticByPlatformSettings": { + "bypassPlatformSafetyChecksOnUserSchedule": bool, + "rebootSetting": "str", + }, + "enableHotpatching": bool, + "patchMode": "str", + }, + "provisionVMAgent": bool, + "timeZone": "str", + "winRM": {"listeners": [{"certificateUrl": "str", "protocol": "str"}]}, + }, + }, + "scheduledEventsProfile": { + "osImageNotificationProfile": {"enable": bool, "notBeforeTimeout": "str"}, + "terminateNotificationProfile": {"enable": bool, "notBeforeTimeout": "str"}, + }, + "securityPostureReference": { + "excludeExtensions": ["str"], + "id": "str", + "isOverridable": bool, + }, + "securityProfile": { + "encryptionAtHost": bool, + "encryptionIdentity": {"userAssignedIdentityResourceId": "str"}, + "proxyAgentSettings": { + "enabled": bool, + "keyIncarnationId": 0, + "mode": "str", + }, + "securityType": "str", + "uefiSettings": {"secureBootEnabled": bool, "vTpmEnabled": bool}, + }, + "serviceArtifactReference": {"id": "str"}, + "storageProfile": { + "dataDisks": [ + { + "createOption": "str", + "lun": 0, + "caching": "str", + "deleteOption": "str", + "diskIOPSReadWrite": 0, + "diskMBpsReadWrite": 0, + "diskSizeGB": 0, + "managedDisk": { + "diskEncryptionSet": {"id": "str"}, + "securityProfile": { + "diskEncryptionSet": {"id": "str"}, + "securityEncryptionType": "str", + }, + "storageAccountType": "str", + }, + "name": "str", + "writeAcceleratorEnabled": bool, + } + ], + "diskControllerType": "str", + "imageReference": { + "communityGalleryImageId": "str", + "exactVersion": "str", + "id": "str", + "offer": "str", + "publisher": "str", + "sharedGalleryImageId": "str", + "sku": "str", + "version": "str", + }, + "osDisk": { + "createOption": "str", + "caching": "str", + "deleteOption": "str", + "diffDiskSettings": {"option": "str", "placement": "str"}, + "diskSizeGB": 0, + "image": {"uri": "str"}, + "managedDisk": { + "diskEncryptionSet": {"id": "str"}, + "securityProfile": { + "diskEncryptionSet": {"id": "str"}, + "securityEncryptionType": "str", + }, + "storageAccountType": "str", + }, + "name": "str", + "osType": "str", + "vhdContainers": ["str"], + "writeAcceleratorEnabled": bool, + }, + }, + "timeCreated": "2020-02-20 00:00:00", + "userData": "str", + }, + } + ] + }, "provisioningState": "str", "regularPriorityProfile": {"allocationStrategy": "str", "capacity": 0, "minCapacity": 0}, "spotPriorityProfile": { @@ -292,6 +538,28 @@ async def test_begin_create_or_update(self, resource_group): }, "timeCreated": "2020-02-20 00:00:00", "uniqueId": "str", + "vmAttributes": { + "memoryInGiB": {"max": 0.0, "min": 0.0}, + "vCpuCount": {"max": 0, "min": 0}, + "acceleratorCount": {"max": 0, "min": 0}, + "acceleratorManufacturers": ["str"], + "acceleratorSupport": "str", + "acceleratorTypes": ["str"], + "architectureTypes": ["str"], + "burstableSupport": "str", + "cpuManufacturers": ["str"], + "dataDiskCount": {"max": 0, "min": 0}, + "excludedVMSizes": ["str"], + "localStorageDiskTypes": ["str"], + "localStorageInGiB": {"max": 0.0, "min": 0.0}, + "localStorageSupport": "str", + "memoryInGiBPerVCpu": {"max": 0.0, "min": 0.0}, + "networkBandwidthInMbps": {"max": 0.0, "min": 0.0}, + "networkInterfaceCount": {"max": 0, "min": 0}, + "rdmaNetworkInterfaceCount": {"max": 0, "min": 0}, + "rdmaSupport": "str", + "vmCategories": ["str"], + }, }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -313,7 +581,7 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_fleets_begin_update(self, resource_group): response = await ( await self.client.fleets.begin_update( resource_group_name=resource_group.name, @@ -552,10 +820,255 @@ async def test_begin_update(self, resource_group): "timeCreated": "2020-02-20 00:00:00", "userData": "str", }, + "additionalVirtualMachineCapabilities": { + "hibernationEnabled": bool, + "ultraSSDEnabled": bool, + }, "computeApiVersion": "str", "platformFaultDomainCount": 0, }, "vmSizesProfile": [{"name": "str", "rank": 0}], + "additionalLocationsProfile": { + "locationProfiles": [ + { + "location": "str", + "virtualMachineProfileOverride": { + "applicationProfile": { + "galleryApplications": [ + { + "packageReferenceId": "str", + "configurationReference": "str", + "enableAutomaticUpgrade": bool, + "order": 0, + "tags": "str", + "treatFailureAsDeploymentFailure": bool, + } + ] + }, + "capacityReservation": {"capacityReservationGroup": {"id": "str"}}, + "diagnosticsProfile": { + "bootDiagnostics": {"enabled": bool, "storageUri": "str"} + }, + "extensionProfile": { + "extensions": [ + { + "id": "str", + "name": "str", + "properties": { + "autoUpgradeMinorVersion": bool, + "enableAutomaticUpgrade": bool, + "forceUpdateTag": "str", + "protectedSettings": {"str": {}}, + "protectedSettingsFromKeyVault": { + "secretUrl": "str", + "sourceVault": {"id": "str"}, + }, + "provisionAfterExtensions": ["str"], + "provisioningState": "str", + "publisher": "str", + "settings": {"str": {}}, + "suppressFailures": bool, + "type": "str", + "typeHandlerVersion": "str", + }, + "type": "str", + } + ], + "extensionsTimeBudget": "str", + }, + "hardwareProfile": { + "vmSizeProperties": {"vCPUsAvailable": 0, "vCPUsPerCore": 0} + }, + "licenseType": "str", + "networkProfile": { + "healthProbe": {"id": "str"}, + "networkApiVersion": "str", + "networkInterfaceConfigurations": [ + { + "name": "str", + "properties": { + "ipConfigurations": [ + { + "name": "str", + "properties": { + "applicationGatewayBackendAddressPools": [ + {"id": "str"} + ], + "applicationSecurityGroups": [{"id": "str"}], + "loadBalancerBackendAddressPools": [{"id": "str"}], + "loadBalancerInboundNatPools": [{"id": "str"}], + "primary": bool, + "privateIPAddressVersion": "str", + "publicIPAddressConfiguration": { + "name": "str", + "properties": { + "deleteOption": "str", + "dnsSettings": { + "domainNameLabel": "str", + "domainNameLabelScope": "str", + }, + "idleTimeoutInMinutes": 0, + "ipTags": [ + {"ipTagType": "str", "tag": "str"} + ], + "publicIPAddressVersion": "str", + "publicIPPrefix": {"id": "str"}, + }, + "sku": {"name": "str", "tier": "str"}, + }, + "subnet": {"id": "str"}, + }, + } + ], + "auxiliaryMode": "str", + "auxiliarySku": "str", + "deleteOption": "str", + "disableTcpStateTracking": bool, + "dnsSettings": {"dnsServers": ["str"]}, + "enableAcceleratedNetworking": bool, + "enableFpga": bool, + "enableIPForwarding": bool, + "networkSecurityGroup": {"id": "str"}, + "primary": bool, + }, + } + ], + }, + "osProfile": { + "adminPassword": "str", + "adminUsername": "str", + "allowExtensionOperations": bool, + "computerNamePrefix": "str", + "customData": "str", + "linuxConfiguration": { + "disablePasswordAuthentication": bool, + "enableVMAgentPlatformUpdates": bool, + "patchSettings": { + "assessmentMode": "str", + "automaticByPlatformSettings": { + "bypassPlatformSafetyChecksOnUserSchedule": bool, + "rebootSetting": "str", + }, + "patchMode": "str", + }, + "provisionVMAgent": bool, + "ssh": {"publicKeys": [{"keyData": "str", "path": "str"}]}, + }, + "requireGuestProvisionSignal": bool, + "secrets": [ + { + "sourceVault": {"id": "str"}, + "vaultCertificates": [ + {"certificateStore": "str", "certificateUrl": "str"} + ], + } + ], + "windowsConfiguration": { + "additionalUnattendContent": [ + { + "componentName": "Microsoft-Windows-Shell-Setup", + "content": "str", + "passName": "OobeSystem", + "settingName": "str", + } + ], + "enableAutomaticUpdates": bool, + "enableVMAgentPlatformUpdates": bool, + "patchSettings": { + "assessmentMode": "str", + "automaticByPlatformSettings": { + "bypassPlatformSafetyChecksOnUserSchedule": bool, + "rebootSetting": "str", + }, + "enableHotpatching": bool, + "patchMode": "str", + }, + "provisionVMAgent": bool, + "timeZone": "str", + "winRM": {"listeners": [{"certificateUrl": "str", "protocol": "str"}]}, + }, + }, + "scheduledEventsProfile": { + "osImageNotificationProfile": {"enable": bool, "notBeforeTimeout": "str"}, + "terminateNotificationProfile": {"enable": bool, "notBeforeTimeout": "str"}, + }, + "securityPostureReference": { + "excludeExtensions": ["str"], + "id": "str", + "isOverridable": bool, + }, + "securityProfile": { + "encryptionAtHost": bool, + "encryptionIdentity": {"userAssignedIdentityResourceId": "str"}, + "proxyAgentSettings": { + "enabled": bool, + "keyIncarnationId": 0, + "mode": "str", + }, + "securityType": "str", + "uefiSettings": {"secureBootEnabled": bool, "vTpmEnabled": bool}, + }, + "serviceArtifactReference": {"id": "str"}, + "storageProfile": { + "dataDisks": [ + { + "createOption": "str", + "lun": 0, + "caching": "str", + "deleteOption": "str", + "diskIOPSReadWrite": 0, + "diskMBpsReadWrite": 0, + "diskSizeGB": 0, + "managedDisk": { + "diskEncryptionSet": {"id": "str"}, + "securityProfile": { + "diskEncryptionSet": {"id": "str"}, + "securityEncryptionType": "str", + }, + "storageAccountType": "str", + }, + "name": "str", + "writeAcceleratorEnabled": bool, + } + ], + "diskControllerType": "str", + "imageReference": { + "communityGalleryImageId": "str", + "exactVersion": "str", + "id": "str", + "offer": "str", + "publisher": "str", + "sharedGalleryImageId": "str", + "sku": "str", + "version": "str", + }, + "osDisk": { + "createOption": "str", + "caching": "str", + "deleteOption": "str", + "diffDiskSettings": {"option": "str", "placement": "str"}, + "diskSizeGB": 0, + "image": {"uri": "str"}, + "managedDisk": { + "diskEncryptionSet": {"id": "str"}, + "securityProfile": { + "diskEncryptionSet": {"id": "str"}, + "securityEncryptionType": "str", + }, + "storageAccountType": "str", + }, + "name": "str", + "osType": "str", + "vhdContainers": ["str"], + "writeAcceleratorEnabled": bool, + }, + }, + "timeCreated": "2020-02-20 00:00:00", + "userData": "str", + }, + } + ] + }, "provisioningState": "str", "regularPriorityProfile": {"allocationStrategy": "str", "capacity": 0, "minCapacity": 0}, "spotPriorityProfile": { @@ -568,6 +1081,28 @@ async def test_begin_update(self, resource_group): }, "timeCreated": "2020-02-20 00:00:00", "uniqueId": "str", + "vmAttributes": { + "memoryInGiB": {"max": 0.0, "min": 0.0}, + "vCpuCount": {"max": 0, "min": 0}, + "acceleratorCount": {"max": 0, "min": 0}, + "acceleratorManufacturers": ["str"], + "acceleratorSupport": "str", + "acceleratorTypes": ["str"], + "architectureTypes": ["str"], + "burstableSupport": "str", + "cpuManufacturers": ["str"], + "dataDiskCount": {"max": 0, "min": 0}, + "excludedVMSizes": ["str"], + "localStorageDiskTypes": ["str"], + "localStorageInGiB": {"max": 0.0, "min": 0.0}, + "localStorageSupport": "str", + "memoryInGiBPerVCpu": {"max": 0.0, "min": 0.0}, + "networkBandwidthInMbps": {"max": 0.0, "min": 0.0}, + "networkInterfaceCount": {"max": 0, "min": 0}, + "rdmaNetworkInterfaceCount": {"max": 0, "min": 0}, + "rdmaSupport": "str", + "vmCategories": ["str"], + }, }, "tags": {"str": "str"}, }, @@ -579,7 +1114,7 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_fleets_begin_delete(self, resource_group): response = await ( await self.client.fleets.begin_delete( resource_group_name=resource_group.name, @@ -592,7 +1127,7 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_fleets_list_by_resource_group(self, resource_group): response = self.client.fleets.list_by_resource_group( resource_group_name=resource_group.name, ) @@ -602,7 +1137,7 @@ 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_fleets_list_by_subscription(self, resource_group): response = self.client.fleets.list_by_subscription() result = [r async for r in response] # please add some check logic here by yourself @@ -610,7 +1145,7 @@ async def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_virtual_machine_scale_sets(self, resource_group): + async def test_fleets_list_virtual_machine_scale_sets(self, resource_group): response = self.client.fleets.list_virtual_machine_scale_sets( resource_group_name=resource_group.name, name="str", diff --git a/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_compute_fleet_mgmt_operations.py b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_compute_fleet_mgmt_operations.py index ee3c5dfa2ad5..b8d4e4c8048d 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_compute_fleet_mgmt_operations.py +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_compute_fleet_mgmt_operations.py @@ -20,7 +20,7 @@ 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() result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_compute_fleet_mgmt_operations_async.py b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_compute_fleet_mgmt_operations_async.py index 36313543213d..f311aefce749 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_compute_fleet_mgmt_operations_async.py +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_compute_fleet_mgmt_operations_async.py @@ -21,7 +21,7 @@ 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() result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/computefleet/azure-mgmt-computefleet/sdk_packaging.toml b/sdk/computefleet/azure-mgmt-computefleet/sdk_packaging.toml index d6b18f2d5178..f19c21d8eb05 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/sdk_packaging.toml +++ b/sdk/computefleet/azure-mgmt-computefleet/sdk_packaging.toml @@ -3,7 +3,7 @@ package_name = "azure-mgmt-computefleet" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "Computefleet Management" package_doc_id = "" -is_stable = false +is_stable = true is_arm = true need_msrestazure = false need_azuremgmtcore = true diff --git a/sdk/computefleet/azure-mgmt-computefleet/setup.py b/sdk/computefleet/azure-mgmt-computefleet/setup.py index 29a5f9125bc0..4b522212283a 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/setup.py +++ b/sdk/computefleet/azure-mgmt-computefleet/setup.py @@ -49,7 +49,7 @@ url="https://github.com/Azure/azure-sdk-for-python", keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product classifiers=[ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", diff --git a/sdk/computefleet/azure-mgmt-computefleet/tests/conftest.py b/sdk/computefleet/azure-mgmt-computefleet/tests/conftest.py index 56f507f51ec9..7293be017790 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/tests/conftest.py +++ b/sdk/computefleet/azure-mgmt-computefleet/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): computefleetmgmt_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") diff --git a/sdk/computefleet/azure-mgmt-computefleet/tests/test_compute_fleet_mgmt_fleets_operations_async_test.py b/sdk/computefleet/azure-mgmt-computefleet/tests/test_compute_fleet_mgmt_fleets_operations_async_test.py index c36b94d5409b..e7555263c790 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/tests/test_compute_fleet_mgmt_fleets_operations_async_test.py +++ b/sdk/computefleet/azure-mgmt-computefleet/tests/test_compute_fleet_mgmt_fleets_operations_async_test.py @@ -13,7 +13,7 @@ AZURE_LOCATION = "eastus" - +@pytest.mark.live_test_only class TestComputeFleetMgmtFleetsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(ComputeFleetMgmtClient, is_async=True) diff --git a/sdk/computefleet/azure-mgmt-computefleet/tests/test_compute_fleet_mgmt_fleets_operations_test.py b/sdk/computefleet/azure-mgmt-computefleet/tests/test_compute_fleet_mgmt_fleets_operations_test.py index 431540f9d114..4740170973b8 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/tests/test_compute_fleet_mgmt_fleets_operations_test.py +++ b/sdk/computefleet/azure-mgmt-computefleet/tests/test_compute_fleet_mgmt_fleets_operations_test.py @@ -12,7 +12,7 @@ AZURE_LOCATION = "eastus" - +@pytest.mark.live_test_only class TestComputeFleetMgmtFleetsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(ComputeFleetMgmtClient) diff --git a/sdk/computefleet/azure-mgmt-computefleet/tests/test_compute_fleet_mgmt_operations_async_test.py b/sdk/computefleet/azure-mgmt-computefleet/tests/test_compute_fleet_mgmt_operations_async_test.py index 7bfb0fc69e98..b87a333b58e4 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/tests/test_compute_fleet_mgmt_operations_async_test.py +++ b/sdk/computefleet/azure-mgmt-computefleet/tests/test_compute_fleet_mgmt_operations_async_test.py @@ -13,7 +13,7 @@ AZURE_LOCATION = "eastus" - +@pytest.mark.live_test_only class TestComputeFleetMgmtOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(ComputeFleetMgmtClient, is_async=True) diff --git a/sdk/computefleet/azure-mgmt-computefleet/tests/test_compute_fleet_mgmt_operations_test.py b/sdk/computefleet/azure-mgmt-computefleet/tests/test_compute_fleet_mgmt_operations_test.py index 21bbe9e61fda..921096d91c60 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/tests/test_compute_fleet_mgmt_operations_test.py +++ b/sdk/computefleet/azure-mgmt-computefleet/tests/test_compute_fleet_mgmt_operations_test.py @@ -12,7 +12,7 @@ AZURE_LOCATION = "eastus" - +@pytest.mark.live_test_only class TestComputeFleetMgmtOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(ComputeFleetMgmtClient) diff --git a/sdk/computefleet/azure-mgmt-computefleet/tsp-location.yaml b/sdk/computefleet/azure-mgmt-computefleet/tsp-location.yaml index 3edda0322bc0..58d3b9419143 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/tsp-location.yaml +++ b/sdk/computefleet/azure-mgmt-computefleet/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/azurefleet/AzureFleet.Management -commit: c1cea38fb7e5cec9afe223a2ed15cbe2fbeecbdb +commit: fda3d5e4ae4c69aa72ddfdf5ca1b6d5795a03e71 repo: Azure/azure-rest-api-specs -additionalDirectories: +additionalDirectories: