diff --git a/sdk/computefleet/azure-mgmt-computefleet/_meta.json b/sdk/computefleet/azure-mgmt-computefleet/_meta.json index 66649e3ac4f6..50e7c7139751 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/_meta.json +++ b/sdk/computefleet/azure-mgmt-computefleet/_meta.json @@ -1,6 +1,13 @@ { - "commit": "c1cea38fb7e5cec9afe223a2ed15cbe2fbeecbdb", + "commit": "c9e86b09add417bb10ac8d880c5b8d69dae12201", "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.26.0", + "autorest": "3.10.2", + "use": [ + "@autorest/python@6.19.0", + "@autorest/modelerfour@4.27.0" + ], + "autorest_command": "autorest specification/azurefleet/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "readme": "specification/azurefleet/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/__init__.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/__init__.py index 9ff3c12c42a2..f55041cdcb36 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/__init__.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/__init__.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._client import ComputeFleetMgmtClient +from ._microsoft_azure_fleet import MicrosoftAzureFleet from ._version import VERSION __version__ = VERSION @@ -19,7 +19,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "ComputeFleetMgmtClient", + "MicrosoftAzureFleet", ] __all__.extend([p for p in _patch_all if p not in __all__]) 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..d6cb80461ed6 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_configuration.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_configuration.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -18,24 +18,23 @@ from azure.core.credentials import TokenCredential -class ComputeFleetMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long - """Configuration for ComputeFleetMgmtClient. +class MicrosoftAzureFleetConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for MicrosoftAzureFleet. Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential used to authenticate requests to the service. Required. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. 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. + :keyword api_version: Api Version. 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") + api_version: str = kwargs.pop("api_version", "2024-11-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_client.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_microsoft_azure_fleet.py similarity index 81% rename from sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_client.py rename to sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_microsoft_azure_fleet.py index 1e79203618f3..b3d0c1e67141 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_client.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_microsoft_azure_fleet.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,8 @@ from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy -from ._configuration import ComputeFleetMgmtClientConfiguration +from . import models as _models +from ._configuration import MicrosoftAzureFleetConfiguration from ._serialization import Deserializer, Serializer from .operations import FleetsOperations, Operations @@ -24,22 +25,21 @@ from azure.core.credentials import TokenCredential -class ComputeFleetMgmtClient: # pylint: disable=client-accepts-api-version-keyword - """ComputeFleetMgmtClient. +class MicrosoftAzureFleet: # pylint: disable=client-accepts-api-version-keyword + """MicrosoftAzureFleet. :ivar operations: Operations operations :vartype operations: azure.mgmt.computefleet.operations.Operations :ivar fleets: FleetsOperations operations :vartype fleets: azure.mgmt.computefleet.operations.FleetsOperations - :param credential: Credential used to authenticate requests to the service. Required. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service host. Default value is "https://management.azure.com". + :param base_url: Service URL. 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: Api Version. 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,7 +52,7 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = ComputeFleetMgmtClientConfiguration( + self._config = MicrosoftAzureFleetConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) _policies = kwargs.pop("policies", None) @@ -75,19 +75,20 @@ def __init__( ] self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) - self._serialize = Serializer() - self._deserialize = Deserializer() + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.fleets = FleetsOperations(self._client, self._config, self._serialize, self._deserialize) - def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = client.send_request(request) + >>> response = client._send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request 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 deleted file mode 100644 index 43fd8c7e9b1b..000000000000 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_model_base.py +++ /dev/null @@ -1,888 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except - -import copy -import calendar -import decimal -import functools -import sys -import logging -import base64 -import re -import typing -import enum -import email.utils -from datetime import datetime, date, time, timedelta, timezone -from json import JSONEncoder -from typing_extensions import Self -import isodate -from azure.core.exceptions import DeserializationError -from azure.core import CaseInsensitiveEnumMeta -from azure.core.pipeline import PipelineResponse -from azure.core.serialization import _Null - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping - -_LOGGER = logging.getLogger(__name__) - -__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] - -TZ_UTC = timezone.utc -_T = typing.TypeVar("_T") - - -def _timedelta_as_isostr(td: timedelta) -> str: - """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' - - Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython - - :param timedelta td: The timedelta to convert - :rtype: str - :return: ISO8601 version of this timedelta - """ - - # Split seconds to larger units - seconds = td.total_seconds() - minutes, seconds = divmod(seconds, 60) - hours, minutes = divmod(minutes, 60) - days, hours = divmod(hours, 24) - - days, hours, minutes = list(map(int, (days, hours, minutes))) - seconds = round(seconds, 6) - - # Build date - date_str = "" - if days: - date_str = "%sD" % days - - if hours or minutes or seconds: - # Build time - time_str = "T" - - # Hours - bigger_exists = date_str or hours - if bigger_exists: - time_str += "{:02}H".format(hours) - - # Minutes - bigger_exists = bigger_exists or minutes - if bigger_exists: - time_str += "{:02}M".format(minutes) - - # Seconds - try: - if seconds.is_integer(): - seconds_string = "{:02}".format(int(seconds)) - else: - # 9 chars long w/ leading 0, 6 digits after decimal - seconds_string = "%09.6f" % seconds - # Remove trailing zeros - seconds_string = seconds_string.rstrip("0") - except AttributeError: # int.is_integer() raises - seconds_string = "{:02}".format(seconds) - - time_str += "{}S".format(seconds_string) - else: - time_str = "" - - return "P" + date_str + time_str - - -def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: - encoded = base64.b64encode(o).decode() - if format == "base64url": - return encoded.strip("=").replace("+", "-").replace("/", "_") - return encoded - - -def _serialize_datetime(o, format: typing.Optional[str] = None): - if hasattr(o, "year") and hasattr(o, "hour"): - if format == "rfc7231": - return email.utils.format_datetime(o, usegmt=True) - if format == "unix-timestamp": - return int(calendar.timegm(o.utctimetuple())) - - # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) - if not o.tzinfo: - iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() - else: - iso_formatted = o.astimezone(TZ_UTC).isoformat() - # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) - return iso_formatted.replace("+00:00", "Z") - # Next try datetime.date or datetime.time - return o.isoformat() - - -def _is_readonly(p): - try: - return p._visibility == ["read"] # pylint: disable=protected-access - except AttributeError: - return False - - -class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" - - def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): - super().__init__(*args, **kwargs) - self.exclude_readonly = exclude_readonly - self.format = format - - def default(self, o): # pylint: disable=too-many-return-statements - if _is_model(o): - if self.exclude_readonly: - readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] - return {k: v for k, v in o.items() if k not in readonly_props} - return dict(o.items()) - try: - return super(SdkJSONEncoder, self).default(o) - except TypeError: - if isinstance(o, _Null): - return None - if isinstance(o, decimal.Decimal): - return float(o) - if isinstance(o, (bytes, bytearray)): - return _serialize_bytes(o, self.format) - try: - # First try datetime.datetime - return _serialize_datetime(o, self.format) - except AttributeError: - pass - # Last, try datetime.timedelta - try: - return _timedelta_as_isostr(o) - except AttributeError: - # This will be raised when it hits value.total_seconds in the method above - pass - return super(SdkJSONEncoder, self).default(o) - - -_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_RFC7231 = re.compile( - r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" - r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" -) - - -def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: - """Deserialize ISO-8601 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: ~datetime.datetime - :returns: The datetime object from that input - """ - if isinstance(attr, datetime): - # i'm already deserialized - return attr - attr = attr.upper() - match = _VALID_DATE.match(attr) - if not match: - raise ValueError("Invalid datetime string: " + attr) - - check_decimal = attr.split(".") - if len(check_decimal) > 1: - decimal_str = "" - for digit in check_decimal[1]: - if digit.isdigit(): - decimal_str += digit - else: - break - if len(decimal_str) > 6: - attr = attr.replace(decimal_str, decimal_str[0:6]) - - date_obj = isodate.parse_datetime(attr) - test_utc = date_obj.utctimetuple() - if test_utc.tm_year > 9999 or test_utc.tm_year < 1: - raise OverflowError("Hit max or min date") - return date_obj - - -def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: - """Deserialize RFC7231 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: ~datetime.datetime - :returns: The datetime object from that input - """ - if isinstance(attr, datetime): - # i'm already deserialized - return attr - match = _VALID_RFC7231.match(attr) - if not match: - raise ValueError("Invalid datetime string: " + attr) - - return email.utils.parsedate_to_datetime(attr) - - -def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: - """Deserialize unix timestamp into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: ~datetime.datetime - :returns: The datetime object from that input - """ - if isinstance(attr, datetime): - # i'm already deserialized - return attr - return datetime.fromtimestamp(attr, TZ_UTC) - - -def _deserialize_date(attr: typing.Union[str, date]) -> date: - """Deserialize ISO-8601 formatted string into Date object. - :param str attr: response string to be deserialized. - :rtype: date - :returns: The date object from that input - """ - # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. - if isinstance(attr, date): - return attr - return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore - - -def _deserialize_time(attr: typing.Union[str, time]) -> time: - """Deserialize ISO-8601 formatted string into time object. - - :param str attr: response string to be deserialized. - :rtype: datetime.time - :returns: The time object from that input - """ - if isinstance(attr, time): - return attr - return isodate.parse_time(attr) - - -def _deserialize_bytes(attr): - if isinstance(attr, (bytes, bytearray)): - return attr - return bytes(base64.b64decode(attr)) - - -def _deserialize_bytes_base64(attr): - if isinstance(attr, (bytes, bytearray)): - return attr - padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore - attr = attr + padding # type: ignore - encoded = attr.replace("-", "+").replace("_", "/") - return bytes(base64.b64decode(encoded)) - - -def _deserialize_duration(attr): - if isinstance(attr, timedelta): - return attr - return isodate.parse_duration(attr) - - -def _deserialize_decimal(attr): - if isinstance(attr, decimal.Decimal): - return attr - return decimal.Decimal(str(attr)) - - -_DESERIALIZE_MAPPING = { - datetime: _deserialize_datetime, - date: _deserialize_date, - time: _deserialize_time, - bytes: _deserialize_bytes, - bytearray: _deserialize_bytes, - timedelta: _deserialize_duration, - typing.Any: lambda x: x, - decimal.Decimal: _deserialize_decimal, -} - -_DESERIALIZE_MAPPING_WITHFORMAT = { - "rfc3339": _deserialize_datetime, - "rfc7231": _deserialize_datetime_rfc7231, - "unix-timestamp": _deserialize_datetime_unix_timestamp, - "base64": _deserialize_bytes, - "base64url": _deserialize_bytes_base64, -} - - -def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): - if rf and rf._format: - return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) - return _DESERIALIZE_MAPPING.get(annotation) - - -def _get_type_alias_type(module_name: str, alias_name: str): - types = { - k: v - for k, v in sys.modules[module_name].__dict__.items() - if isinstance(v, typing._GenericAlias) # type: ignore - } - if alias_name not in types: - return alias_name - return types[alias_name] - - -def _get_model(module_name: str, model_name: str): - models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} - module_end = module_name.rsplit(".", 1)[0] - models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) - if isinstance(model_name, str): - model_name = model_name.split(".")[-1] - if model_name not in models: - return model_name - return models[model_name] - - -_UNSET = object() - - -class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object - def __init__(self, data: typing.Dict[str, typing.Any]) -> None: - self._data = data - - def __contains__(self, key: typing.Any) -> bool: - return key in self._data - - def __getitem__(self, key: str) -> typing.Any: - return self._data.__getitem__(key) - - def __setitem__(self, key: str, value: typing.Any) -> None: - self._data.__setitem__(key, value) - - def __delitem__(self, key: str) -> None: - self._data.__delitem__(key) - - def __iter__(self) -> typing.Iterator[typing.Any]: - return self._data.__iter__() - - def __len__(self) -> int: - return self._data.__len__() - - def __ne__(self, other: typing.Any) -> bool: - return not self.__eq__(other) - - def keys(self) -> typing.KeysView[str]: - return self._data.keys() - - def values(self) -> typing.ValuesView[typing.Any]: - return self._data.values() - - def items(self) -> typing.ItemsView[str, typing.Any]: - return self._data.items() - - def get(self, key: str, default: typing.Any = None) -> typing.Any: - try: - return self[key] - except KeyError: - return default - - @typing.overload - def pop(self, key: str) -> typing.Any: ... - - @typing.overload - def pop(self, key: str, default: _T) -> _T: ... - - @typing.overload - def pop(self, key: str, default: typing.Any) -> typing.Any: ... - - def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: - if default is _UNSET: - return self._data.pop(key) - return self._data.pop(key, default) - - def popitem(self) -> typing.Tuple[str, typing.Any]: - return self._data.popitem() - - def clear(self) -> None: - self._data.clear() - - def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: - self._data.update(*args, **kwargs) - - @typing.overload - def setdefault(self, key: str, default: None = None) -> None: ... - - @typing.overload - def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... - - def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: - if default is _UNSET: - return self._data.setdefault(key) - return self._data.setdefault(key, default) - - def __eq__(self, other: typing.Any) -> bool: - try: - other_model = self.__class__(other) - except Exception: - return False - return self._data == other_model._data - - def __repr__(self) -> str: - return str(self._data) - - -def _is_model(obj: typing.Any) -> bool: - return getattr(obj, "_is_model", False) - - -def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements - if isinstance(o, list): - return [_serialize(x, format) for x in o] - if isinstance(o, dict): - return {k: _serialize(v, format) for k, v in o.items()} - if isinstance(o, set): - return {_serialize(x, format) for x in o} - if isinstance(o, tuple): - return tuple(_serialize(x, format) for x in o) - if isinstance(o, (bytes, bytearray)): - return _serialize_bytes(o, format) - if isinstance(o, decimal.Decimal): - return float(o) - if isinstance(o, enum.Enum): - return o.value - try: - # First try datetime.datetime - return _serialize_datetime(o, format) - except AttributeError: - pass - # Last, try datetime.timedelta - try: - return _timedelta_as_isostr(o) - except AttributeError: - # This will be raised when it hits value.total_seconds in the method above - pass - return o - - -def _get_rest_field( - attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str -) -> typing.Optional["_RestField"]: - try: - return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) - except StopIteration: - return None - - -def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: - if not rf: - return _serialize(value, None) - if rf._is_multipart_file_input: - return value - if rf._is_model: - return _deserialize(rf._type, value) - return _serialize(value, rf._format) - - -class Model(_MyMutableMapping): - _is_model = True - - def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: - class_name = self.__class__.__name__ - if len(args) > 1: - raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - 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()} - ) - else: - non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] - if non_attr_kwargs: - # actual type errors only throw the first wrong keyword arg they see, so following that. - raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") - dict_to_pass.update( - { - self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) - for k, v in kwargs.items() - if v is not None - } - ) - super().__init__(dict_to_pass) - - 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()) - - return super().__new__(cls) # pylint: disable=no-value-for-parameter - - def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: - for base in cls.__bases__: - if hasattr(base, "__mapping__"): # pylint: disable=no-member - base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member - - @classmethod - def _get_discriminator(cls, exist_discriminators) -> typing.Optional[str]: - 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 - return None - - @classmethod - 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: - return cls(data) - return mapped_cls._deserialize(data, exist_discriminators) # pylint: disable=protected-access - - def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: - """Return a dict that can be JSONify using json.dump. - - :keyword bool exclude_readonly: Whether to remove the readonly properties. - :returns: A dict JSON compatible object - :rtype: dict - """ - - result = {} - 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(): - if exclude_readonly and k in readonly_props: # pyright: ignore - continue - is_multipart_file_input = False - try: - is_multipart_file_input = next( - rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k - )._is_multipart_file_input - except StopIteration: - pass - result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) - return result - - @staticmethod - def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: - if v is None or isinstance(v, _Null): - return None - if isinstance(v, (list, tuple, set)): - return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) - if isinstance(v, dict): - return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} - return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v - - -def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): - if _is_model(obj): - return obj - return _deserialize(model_deserializer, obj) - - -def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): - if obj is None: - return obj - return _deserialize_with_callable(if_obj_deserializer, obj) - - -def _deserialize_with_union(deserializers, obj): - for deserializer in deserializers: - try: - return _deserialize(deserializer, obj) - except DeserializationError: - pass - raise DeserializationError() - - -def _deserialize_dict( - value_deserializer: typing.Optional[typing.Callable], - module: typing.Optional[str], - obj: typing.Dict[typing.Any, typing.Any], -): - if obj is None: - return obj - return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} - - -def _deserialize_multiple_sequence( - entry_deserializers: typing.List[typing.Optional[typing.Callable]], - module: typing.Optional[str], - obj, -): - if obj is None: - return obj - return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) - - -def _deserialize_sequence( - deserializer: typing.Optional[typing.Callable], - module: typing.Optional[str], - obj, -): - if obj is None: - return obj - return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) - - -def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.Any]: - return sorted( - types, - key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), - ) - - -def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, R0912 - 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]: - return None - - # is it a type alias? - if isinstance(annotation, str): - if module is not None: - annotation = _get_type_alias_type(module, annotation) - - # is it a forward ref / in quotes? - if isinstance(annotation, (str, typing.ForwardRef)): - try: - model_name = annotation.__forward_arg__ # type: ignore - except AttributeError: - model_name = annotation - if module is not None: - annotation = _get_model(module, model_name) - - try: - if module and _is_model(annotation): - if rf: - rf._is_model = True - - return functools.partial(_deserialize_model, annotation) # pyright: ignore - except Exception: - pass - - # is it a literal? - try: - if annotation.__origin__ is typing.Literal: # pyright: ignore - return None - except AttributeError: - pass - - # is it optional? - try: - if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore - if len(annotation.__args__) <= 2: # pyright: ignore - if_obj_deserializer = _get_deserialize_callable_from_annotation( - next(a for a in annotation.__args__ if a != type(None)), module, rf # pyright: ignore - ) - - return functools.partial(_deserialize_with_optional, if_obj_deserializer) - # the type is Optional[Union[...]], we need to remove the None type from the Union - annotation_copy = copy.copy(annotation) - annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a != type(None)] # pyright: ignore - return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) - except AttributeError: - pass - - # is it union? - if getattr(annotation, "__origin__", None) is typing.Union: - # initial ordering is we make `string` the last deserialization option, because it is often them most generic - deserializers = [ - _get_deserialize_callable_from_annotation(arg, module, rf) - for arg in _sorted_annotations(annotation.__args__) # pyright: ignore - ] - - return functools.partial(_deserialize_with_union, deserializers) - - try: - if annotation._name == "Dict": # pyright: ignore - value_deserializer = _get_deserialize_callable_from_annotation( - annotation.__args__[1], module, rf # pyright: ignore - ) - - return functools.partial( - _deserialize_dict, - value_deserializer, - module, - ) - except (AttributeError, IndexError): - pass - 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 - ] - return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) - deserializer = _get_deserialize_callable_from_annotation( - annotation.__args__[0], module, rf # pyright: ignore - ) - - return functools.partial(_deserialize_sequence, deserializer, module) - except (TypeError, IndexError, AttributeError, SyntaxError): - pass - - def _deserialize_default( - deserializer, - obj, - ): - if obj is None: - return obj - try: - return _deserialize_with_callable(deserializer, obj) - except Exception: - pass - return obj - - if get_deserializer(annotation, rf): - return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) - - return functools.partial(_deserialize_default, annotation) - - -def _deserialize_with_callable( - deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], - value: typing.Any, -): - try: - if value is None or isinstance(value, _Null): - return None - if deserializer is None: - return value - if isinstance(deserializer, CaseInsensitiveEnumMeta): - try: - return deserializer(value) - except ValueError: - # for unknown value, return raw value - return value - if isinstance(deserializer, type) and issubclass(deserializer, Model): - return deserializer._deserialize(value, []) - return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) - except Exception as e: - raise DeserializationError() from e - - -def _deserialize( - deserializer: typing.Any, - value: typing.Any, - module: typing.Optional[str] = None, - rf: typing.Optional["_RestField"] = None, - format: typing.Optional[str] = None, -) -> typing.Any: - if isinstance(value, PipelineResponse): - value = value.http_response.json() - if rf is None and format: - rf = _RestField(format=format) - if not isinstance(deserializer, functools.partial): - deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) - return _deserialize_with_callable(deserializer, value) - - -class _RestField: - def __init__( - self, - *, - name: typing.Optional[str] = None, - type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - is_discriminator: bool = False, - visibility: typing.Optional[typing.List[str]] = None, - default: typing.Any = _UNSET, - format: typing.Optional[str] = None, - is_multipart_file_input: bool = False, - ): - self._type = type - self._rest_name_input = name - self._module: typing.Optional[str] = None - self._is_discriminator = is_discriminator - self._visibility = visibility - self._is_model = False - self._default = default - self._format = format - self._is_multipart_file_input = is_multipart_file_input - - @property - def _class_type(self) -> typing.Any: - return getattr(self._type, "args", [None])[0] - - @property - def _rest_name(self) -> str: - if self._rest_name_input is None: - raise ValueError("Rest name was never set") - return self._rest_name_input - - def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin - # by this point, type and rest_name will have a value bc we default - # them in __new__ of the Model class - item = obj.get(self._rest_name) - if item is None: - return item - if self._is_model: - return item - return _deserialize(self._type, _serialize(item, self._format), rf=self) - - def __set__(self, obj: Model, value) -> None: - if value is None: - # we want to wipe out entries if users set attr to None - try: - obj.__delitem__(self._rest_name) - except KeyError: - pass - return - if self._is_model: - if not _is_model(value): - value = _deserialize(self._type, value) - obj.__setitem__(self._rest_name, value) - return - obj.__setitem__(self._rest_name, _serialize(value, self._format)) - - def _get_deserialize_callable_from_annotation( - self, annotation: typing.Any - ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: - return _get_deserialize_callable_from_annotation(annotation, self._module, self) - - -def rest_field( - *, - name: typing.Optional[str] = None, - type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, - default: typing.Any = _UNSET, - format: typing.Optional[str] = None, - is_multipart_file_input: bool = False, -) -> typing.Any: - return _RestField( - name=name, - type=type, - visibility=visibility, - default=default, - format=format, - is_multipart_file_input=is_multipart_file_input, - ) - - -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, -) -> typing.Any: - return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility) 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..e5754a47ce68 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_version.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/_version.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/__init__.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/__init__.py index 9d35ee9b42be..251982f3fb49 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/__init__.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/__init__.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._client import ComputeFleetMgmtClient +from ._microsoft_azure_fleet import MicrosoftAzureFleet try: from ._patch import __all__ as _patch_all @@ -16,7 +16,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "ComputeFleetMgmtClient", + "MicrosoftAzureFleet", ] __all__.extend([p for p in _patch_all if p not in __all__]) 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..86f54f267df4 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 @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -18,24 +18,23 @@ from azure.core.credentials_async import AsyncTokenCredential -class ComputeFleetMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long - """Configuration for ComputeFleetMgmtClient. +class MicrosoftAzureFleetConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for MicrosoftAzureFleet. Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential used to authenticate requests to the service. Required. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. 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. + :keyword api_version: Api Version. 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") + api_version: str = kwargs.pop("api_version", "2024-11-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/_client.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/_microsoft_azure_fleet.py similarity index 83% rename from sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/_client.py rename to sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/_microsoft_azure_fleet.py index 960611ab404e..2b3b19bf6e5c 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/_client.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/_microsoft_azure_fleet.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,8 +15,9 @@ from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from .. import models as _models from .._serialization import Deserializer, Serializer -from ._configuration import ComputeFleetMgmtClientConfiguration +from ._configuration import MicrosoftAzureFleetConfiguration from .operations import FleetsOperations, Operations if TYPE_CHECKING: @@ -24,22 +25,21 @@ from azure.core.credentials_async import AsyncTokenCredential -class ComputeFleetMgmtClient: # pylint: disable=client-accepts-api-version-keyword - """ComputeFleetMgmtClient. +class MicrosoftAzureFleet: # pylint: disable=client-accepts-api-version-keyword + """MicrosoftAzureFleet. :ivar operations: Operations operations :vartype operations: azure.mgmt.computefleet.aio.operations.Operations :ivar fleets: FleetsOperations operations :vartype fleets: azure.mgmt.computefleet.aio.operations.FleetsOperations - :param credential: Credential used to authenticate requests to the service. Required. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service host. Default value is "https://management.azure.com". + :param base_url: Service URL. 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: Api Version. 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,7 +52,7 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = ComputeFleetMgmtClientConfiguration( + self._config = MicrosoftAzureFleetConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) _policies = kwargs.pop("policies", None) @@ -75,13 +75,14 @@ def __init__( ] self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) - self._serialize = Serializer() - self._deserialize = Deserializer() + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.fleets = FleetsOperations(self._client, self._config, self._serialize, self._deserialize) - def send_request( + def _send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. @@ -89,7 +90,7 @@ def send_request( >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = await client.send_request(request) + >>> response = await client._send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/operations/__init__.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/operations/__init__.py index 180cf6d7d211..6fac9ac6d5df 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/operations/__init__.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/operations/__init__.py @@ -2,12 +2,12 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._operations import Operations -from ._operations import FleetsOperations +from ._fleets_operations import FleetsOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/operations/_fleets_operations.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/operations/_fleets_operations.py new file mode 100644 index 000000000000..e5d909d74017 --- /dev/null +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/aio/operations/_fleets_operations.py @@ -0,0 +1,861 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ...operations._fleets_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_list_virtual_machine_scale_sets_request, + build_update_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class FleetsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.computefleet.aio.MicrosoftAzureFleet`'s + :attr:`fleets` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Fleet"]: + """List Fleet resources by subscription ID. + + :return: An iterator like instance of either Fleet or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.computefleet.models.Fleet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.FleetListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FleetListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Fleet"]: + """List Fleet resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of either Fleet or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.computefleet.models.Fleet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.FleetListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FleetListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> _models.Fleet: + """Get a Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param fleet_name: The name of the Compute Fleet. Required. + :type fleet_name: str + :return: Fleet or the result of cls(response) + :rtype: ~azure.mgmt.computefleet.models.Fleet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Fleet] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + fleet_name=fleet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Fleet", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, resource_group_name: str, fleet_name: str, resource: Union[_models.Fleet, IO[bytes]], **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _json = self._serialize.body(resource, "Fleet") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + fleet_name=fleet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + fleet_name: str, + resource: _models.Fleet, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Fleet]: + """Create a Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param fleet_name: The name of the Compute Fleet. Required. + :type fleet_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.computefleet.models.Fleet + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either Fleet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.computefleet.models.Fleet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + fleet_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Fleet]: + """Create a Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param fleet_name: The name of the Compute Fleet. Required. + :type fleet_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either Fleet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.computefleet.models.Fleet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, resource_group_name: str, fleet_name: str, resource: Union[_models.Fleet, IO[bytes]], **kwargs: Any + ) -> AsyncLROPoller[_models.Fleet]: + """Create a Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param fleet_name: The name of the Compute Fleet. Required. + :type fleet_name: str + :param resource: Resource create parameters. Is either a Fleet type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.computefleet.models.Fleet or IO[bytes] + :return: An instance of AsyncLROPoller that returns either Fleet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.computefleet.models.Fleet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Fleet] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + fleet_name=fleet_name, + resource=resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Fleet", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Fleet].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Fleet]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + fleet_name: str, + properties: Union[_models.FleetUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _json = self._serialize.body(properties, "FleetUpdate") + + _request = build_update_request( + resource_group_name=resource_group_name, + fleet_name=fleet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + 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.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + fleet_name: str, + properties: _models.FleetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Fleet]: + """Update a Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param fleet_name: The name of the Compute Fleet. Required. + :type fleet_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.computefleet.models.FleetUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either Fleet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.computefleet.models.Fleet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + fleet_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Fleet]: + """Update a Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param fleet_name: The name of the Compute Fleet. Required. + :type fleet_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either Fleet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.computefleet.models.Fleet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + fleet_name: str, + properties: Union[_models.FleetUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Fleet]: + """Update a Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param fleet_name: The name of the Compute Fleet. Required. + :type fleet_name: str + :param properties: The resource properties to be updated. Is either a FleetUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.computefleet.models.FleetUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns either Fleet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.computefleet.models.Fleet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Fleet] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + fleet_name=fleet_name, + properties=properties, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Fleet", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Fleet].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Fleet]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + fleet_name=fleet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + 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.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete a Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param fleet_name: The name of the Compute Fleet. Required. + :type fleet_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + fleet_name=fleet_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_virtual_machine_scale_sets( + self, resource_group_name: str, name: str, **kwargs: Any + ) -> AsyncIterable["_models.VirtualMachineScaleSet"]: + """List VirtualMachineScaleSet resources by Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param name: The name of the Fleet. Required. + :type name: str + :return: An iterator like instance of either VirtualMachineScaleSet or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.computefleet.models.VirtualMachineScaleSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.VirtualMachineScaleSetListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_virtual_machine_scale_sets_request( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualMachineScaleSetListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) 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..278b79d77191 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 @@ -3,27 +3,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -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, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -33,31 +17,16 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize -from ...operations._operations import ( - build_fleets_create_or_update_request, - build_fleets_delete_request, - build_fleets_get_request, - build_fleets_list_by_resource_group_request, - build_fleets_list_by_subscription_request, - build_fleets_list_virtual_machine_scale_sets_request, - build_fleets_update_request, - build_operations_list_request, -) +from ...operations._operations import build_list_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -65,7 +34,6 @@ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object class Operations: @@ -74,10 +42,12 @@ class Operations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.computefleet.aio.ComputeFleetMgmtClient`'s + :class:`~azure.mgmt.computefleet.aio.MicrosoftAzureFleet`'s :attr:`operations` attribute. """ + models = _models + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") @@ -89,7242 +59,15 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: """List the operations for the provider. - :return: An iterator like instance of Operation + :return: An iterator like instance of either Operation or the result of cls(response) :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]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_operations_list_request( - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized["value"]) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class FleetsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.computefleet.aio.ComputeFleetMgmtClient`'s - :attr:`fleets` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> _models.Fleet: - """Get a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :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]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Fleet] = kwargs.pop("cls", None) - - _request = build_fleets_get_request( - resource_group_name=resource_group_name, - fleet_name=fleet_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Fleet, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - 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]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_fleets_create_or_update_request( - resource_group_name=resource_group_name, - fleet_name=fleet_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) - 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() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - fleet_name: str, - resource: _models.Fleet, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Fleet]: - """Create a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.computefleet.models.Fleet - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Fleet. The Fleet is compatible with - 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 - async def begin_create_or_update( - self, - resource_group_name: str, - fleet_name: str, - resource: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Fleet]: - """Create a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Fleet. The Fleet is compatible with - 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 - async def begin_create_or_update( - self, - resource_group_name: str, - fleet_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Fleet]: - """Create a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Fleet. The Fleet is compatible with - 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 - async def begin_create_or_update( - self, resource_group_name: str, fleet_name: str, resource: Union[_models.Fleet, JSON, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.Fleet]: - """Create a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :param resource: Resource create parameters. Is one of the following types: Fleet, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.computefleet.models.Fleet or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns Fleet. The Fleet is compatible with - 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 {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Fleet] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - fleet_name=fleet_name, - resource=resource, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Fleet, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Fleet].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Fleet]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - fleet_name: str, - properties: Union[_models.FleetUpdate, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_fleets_update_request( - resource_group_name=resource_group_name, - fleet_name=fleet_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) - 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() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - fleet_name: str, - properties: _models.FleetUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Fleet]: - """Update a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.computefleet.models.FleetUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Fleet. The Fleet is compatible with - 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 - async def begin_update( - self, - resource_group_name: str, - fleet_name: str, - properties: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Fleet]: - """Update a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Fleet. The Fleet is compatible with - 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 - async def begin_update( - self, - resource_group_name: str, - fleet_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Fleet]: - """Update a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Fleet. The Fleet is compatible with - 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 - async def begin_update( - self, - resource_group_name: str, - fleet_name: str, - properties: Union[_models.FleetUpdate, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Fleet]: - """Update a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :param properties: The resource properties to be updated. Is one of the following types: - FleetUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.computefleet.models.FleetUpdate or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns Fleet. The Fleet is compatible with - 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 {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Fleet] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - fleet_name=fleet_name, - properties=properties, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Fleet, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Fleet].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Fleet]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_fleets_delete_request( - resource_group_name=resource_group_name, - fleet_name=fleet_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - 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() - - if response.status_code == 204: - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Delete a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - fleet_name=fleet_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Fleet"]: - """List Fleet resources by resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :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]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_fleets_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Fleet], deserialized["value"]) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Fleet"]: - """List Fleet resources by subscription ID. - - :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 {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - cls: ClsType[List[_models.Fleet]] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -7337,9 +80,8 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Fleet"]: def prepare_request(next_link=None): if not next_link: - _request = build_fleets_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, + _request = build_list_request( + api_version=api_version, headers=_headers, params=_params, ) @@ -7359,125 +101,15 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Fleet], deserialized["value"]) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_virtual_machine_scale_sets( - self, resource_group_name: str, name: str, **kwargs: Any - ) -> AsyncIterable["_models.VirtualMachineScaleSet"]: - """List VirtualMachineScaleSet resources by Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param name: The name of the Fleet. Required. - :type name: str - :return: An iterator like instance of VirtualMachineScaleSet - :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]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_fleets_list_virtual_machine_scale_sets_request( - resource_group_name=resource_group_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - + _request.method = "GET" return _request async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.VirtualMachineScaleSet], deserialized["value"]) + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) @@ -7490,7 +122,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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..7b4c12ab688c 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 @@ -2,140 +2,165 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._models import AdditionalUnattendContent -from ._models import ApiEntityReference -from ._models import ApiError -from ._models import ApiErrorBase -from ._models import ApplicationProfile -from ._models import BaseVirtualMachineProfile -from ._models import BootDiagnostics -from ._models import CapacityReservationProfile -from ._models import ComputeProfile -from ._models import DiagnosticsProfile -from ._models import DiffDiskSettings -from ._models import DiskEncryptionSetParameters -from ._models import EncryptionIdentity -from ._models import ErrorAdditionalInfo -from ._models import ErrorDetail -from ._models import ErrorResponse -from ._models import Fleet -from ._models import FleetProperties -from ._models import FleetUpdate -from ._models import ImageReference -from ._models import InnerError -from ._models import KeyVaultSecretReference -from ._models import LinuxConfiguration -from ._models import LinuxPatchSettings -from ._models import LinuxVMGuestPatchAutomaticByPlatformSettings -from ._models import ManagedServiceIdentity -from ._models import ManagedServiceIdentityUpdate -from ._models import OSImageNotificationProfile -from ._models import Operation -from ._models import OperationDisplay -from ._models import PatchSettings -from ._models import Plan -from ._models import ProxyAgentSettings -from ._models import PublicIPAddressSku -from ._models import RegularPriorityProfile -from ._models import Resource -from ._models import ResourcePlanUpdate -from ._models import ScheduledEventsProfile -from ._models import SecurityPostureReference -from ._models import SecurityProfile -from ._models import ServiceArtifactReference -from ._models import SpotPriorityProfile -from ._models import SshConfiguration -from ._models import SshPublicKey -from ._models import SubResource -from ._models import SystemData -from ._models import TerminateNotificationProfile -from ._models import TrackedResource -from ._models import UefiSettings -from ._models import UserAssignedIdentity -from ._models import VMDiskSecurityProfile -from ._models import VMGalleryApplication -from ._models import VMSizeProperties -from ._models import VaultCertificate -from ._models import VaultSecretGroup -from ._models import VirtualHardDisk -from ._models import VirtualMachineScaleSet -from ._models import VirtualMachineScaleSetDataDisk -from ._models import VirtualMachineScaleSetExtension -from ._models import VirtualMachineScaleSetExtensionProfile -from ._models import VirtualMachineScaleSetExtensionProperties -from ._models import VirtualMachineScaleSetHardwareProfile -from ._models import VirtualMachineScaleSetIPConfiguration -from ._models import VirtualMachineScaleSetIPConfigurationProperties -from ._models import VirtualMachineScaleSetIpTag -from ._models import VirtualMachineScaleSetManagedDiskParameters -from ._models import VirtualMachineScaleSetNetworkConfiguration -from ._models import VirtualMachineScaleSetNetworkConfigurationDnsSettings -from ._models import VirtualMachineScaleSetNetworkConfigurationProperties -from ._models import VirtualMachineScaleSetNetworkProfile -from ._models import VirtualMachineScaleSetOSDisk -from ._models import VirtualMachineScaleSetOSProfile -from ._models import VirtualMachineScaleSetPublicIPAddressConfiguration -from ._models import VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings -from ._models import VirtualMachineScaleSetPublicIPAddressConfigurationProperties -from ._models import VirtualMachineScaleSetStorageProfile -from ._models import VmSizeProfile -from ._models import WinRMConfiguration -from ._models import WinRMListener -from ._models import WindowsConfiguration -from ._models import WindowsVMGuestPatchAutomaticByPlatformSettings +from ._models_py3 import AdditionalCapabilities +from ._models_py3 import AdditionalLocationsProfile +from ._models_py3 import AdditionalUnattendContent +from ._models_py3 import ApiEntityReference +from ._models_py3 import ApiError +from ._models_py3 import ApiErrorBase +from ._models_py3 import ApplicationProfile +from ._models_py3 import BasePriorityProfile +from ._models_py3 import BaseVirtualMachineProfile +from ._models_py3 import BootDiagnostics +from ._models_py3 import CapacityReservationProfile +from ._models_py3 import ( + ComponentsQjfoe3SchemasManagedserviceidentityupdatePropertiesUserassignedidentitiesAdditionalproperties, +) +from ._models_py3 import ComputeProfile +from ._models_py3 import DiagnosticsProfile +from ._models_py3 import DiffDiskSettings +from ._models_py3 import DiskEncryptionSetParameters +from ._models_py3 import EncryptionIdentity +from ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorResponse +from ._models_py3 import Fleet +from ._models_py3 import FleetListResult +from ._models_py3 import FleetProperties +from ._models_py3 import FleetUpdate +from ._models_py3 import ImageReference +from ._models_py3 import InnerError +from ._models_py3 import KeyVaultSecretReference +from ._models_py3 import LinuxConfiguration +from ._models_py3 import LinuxPatchSettings +from ._models_py3 import LinuxVMGuestPatchAutomaticByPlatformSettings +from ._models_py3 import LocationProfile +from ._models_py3 import ManagedServiceIdentity +from ._models_py3 import ManagedServiceIdentityUpdate +from ._models_py3 import OSImageNotificationProfile +from ._models_py3 import Operation +from ._models_py3 import OperationDisplay +from ._models_py3 import OperationListResult +from ._models_py3 import PatchSettings +from ._models_py3 import Plan +from ._models_py3 import ProxyAgentSettings +from ._models_py3 import PublicIPAddressSku +from ._models_py3 import RegularPriorityProfile +from ._models_py3 import Resource +from ._models_py3 import ResourcePlanUpdate +from ._models_py3 import ScheduledEventsProfile +from ._models_py3 import SecurityPostureReference +from ._models_py3 import SecurityProfile +from ._models_py3 import ServiceArtifactReference +from ._models_py3 import SpotPriorityProfile +from ._models_py3 import SshConfiguration +from ._models_py3 import SshPublicKey +from ._models_py3 import SubResource +from ._models_py3 import SubResourceReadOnly +from ._models_py3 import SystemData +from ._models_py3 import TerminateNotificationProfile +from ._models_py3 import TrackedResource +from ._models_py3 import UefiSettings +from ._models_py3 import UserAssignedIdentity +from ._models_py3 import VMAttributeMinMax +from ._models_py3 import VMAttributes +from ._models_py3 import VMAttributesList +from ._models_py3 import VMDiskSecurityProfile +from ._models_py3 import VMGalleryApplication +from ._models_py3 import VMSizeProperties +from ._models_py3 import VaultCertificate +from ._models_py3 import VaultSecretGroup +from ._models_py3 import VirtualHardDisk +from ._models_py3 import VirtualMachineScaleSet +from ._models_py3 import VirtualMachineScaleSetDataDisk +from ._models_py3 import VirtualMachineScaleSetExtension +from ._models_py3 import VirtualMachineScaleSetExtensionProfile +from ._models_py3 import VirtualMachineScaleSetExtensionProperties +from ._models_py3 import VirtualMachineScaleSetHardwareProfile +from ._models_py3 import VirtualMachineScaleSetIPConfiguration +from ._models_py3 import VirtualMachineScaleSetIPConfigurationProperties +from ._models_py3 import VirtualMachineScaleSetIpTag +from ._models_py3 import VirtualMachineScaleSetListResult +from ._models_py3 import VirtualMachineScaleSetManagedDiskParameters +from ._models_py3 import VirtualMachineScaleSetNetworkConfiguration +from ._models_py3 import VirtualMachineScaleSetNetworkConfigurationDnsSettings +from ._models_py3 import VirtualMachineScaleSetNetworkConfigurationProperties +from ._models_py3 import VirtualMachineScaleSetNetworkProfile +from ._models_py3 import VirtualMachineScaleSetOSDisk +from ._models_py3 import VirtualMachineScaleSetOSProfile +from ._models_py3 import VirtualMachineScaleSetPublicIPAddressConfiguration +from ._models_py3 import VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings +from ._models_py3 import VirtualMachineScaleSetPublicIPAddressConfigurationProperties +from ._models_py3 import VirtualMachineScaleSetStorageProfile +from ._models_py3 import VmSizeProfile +from ._models_py3 import WinRMConfiguration +from ._models_py3 import WinRMListener +from ._models_py3 import WindowsConfiguration +from ._models_py3 import WindowsVMGuestPatchAutomaticByPlatformSettings -from ._enums import ActionType -from ._enums import CachingTypes -from ._enums import CreatedByType -from ._enums import DeleteOptions -from ._enums import DiffDiskOptions -from ._enums import DiffDiskPlacement -from ._enums import DiskControllerTypes -from ._enums import DiskCreateOptionTypes -from ._enums import DiskDeleteOptionTypes -from ._enums import DomainNameLabelScopeTypes -from ._enums import EvictionPolicy -from ._enums import IPVersion -from ._enums import LinuxPatchAssessmentMode -from ._enums import LinuxVMGuestPatchAutomaticByPlatformRebootSetting -from ._enums import LinuxVMGuestPatchMode -from ._enums import ManagedServiceIdentityType -from ._enums import Mode -from ._enums import NetworkApiVersion -from ._enums import NetworkInterfaceAuxiliaryMode -from ._enums import NetworkInterfaceAuxiliarySku -from ._enums import OperatingSystemTypes -from ._enums import Origin -from ._enums import ProtocolTypes -from ._enums import ProvisioningState -from ._enums import PublicIPAddressSkuName -from ._enums import PublicIPAddressSkuTier -from ._enums import RegularPriorityAllocationStrategy -from ._enums import SecurityEncryptionTypes -from ._enums import SecurityTypes -from ._enums import SettingNames -from ._enums import SpotAllocationStrategy -from ._enums import StorageAccountTypes -from ._enums import WindowsPatchAssessmentMode -from ._enums import WindowsVMGuestPatchAutomaticByPlatformRebootSetting -from ._enums import WindowsVMGuestPatchMode +from ._microsoft_azure_fleet_enums import ActionType +from ._microsoft_azure_fleet_enums import ArchitectureType +from ._microsoft_azure_fleet_enums import CachingTypes +from ._microsoft_azure_fleet_enums import CpuManufacturer +from ._microsoft_azure_fleet_enums import CreatedByType +from ._microsoft_azure_fleet_enums import DeleteOptions +from ._microsoft_azure_fleet_enums import DiffDiskOptions +from ._microsoft_azure_fleet_enums import DiffDiskPlacement +from ._microsoft_azure_fleet_enums import DiskControllerTypes +from ._microsoft_azure_fleet_enums import DiskCreateOptionTypes +from ._microsoft_azure_fleet_enums import DiskDeleteOptionTypes +from ._microsoft_azure_fleet_enums import DomainNameLabelScopeTypes +from ._microsoft_azure_fleet_enums import EvictionPolicy +from ._microsoft_azure_fleet_enums import GpuManufacturer +from ._microsoft_azure_fleet_enums import IPVersion +from ._microsoft_azure_fleet_enums import LinuxPatchAssessmentMode +from ._microsoft_azure_fleet_enums import LinuxVMGuestPatchAutomaticByPlatformRebootSetting +from ._microsoft_azure_fleet_enums import LinuxVMGuestPatchMode +from ._microsoft_azure_fleet_enums import LocalStorageDiskType +from ._microsoft_azure_fleet_enums import ManagedServiceIdentityType +from ._microsoft_azure_fleet_enums import Mode +from ._microsoft_azure_fleet_enums import NetworkApiVersion +from ._microsoft_azure_fleet_enums import NetworkInterfaceAuxiliaryMode +from ._microsoft_azure_fleet_enums import NetworkInterfaceAuxiliarySku +from ._microsoft_azure_fleet_enums import OperatingSystemTypes +from ._microsoft_azure_fleet_enums import Origin +from ._microsoft_azure_fleet_enums import ProtocolTypes +from ._microsoft_azure_fleet_enums import ProvisioningState +from ._microsoft_azure_fleet_enums import PublicIPAddressSkuName +from ._microsoft_azure_fleet_enums import PublicIPAddressSkuTier +from ._microsoft_azure_fleet_enums import RegularPriorityAllocationStrategy +from ._microsoft_azure_fleet_enums import SecurityEncryptionTypes +from ._microsoft_azure_fleet_enums import SecurityTypes +from ._microsoft_azure_fleet_enums import SettingNames +from ._microsoft_azure_fleet_enums import SpotAllocationStrategy +from ._microsoft_azure_fleet_enums import StatusLevelTypes +from ._microsoft_azure_fleet_enums import StorageAccountTypes +from ._microsoft_azure_fleet_enums import VMAttributeSupport +from ._microsoft_azure_fleet_enums import VMCategory +from ._microsoft_azure_fleet_enums import WindowsPatchAssessmentMode +from ._microsoft_azure_fleet_enums import WindowsVMGuestPatchAutomaticByPlatformRebootSetting +from ._microsoft_azure_fleet_enums import WindowsVMGuestPatchMode from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ + "AdditionalCapabilities", + "AdditionalLocationsProfile", "AdditionalUnattendContent", "ApiEntityReference", "ApiError", "ApiErrorBase", "ApplicationProfile", + "BasePriorityProfile", "BaseVirtualMachineProfile", "BootDiagnostics", "CapacityReservationProfile", + "ComponentsQjfoe3SchemasManagedserviceidentityupdatePropertiesUserassignedidentitiesAdditionalproperties", "ComputeProfile", "DiagnosticsProfile", "DiffDiskSettings", @@ -145,6 +170,7 @@ "ErrorDetail", "ErrorResponse", "Fleet", + "FleetListResult", "FleetProperties", "FleetUpdate", "ImageReference", @@ -153,11 +179,13 @@ "LinuxConfiguration", "LinuxPatchSettings", "LinuxVMGuestPatchAutomaticByPlatformSettings", + "LocationProfile", "ManagedServiceIdentity", "ManagedServiceIdentityUpdate", "OSImageNotificationProfile", "Operation", "OperationDisplay", + "OperationListResult", "PatchSettings", "Plan", "ProxyAgentSettings", @@ -173,11 +201,15 @@ "SshConfiguration", "SshPublicKey", "SubResource", + "SubResourceReadOnly", "SystemData", "TerminateNotificationProfile", "TrackedResource", "UefiSettings", "UserAssignedIdentity", + "VMAttributeMinMax", + "VMAttributes", + "VMAttributesList", "VMDiskSecurityProfile", "VMGalleryApplication", "VMSizeProperties", @@ -193,6 +225,7 @@ "VirtualMachineScaleSetIPConfiguration", "VirtualMachineScaleSetIPConfigurationProperties", "VirtualMachineScaleSetIpTag", + "VirtualMachineScaleSetListResult", "VirtualMachineScaleSetManagedDiskParameters", "VirtualMachineScaleSetNetworkConfiguration", "VirtualMachineScaleSetNetworkConfigurationDnsSettings", @@ -210,7 +243,9 @@ "WindowsConfiguration", "WindowsVMGuestPatchAutomaticByPlatformSettings", "ActionType", + "ArchitectureType", "CachingTypes", + "CpuManufacturer", "CreatedByType", "DeleteOptions", "DiffDiskOptions", @@ -220,10 +255,12 @@ "DiskDeleteOptionTypes", "DomainNameLabelScopeTypes", "EvictionPolicy", + "GpuManufacturer", "IPVersion", "LinuxPatchAssessmentMode", "LinuxVMGuestPatchAutomaticByPlatformRebootSetting", "LinuxVMGuestPatchMode", + "LocalStorageDiskType", "ManagedServiceIdentityType", "Mode", "NetworkApiVersion", @@ -240,7 +277,10 @@ "SecurityTypes", "SettingNames", "SpotAllocationStrategy", + "StatusLevelTypes", "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/_microsoft_azure_fleet_enums.py similarity index 85% rename from sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_enums.py rename to sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_microsoft_azure_fleet_enums.py index 5fdf63bfc764..bf67f3bcb38c 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_enums.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_microsoft_azure_fleet_enums.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -11,12 +11,18 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal - only APIs. - """ + """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" INTERNAL = "Internal" - """Actions are for internal-only APIs.""" + + +class ArchitectureType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Architecture types supported by Azure VMs.""" + + INTEL = "Intel" + """Intel""" + AMD = "AMD" + """AMD""" class CachingTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -30,17 +36,22 @@ class CachingTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """'ReadWrite' is default for OS Disk""" +class CpuManufacturer(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Architecture types supported by Azure VMs.""" + + INTEL = "Intel" + """Intel.""" + AMD = "AMD" + """AMD.""" + + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The kind of entity that created the resource.""" + """The type of identity that created the resource.""" USER = "User" - """The entity was created by a user.""" APPLICATION = "Application" - """The entity was created by an application.""" MANAGED_IDENTITY = "ManagedIdentity" - """The entity was created by a managed identity.""" KEY = "Key" - """The entity was created by a key.""" class DeleteOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -93,7 +104,7 @@ class DiskControllerTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): SCSI = "SCSI" """SCSI disk type""" - N_V_ME = "NVMe" + NV_ME = "NVMe" """NVMe disk type""" @@ -156,6 +167,17 @@ class EvictionPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """When evicted, the Spot VM will be deallocated/stopped""" +class GpuManufacturer(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Gpu manufacturers supported by Azure VMs.""" + + INTEL = "Intel" + """Intel GpuType""" + AMD = "AMD" + """AMD GpuType""" + NVIDIA = "Nvidia" + """Nvidia GpuType""" + + class IPVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible @@ -212,19 +234,24 @@ 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). """ NONE = "None" - """No managed identity.""" SYSTEM_ASSIGNED = "SystemAssigned" - """System assigned managed identity.""" USER_ASSIGNED = "UserAssigned" - """User assigned managed identity.""" - SYSTEM_AND_USER_ASSIGNED = "SystemAssigned,UserAssigned" - """System and user assigned managed identity.""" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" class Mode(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -246,7 +273,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.""" @@ -298,11 +325,8 @@ class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ USER = "user" - """Indicates the operation is initiated by a user.""" SYSTEM = "system" - """Indicates the operation is initiated by a system.""" USER_SYSTEM = "user,system" - """Indicates the operation is initiated by a user or system.""" class ProtocolTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -351,6 +375,8 @@ class PublicIPAddressSkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Regional sku tier""" GLOBAL = "Global" """Global sku tier""" + GLOBAL_ENUM = "Global" + """Global sku tier""" class RegularPriorityAllocationStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -368,13 +394,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 +413,7 @@ class SecurityTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): TRUSTED_LAUNCH = "TrustedLaunch" """TrustedLaunch security type""" - CONFIDENTIAL_V_M = "ConfidentialVM" + CONFIDENTIAL_VM = "ConfidentialVM" """ConfidentialVM security type""" @@ -414,6 +440,17 @@ class SpotAllocationStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """VM sizes distribution will be determined to optimize for capacity.""" +class StatusLevelTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The level code.""" + + INFO = "Info" + """Info level""" + WARNING = "Warning" + """Warning level""" + ERROR = "Error" + """Error Level""" + + class StorageAccountTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the storage account type for the managed disk. Managed OS disk storage account type can only be set when you create the scale set. NOTE: @@ -428,22 +465,50 @@ 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" + """SDD DiskType.""" + REQUIRED = "Required" + """VMSizes that have the feature support and that do not have the feature support will be used.""" + + +class VMCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """VMCategories defined for Azure VMs.""" + + GENERAL_PURPOSE = "GeneralPurpose" + """GeneralPurpose VM.""" + COMPUTE_OPTIMIZED = "ComputeOptimized" + """ComputeOptimized VM.""" + MEMORY_OPTIMIZED = "MemoryOptimized" + """MemoryOptimized VM.""" + STORAGE_OPTIMIZED = "StorageOptimized" + """StorageOptimized VM.""" + GPU_ACCELERATED = "GpuAccelerated" + """GpuAccelerated VM.""" + FPGA_ACCELERATED = "FpgaAccelerated" + """FpgaAccelerated VM.""" + + class WindowsPatchAssessmentMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the mode of VM Guest patch assessment for the IaaS virtual machine.""" @@ -478,7 +543,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 deleted file mode 100644 index fb90cf1120f2..000000000000 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_models.py +++ /dev/null @@ -1,4305 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------- - -import datetime -from typing import Any, Dict, List, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload - -from .. import _model_base -from .._model_base import rest_field - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models - - -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 - setting name, component name, and the pass in which the content is applied. - - :ivar pass_name: The pass name. Currently, the only allowable value is OobeSystem. Default - value is "OobeSystem". - :vartype pass_name: str - :ivar component_name: The component name. Currently, the only allowable value is - Microsoft-Windows-Shell-Setup. Default value is "Microsoft-Windows-Shell-Setup". - :vartype component_name: str - :ivar setting_name: Specifies the name of the setting to which the content applies. Possible - values - are: FirstLogonCommands and AutoLogon. Known values are: "AutoLogon" and "FirstLogonCommands". - :vartype setting_name: str or ~azure.mgmt.computefleet.models.SettingNames - :ivar content: Specifies the XML formatted content that is added to the unattend.xml file for - the specified path and component. The XML must be less than 4KB and must - include the root element for the setting or feature that is being inserted. - :vartype content: str - """ - - pass_name: Optional[Literal["OobeSystem"]] = rest_field(name="passName") - """The pass name. Currently, the only allowable value is OobeSystem. Default value is - \"OobeSystem\".""" - component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = rest_field(name="componentName") - """The component name. Currently, the only allowable value is - Microsoft-Windows-Shell-Setup. Default value is \"Microsoft-Windows-Shell-Setup\".""" - setting_name: Optional[Union[str, "_models.SettingNames"]] = rest_field(name="settingName") - """Specifies the name of the setting to which the content applies. Possible values - are: FirstLogonCommands and AutoLogon. Known values are: \"AutoLogon\" and - \"FirstLogonCommands\".""" - content: Optional[str] = rest_field(visibility=["create", "update"]) - """Specifies the XML formatted content that is added to the unattend.xml file for - the specified path and component. The XML must be less than 4KB and must - include the root element for the setting or feature that is being inserted.""" - - @overload - def __init__( - self, - *, - pass_name: Optional[Literal["OobeSystem"]] = None, - component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, - setting_name: Optional[Union[str, "_models.SettingNames"]] = None, - content: Optional[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 ApiEntityReference(_model_base.Model): - """The API entity reference. - - :ivar id: The ARM resource id in the form of - /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... - :vartype id: str - """ - - id: Optional[str] = rest_field() - """The ARM resource id in the form of - /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/...""" - - @overload - def __init__( - self, - *, - id: Optional[str] = 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 ApiError(_model_base.Model): - """ApiError for Fleet. - - :ivar code: The error code. - :vartype code: str - :ivar target: The target of the particular error. - :vartype target: str - :ivar message: The error message. - :vartype message: str - :ivar details: The API error details. - :vartype details: list[~azure.mgmt.computefleet.models.ApiErrorBase] - :ivar innererror: The API inner error. - :vartype innererror: ~azure.mgmt.computefleet.models.InnerError - """ - - code: Optional[str] = rest_field() - """The error code.""" - target: Optional[str] = rest_field() - """The target of the particular error.""" - message: Optional[str] = rest_field() - """The error message.""" - details: Optional[List["_models.ApiErrorBase"]] = rest_field() - """The API error details.""" - innererror: Optional["_models.InnerError"] = rest_field() - """The API inner error.""" - - @overload - def __init__( - self, - *, - code: Optional[str] = None, - target: Optional[str] = None, - message: Optional[str] = None, - details: Optional[List["_models.ApiErrorBase"]] = None, - innererror: Optional["_models.InnerError"] = 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 ApiErrorBase(_model_base.Model): - """API error base. - - :ivar code: The error code. - :vartype code: str - :ivar target: The target of the particular error. - :vartype target: str - :ivar message: The error message. - :vartype message: str - """ - - code: Optional[str] = rest_field() - """The error code.""" - target: Optional[str] = rest_field() - """The target of the particular error.""" - message: Optional[str] = rest_field() - """The error message.""" - - @overload - def __init__( - self, - *, - code: Optional[str] = None, - target: Optional[str] = None, - message: Optional[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 ApplicationProfile(_model_base.Model): - """Contains the list of gallery applications that should be made available to the - VM/VMSS. - - :ivar gallery_applications: Specifies the gallery applications that should be made available to - the VM/VMSS. - :vartype gallery_applications: list[~azure.mgmt.computefleet.models.VMGalleryApplication] - """ - - gallery_applications: Optional[List["_models.VMGalleryApplication"]] = rest_field(name="galleryApplications") - """Specifies the gallery applications that should be made available to the VM/VMSS.""" - - @overload - def __init__( - self, - *, - gallery_applications: Optional[List["_models.VMGalleryApplication"]] = 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 BaseVirtualMachineProfile(_model_base.Model): # pylint: disable=too-many-instance-attributes - """Describes the base virtual machine profile for fleet. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar os_profile: Specifies the operating system settings for the virtual machines in the scale - set. - :vartype os_profile: ~azure.mgmt.computefleet.models.VirtualMachineScaleSetOSProfile - :ivar storage_profile: Specifies the storage settings for the virtual machine disks. - :vartype storage_profile: ~azure.mgmt.computefleet.models.VirtualMachineScaleSetStorageProfile - :ivar network_profile: Specifies properties of the network interfaces of the virtual machines - in the - scale set. - :vartype network_profile: ~azure.mgmt.computefleet.models.VirtualMachineScaleSetNetworkProfile - :ivar security_profile: Specifies the Security related profile settings for the virtual - machines in the - scale set. - :vartype security_profile: ~azure.mgmt.computefleet.models.SecurityProfile - :ivar diagnostics_profile: Specifies the boot diagnostic settings state. - :vartype diagnostics_profile: ~azure.mgmt.computefleet.models.DiagnosticsProfile - :ivar extension_profile: Specifies a collection of settings for extensions installed on virtual - machines - in the scale set. - :vartype extension_profile: - ~azure.mgmt.computefleet.models.VirtualMachineScaleSetExtensionProfile - :ivar license_type: Specifies that the image or disk that is being used was licensed - on-premises. - :code:`
`:code:`
` Possible values for Windows Server operating system are: - :code:`
`:code:`
` - Windows_Client :code:`
`:code:`
` Windows_Server :code:`
`:code:`
` Possible - values for Linux - Server operating system are: :code:`
`:code:`
` RHEL_BYOS (for RHEL) - :code:`
`:code:`
` SLES_BYOS - (for SUSE) :code:`
`:code:`
` For more information, see `Azure Hybrid Use Benefit for - Windows - Server - `_ - :code:`
`:code:`
` `Azure Hybrid Use Benefit for Linux - Server `_ - :code:`
`:code:`
` Minimum api-version: 2015-06-15. - :vartype license_type: str - :ivar scheduled_events_profile: Specifies Scheduled Event related configurations. - :vartype scheduled_events_profile: ~azure.mgmt.computefleet.models.ScheduledEventsProfile - :ivar user_data: UserData for the virtual machines in the scale set, which must be base-64 - encoded. Customer should not pass any secrets in here. Minimum api-version: - 2021-03-01. - :vartype user_data: str - :ivar capacity_reservation: Specifies the capacity reservation related details of a scale set. - Minimum - api-version: 2021-04-01. - :vartype capacity_reservation: ~azure.mgmt.computefleet.models.CapacityReservationProfile - :ivar application_profile: Specifies the gallery applications that should be made available to - the VM/VMSS. - :vartype application_profile: ~azure.mgmt.computefleet.models.ApplicationProfile - :ivar hardware_profile: Specifies the hardware profile related details of a scale set. Minimum - api-version: 2021-11-01. - :vartype hardware_profile: - ~azure.mgmt.computefleet.models.VirtualMachineScaleSetHardwareProfile - :ivar service_artifact_reference: Specifies the service artifact reference id used to set same - image version for - all virtual machines in the scale set when using 'latest' image version. - Minimum api-version: 2022-11-01. - :vartype service_artifact_reference: ~azure.mgmt.computefleet.models.ServiceArtifactReference - :ivar security_posture_reference: Specifies the security posture to be used for all virtual - machines in the scale - set. Minimum api-version: 2023-03-01. - :vartype security_posture_reference: ~azure.mgmt.computefleet.models.SecurityPostureReference - :ivar time_created: Specifies the time in which this VM profile for the Virtual Machine Scale - Set - was created. Minimum API version for this property is 2023-09-01. This value - will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile - with minimum api-version 2023-09-01. Examples: "2024-07-01T00:00:01.1234567+00:00". - :vartype time_created: ~datetime.datetime - """ - - os_profile: Optional["_models.VirtualMachineScaleSetOSProfile"] = rest_field(name="osProfile") - """Specifies the operating system settings for the virtual machines in the scale - set.""" - storage_profile: Optional["_models.VirtualMachineScaleSetStorageProfile"] = rest_field(name="storageProfile") - """Specifies the storage settings for the virtual machine disks.""" - network_profile: Optional["_models.VirtualMachineScaleSetNetworkProfile"] = rest_field(name="networkProfile") - """Specifies properties of the network interfaces of the virtual machines in the - scale set.""" - security_profile: Optional["_models.SecurityProfile"] = rest_field(name="securityProfile") - """Specifies the Security related profile settings for the virtual machines in the - scale set.""" - diagnostics_profile: Optional["_models.DiagnosticsProfile"] = rest_field(name="diagnosticsProfile") - """Specifies the boot diagnostic settings state.""" - extension_profile: Optional["_models.VirtualMachineScaleSetExtensionProfile"] = rest_field(name="extensionProfile") - """Specifies a collection of settings for extensions installed on virtual machines - in the scale set.""" - license_type: Optional[str] = rest_field(name="licenseType") - """Specifies that the image or disk that is being used was licensed on-premises. - :code:`
`:code:`
` Possible values for Windows Server operating system are: - :code:`
`:code:`
` - Windows_Client :code:`
`:code:`
` Windows_Server :code:`
`:code:`
` Possible values - for Linux - Server operating system are: :code:`
`:code:`
` RHEL_BYOS (for RHEL) - :code:`
`:code:`
` SLES_BYOS - (for SUSE) :code:`
`:code:`
` For more information, see `Azure Hybrid Use Benefit for - Windows - Server - `_ - :code:`
`:code:`
` `Azure Hybrid Use Benefit for Linux - Server `_ - :code:`
`:code:`
` Minimum api-version: 2015-06-15.""" - scheduled_events_profile: Optional["_models.ScheduledEventsProfile"] = rest_field(name="scheduledEventsProfile") - """Specifies Scheduled Event related configurations.""" - user_data: Optional[str] = rest_field(name="userData") - """UserData for the virtual machines in the scale set, which must be base-64 - encoded. Customer should not pass any secrets in here. Minimum api-version: - 2021-03-01.""" - capacity_reservation: Optional["_models.CapacityReservationProfile"] = rest_field(name="capacityReservation") - """Specifies the capacity reservation related details of a scale set. Minimum - api-version: 2021-04-01.""" - application_profile: Optional["_models.ApplicationProfile"] = rest_field(name="applicationProfile") - """Specifies the gallery applications that should be made available to the VM/VMSS.""" - hardware_profile: Optional["_models.VirtualMachineScaleSetHardwareProfile"] = rest_field(name="hardwareProfile") - """Specifies the hardware profile related details of a scale set. Minimum - api-version: 2021-11-01.""" - service_artifact_reference: Optional["_models.ServiceArtifactReference"] = rest_field( - name="serviceArtifactReference" - ) - """Specifies the service artifact reference id used to set same image version for - all virtual machines in the scale set when using 'latest' image version. - Minimum api-version: 2022-11-01.""" - security_posture_reference: Optional["_models.SecurityPostureReference"] = rest_field( - name="securityPostureReference" - ) - """Specifies the security posture to be used for all virtual machines in the scale - set. Minimum api-version: 2023-03-01.""" - time_created: Optional[datetime.datetime] = rest_field(name="timeCreated", visibility=["read"], format="rfc3339") - """Specifies the time in which this VM profile for the Virtual Machine Scale Set - was created. Minimum API version for this property is 2023-09-01. This value - will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile - with minimum api-version 2023-09-01. Examples: \"2024-07-01T00:00:01.1234567+00:00\".""" - - @overload - def __init__( - self, - *, - os_profile: Optional["_models.VirtualMachineScaleSetOSProfile"] = None, - storage_profile: Optional["_models.VirtualMachineScaleSetStorageProfile"] = None, - network_profile: Optional["_models.VirtualMachineScaleSetNetworkProfile"] = None, - security_profile: Optional["_models.SecurityProfile"] = None, - diagnostics_profile: Optional["_models.DiagnosticsProfile"] = None, - extension_profile: Optional["_models.VirtualMachineScaleSetExtensionProfile"] = None, - license_type: Optional[str] = None, - scheduled_events_profile: Optional["_models.ScheduledEventsProfile"] = None, - user_data: Optional[str] = None, - capacity_reservation: Optional["_models.CapacityReservationProfile"] = None, - application_profile: Optional["_models.ApplicationProfile"] = None, - hardware_profile: Optional["_models.VirtualMachineScaleSetHardwareProfile"] = None, - service_artifact_reference: Optional["_models.ServiceArtifactReference"] = None, - security_posture_reference: Optional["_models.SecurityPostureReference"] = 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 BootDiagnostics(_model_base.Model): - """Boot Diagnostics is a debugging feature which allows you to view Console Output - and Screenshot to diagnose VM status. You can easily view the output of your - console log. Azure also enables you to see a screenshot of the VM from the - hypervisor. - - :ivar enabled: Whether boot diagnostics should be enabled on the Virtual Machine. - :vartype enabled: bool - :ivar storage_uri: Uri of the storage account to use for placing the console output and - screenshot. If storageUri is not specified while enabling boot diagnostics, - managed storage will be used. - :vartype storage_uri: str - """ - - enabled: Optional[bool] = rest_field() - """Whether boot diagnostics should be enabled on the Virtual Machine.""" - storage_uri: Optional[str] = rest_field(name="storageUri") - """Uri of the storage account to use for placing the console output and - screenshot. If storageUri is not specified while enabling boot diagnostics, - managed storage will be used.""" - - @overload - def __init__( - self, - *, - enabled: Optional[bool] = None, - storage_uri: Optional[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 CapacityReservationProfile(_model_base.Model): - """The parameters of a capacity reservation Profile. - - :ivar capacity_reservation_group: Specifies the capacity reservation group resource id that - should be used for - allocating the virtual machine or scaleset vm instances provided enough - capacity has been reserved. Please refer to https://aka.ms/CapacityReservation - for more details. - :vartype capacity_reservation_group: ~azure.mgmt.computefleet.models.SubResource - """ - - capacity_reservation_group: Optional["_models.SubResource"] = rest_field(name="capacityReservationGroup") - """Specifies the capacity reservation group resource id that should be used for - allocating the virtual machine or scaleset vm instances provided enough - capacity has been reserved. Please refer to https://aka.ms/CapacityReservation - for more details.""" - - @overload - def __init__( - self, - *, - capacity_reservation_group: Optional["_models.SubResource"] = 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 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 - "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile". # pylint: disable=line-too-long - Required. - :vartype base_virtual_machine_profile: - ~azure.mgmt.computefleet.models.BaseVirtualMachineProfile - :ivar compute_api_version: Specifies the Microsoft.Compute API version to use when creating - underlying Virtual Machine scale sets and Virtual Machines. - The default value will be the latest supported computeApiVersion by Compute Fleet. - :vartype compute_api_version: str - :ivar platform_fault_domain_count: Specifies the number of fault domains to use when creating - the underlying VMSS. - A fault domain is a logical group of hardware within an Azure datacenter. - VMs in the same fault domain share a common power source and network switch. - If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains - as possible). - This property cannot be updated. - :vartype platform_fault_domain_count: int - """ - - base_virtual_machine_profile: "_models.BaseVirtualMachineProfile" = rest_field(name="baseVirtualMachineProfile") - """Base Virtual Machine Profile Properties to be specified according to - \"specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile\". # pylint: disable=line-too-long - Required.""" - compute_api_version: Optional[str] = rest_field(name="computeApiVersion") - """Specifies the Microsoft.Compute API version to use when creating underlying Virtual Machine - scale sets and Virtual Machines. - The default value will be the latest supported computeApiVersion by Compute Fleet.""" - platform_fault_domain_count: Optional[int] = rest_field(name="platformFaultDomainCount") - """Specifies the number of fault domains to use when creating the underlying VMSS. - A fault domain is a logical group of hardware within an Azure datacenter. - VMs in the same fault domain share a common power source and network switch. - If not specified, defaults to 1, which represents \"Max Spreading\" (using as many fault - domains as possible). - This property cannot be updated.""" - - @overload - def __init__( - self, - *, - base_virtual_machine_profile: "_models.BaseVirtualMachineProfile", - compute_api_version: Optional[str] = None, - platform_fault_domain_count: Optional[int] = 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 DiagnosticsProfile(_model_base.Model): - """Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. - - :ivar boot_diagnostics: Boot Diagnostics is a debugging feature which allows you to view - Console Output - and Screenshot to diagnose VM status. **NOTE**\\ : If storageUri is being - specified then ensure that the storage account is in the same region and - subscription as the VM. You can easily view the output of your console log. - Azure also enables you to see a screenshot of the VM from the hypervisor. - :vartype boot_diagnostics: ~azure.mgmt.computefleet.models.BootDiagnostics - """ - - boot_diagnostics: Optional["_models.BootDiagnostics"] = rest_field(name="bootDiagnostics") - """Boot Diagnostics is a debugging feature which allows you to view Console Output - and Screenshot to diagnose VM status. **NOTE**\ : If storageUri is being - specified then ensure that the storage account is in the same region and - subscription as the VM. You can easily view the output of your console log. - Azure also enables you to see a screenshot of the VM from the hypervisor.""" - - @overload - def __init__( - self, - *, - boot_diagnostics: Optional["_models.BootDiagnostics"] = 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 DiffDiskSettings(_model_base.Model): - """Describes the parameters of ephemeral disk settings that can be specified for - operating system disk. **Note:** The ephemeral disk settings can only be - specified for managed disk. - - :ivar option: Specifies the ephemeral disk settings for operating system disk. "Local" - :vartype option: str or ~azure.mgmt.computefleet.models.DiffDiskOptions - :ivar placement: Specifies the ephemeral disk placement for operating system disk. Possible - values are: **CacheDisk,** **ResourceDisk.** The defaulting behavior is: - **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** - is used. Refer to the VM size documentation for Windows VM at - https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at - https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM - sizes exposes a cache disk. Known values are: "CacheDisk", "ResourceDisk", and "NvmeDisk". - :vartype placement: str or ~azure.mgmt.computefleet.models.DiffDiskPlacement - """ - - option: Optional[Union[str, "_models.DiffDiskOptions"]] = rest_field() - """Specifies the ephemeral disk settings for operating system disk. \"Local\"""" - placement: Optional[Union[str, "_models.DiffDiskPlacement"]] = rest_field() - """Specifies the ephemeral disk placement for operating system disk. Possible - values are: **CacheDisk,** **ResourceDisk.** The defaulting behavior is: - **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** - is used. Refer to the VM size documentation for Windows VM at - https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at - https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM - sizes exposes a cache disk. Known values are: \"CacheDisk\", \"ResourceDisk\", and - \"NvmeDisk\".""" - - @overload - def __init__( - self, - *, - option: Optional[Union[str, "_models.DiffDiskOptions"]] = None, - placement: Optional[Union[str, "_models.DiffDiskPlacement"]] = 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 DiskEncryptionSetParameters(_model_base.Model): - """Describes the parameter of customer managed disk encryption set resource id - that can be specified for disk. **Note:** The disk encryption set resource id - can only be specified for managed disk. Please refer - https://aka.ms/mdssewithcmkoverview for more details. - - :ivar id: Resource Id. - :vartype id: str - """ - - id: Optional[str] = rest_field() - """Resource Id.""" - - @overload - def __init__( - self, - *, - id: Optional[str] = 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 EncryptionIdentity(_model_base.Model): - """Specifies the Managed Identity used by ADE to get access token for keyvault - operations. - - :ivar user_assigned_identity_resource_id: Specifies ARM Resource ID of one of the user - identities associated with the VM. - :vartype user_assigned_identity_resource_id: str - """ - - user_assigned_identity_resource_id: Optional[str] = rest_field(name="userAssignedIdentityResourceId") - """Specifies ARM Resource ID of one of the user identities associated with the VM.""" - - @overload - def __init__( - self, - *, - user_assigned_identity_resource_id: Optional[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 ErrorAdditionalInfo(_model_base.Model): - """The resource management error additional info. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - type: Optional[str] = rest_field(visibility=["read"]) - """The additional info type.""" - info: Optional[Any] = rest_field(visibility=["read"]) - """The additional info.""" - - -class ErrorDetail(_model_base.Model): - """The error detail. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.computefleet.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.computefleet.models.ErrorAdditionalInfo] - """ - - code: Optional[str] = rest_field(visibility=["read"]) - """The error code.""" - message: Optional[str] = rest_field(visibility=["read"]) - """The error message.""" - target: Optional[str] = rest_field(visibility=["read"]) - """The error target.""" - details: Optional[List["_models.ErrorDetail"]] = rest_field(visibility=["read"]) - """The error details.""" - additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = rest_field( - name="additionalInfo", visibility=["read"] - ) - """The error additional info.""" - - -class ErrorResponse(_model_base.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. - - :ivar error: The error object. - :vartype error: ~azure.mgmt.computefleet.models.ErrorDetail - """ - - error: Optional["_models.ErrorDetail"] = rest_field() - """The error object.""" - - @overload - def __init__( - self, - *, - error: Optional["_models.ErrorDetail"] = 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 Resource(_model_base.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.computefleet.models.SystemData - """ - - id: Optional[str] = rest_field(visibility=["read"]) - """Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long""" - name: Optional[str] = rest_field(visibility=["read"]) - """The name of the resource.""" - type: Optional[str] = rest_field(visibility=["read"]) - """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or - \"Microsoft.Storage/storageAccounts\".""" - system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) - """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. - - 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 - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.computefleet.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - """ - - tags: Optional[Dict[str, str]] = rest_field() - """Resource tags.""" - location: str = rest_field(visibility=["read", "create"]) - """The geo-location where the resource lives. Required.""" - - @overload - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, 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 Fleet(TrackedResource): - """An Compute Fleet 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 - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.computefleet.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.computefleet.models.FleetProperties - :ivar zones: Zones in which the Compute Fleet is available. - :vartype zones: list[str] - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.computefleet.models.ManagedServiceIdentity - :ivar plan: Details of the resource plan. - :vartype plan: ~azure.mgmt.computefleet.models.Plan - """ - - properties: Optional["_models.FleetProperties"] = rest_field() - """The resource-specific properties for this resource.""" - zones: Optional[List[str]] = rest_field() - """Zones in which the Compute Fleet is available.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field() - """The managed service identities assigned to this resource.""" - plan: Optional["_models.Plan"] = rest_field() - """Details of the resource plan.""" - - @overload - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.FleetProperties"] = None, - zones: Optional[List[str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - plan: Optional["_models.Plan"] = 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 FleetProperties(_model_base.Model): - """Details of the Compute Fleet. - - 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". - :vartype provisioning_state: str or ~azure.mgmt.computefleet.models.ProvisioningState - :ivar spot_priority_profile: Configuration Options for Spot instances in Compute Fleet. - :vartype spot_priority_profile: ~azure.mgmt.computefleet.models.SpotPriorityProfile - :ivar regular_priority_profile: Configuration Options for Regular instances in Compute Fleet. - :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 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. - :vartype time_created: ~datetime.datetime - :ivar unique_id: Specifies the ID which uniquely identifies a Compute Fleet. - :vartype unique_id: str - """ - - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", - \"Creating\", \"Updating\", \"Deleting\", and \"Migrating\".""" - spot_priority_profile: Optional["_models.SpotPriorityProfile"] = rest_field(name="spotPriorityProfile") - """Configuration Options for Spot instances in Compute Fleet.""" - regular_priority_profile: Optional["_models.RegularPriorityProfile"] = rest_field(name="regularPriorityProfile") - """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.""" - 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") - """Specifies the time at which the Compute Fleet is created.""" - unique_id: Optional[str] = rest_field(name="uniqueId", visibility=["read"]) - """Specifies the ID which uniquely identifies a Compute Fleet.""" - - @overload - def __init__( - self, - *, - vm_sizes_profile: List["_models.VmSizeProfile"], - compute_profile: "_models.ComputeProfile", - spot_priority_profile: Optional["_models.SpotPriorityProfile"] = None, - regular_priority_profile: Optional["_models.RegularPriorityProfile"] = 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 FleetUpdate(_model_base.Model): - """Fleet Update Model. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Updatable managed service identity. - :vartype identity: ~azure.mgmt.computefleet.models.ManagedServiceIdentityUpdate - :ivar plan: Updatable resource plan. - :vartype plan: ~azure.mgmt.computefleet.models.ResourcePlanUpdate - :ivar properties: RP-specific updatable properties. - :vartype properties: ~azure.mgmt.computefleet.models.FleetProperties - """ - - tags: Optional[Dict[str, str]] = rest_field() - """Resource tags.""" - identity: Optional["_models.ManagedServiceIdentityUpdate"] = rest_field() - """Updatable managed service identity.""" - plan: Optional["_models.ResourcePlanUpdate"] = rest_field() - """Updatable resource plan.""" - properties: Optional["_models.FleetProperties"] = rest_field() - """RP-specific updatable properties.""" - - @overload - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentityUpdate"] = None, - plan: Optional["_models.ResourcePlanUpdate"] = None, - properties: Optional["_models.FleetProperties"] = 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 ImageReference(_model_base.Model): - """Specifies information about the image to use. You can specify information about - platform images, marketplace images, or virtual machine images. This element is - required when you want to use a platform image, marketplace image, or virtual - machine image, but is not used in other creation operations. NOTE: Image - reference publisher and offer can only be set when you create the scale set. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar publisher: The image publisher. - :vartype publisher: str - :ivar offer: Specifies the offer of the platform image or marketplace image used to create - the virtual machine. - :vartype offer: str - :ivar sku: The image SKU. - :vartype sku: str - :ivar version: Specifies the version of the platform image or marketplace image used to create - the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. - Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest - version of an image available at deploy time. Even if you use 'latest', the VM - image will not automatically update after deploy time even if a new version - becomes available. Please do not use field 'version' for gallery image - deployment, gallery image should always use 'id' field for deployment, to use 'latest' - version of gallery image, just set - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' # pylint: disable=line-too-long - in the 'id' field without version input. - :vartype version: str - :ivar exact_version: Specifies in decimal numbers, the version of platform image or marketplace - image used to create the virtual machine. This readonly field differs from 'version', - only if the value specified in 'version' field is 'latest'. - :vartype exact_version: str - :ivar shared_gallery_image_id: Specified the shared gallery image unique id for vm deployment. - This can be - fetched from shared gallery image GET call. - :vartype shared_gallery_image_id: str - :ivar community_gallery_image_id: Specified the community gallery image unique id for vm - deployment. This can be - fetched from community gallery image GET call. - :vartype community_gallery_image_id: str - """ - - id: Optional[str] = rest_field() - """Resource Id.""" - publisher: Optional[str] = rest_field() - """The image publisher.""" - offer: Optional[str] = rest_field() - """Specifies the offer of the platform image or marketplace image used to create - the virtual machine.""" - sku: Optional[str] = rest_field() - """The image SKU.""" - version: Optional[str] = rest_field() - """Specifies the version of the platform image or marketplace image used to create - the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. - Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest - version of an image available at deploy time. Even if you use 'latest', the VM - image will not automatically update after deploy time even if a new version - becomes available. Please do not use field 'version' for gallery image - deployment, gallery image should always use 'id' field for deployment, to use 'latest' - version of gallery image, just set - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' # pylint: disable=line-too-long - in the 'id' field without version input.""" - exact_version: Optional[str] = rest_field(name="exactVersion", visibility=["read"]) - """Specifies in decimal numbers, the version of platform image or marketplace - image used to create the virtual machine. This readonly field differs from 'version', - only if the value specified in 'version' field is 'latest'.""" - shared_gallery_image_id: Optional[str] = rest_field(name="sharedGalleryImageId") - """Specified the shared gallery image unique id for vm deployment. This can be - fetched from shared gallery image GET call.""" - community_gallery_image_id: Optional[str] = rest_field(name="communityGalleryImageId") - """Specified the community gallery image unique id for vm deployment. This can be - fetched from community gallery image GET call.""" - - @overload - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - publisher: Optional[str] = None, - offer: Optional[str] = None, - sku: Optional[str] = None, - version: Optional[str] = None, - shared_gallery_image_id: Optional[str] = None, - community_gallery_image_id: Optional[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 InnerError(_model_base.Model): - """Inner error details. - - :ivar exception_type: The exception type. - :vartype exception_type: str - :ivar error_detail: The internal error message or exception dump. - :vartype error_detail: str - """ - - exception_type: Optional[str] = rest_field(name="exceptionType") - """The exception type.""" - error_detail: Optional[str] = rest_field(name="errorDetail") - """The internal error message or exception dump.""" - - @overload - def __init__( - self, - *, - exception_type: Optional[str] = None, - error_detail: Optional[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 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 - :ivar source_vault: The relative URL of the Key Vault containing the secret. Required. - :vartype source_vault: ~azure.mgmt.computefleet.models.SubResource - """ - - secret_url: str = rest_field(name="secretUrl") - """The URL referencing a secret in a Key Vault. Required.""" - source_vault: "_models.SubResource" = rest_field(name="sourceVault") - """The relative URL of the Key Vault containing the secret. Required.""" - - @overload - def __init__( - self, - *, - secret_url: str, - source_vault: "_models.SubResource", - ): ... - - @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 LinuxConfiguration(_model_base.Model): - """Specifies the Linux operating system settings on the virtual machine. For a - list of supported Linux distributions, see `Linux on Azure-Endorsed - Distributions `_. - - :ivar disable_password_authentication: Specifies whether password authentication should be - disabled. - :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 - 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 - :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 - for the Linux virtual - machine. Default value is false. - :vartype enable_v_m_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") - """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") - """Indicates whether VMAgent Platform Updates is enabled for the Linux virtual - machine. Default value is false.""" - - @overload - def __init__( - self, - *, - disable_password_authentication: Optional[bool] = None, - ssh: Optional["_models.SshConfiguration"] = None, - provision_v_m_agent: Optional[bool] = None, - patch_settings: Optional["_models.LinuxPatchSettings"] = None, - enable_v_m_agent_platform_updates: 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 LinuxPatchSettings(_model_base.Model): - """Specifies settings related to VM Guest Patching on Linux. - - :ivar patch_mode: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual - machines associated to virtual machine scale set with OrchestrationMode as - Flexible.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` - **ImageDefault** - The - virtual machine's default patching configuration is used. :code:`
`:code:`
` - **AutomaticByPlatform** - The virtual machine will be automatically updated by - the platform. The property provisionVMAgent must be true. Known values are: "ImageDefault" and - "AutomaticByPlatform". - :vartype patch_mode: str or ~azure.mgmt.computefleet.models.LinuxVMGuestPatchMode - :ivar assessment_mode: Specifies the mode of VM Guest Patch Assessment for the IaaS virtual - machine.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` - **ImageDefault** - You - control the timing of patch assessments on a virtual machine. :code:`
`:code:`
` - **AutomaticByPlatform** - The platform will trigger periodic patch assessments. - The property provisionVMAgent must be true. Known values are: "ImageDefault" and - "AutomaticByPlatform". - :vartype assessment_mode: str or ~azure.mgmt.computefleet.models.LinuxPatchAssessmentMode - :ivar automatic_by_platform_settings: Specifies additional settings for patch mode - AutomaticByPlatform in VM Guest - Patching on Linux. - :vartype automatic_by_platform_settings: - ~azure.mgmt.computefleet.models.LinuxVMGuestPatchAutomaticByPlatformSettings - """ - - patch_mode: Optional[Union[str, "_models.LinuxVMGuestPatchMode"]] = rest_field(name="patchMode") - """Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual - machines associated to virtual machine scale set with OrchestrationMode as - Flexible.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` - **ImageDefault** - The - virtual machine's default patching configuration is used. :code:`
`:code:`
` - **AutomaticByPlatform** - The virtual machine will be automatically updated by - the platform. The property provisionVMAgent must be true. Known values are: \"ImageDefault\" - and \"AutomaticByPlatform\".""" - assessment_mode: Optional[Union[str, "_models.LinuxPatchAssessmentMode"]] = rest_field(name="assessmentMode") - """Specifies the mode of VM Guest Patch Assessment for the IaaS virtual - machine.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` - **ImageDefault** - You - control the timing of patch assessments on a virtual machine. :code:`
`:code:`
` - **AutomaticByPlatform** - The platform will trigger periodic patch assessments. - The property provisionVMAgent must be true. Known values are: \"ImageDefault\" and - \"AutomaticByPlatform\".""" - automatic_by_platform_settings: Optional["_models.LinuxVMGuestPatchAutomaticByPlatformSettings"] = rest_field( - name="automaticByPlatformSettings" - ) - """Specifies additional settings for patch mode AutomaticByPlatform in VM Guest - Patching on Linux.""" - - @overload - def __init__( - self, - *, - patch_mode: Optional[Union[str, "_models.LinuxVMGuestPatchMode"]] = None, - assessment_mode: Optional[Union[str, "_models.LinuxPatchAssessmentMode"]] = None, - automatic_by_platform_settings: Optional["_models.LinuxVMGuestPatchAutomaticByPlatformSettings"] = 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 LinuxVMGuestPatchAutomaticByPlatformSettings(_model_base.Model): # pylint: disable=name-too-long - """Specifies additional settings to be applied when patch mode AutomaticByPlatform - is selected in Linux patch settings. - - :ivar reboot_setting: Specifies the reboot setting for all AutomaticByPlatform patch - installation - operations. Known values are: "Unknown", "IfRequired", "Never", and "Always". - :vartype reboot_setting: str or - ~azure.mgmt.computefleet.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting - :ivar bypass_platform_safety_checks_on_user_schedule: Enables customer to schedule patching - without accidental upgrades. - :vartype bypass_platform_safety_checks_on_user_schedule: bool - """ - - reboot_setting: Optional[Union[str, "_models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting"]] = rest_field( - name="rebootSetting" - ) - """Specifies the reboot setting for all AutomaticByPlatform patch installation - operations. Known values are: \"Unknown\", \"IfRequired\", \"Never\", and \"Always\".""" - bypass_platform_safety_checks_on_user_schedule: Optional[bool] = rest_field( - name="bypassPlatformSafetyChecksOnUserSchedule" - ) - """Enables customer to schedule patching without accidental upgrades.""" - - @overload - def __init__( - self, - *, - reboot_setting: Optional[Union[str, "_models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting"]] = None, - bypass_platform_safety_checks_on_user_schedule: 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 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. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: The type of managed identity assigned to this resource. Required. Known values are: - "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.computefleet.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The identities assigned to this resource by the user. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.computefleet.models.UserAssignedIdentity] - """ - - principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) - """The service principal ID of the system assigned identity. This property will only be provided - for a system assigned identity.""" - tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) - """The tenant ID of the system assigned identity. This property will only be provided for a system - assigned identity.""" - type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field() - """The type of managed identity assigned to this resource. Required. Known values are: \"None\", - \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = rest_field( - name="userAssignedIdentities" - ) - """The identities assigned to this resource by the user.""" - - @overload - def __init__( - self, - *, - type: Union[str, "_models.ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = 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 ManagedServiceIdentityUpdate(_model_base.Model): - """The template for adding optional properties. - - :ivar type: The type of managed identity assigned to this resource. Known values are: "None", - "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.computefleet.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The identities assigned to this resource by the user. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.computefleet.models.UserAssignedIdentity] - """ - - type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = rest_field() - """The type of managed identity assigned to this resource. Known values are: \"None\", - \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = rest_field( - name="userAssignedIdentities" - ) - """The identities assigned to this resource by the user.""" - - @overload - def __init__( - self, - *, - type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = 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 Operation(_model_base.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for Azure Resource Manager/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.computefleet.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", - and "user,system". - :vartype origin: str or ~azure.mgmt.computefleet.models.Origin - :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions - that are for internal only APIs. "Internal" - :vartype action_type: str or ~azure.mgmt.computefleet.models.ActionType - """ - - name: Optional[str] = rest_field(visibility=["read"]) - """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - \"Microsoft.Compute/virtualMachines/write\", - \"Microsoft.Compute/virtualMachines/capture/action\".""" - is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) - """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and - \"false\" for Azure Resource Manager/control-plane operations.""" - display: Optional["_models.OperationDisplay"] = rest_field(visibility=["read"]) - """Localized display information for this particular operation.""" - origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) - """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and - \"user,system\".""" - action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType") - """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for - internal only APIs. \"Internal\"""" - - @overload - def __init__( - self, - *, - action_type: Optional[Union[str, "_models.ActionType"]] = 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 OperationDisplay(_model_base.Model): - """Localized display information for and operation. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - provider: Optional[str] = rest_field(visibility=["read"]) - """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring - Insights\" or \"Microsoft Compute\".""" - resource: Optional[str] = rest_field(visibility=["read"]) - """The localized friendly name of the resource type related to this operation. E.g. \"Virtual - Machines\" or \"Job Schedule Collections\".""" - operation: Optional[str] = rest_field(visibility=["read"]) - """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create - or Update Virtual Machine\", \"Restart Virtual Machine\".""" - description: Optional[str] = rest_field(visibility=["read"]) - """The short, localized friendly description of the operation; suitable for tool tips and detailed - views.""" - - -class OSImageNotificationProfile(_model_base.Model): - """Specifies OS Image Scheduled Event related configurations. - - :ivar not_before_timeout: Length of time a Virtual Machine being reimaged or having its OS - upgraded will - have to potentially approve the OS Image Scheduled Event before the event is - auto approved (timed out). The configuration is specified in ISO 8601 format, - and the value must not exceed 15 minutes (PT15M). - :vartype not_before_timeout: str - :ivar enable: Specifies whether the OS Image Scheduled event is enabled or disabled. - :vartype enable: bool - """ - - not_before_timeout: Optional[str] = rest_field(name="notBeforeTimeout") - """Length of time a Virtual Machine being reimaged or having its OS upgraded will - have to potentially approve the OS Image Scheduled Event before the event is - auto approved (timed out). The configuration is specified in ISO 8601 format, - and the value must not exceed 15 minutes (PT15M).""" - enable: Optional[bool] = rest_field() - """Specifies whether the OS Image Scheduled event is enabled or disabled.""" - - @overload - def __init__( - self, - *, - not_before_timeout: Optional[str] = None, - enable: 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 PatchSettings(_model_base.Model): - """Specifies settings related to VM Guest Patching on Windows. - - :ivar patch_mode: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual - machines associated to virtual machine scale set with OrchestrationMode as - Flexible.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` - **Manual** - You - control the application of patches to a virtual machine. You do this by - applying patches manually inside the VM. In this mode, automatic updates are - disabled; the property WindowsConfiguration.enableAutomaticUpdates must be - false:code:`
`:code:`
` **AutomaticByOS** - The virtual machine will automatically - be - updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates - must be true. :code:`
`:code:`
` **AutomaticByPlatform** - the virtual machine will - automatically updated by the platform. The properties provisionVMAgent and - WindowsConfiguration.enableAutomaticUpdates must be true. Known values are: "Manual", - "AutomaticByOS", and "AutomaticByPlatform". - :vartype patch_mode: str or ~azure.mgmt.computefleet.models.WindowsVMGuestPatchMode - :ivar enable_hotpatching: Enables customers to patch their Azure VMs without requiring a - reboot. For - enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' - must be set to 'AutomaticByPlatform'. - :vartype enable_hotpatching: bool - :ivar assessment_mode: Specifies the mode of VM Guest patch assessment for the IaaS virtual - machine.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` - **ImageDefault** - You - control the timing of patch assessments on a virtual machine.:code:`
`:code:`
` - **AutomaticByPlatform** - The platform will trigger periodic patch assessments. - The property provisionVMAgent must be true. Known values are: "ImageDefault" and - "AutomaticByPlatform". - :vartype assessment_mode: str or ~azure.mgmt.computefleet.models.WindowsPatchAssessmentMode - :ivar automatic_by_platform_settings: Specifies additional settings for patch mode - AutomaticByPlatform in VM Guest - Patching on Windows. - :vartype automatic_by_platform_settings: - ~azure.mgmt.computefleet.models.WindowsVMGuestPatchAutomaticByPlatformSettings - """ - - patch_mode: Optional[Union[str, "_models.WindowsVMGuestPatchMode"]] = rest_field(name="patchMode") - """Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual - machines associated to virtual machine scale set with OrchestrationMode as - Flexible.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` - **Manual** - You - control the application of patches to a virtual machine. You do this by - applying patches manually inside the VM. In this mode, automatic updates are - disabled; the property WindowsConfiguration.enableAutomaticUpdates must be - false:code:`
`:code:`
` **AutomaticByOS** - The virtual machine will automatically be - updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates - must be true. :code:`
`:code:`
` **AutomaticByPlatform** - the virtual machine will - automatically updated by the platform. The properties provisionVMAgent and - WindowsConfiguration.enableAutomaticUpdates must be true. Known values are: \"Manual\", - \"AutomaticByOS\", and \"AutomaticByPlatform\".""" - enable_hotpatching: Optional[bool] = rest_field(name="enableHotpatching") - """Enables customers to patch their Azure VMs without requiring a reboot. For - enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' - must be set to 'AutomaticByPlatform'.""" - assessment_mode: Optional[Union[str, "_models.WindowsPatchAssessmentMode"]] = rest_field(name="assessmentMode") - """Specifies the mode of VM Guest patch assessment for the IaaS virtual - machine.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` - **ImageDefault** - You - control the timing of patch assessments on a virtual machine.:code:`
`:code:`
` - **AutomaticByPlatform** - The platform will trigger periodic patch assessments. - The property provisionVMAgent must be true. Known values are: \"ImageDefault\" and - \"AutomaticByPlatform\".""" - automatic_by_platform_settings: Optional["_models.WindowsVMGuestPatchAutomaticByPlatformSettings"] = rest_field( - name="automaticByPlatformSettings" - ) - """Specifies additional settings for patch mode AutomaticByPlatform in VM Guest - Patching on Windows.""" - - @overload - def __init__( - self, - *, - patch_mode: Optional[Union[str, "_models.WindowsVMGuestPatchMode"]] = None, - enable_hotpatching: Optional[bool] = None, - assessment_mode: Optional[Union[str, "_models.WindowsPatchAssessmentMode"]] = None, - automatic_by_platform_settings: Optional["_models.WindowsVMGuestPatchAutomaticByPlatformSettings"] = 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 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 - :ivar publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. - Required. - :vartype publisher: str - :ivar product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to - the OfferID specified for the artifact at the time of Data Market onboarding. Required. - :vartype product: str - :ivar promotion_code: A publisher provided promotion code as provisioned in Data Market for the - said product/artifact. - :vartype promotion_code: str - :ivar version: The version of the desired product/artifact. - :vartype version: str - """ - - name: str = rest_field() - """A user defined name of the 3rd Party Artifact that is being procured. Required.""" - publisher: str = rest_field() - """The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. Required.""" - product: str = rest_field() - """The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID - specified for the artifact at the time of Data Market onboarding. Required.""" - promotion_code: Optional[str] = rest_field(name="promotionCode") - """A publisher provided promotion code as provisioned in Data Market for the said - product/artifact.""" - version: Optional[str] = rest_field() - """The version of the desired product/artifact.""" - - @overload - def __init__( - self, - *, - name: str, - publisher: str, - product: str, - promotion_code: Optional[str] = None, - version: Optional[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 ProxyAgentSettings(_model_base.Model): - """Specifies ProxyAgent settings while creating the virtual machine. Minimum - api-version: 2023-09-01. - - :ivar enabled: Specifies whether ProxyAgent feature should be enabled on the virtual machine - or virtual machine scale set. - :vartype enabled: bool - :ivar mode: Specifies the mode that ProxyAgent will execute on if the feature is enabled. - ProxyAgent will start to audit or monitor but not enforce access control over - requests to host endpoints in Audit mode, while in Enforce mode it will enforce - access control. The default value is Enforce mode. Known values are: "Audit" and "Enforce". - :vartype mode: str or ~azure.mgmt.computefleet.models.Mode - :ivar key_incarnation_id: Increase the value of this property allows user to reset the key used - for - securing communication channel between guest and host. - :vartype key_incarnation_id: int - """ - - enabled: Optional[bool] = rest_field() - """Specifies whether ProxyAgent feature should be enabled on the virtual machine - or virtual machine scale set.""" - mode: Optional[Union[str, "_models.Mode"]] = rest_field() - """Specifies the mode that ProxyAgent will execute on if the feature is enabled. - ProxyAgent will start to audit or monitor but not enforce access control over - requests to host endpoints in Audit mode, while in Enforce mode it will enforce - access control. The default value is Enforce mode. Known values are: \"Audit\" and \"Enforce\".""" - key_incarnation_id: Optional[int] = rest_field(name="keyIncarnationId") - """Increase the value of this property allows user to reset the key used for - securing communication channel between guest and host.""" - - @overload - def __init__( - self, - *, - enabled: Optional[bool] = None, - mode: Optional[Union[str, "_models.Mode"]] = None, - key_incarnation_id: Optional[int] = 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 PublicIPAddressSku(_model_base.Model): - """Describes the public IP Sku. It can only be set with OrchestrationMode as - Flexible. - - :ivar name: Specify public IP sku name. Known values are: "Basic" and "Standard". - :vartype name: str or ~azure.mgmt.computefleet.models.PublicIPAddressSkuName - :ivar tier: Specify public IP sku tier. Known values are: "Regional" and "Global". - :vartype tier: str or ~azure.mgmt.computefleet.models.PublicIPAddressSkuTier - """ - - name: Optional[Union[str, "_models.PublicIPAddressSkuName"]] = rest_field() - """Specify public IP sku name. Known values are: \"Basic\" and \"Standard\".""" - tier: Optional[Union[str, "_models.PublicIPAddressSkuTier"]] = rest_field() - """Specify public IP sku tier. Known values are: \"Regional\" and \"Global\".""" - - @overload - def __init__( - self, - *, - name: Optional[Union[str, "_models.PublicIPAddressSkuName"]] = None, - tier: Optional[Union[str, "_models.PublicIPAddressSkuTier"]] = 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 RegularPriorityProfile(_model_base.Model): - """Configuration Options for Regular instances in Compute Fleet. - - :ivar capacity: Total capacity to achieve. It is currently in terms of number of VMs. - :vartype capacity: int - :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 allocation_strategy: Allocation strategy to follow when determining the VM sizes - distribution for Regular VMs. Known values are: "LowestPrice" and "Prioritized". - :vartype allocation_strategy: str or - ~azure.mgmt.computefleet.models.RegularPriorityAllocationStrategy - """ - - capacity: Optional[int] = rest_field() - """Total capacity to achieve. It is currently in terms of number of VMs.""" - 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.""" - allocation_strategy: Optional[Union[str, "_models.RegularPriorityAllocationStrategy"]] = rest_field( - name="allocationStrategy" - ) - """Allocation strategy to follow when determining the VM sizes distribution for Regular VMs. Known - values are: \"LowestPrice\" and \"Prioritized\".""" - - @overload - def __init__( - self, - *, - capacity: Optional[int] = None, - min_capacity: Optional[int] = None, - allocation_strategy: Optional[Union[str, "_models.RegularPriorityAllocationStrategy"]] = 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 ResourcePlanUpdate(_model_base.Model): - """The template for adding optional properties. - - :ivar name: A user defined name of the 3rd Party Artifact that is being procured. - :vartype name: str - :ivar publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. - :vartype publisher: str - :ivar product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to - the OfferID specified for the artifact at the time of Data Market onboarding. - :vartype product: str - :ivar promotion_code: A publisher provided promotion code as provisioned in Data Market for the - said product/artifact. - :vartype promotion_code: str - :ivar version: The version of the desired product/artifact. - :vartype version: str - """ - - name: Optional[str] = rest_field() - """A user defined name of the 3rd Party Artifact that is being procured.""" - publisher: Optional[str] = rest_field() - """The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic.""" - product: Optional[str] = rest_field() - """The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID - specified for the artifact at the time of Data Market onboarding.""" - promotion_code: Optional[str] = rest_field(name="promotionCode") - """A publisher provided promotion code as provisioned in Data Market for the said - product/artifact.""" - version: Optional[str] = rest_field() - """The version of the desired product/artifact.""" - - @overload - def __init__( - self, - *, - name: Optional[str] = None, - publisher: Optional[str] = None, - product: Optional[str] = None, - promotion_code: Optional[str] = None, - version: Optional[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 ScheduledEventsProfile(_model_base.Model): - """Specifies Scheduled Event related configurations. - - :ivar terminate_notification_profile: Specifies Terminate Scheduled Event related - configurations. - :vartype terminate_notification_profile: - ~azure.mgmt.computefleet.models.TerminateNotificationProfile - :ivar os_image_notification_profile: Specifies OS Image Scheduled Event related configurations. - :vartype os_image_notification_profile: - ~azure.mgmt.computefleet.models.OSImageNotificationProfile - """ - - terminate_notification_profile: Optional["_models.TerminateNotificationProfile"] = rest_field( - name="terminateNotificationProfile" - ) - """Specifies Terminate Scheduled Event related configurations.""" - os_image_notification_profile: Optional["_models.OSImageNotificationProfile"] = rest_field( - name="osImageNotificationProfile" - ) - """Specifies OS Image Scheduled Event related configurations.""" - - @overload - def __init__( - self, - *, - terminate_notification_profile: Optional["_models.TerminateNotificationProfile"] = None, - os_image_notification_profile: Optional["_models.OSImageNotificationProfile"] = 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 SecurityPostureReference(_model_base.Model): - """Specifies the security posture to be used for all virtual machines in the scale - set. Minimum api-version: 2023-03-01. - - :ivar id: The security posture reference id in the form of - /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest. # pylint: disable=line-too-long - :vartype id: str - :ivar exclude_extensions: List of virtual machine extension names to exclude when applying the - security - posture. - :vartype exclude_extensions: list[str] - :ivar is_overridable: Whether the security posture can be overridden by the user. - :vartype is_overridable: bool - """ - - id: Optional[str] = rest_field() - """The security posture reference id in the form of - /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest. # pylint: disable=line-too-long""" - exclude_extensions: Optional[List[str]] = rest_field(name="excludeExtensions") - """List of virtual machine extension names to exclude when applying the security - posture.""" - is_overridable: Optional[bool] = rest_field(name="isOverridable") - """Whether the security posture can be overridden by the user.""" - - @overload - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - exclude_extensions: Optional[List[str]] = None, - is_overridable: 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 SecurityProfile(_model_base.Model): - """Specifies the Security profile settings for the virtual machine or virtual - machine scale set. - - :ivar uefi_settings: Specifies the security settings like secure boot and vTPM used while - creating - the virtual machine. Minimum api-version: 2020-12-01. - :vartype uefi_settings: ~azure.mgmt.computefleet.models.UefiSettings - :ivar encryption_at_host: This property can be used by user in the request to enable or disable - the Host - Encryption for the virtual machine or virtual machine scale set. This will - enable the encryption for all the disks including Resource/Temp disk at host - itself. The default behavior is: The Encryption at host will be disabled unless - this property is set to true for the resource. - :vartype encryption_at_host: bool - :ivar security_type: Specifies the SecurityType of the virtual machine. It has to be set to any - specified value to enable UefiSettings. The default behavior is: UefiSettings - will not be enabled unless this property is set. Known values are: "TrustedLaunch" and - "ConfidentialVM". - :vartype security_type: str or ~azure.mgmt.computefleet.models.SecurityTypes - :ivar encryption_identity: Specifies the Managed Identity used by ADE to get access token for - keyvault - operations. - :vartype encryption_identity: ~azure.mgmt.computefleet.models.EncryptionIdentity - :ivar proxy_agent_settings: Specifies ProxyAgent settings while creating the virtual machine. - Minimum - api-version: 2023-09-01. - :vartype proxy_agent_settings: ~azure.mgmt.computefleet.models.ProxyAgentSettings - """ - - uefi_settings: Optional["_models.UefiSettings"] = rest_field(name="uefiSettings") - """Specifies the security settings like secure boot and vTPM used while creating - the virtual machine. Minimum api-version: 2020-12-01.""" - encryption_at_host: Optional[bool] = rest_field(name="encryptionAtHost") - """This property can be used by user in the request to enable or disable the Host - Encryption for the virtual machine or virtual machine scale set. This will - enable the encryption for all the disks including Resource/Temp disk at host - itself. The default behavior is: The Encryption at host will be disabled unless - this property is set to true for the resource.""" - security_type: Optional[Union[str, "_models.SecurityTypes"]] = rest_field(name="securityType") - """Specifies the SecurityType of the virtual machine. It has to be set to any - specified value to enable UefiSettings. The default behavior is: UefiSettings - will not be enabled unless this property is set. Known values are: \"TrustedLaunch\" and - \"ConfidentialVM\".""" - encryption_identity: Optional["_models.EncryptionIdentity"] = rest_field(name="encryptionIdentity") - """Specifies the Managed Identity used by ADE to get access token for keyvault - operations.""" - proxy_agent_settings: Optional["_models.ProxyAgentSettings"] = rest_field(name="proxyAgentSettings") - """Specifies ProxyAgent settings while creating the virtual machine. Minimum - api-version: 2023-09-01.""" - - @overload - def __init__( - self, - *, - uefi_settings: Optional["_models.UefiSettings"] = None, - encryption_at_host: Optional[bool] = None, - security_type: Optional[Union[str, "_models.SecurityTypes"]] = None, - encryption_identity: Optional["_models.EncryptionIdentity"] = None, - proxy_agent_settings: Optional["_models.ProxyAgentSettings"] = 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 ServiceArtifactReference(_model_base.Model): - """Specifies the service artifact reference id used to set same image version for - all virtual machines in the scale set when using 'latest' image version. - Minimum api-version: 2022-11-01. - - :ivar id: The service artifact reference id in the form of - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. # pylint: disable=line-too-long - :vartype id: str - """ - - id: Optional[str] = rest_field() - """The service artifact reference id in the form of - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. # pylint: disable=line-too-long""" - - @overload - def __init__( - self, - *, - id: Optional[str] = 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 SpotPriorityProfile(_model_base.Model): - """Configuration Options for Spot instances in Compute Fleet. - - :ivar capacity: Total capacity to achieve. It is currently in terms of number of VMs. - :vartype capacity: int - :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 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 - :ivar allocation_strategy: Allocation strategy to follow when determining the VM sizes - distribution for Spot VMs. Known values are: "PriceCapacityOptimized", "LowestPrice", and - "CapacityOptimized". - :vartype allocation_strategy: str or ~azure.mgmt.computefleet.models.SpotAllocationStrategy - :ivar maintain: Flag to enable/disable continuous goal seeking for the desired capacity and - restoration of evicted Spot VMs. - If maintain is enabled, AzureFleetRP will use all VM sizes in vmSizesProfile to create new VMs - (if VMs are evicted deleted) - or update existing VMs with new VM sizes (if VMs are evicted deallocated or failed to allocate - due to capacity constraint) in order to achieve the desired capacity. - Maintain is enabled by default. - :vartype maintain: bool - """ - - capacity: Optional[int] = rest_field() - """Total capacity to achieve. It is currently in terms of number of VMs.""" - 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") - """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 - \"Deallocate\".""" - allocation_strategy: Optional[Union[str, "_models.SpotAllocationStrategy"]] = rest_field(name="allocationStrategy") - """Allocation strategy to follow when determining the VM sizes distribution for Spot VMs. Known - values are: \"PriceCapacityOptimized\", \"LowestPrice\", and \"CapacityOptimized\".""" - maintain: Optional[bool] = rest_field() - """Flag to enable/disable continuous goal seeking for the desired capacity and restoration of - evicted Spot VMs. - If maintain is enabled, AzureFleetRP will use all VM sizes in vmSizesProfile to create new VMs - (if VMs are evicted deleted) - or update existing VMs with new VM sizes (if VMs are evicted deallocated or failed to allocate - due to capacity constraint) in order to achieve the desired capacity. - Maintain is enabled by default.""" - - @overload - def __init__( - self, - *, - capacity: Optional[int] = None, - min_capacity: Optional[int] = None, - max_price_per_v_m: Optional[float] = None, - eviction_policy: Optional[Union[str, "_models.EvictionPolicy"]] = None, - allocation_strategy: Optional[Union[str, "_models.SpotAllocationStrategy"]] = None, - maintain: 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 SshConfiguration(_model_base.Model): - """SSH configuration for Linux based VMs running on Azure. - - :ivar public_keys: The list of SSH public keys used to authenticate with linux based VMs. - :vartype public_keys: list[~azure.mgmt.computefleet.models.SshPublicKey] - """ - - public_keys: Optional[List["_models.SshPublicKey"]] = rest_field(name="publicKeys") - """The list of SSH public keys used to authenticate with linux based VMs.""" - - @overload - def __init__( - self, - *, - public_keys: Optional[List["_models.SshPublicKey"]] = 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 SshPublicKey(_model_base.Model): - """Contains information about SSH certificate public key and the path on the Linux - VM where the public key is placed. - - :ivar path: Specifies the full path on the created VM where ssh public key is stored. If - the file already exists, the specified key is appended to the file. Example: - /home/user/.ssh/authorized_keys. - :vartype path: str - :ivar key_data: SSH public key certificate used to authenticate with the VM through ssh. The - key needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, - see [Create SSH keys on Linux and Mac for Linux VMs in - Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). - :vartype key_data: str - """ - - path: Optional[str] = rest_field() - """Specifies the full path on the created VM where ssh public key is stored. If - the file already exists, the specified key is appended to the file. Example: - /home/user/.ssh/authorized_keys.""" - key_data: Optional[str] = rest_field(name="keyData") - """SSH public key certificate used to authenticate with the VM through ssh. The - key needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, - see [Create SSH keys on Linux and Mac for Linux VMs in - Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed).""" - - @overload - def __init__( - self, - *, - path: Optional[str] = None, - key_data: Optional[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 SubResource(_model_base.Model): - """Describes SubResource. - - :ivar id: Resource Id. - :vartype id: str - """ - - id: Optional[str] = rest_field() - """Resource Id.""" - - @overload - def __init__( - self, - *, - id: Optional[str] = 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 SystemData(_model_base.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or ~azure.mgmt.computefleet.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Known values - are: "User", "Application", "ManagedIdentity", and "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.computefleet.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - created_by: Optional[str] = rest_field(name="createdBy") - """The identity that created the resource.""" - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="createdByType") - """The type of identity that created the resource. Known values are: \"User\", \"Application\", - \"ManagedIdentity\", and \"Key\".""" - created_at: Optional[datetime.datetime] = rest_field(name="createdAt", format="rfc3339") - """The timestamp of resource creation (UTC).""" - last_modified_by: Optional[str] = rest_field(name="lastModifiedBy") - """The identity that last modified the resource.""" - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="lastModifiedByType") - """The type of identity that last modified the resource. Known values are: \"User\", - \"Application\", \"ManagedIdentity\", and \"Key\".""" - last_modified_at: Optional[datetime.datetime] = rest_field(name="lastModifiedAt", format="rfc3339") - """The timestamp of resource last modification (UTC).""" - - @overload - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = 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 TerminateNotificationProfile(_model_base.Model): - """Specifies Terminate Scheduled Event related configurations. - - :ivar not_before_timeout: Configurable length of time a Virtual Machine being deleted will have - to - potentially approve the Terminate Scheduled Event before the event is auto - approved (timed out). The configuration must be specified in ISO 8601 format, - the default value is 5 minutes (PT5M). - :vartype not_before_timeout: str - :ivar enable: Specifies whether the Terminate Scheduled event is enabled or disabled. - :vartype enable: bool - """ - - not_before_timeout: Optional[str] = rest_field(name="notBeforeTimeout") - """Configurable length of time a Virtual Machine being deleted will have to - potentially approve the Terminate Scheduled Event before the event is auto - approved (timed out). The configuration must be specified in ISO 8601 format, - the default value is 5 minutes (PT5M).""" - enable: Optional[bool] = rest_field() - """Specifies whether the Terminate Scheduled event is enabled or disabled.""" - - @overload - def __init__( - self, - *, - not_before_timeout: Optional[str] = None, - enable: 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 UefiSettings(_model_base.Model): - """Specifies the security settings like secure boot and vTPM used while creating - the virtual machine. Minimum api-version: 2020-12-01. - - :ivar secure_boot_enabled: Specifies whether secure boot should be enabled on the virtual - machine. Minimum - api-version: 2020-12-01. - :vartype secure_boot_enabled: bool - :ivar v_tpm_enabled: Specifies whether vTPM should be enabled on the virtual machine. Minimum - api-version: 2020-12-01. - :vartype v_tpm_enabled: bool - """ - - secure_boot_enabled: Optional[bool] = rest_field(name="secureBootEnabled") - """Specifies whether secure boot should be enabled on the virtual machine. Minimum - api-version: 2020-12-01.""" - v_tpm_enabled: Optional[bool] = rest_field(name="vTpmEnabled") - """Specifies whether vTPM should be enabled on the virtual machine. Minimum - api-version: 2020-12-01.""" - - @overload - def __init__( - self, - *, - secure_boot_enabled: Optional[bool] = None, - v_tpm_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 UserAssignedIdentity(_model_base.Model): - """User assigned identity properties. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) - """The principal ID of the assigned identity.""" - client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) - """The client ID of the assigned identity.""" - - -class VaultCertificate(_model_base.Model): - """Describes a single certificate reference in a Key Vault, and where the - certificate should reside on the VM. - - :ivar certificate_url: This is the URL of a certificate that has been uploaded to Key Vault as - a - secret. For adding a secret to the Key Vault, see `Add a key or secret to the - key - vault `_. - In this case, your certificate needs to be It is the Base64 encoding of the - following JSON Object which is encoded in UTF-8: :code:`
`:code:`
` {:code:`
` - "data":":code:``",:code:`
` "dataType":"pfx",:code:`
` - "password":":code:``":code:`
`} :code:`
` To install certificates on - a virtual - machine it is recommended to use the `Azure Key Vault virtual machine extension - for - Linux `_ - or the `Azure Key Vault virtual machine extension for - Windows `_. - :vartype certificate_url: str - :ivar certificate_store: For Windows VMs, specifies the certificate store on the Virtual - Machine to - which the certificate should be added. The specified certificate store is - implicitly in the LocalMachine account. For Linux VMs, the certificate file is - placed under the /var/lib/waagent directory, with the file name - <UppercaseThumbprint>.crt for the X509 certificate file and - <UppercaseThumbprint>.prv for private key. Both of these files are .pem - formatted. - :vartype certificate_store: str - """ - - certificate_url: Optional[str] = rest_field(name="certificateUrl") - """This is the URL of a certificate that has been uploaded to Key Vault as a - secret. For adding a secret to the Key Vault, see `Add a key or secret to the - key - vault `_. - In this case, your certificate needs to be It is the Base64 encoding of the - following JSON Object which is encoded in UTF-8: :code:`
`:code:`
` {:code:`
` - \"data\":\":code:``\",:code:`
` - \"dataType\":\"pfx\",:code:`
` - \"password\":\":code:``\":code:`
`} :code:`
` To install certificates - on a virtual - machine it is recommended to use the `Azure Key Vault virtual machine extension - for - Linux `_ - or the `Azure Key Vault virtual machine extension for - Windows `_.""" - certificate_store: Optional[str] = rest_field(name="certificateStore") - """For Windows VMs, specifies the certificate store on the Virtual Machine to - which the certificate should be added. The specified certificate store is - implicitly in the LocalMachine account. For Linux VMs, the certificate file is - placed under the /var/lib/waagent directory, with the file name - <UppercaseThumbprint>.crt for the X509 certificate file and - <UppercaseThumbprint>.prv for private key. Both of these files are .pem - formatted.""" - - @overload - def __init__( - self, - *, - certificate_url: Optional[str] = None, - certificate_store: Optional[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 VaultSecretGroup(_model_base.Model): - """Describes a set of certificates which are all in the same Key Vault. - - :ivar source_vault: The relative URL of the Key Vault containing all of the certificates in - VaultCertificates. - :vartype source_vault: ~azure.mgmt.computefleet.models.SubResource - :ivar vault_certificates: The list of key vault references in SourceVault which contain - certificates. - :vartype vault_certificates: list[~azure.mgmt.computefleet.models.VaultCertificate] - """ - - source_vault: Optional["_models.SubResource"] = rest_field(name="sourceVault") - """The relative URL of the Key Vault containing all of the certificates in - VaultCertificates.""" - vault_certificates: Optional[List["_models.VaultCertificate"]] = rest_field(name="vaultCertificates") - """The list of key vault references in SourceVault which contain certificates.""" - - @overload - def __init__( - self, - *, - source_vault: Optional["_models.SubResource"] = None, - vault_certificates: Optional[List["_models.VaultCertificate"]] = 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 VirtualHardDisk(_model_base.Model): - """Describes the uri of a disk. - - :ivar uri: Specifies the virtual hard disk's uri. - :vartype uri: str - """ - - uri: Optional[str] = rest_field() - """Specifies the virtual hard disk's uri.""" - - @overload - def __init__( - self, - *, - uri: Optional[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 VirtualMachineScaleSet(_model_base.Model): - """An AzureFleet's virtualMachineScaleSet. - - 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}". - Required. - :vartype id: str - :ivar type: Type of the virtualMachineScaleSet. - :vartype type: str - :ivar operation_status: This represents the operationStatus of the VMSS in response to the last - operation that was performed on it by Azure Fleet resource. Required. Known values are: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting", and "Migrating". - :vartype operation_status: str or ~azure.mgmt.computefleet.models.ProvisioningState - :ivar error: Error Information when ``operationStatus`` is ``Failed``. - :vartype error: ~azure.mgmt.computefleet.models.ApiError - """ - - id: str = rest_field(visibility=["read"]) - """The compute RP resource id of the virtualMachineScaleSet - \"subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}\". - Required.""" - type: Optional[str] = rest_field(visibility=["read"]) - """Type of the virtualMachineScaleSet.""" - operation_status: Union[str, "_models.ProvisioningState"] = rest_field(name="operationStatus", visibility=["read"]) - """This represents the operationStatus of the VMSS in response to the last operation that was - performed on it by Azure Fleet resource. Required. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"Creating\", \"Updating\", \"Deleting\", and \"Migrating\".""" - error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) - """Error Information when ``operationStatus`` is ``Failed``.""" - - -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 - :ivar lun: Specifies the logical unit number of the data disk. This value is used to - identify data disks within the VM and therefore must be unique for each data - disk attached to a VM. Required. - :vartype lun: int - :ivar caching: Specifies the caching requirements. Possible values are: **None,** - **ReadOnly,** **ReadWrite.** The default values are: **None for Standard - storage. ReadOnly for Premium storage.**. Known values are: "None", "ReadOnly", and - "ReadWrite". - :vartype caching: str or ~azure.mgmt.computefleet.models.CachingTypes - :ivar write_accelerator_enabled: Specifies whether writeAccelerator should be enabled or - disabled on the disk. - :vartype write_accelerator_enabled: bool - :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 - 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 - :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 - 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 - :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 - would be assigned based on diskSizeGB. - :vartype disk_m_bps_read_write: int - :ivar delete_option: Specifies whether data disk should be deleted or detached upon VMSS Flex - deletion (This feature is available for VMSS with Flexible OrchestrationMode - only).:code:`
`:code:`
` Possible values: :code:`
`:code:`
` **Delete** If this - value is used, the - data disk is deleted when the VMSS Flex VM is deleted.:code:`
`:code:`
` **Detach** If - this value is used, the data disk is retained after VMSS Flex VM is - deleted.:code:`
`:code:`
` The default value is set to **Delete**. Known values are: - "Delete" and "Detach". - :vartype delete_option: str or ~azure.mgmt.computefleet.models.DiskDeleteOptionTypes - """ - - name: Optional[str] = rest_field() - """The disk name.""" - lun: int = rest_field() - """Specifies the logical unit number of the data disk. This value is used to - identify data disks within the VM and therefore must be unique for each data - disk attached to a VM. Required.""" - caching: Optional[Union[str, "_models.CachingTypes"]] = rest_field() - """Specifies the caching requirements. Possible values are: **None,** - **ReadOnly,** **ReadWrite.** The default values are: **None for Standard - storage. ReadOnly for Premium storage.**. Known values are: \"None\", \"ReadOnly\", and - \"ReadWrite\".""" - write_accelerator_enabled: Optional[bool] = rest_field(name="writeAcceleratorEnabled") - """Specifies whether writeAccelerator should be enabled or disabled on the disk.""" - 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") - """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") - """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.""" - disk_m_bps_read_write: Optional[int] = rest_field(name="diskMBpsReadWrite") - """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 - would be assigned based on diskSizeGB.""" - delete_option: Optional[Union[str, "_models.DiskDeleteOptionTypes"]] = rest_field(name="deleteOption") - """Specifies whether data disk should be deleted or detached upon VMSS Flex - deletion (This feature is available for VMSS with Flexible OrchestrationMode - only).:code:`
`:code:`
` Possible values: :code:`
`:code:`
` **Delete** If this - value is used, the - data disk is deleted when the VMSS Flex VM is deleted.:code:`
`:code:`
` **Detach** If - this value is used, the data disk is retained after VMSS Flex VM is - deleted.:code:`
`:code:`
` The default value is set to **Delete**. Known values are: - \"Delete\" and \"Detach\".""" - - @overload - def __init__( - self, - *, - lun: int, - create_option: Union[str, "_models.DiskCreateOptionTypes"], - name: Optional[str] = None, - caching: Optional[Union[str, "_models.CachingTypes"]] = None, - write_accelerator_enabled: Optional[bool] = None, - disk_size_g_b: Optional[int] = None, - managed_disk: Optional["_models.VirtualMachineScaleSetManagedDiskParameters"] = None, - disk_i_o_p_s_read_write: Optional[int] = None, - disk_m_bps_read_write: Optional[int] = None, - delete_option: Optional[Union[str, "_models.DiskDeleteOptionTypes"]] = 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 VirtualMachineScaleSetExtension(_model_base.Model): - """Describes a Virtual Machine Scale Set Extension. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: The name of the extension. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar properties: Describes the properties of a Virtual Machine Scale Set Extension. - :vartype properties: ~azure.mgmt.computefleet.models.VirtualMachineScaleSetExtensionProperties - """ - - id: Optional[str] = rest_field(visibility=["read"]) - """Resource Id.""" - name: Optional[str] = rest_field() - """The name of the extension.""" - type: Optional[str] = rest_field(visibility=["read"]) - """Resource type.""" - properties: Optional["_models.VirtualMachineScaleSetExtensionProperties"] = rest_field() - """Describes the properties of a Virtual Machine Scale Set Extension.""" - - @overload - def __init__( - self, - *, - name: Optional[str] = None, - properties: Optional["_models.VirtualMachineScaleSetExtensionProperties"] = 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 VirtualMachineScaleSetExtensionProfile(_model_base.Model): - """Describes a virtual machine scale set extension profile. - - :ivar extensions: The virtual machine scale set child extension resources. - :vartype extensions: list[~azure.mgmt.computefleet.models.VirtualMachineScaleSetExtension] - :ivar extensions_time_budget: Specifies the time alloted for all extensions to start. The time - duration - should be between 15 minutes and 120 minutes (inclusive) and should be - specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). - Minimum api-version: 2020-06-01. - :vartype extensions_time_budget: str - """ - - extensions: Optional[List["_models.VirtualMachineScaleSetExtension"]] = rest_field() - """The virtual machine scale set child extension resources.""" - extensions_time_budget: Optional[str] = rest_field(name="extensionsTimeBudget") - """Specifies the time alloted for all extensions to start. The time duration - should be between 15 minutes and 120 minutes (inclusive) and should be - specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). - Minimum api-version: 2020-06-01.""" - - @overload - def __init__( - self, - *, - extensions: Optional[List["_models.VirtualMachineScaleSetExtension"]] = None, - extensions_time_budget: Optional[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 VirtualMachineScaleSetExtensionProperties( - _model_base.Model -): # pylint: disable=too-many-instance-attributes,name-too-long - """Describes the properties of a Virtual Machine Scale Set Extension. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar force_update_tag: If a value is provided and is different from the previous value, the - extension - handler will be forced to update even if the extension configuration has not - changed. - :vartype force_update_tag: str - :ivar publisher: The name of the extension handler publisher. - :vartype publisher: str - :ivar type: Specifies the type of the extension; an example is "CustomScriptExtension". - :vartype type: str - :ivar type_handler_version: Specifies the version of the script handler. - :vartype type_handler_version: str - :ivar auto_upgrade_minor_version: Indicates whether the extension should use a newer minor - version if one is - available at deployment time. Once deployed, however, the extension will not - upgrade minor versions unless redeployed, even with this property set to true. - :vartype auto_upgrade_minor_version: bool - :ivar enable_automatic_upgrade: Indicates whether the extension should be automatically - upgraded by the - platform if there is a newer version of the extension available. - :vartype enable_automatic_upgrade: bool - :ivar settings: Json formatted public settings for the extension. - :vartype settings: dict[str, any] - :ivar protected_settings: The extension can contain either protectedSettings or - protectedSettingsFromKeyVault or no protected settings at all. - :vartype protected_settings: dict[str, any] - :ivar provisioning_state: The provisioning state, which only appears in the response. - :vartype provisioning_state: str - :ivar provision_after_extensions: Collection of extension names after which this extension - needs to be - provisioned. - :vartype provision_after_extensions: list[str] - :ivar suppress_failures: Indicates whether failures stemming from the extension will be - suppressed - (Operational failures such as not connecting to the VM will not be suppressed - regardless of this value). The default is false. - :vartype suppress_failures: bool - :ivar protected_settings_from_key_vault: The extensions protected settings that are passed by - reference, and consumed - from key vault. - :vartype protected_settings_from_key_vault: - ~azure.mgmt.computefleet.models.KeyVaultSecretReference - """ - - force_update_tag: Optional[str] = rest_field(name="forceUpdateTag") - """If a value is provided and is different from the previous value, the extension - handler will be forced to update even if the extension configuration has not - changed.""" - publisher: Optional[str] = rest_field() - """The name of the extension handler publisher.""" - type: Optional[str] = rest_field() - """Specifies the type of the extension; an example is \"CustomScriptExtension\".""" - type_handler_version: Optional[str] = rest_field(name="typeHandlerVersion") - """Specifies the version of the script handler.""" - auto_upgrade_minor_version: Optional[bool] = rest_field(name="autoUpgradeMinorVersion") - """Indicates whether the extension should use a newer minor version if one is - available at deployment time. Once deployed, however, the extension will not - upgrade minor versions unless redeployed, even with this property set to true.""" - enable_automatic_upgrade: Optional[bool] = rest_field(name="enableAutomaticUpgrade") - """Indicates whether the extension should be automatically upgraded by the - platform if there is a newer version of the extension available.""" - settings: Optional[Dict[str, Any]] = rest_field() - """Json formatted public settings for the extension.""" - protected_settings: Optional[Dict[str, Any]] = rest_field(name="protectedSettings", visibility=["create", "update"]) - """The extension can contain either protectedSettings or - protectedSettingsFromKeyVault or no protected settings at all.""" - provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) - """The provisioning state, which only appears in the response.""" - provision_after_extensions: Optional[List[str]] = rest_field(name="provisionAfterExtensions") - """Collection of extension names after which this extension needs to be - provisioned.""" - suppress_failures: Optional[bool] = rest_field(name="suppressFailures") - """Indicates whether failures stemming from the extension will be suppressed - (Operational failures such as not connecting to the VM will not be suppressed - regardless of this value). The default is false.""" - protected_settings_from_key_vault: Optional["_models.KeyVaultSecretReference"] = rest_field( - name="protectedSettingsFromKeyVault" - ) - """The extensions protected settings that are passed by reference, and consumed - from key vault.""" - - @overload - def __init__( - self, - *, - force_update_tag: Optional[str] = None, - publisher: Optional[str] = None, - type: Optional[str] = None, - type_handler_version: Optional[str] = None, - auto_upgrade_minor_version: Optional[bool] = None, - enable_automatic_upgrade: Optional[bool] = None, - settings: Optional[Dict[str, Any]] = None, - protected_settings: Optional[Dict[str, Any]] = None, - provision_after_extensions: Optional[List[str]] = None, - suppress_failures: Optional[bool] = None, - protected_settings_from_key_vault: Optional["_models.KeyVaultSecretReference"] = 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 VirtualMachineScaleSetHardwareProfile(_model_base.Model): - """Specifies the hardware settings for the virtual machine scale set. - - :ivar vm_size_properties: Specifies the properties for customizing the size of the virtual - machine. - Minimum api-version: 2021-11-01. Please follow the instructions in `VM - Customization `_ for more details. - :vartype vm_size_properties: ~azure.mgmt.computefleet.models.VMSizeProperties - """ - - vm_size_properties: Optional["_models.VMSizeProperties"] = rest_field(name="vmSizeProperties") - """Specifies the properties for customizing the size of the virtual machine. - Minimum api-version: 2021-11-01. Please follow the instructions in `VM - Customization `_ for more details.""" - - @overload - def __init__( - self, - *, - vm_size_properties: Optional["_models.VMSizeProperties"] = 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 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 - :ivar properties: Describes a virtual machine scale set network profile's IP configuration - properties. - :vartype properties: - ~azure.mgmt.computefleet.models.VirtualMachineScaleSetIPConfigurationProperties - """ - - name: str = rest_field() - """The IP configuration name. Required.""" - properties: Optional["_models.VirtualMachineScaleSetIPConfigurationProperties"] = rest_field() - """Describes a virtual machine scale set network profile's IP configuration - properties.""" - - @overload - def __init__( - self, - *, - name: str, - properties: Optional["_models.VirtualMachineScaleSetIPConfigurationProperties"] = 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 VirtualMachineScaleSetIPConfigurationProperties(_model_base.Model): # pylint: disable=name-too-long - """Describes a virtual machine scale set network profile's IP configuration - properties. - - :ivar subnet: Specifies the identifier of the subnet. - :vartype subnet: ~azure.mgmt.computefleet.models.ApiEntityReference - :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: - ~azure.mgmt.computefleet.models.VirtualMachineScaleSetPublicIPAddressConfiguration - :ivar private_i_p_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 - :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 - application gateways. Multiple scale sets cannot use the same application - gateway. - :vartype application_gateway_backend_address_pools: - list[~azure.mgmt.computefleet.models.SubResource] - :ivar application_security_groups: Specifies an array of references to application security - group. - :vartype application_security_groups: list[~azure.mgmt.computefleet.models.SubResource] - :ivar load_balancer_backend_address_pools: Specifies an array of references to backend address - pools of load balancers. A - scale set can reference backend address pools of one public and one internal - load balancer. Multiple scale sets cannot use the same basic sku load balancer. - :vartype load_balancer_backend_address_pools: list[~azure.mgmt.computefleet.models.SubResource] - :ivar load_balancer_inbound_nat_pools: Specifies an array of references to inbound Nat pools of - the load balancers. A - scale set can reference inbound nat pools of one public and one internal load - balancer. Multiple scale sets cannot use the same basic sku load balancer. - :vartype load_balancer_inbound_nat_pools: list[~azure.mgmt.computefleet.models.SubResource] - """ - - subnet: Optional["_models.ApiEntityReference"] = rest_field() - """Specifies the identifier of the subnet.""" - 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"] = ( - rest_field(name="publicIPAddressConfiguration") - ) - """The publicIPAddressConfiguration.""" - private_i_p_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\".""" - application_gateway_backend_address_pools: Optional[List["_models.SubResource"]] = rest_field( - name="applicationGatewayBackendAddressPools" - ) - """Specifies an array of references to backend address pools of application - gateways. A scale set can reference backend address pools of multiple - application gateways. Multiple scale sets cannot use the same application - gateway.""" - application_security_groups: Optional[List["_models.SubResource"]] = rest_field(name="applicationSecurityGroups") - """Specifies an array of references to application security group.""" - load_balancer_backend_address_pools: Optional[List["_models.SubResource"]] = rest_field( - name="loadBalancerBackendAddressPools" - ) - """Specifies an array of references to backend address pools of load balancers. A - scale set can reference backend address pools of one public and one internal - load balancer. Multiple scale sets cannot use the same basic sku load balancer.""" - load_balancer_inbound_nat_pools: Optional[List["_models.SubResource"]] = rest_field( - name="loadBalancerInboundNatPools" - ) - """Specifies an array of references to inbound Nat pools of the load balancers. A - scale set can reference inbound nat pools of one public and one internal load - balancer. Multiple scale sets cannot use the same basic sku load balancer.""" - - @overload - def __init__( - self, - *, - 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, - 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, - load_balancer_inbound_nat_pools: Optional[List["_models.SubResource"]] = 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 VirtualMachineScaleSetIpTag(_model_base.Model): - """Contains the IP tag associated with the public IP address. - - :ivar ip_tag_type: IP tag type. Example: FirstPartyUsage. - :vartype ip_tag_type: str - :ivar tag: IP tag associated with the public IP. Example: SQL, Storage etc. - :vartype tag: str - """ - - ip_tag_type: Optional[str] = rest_field(name="ipTagType") - """IP tag type. Example: FirstPartyUsage.""" - tag: Optional[str] = rest_field() - """IP tag associated with the public IP. Example: SQL, Storage etc.""" - - @overload - def __init__( - self, - *, - ip_tag_type: Optional[str] = None, - tag: Optional[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 VirtualMachineScaleSetManagedDiskParameters(_model_base.Model): # pylint: disable=name-too-long - """Describes the parameters of a ScaleSet managed disk. - - :ivar storage_account_type: Specifies the storage account type for the managed disk. NOTE: - UltraSSD_LRS can - only be used with data disks, it cannot be used with OS Disk. Known values are: - "Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS", "Premium_ZRS", - "StandardSSD_ZRS", and "PremiumV2_LRS". - :vartype storage_account_type: str or ~azure.mgmt.computefleet.models.StorageAccountTypes - :ivar disk_encryption_set: Specifies the customer managed disk encryption set resource id for - the managed - disk. - :vartype disk_encryption_set: ~azure.mgmt.computefleet.models.DiskEncryptionSetParameters - :ivar security_profile: Specifies the security profile for the managed disk. - :vartype security_profile: ~azure.mgmt.computefleet.models.VMDiskSecurityProfile - """ - - storage_account_type: Optional[Union[str, "_models.StorageAccountTypes"]] = rest_field(name="storageAccountType") - """Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can - only be used with data disks, it cannot be used with OS Disk. Known values are: - \"Standard_LRS\", \"Premium_LRS\", \"StandardSSD_LRS\", \"UltraSSD_LRS\", \"Premium_ZRS\", - \"StandardSSD_ZRS\", and \"PremiumV2_LRS\".""" - disk_encryption_set: Optional["_models.DiskEncryptionSetParameters"] = rest_field(name="diskEncryptionSet") - """Specifies the customer managed disk encryption set resource id for the managed - disk.""" - security_profile: Optional["_models.VMDiskSecurityProfile"] = rest_field(name="securityProfile") - """Specifies the security profile for the managed disk.""" - - @overload - def __init__( - self, - *, - storage_account_type: Optional[Union[str, "_models.StorageAccountTypes"]] = None, - disk_encryption_set: Optional["_models.DiskEncryptionSetParameters"] = None, - security_profile: Optional["_models.VMDiskSecurityProfile"] = 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 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 - :ivar properties: Describes a virtual machine scale set network profile's IP configuration. - :vartype properties: - ~azure.mgmt.computefleet.models.VirtualMachineScaleSetNetworkConfigurationProperties - """ - - name: str = rest_field() - """The network configuration name. Required.""" - properties: Optional["_models.VirtualMachineScaleSetNetworkConfigurationProperties"] = rest_field() - """Describes a virtual machine scale set network profile's IP configuration.""" - - @overload - def __init__( - self, - *, - name: str, - properties: Optional["_models.VirtualMachineScaleSetNetworkConfigurationProperties"] = 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 VirtualMachineScaleSetNetworkConfigurationDnsSettings(_model_base.Model): # pylint: disable=name-too-long - """Describes a virtual machines scale sets network configuration's DNS settings. - - :ivar dns_servers: List of DNS servers IP addresses. - :vartype dns_servers: list[str] - """ - - dns_servers: Optional[List[str]] = rest_field(name="dnsServers") - """List of DNS servers IP addresses.""" - - @overload - def __init__( - self, - *, - dns_servers: 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 VirtualMachineScaleSetNetworkConfigurationProperties( - _model_base.Model -): # 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. - :vartype primary: bool - :ivar enable_accelerated_networking: Specifies whether the network interface is accelerated - networking-enabled. - :vartype enable_accelerated_networking: bool - :ivar disable_tcp_state_tracking: Specifies whether the network interface is disabled for tcp - state tracking. - :vartype disable_tcp_state_tracking: bool - :ivar enable_fpga: Specifies whether the network interface is FPGA networking-enabled. - :vartype enable_fpga: bool - :ivar network_security_group: The network security group. - :vartype network_security_group: ~azure.mgmt.computefleet.models.SubResource - :ivar dns_settings: The dns settings to be applied on the network interfaces. - :vartype dns_settings: - ~azure.mgmt.computefleet.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings - :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 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 - :ivar auxiliary_mode: Specifies whether the Auxiliary mode is enabled for the Network Interface - resource. Known values are: "None", "AcceleratedConnections", and "Floating". - :vartype auxiliary_mode: str or ~azure.mgmt.computefleet.models.NetworkInterfaceAuxiliaryMode - :ivar auxiliary_sku: Specifies whether the Auxiliary sku is enabled for the Network Interface - resource. Known values are: "None", "A1", "A2", "A4", and "A8". - :vartype auxiliary_sku: str or ~azure.mgmt.computefleet.models.NetworkInterfaceAuxiliarySku - """ - - primary: Optional[bool] = rest_field() - """Specifies the primary network interface in case the virtual machine has more - than 1 network interface.""" - enable_accelerated_networking: Optional[bool] = rest_field(name="enableAcceleratedNetworking") - """Specifies whether the network interface is accelerated networking-enabled.""" - disable_tcp_state_tracking: Optional[bool] = rest_field(name="disableTcpStateTracking") - """Specifies whether the network interface is disabled for tcp state tracking.""" - enable_fpga: Optional[bool] = rest_field(name="enableFpga") - """Specifies whether the network interface is FPGA networking-enabled.""" - network_security_group: Optional["_models.SubResource"] = rest_field(name="networkSecurityGroup") - """The network security group.""" - dns_settings: Optional["_models.VirtualMachineScaleSetNetworkConfigurationDnsSettings"] = rest_field( - name="dnsSettings" - ) - """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") - """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: - \"Delete\" and \"Detach\".""" - auxiliary_mode: Optional[Union[str, "_models.NetworkInterfaceAuxiliaryMode"]] = rest_field(name="auxiliaryMode") - """Specifies whether the Auxiliary mode is enabled for the Network Interface - resource. Known values are: \"None\", \"AcceleratedConnections\", and \"Floating\".""" - auxiliary_sku: Optional[Union[str, "_models.NetworkInterfaceAuxiliarySku"]] = rest_field(name="auxiliarySku") - """Specifies whether the Auxiliary sku is enabled for the Network Interface - resource. Known values are: \"None\", \"A1\", \"A2\", \"A4\", and \"A8\".""" - - @overload - def __init__( - self, - *, - ip_configurations: List["_models.VirtualMachineScaleSetIPConfiguration"], - primary: Optional[bool] = None, - enable_accelerated_networking: Optional[bool] = None, - disable_tcp_state_tracking: Optional[bool] = None, - 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, - delete_option: Optional[Union[str, "_models.DeleteOptions"]] = None, - auxiliary_mode: Optional[Union[str, "_models.NetworkInterfaceAuxiliaryMode"]] = None, - auxiliary_sku: Optional[Union[str, "_models.NetworkInterfaceAuxiliarySku"]] = 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 VirtualMachineScaleSetNetworkProfile(_model_base.Model): - """Describes a virtual machine scale set network profile. - - :ivar health_probe: A reference to a load balancer probe used to determine the health of an - instance in the virtual machine scale set. The reference will be in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. # pylint: disable=line-too-long - :vartype health_probe: ~azure.mgmt.computefleet.models.ApiEntityReference - :ivar network_interface_configurations: The list of network configurations. - :vartype network_interface_configurations: - list[~azure.mgmt.computefleet.models.VirtualMachineScaleSetNetworkConfiguration] - :ivar network_api_version: specifies the Microsoft.Network API version used when creating - networking - resources in the Network Interface Configurations for Virtual Machine Scale Set - with orchestration mode 'Flexible'. "2020-11-01" - :vartype network_api_version: str or ~azure.mgmt.computefleet.models.NetworkApiVersion - """ - - health_probe: Optional["_models.ApiEntityReference"] = rest_field(name="healthProbe") - """A reference to a load balancer probe used to determine the health of an - instance in the virtual machine scale set. The reference will be in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. # pylint: disable=line-too-long""" - network_interface_configurations: Optional[List["_models.VirtualMachineScaleSetNetworkConfiguration"]] = rest_field( - name="networkInterfaceConfigurations" - ) - """The list of network configurations.""" - network_api_version: Optional[Union[str, "_models.NetworkApiVersion"]] = rest_field(name="networkApiVersion") - """specifies the Microsoft.Network API version used when creating networking - resources in the Network Interface Configurations for Virtual Machine Scale Set - with orchestration mode 'Flexible'. \"2020-11-01\"""" - - @overload - def __init__( - self, - *, - health_probe: Optional["_models.ApiEntityReference"] = None, - network_interface_configurations: Optional[List["_models.VirtualMachineScaleSetNetworkConfiguration"]] = None, - network_api_version: Optional[Union[str, "_models.NetworkApiVersion"]] = 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 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 - :ivar caching: Specifies the caching requirements. Possible values are: **None,** - **ReadOnly,** **ReadWrite.** The default values are: **None for Standard - storage. ReadOnly for Premium storage.**. Known values are: "None", "ReadOnly", and - "ReadWrite". - :vartype caching: str or ~azure.mgmt.computefleet.models.CachingTypes - :ivar write_accelerator_enabled: Specifies whether writeAccelerator should be enabled or - disabled on the disk. - :vartype write_accelerator_enabled: bool - :ivar create_option: Specifies how the virtual machines in the scale set should be created. The - only - allowed value is: **FromImage.** This value is used when you are using an image - to create the virtual machine. If you are using a platform image, you also use - the imageReference element described above. If you are using a marketplace - image, you also use the plan element previously described. Required. Known values are: - "FromImage", "Empty", "Attach", "Copy", and "Restore". - :vartype create_option: str or ~azure.mgmt.computefleet.models.DiskCreateOptionTypes - :ivar diff_disk_settings: Specifies the ephemeral disk Settings for the operating system disk - 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 - 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 - :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". - :vartype os_type: str or ~azure.mgmt.computefleet.models.OperatingSystemTypes - :ivar image: Specifies information about the unmanaged user image to base the scale set on. - :vartype image: ~azure.mgmt.computefleet.models.VirtualHardDisk - :ivar vhd_containers: Specifies the container urls that are used to store operating system - disks for - the scale set. - :vartype vhd_containers: list[str] - :ivar managed_disk: The managed disk parameters. - :vartype managed_disk: - ~azure.mgmt.computefleet.models.VirtualMachineScaleSetManagedDiskParameters - :ivar delete_option: Specifies whether OS Disk should be deleted or detached upon VMSS Flex - deletion - (This feature is available for VMSS with Flexible OrchestrationMode only). - :code:`
`:code:`
` Possible values: :code:`
`:code:`
` **Delete** If this value is - used, the OS - disk is deleted when VMSS Flex VM is deleted.:code:`
`:code:`
` **Detach** If this value - is used, the OS disk is retained after VMSS Flex VM is deleted. :code:`
`:code:`
` The - default value is set to **Delete**. For an Ephemeral OS Disk, the default value - is set to **Delete**. User cannot change the delete option for Ephemeral OS - Disk. Known values are: "Delete" and "Detach". - :vartype delete_option: str or ~azure.mgmt.computefleet.models.DiskDeleteOptionTypes - """ - - name: Optional[str] = rest_field() - """The disk name.""" - caching: Optional[Union[str, "_models.CachingTypes"]] = rest_field() - """Specifies the caching requirements. Possible values are: **None,** - **ReadOnly,** **ReadWrite.** The default values are: **None for Standard - storage. ReadOnly for Premium storage.**. Known values are: \"None\", \"ReadOnly\", and - \"ReadWrite\".""" - write_accelerator_enabled: Optional[bool] = rest_field(name="writeAcceleratorEnabled") - """Specifies whether writeAccelerator should be enabled or disabled on the disk.""" - create_option: Union[str, "_models.DiskCreateOptionTypes"] = rest_field(name="createOption") - """Specifies how the virtual machines in the scale set should be created. The only - allowed value is: **FromImage.** This value is used when you are using an image - to create the virtual machine. If you are using a platform image, you also use - the imageReference element described above. If you are using a marketplace - image, you also use the plan element previously described. Required. Known values are: - \"FromImage\", \"Empty\", \"Attach\", \"Copy\", and \"Restore\".""" - 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") - """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.""" - os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = rest_field(name="osType") - """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\".""" - image: Optional["_models.VirtualHardDisk"] = rest_field() - """Specifies information about the unmanaged user image to base the scale set on.""" - vhd_containers: Optional[List[str]] = rest_field(name="vhdContainers") - """Specifies the container urls that are used to store operating system disks for - the scale set.""" - managed_disk: Optional["_models.VirtualMachineScaleSetManagedDiskParameters"] = rest_field(name="managedDisk") - """The managed disk parameters.""" - delete_option: Optional[Union[str, "_models.DiskDeleteOptionTypes"]] = rest_field(name="deleteOption") - """Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion - (This feature is available for VMSS with Flexible OrchestrationMode only). - :code:`
`:code:`
` Possible values: :code:`
`:code:`
` **Delete** If this value is - used, the OS - disk is deleted when VMSS Flex VM is deleted.:code:`
`:code:`
` **Detach** If this value - is used, the OS disk is retained after VMSS Flex VM is deleted. :code:`
`:code:`
` The - default value is set to **Delete**. For an Ephemeral OS Disk, the default value - is set to **Delete**. User cannot change the delete option for Ephemeral OS - Disk. Known values are: \"Delete\" and \"Detach\".""" - - @overload - def __init__( - self, - *, - create_option: Union[str, "_models.DiskCreateOptionTypes"], - name: Optional[str] = None, - 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, - os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, - image: Optional["_models.VirtualHardDisk"] = None, - vhd_containers: Optional[List[str]] = None, - managed_disk: Optional["_models.VirtualMachineScaleSetManagedDiskParameters"] = None, - delete_option: Optional[Union[str, "_models.DiskDeleteOptionTypes"]] = 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 VirtualMachineScaleSetOSProfile(_model_base.Model): - """Describes a virtual machine scale set OS profile. - - :ivar computer_name_prefix: Specifies the computer name prefix for all of the virtual machines - in the scale - set. Computer name prefixes must be 1 to 15 characters long. - :vartype computer_name_prefix: str - :ivar admin_username: Specifies the name of the administrator account. :code:`
`:code:`
` - **Windows-only - restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** - "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", - "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", - "console", "david", "guest", "john", "owner", "root", "server", "sql", - "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". - :code:`
`:code:`
` **Minimum-length (Linux):** 1 character :code:`
`:code:`
` - **Max-length - (Linux):** 64 characters :code:`
`:code:`
` **Max-length (Windows):** 20 characters. - :vartype admin_username: str - :ivar admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length - (Windows):** 8 characters :code:`
`:code:`
` **Minimum-length (Linux):** 6 characters - :code:`
`:code:`
` **Max-length (Windows):** 123 characters :code:`
`:code:`
` - **Max-length - (Linux):** 72 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - "Password22", "iloveyou!" :code:`
`:code:`
` For resetting the password, see `How to - reset the Remote Desktop service or its login password in a Windows - VM `_ - :code:`
`:code:`
` For resetting root password, see `Manage users, SSH, and check or - repair disks on Azure Linux VMs using the VMAccess - Extension - `_. - :vartype admin_password: str - :ivar custom_data: Specifies a base-64 encoded string of custom data. The base-64 encoded - string - is decoded to a binary array that is saved as a file on the Virtual Machine. - The maximum length of the binary array is 65535 bytes. For using cloud-init for - your VM, see `Using cloud-init to customize a Linux VM during - creation `_. - :vartype custom_data: str - :ivar windows_configuration: Specifies Windows operating system settings on the virtual - machine. - :vartype windows_configuration: ~azure.mgmt.computefleet.models.WindowsConfiguration - :ivar linux_configuration: Specifies the Linux operating system settings on the virtual - machine. For a - list of supported Linux distributions, see `Linux on Azure-Endorsed - Distributions `_. - :vartype linux_configuration: ~azure.mgmt.computefleet.models.LinuxConfiguration - :ivar secrets: Specifies set of certificates that should be installed onto the virtual - machines in the scale set. To install certificates on a virtual machine it is - recommended to use the `Azure Key Vault virtual machine extension for - Linux `_ - or the `Azure Key Vault virtual machine extension for - Windows `_. - :vartype secrets: list[~azure.mgmt.computefleet.models.VaultSecretGroup] - :ivar allow_extension_operations: Specifies whether extension operations should be allowed on - the virtual machine - scale set. This may only be set to False when no extensions are present on the - virtual machine scale set. - :vartype allow_extension_operations: bool - :ivar require_guest_provision_signal: Optional property which must either be set to True or - omitted. - :vartype require_guest_provision_signal: bool - """ - - computer_name_prefix: Optional[str] = rest_field(name="computerNamePrefix") - """Specifies the computer name prefix for all of the virtual machines in the scale - set. Computer name prefixes must be 1 to 15 characters long.""" - admin_username: Optional[str] = rest_field(name="adminUsername") - """Specifies the name of the administrator account. :code:`
`:code:`
` **Windows-only - restriction:** Cannot end in \".\" :code:`
`:code:`
` **Disallowed values:** - \"administrator\", \"admin\", \"user\", \"user1\", \"test\", \"user2\", \"test1\", \"user3\", - \"admin1\", \"1\", \"123\", \"a\", \"actuser\", \"adm\", \"admin2\", \"aspnet\", \"backup\", - \"console\", \"david\", \"guest\", \"john\", \"owner\", \"root\", \"server\", \"sql\", - \"support\", \"support_388945a0\", \"sys\", \"test2\", \"test3\", \"user4\", \"user5\". - :code:`
`:code:`
` **Minimum-length (Linux):** 1 character :code:`
`:code:`
` - **Max-length - (Linux):** 64 characters :code:`
`:code:`
` **Max-length (Windows):** 20 characters.""" - admin_password: Optional[str] = rest_field(name="adminPassword", visibility=["create", "update"]) - """Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length - (Windows):** 8 characters :code:`
`:code:`
` **Minimum-length (Linux):** 6 characters - :code:`
`:code:`
` **Max-length (Windows):** 123 characters :code:`
`:code:`
` - **Max-length - (Linux):** 72 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** \"abc@123\", \"P@$$w0rd\", \"P@ssw0rd\", - \"P@ssword123\", \"Pa$$word\", \"pass@word1\", \"Password!\", \"Password1\", - \"Password22\", \"iloveyou!\" :code:`
`:code:`
` For resetting the password, see `How to - reset the Remote Desktop service or its login password in a Windows - VM `_ - :code:`
`:code:`
` For resetting root password, see `Manage users, SSH, and check or - repair disks on Azure Linux VMs using the VMAccess - Extension - `_.""" - custom_data: Optional[str] = rest_field(name="customData", visibility=["create", "update"]) - """Specifies a base-64 encoded string of custom data. The base-64 encoded string - is decoded to a binary array that is saved as a file on the Virtual Machine. - The maximum length of the binary array is 65535 bytes. For using cloud-init for - your VM, see `Using cloud-init to customize a Linux VM during - creation `_.""" - windows_configuration: Optional["_models.WindowsConfiguration"] = rest_field(name="windowsConfiguration") - """Specifies Windows operating system settings on the virtual machine.""" - linux_configuration: Optional["_models.LinuxConfiguration"] = rest_field(name="linuxConfiguration") - """Specifies the Linux operating system settings on the virtual machine. For a - list of supported Linux distributions, see `Linux on Azure-Endorsed - Distributions `_.""" - secrets: Optional[List["_models.VaultSecretGroup"]] = rest_field() - """Specifies set of certificates that should be installed onto the virtual - machines in the scale set. To install certificates on a virtual machine it is - recommended to use the `Azure Key Vault virtual machine extension for - Linux `_ - or the `Azure Key Vault virtual machine extension for - Windows `_.""" - allow_extension_operations: Optional[bool] = rest_field(name="allowExtensionOperations") - """Specifies whether extension operations should be allowed on the virtual machine - scale set. This may only be set to False when no extensions are present on the - virtual machine scale set.""" - require_guest_provision_signal: Optional[bool] = rest_field(name="requireGuestProvisionSignal") - """Optional property which must either be set to True or omitted.""" - - @overload - def __init__( - self, - *, - computer_name_prefix: Optional[str] = None, - admin_username: Optional[str] = None, - admin_password: Optional[str] = None, - custom_data: Optional[str] = None, - windows_configuration: Optional["_models.WindowsConfiguration"] = None, - linux_configuration: Optional["_models.LinuxConfiguration"] = None, - secrets: Optional[List["_models.VaultSecretGroup"]] = None, - allow_extension_operations: Optional[bool] = None, - require_guest_provision_signal: 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 VirtualMachineScaleSetPublicIPAddressConfiguration(_model_base.Model): # pylint: disable=name-too-long - """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 - :ivar properties: Describes a virtual machines scale set IP Configuration's PublicIPAddress - configuration. - :vartype properties: - ~azure.mgmt.computefleet.models.VirtualMachineScaleSetPublicIPAddressConfigurationProperties - :ivar sku: Describes the public IP Sku. It can only be set with OrchestrationMode as - Flexible. - :vartype sku: ~azure.mgmt.computefleet.models.PublicIPAddressSku - """ - - name: str = rest_field() - """The publicIP address configuration name. Required.""" - properties: Optional["_models.VirtualMachineScaleSetPublicIPAddressConfigurationProperties"] = rest_field() - """Describes a virtual machines scale set IP Configuration's PublicIPAddress - configuration.""" - sku: Optional["_models.PublicIPAddressSku"] = rest_field() - """Describes the public IP Sku. It can only be set with OrchestrationMode as - Flexible.""" - - @overload - def __init__( - self, - *, - name: str, - properties: Optional["_models.VirtualMachineScaleSetPublicIPAddressConfigurationProperties"] = None, - sku: Optional["_models.PublicIPAddressSku"] = 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 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 - will be the domain name labels of the PublicIPAddress resources that will be - created. Required. - :vartype domain_name_label: str - :ivar domain_name_label_scope: The Domain name label scope.The concatenation of the hashed - domain name label - that generated according to the policy from domain name label scope and vm - index will be the domain name labels of the PublicIPAddress resources that will - be created. Known values are: "TenantReuse", "SubscriptionReuse", "ResourceGroupReuse", and - "NoReuse". - :vartype domain_name_label_scope: str or - ~azure.mgmt.computefleet.models.DomainNameLabelScopeTypes - """ - - domain_name_label: str = rest_field(name="domainNameLabel") - """The Domain name label.The concatenation of the domain name label and vm index - will be the domain name labels of the PublicIPAddress resources that will be - created. Required.""" - domain_name_label_scope: Optional[Union[str, "_models.DomainNameLabelScopeTypes"]] = rest_field( - name="domainNameLabelScope" - ) - """The Domain name label scope.The concatenation of the hashed domain name label - that generated according to the policy from domain name label scope and vm - index will be the domain name labels of the PublicIPAddress resources that will - be created. Known values are: \"TenantReuse\", \"SubscriptionReuse\", \"ResourceGroupReuse\", - and \"NoReuse\".""" - - @overload - def __init__( - self, - *, - domain_name_label: str, - domain_name_label_scope: Optional[Union[str, "_models.DomainNameLabelScopeTypes"]] = 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 VirtualMachineScaleSetPublicIPAddressConfigurationProperties(_model_base.Model): # pylint: disable=name-too-long - """Describes a virtual machines scale set IP Configuration's PublicIPAddress - configuration. - - :ivar idle_timeout_in_minutes: The idle timeout of the public IP address. - :vartype idle_timeout_in_minutes: int - :ivar dns_settings: The dns settings to be applied on the publicIP addresses . - :vartype dns_settings: - ~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 - 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 - :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 - """ - - idle_timeout_in_minutes: Optional[int] = rest_field(name="idleTimeoutInMinutes") - """The idle timeout of the public IP address.""" - dns_settings: Optional["_models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings"] = rest_field( - name="dnsSettings" - ) - """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") - """The PublicIPPrefix from which to allocate publicIP addresses.""" - public_i_p_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\".""" - delete_option: Optional[Union[str, "_models.DeleteOptions"]] = rest_field(name="deleteOption") - """Specify what happens to the public IP when the VM is deleted. Known values are: \"Delete\" and - \"Detach\".""" - - @overload - def __init__( - self, - *, - 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, - delete_option: Optional[Union[str, "_models.DeleteOptions"]] = 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 VirtualMachineScaleSetStorageProfile(_model_base.Model): - """Describes a virtual machine scale set storage profile. - - :ivar image_reference: Specifies information about the image to use. You can specify - information about - platform images, marketplace images, or virtual machine images. This element is - required when you want to use a platform image, marketplace image, or virtual - machine image, but is not used in other creation operations. - :vartype image_reference: ~azure.mgmt.computefleet.models.ImageReference - :ivar os_disk: Specifies information about the operating system disk used by the virtual - machines in the scale set. For more information about disks, see `About disks - and VHDs for Azure virtual - machines `_. - :vartype os_disk: ~azure.mgmt.computefleet.models.VirtualMachineScaleSetOSDisk - :ivar data_disks: Specifies the parameters that are used to add data disks to the virtual - machines in the scale set. For more information about disks, see `About disks - and VHDs for Azure virtual - machines `_. - :vartype data_disks: list[~azure.mgmt.computefleet.models.VirtualMachineScaleSetDataDisk] - :ivar disk_controller_type: Specifies the disk controller type configured for the virtual - machines in the scale set. Minimum api-version: 2022-08-01. Known values are: "SCSI" and - "NVMe". - :vartype disk_controller_type: str or ~azure.mgmt.computefleet.models.DiskControllerTypes - """ - - image_reference: Optional["_models.ImageReference"] = rest_field(name="imageReference") - """Specifies information about the image to use. You can specify information about - platform images, marketplace images, or virtual machine images. This element is - required when you want to use a platform image, marketplace image, or virtual - machine image, but is not used in other creation operations.""" - os_disk: Optional["_models.VirtualMachineScaleSetOSDisk"] = rest_field(name="osDisk") - """Specifies information about the operating system disk used by the virtual - machines in the scale set. For more information about disks, see `About disks - and VHDs for Azure virtual - machines `_.""" - data_disks: Optional[List["_models.VirtualMachineScaleSetDataDisk"]] = rest_field(name="dataDisks") - """Specifies the parameters that are used to add data disks to the virtual - machines in the scale set. For more information about disks, see `About disks - and VHDs for Azure virtual - machines `_.""" - disk_controller_type: Optional[Union[str, "_models.DiskControllerTypes"]] = rest_field(name="diskControllerType") - """Specifies the disk controller type configured for the virtual machines in the scale set. - Minimum api-version: 2022-08-01. Known values are: \"SCSI\" and \"NVMe\".""" - - @overload - def __init__( - self, - *, - image_reference: Optional["_models.ImageReference"] = None, - os_disk: Optional["_models.VirtualMachineScaleSetOSDisk"] = None, - data_disks: Optional[List["_models.VirtualMachineScaleSetDataDisk"]] = None, - disk_controller_type: Optional[Union[str, "_models.DiskControllerTypes"]] = 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. - - :ivar security_encryption_type: Specifies the EncryptionType of the managed disk. It is set to - DiskWithVMGuestState for encryption of the managed disk along with VMGuestState - blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and - NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. - **Note:** It can be set for only Confidential VMs. Known values are: "VMGuestStateOnly", - "DiskWithVMGuestState", and "NonPersistedTPM". - :vartype security_encryption_type: str or - ~azure.mgmt.computefleet.models.SecurityEncryptionTypes - :ivar disk_encryption_set: Specifies the customer managed disk encryption set resource id for - the managed - disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and - VMGuest blob. - :vartype disk_encryption_set: ~azure.mgmt.computefleet.models.DiskEncryptionSetParameters - """ - - security_encryption_type: Optional[Union[str, "_models.SecurityEncryptionTypes"]] = rest_field( - name="securityEncryptionType" - ) - """Specifies the EncryptionType of the managed disk. It is set to - DiskWithVMGuestState for encryption of the managed disk along with VMGuestState - blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and - NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. - **Note:** It can be set for only Confidential VMs. Known values are: \"VMGuestStateOnly\", - \"DiskWithVMGuestState\", and \"NonPersistedTPM\".""" - disk_encryption_set: Optional["_models.DiskEncryptionSetParameters"] = rest_field(name="diskEncryptionSet") - """Specifies the customer managed disk encryption set resource id for the managed - disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and - VMGuest blob.""" - - @overload - def __init__( - self, - *, - security_encryption_type: Optional[Union[str, "_models.SecurityEncryptionTypes"]] = None, - disk_encryption_set: Optional["_models.DiskEncryptionSetParameters"] = 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 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 - :ivar order: Optional, Specifies the order in which the packages have to be installed. - :vartype order: int - :ivar package_reference_id: Specifies the GalleryApplicationVersion resource id on the form of - /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version}. # pylint: disable=line-too-long - Required. - :vartype package_reference_id: str - :ivar configuration_reference: Optional, Specifies the uri to an azure blob that will replace - the default - configuration for the package if provided. - :vartype configuration_reference: str - :ivar treat_failure_as_deployment_failure: Optional, If true, any failure for any operation in - the VmApplication will fail - the deployment. - :vartype treat_failure_as_deployment_failure: bool - :ivar enable_automatic_upgrade: If set to true, when a new Gallery Application version is - available in PIR/SIG, - it will be automatically updated for the VM/VMSS. - :vartype enable_automatic_upgrade: bool - """ - - tags: Optional[str] = rest_field() - """Optional, Specifies a passthrough value for more generic context.""" - order: Optional[int] = rest_field() - """Optional, Specifies the order in which the packages have to be installed.""" - package_reference_id: str = rest_field(name="packageReferenceId") - """Specifies the GalleryApplicationVersion resource id on the form of - /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version}. # pylint: disable=line-too-long - Required.""" - configuration_reference: Optional[str] = rest_field(name="configurationReference") - """Optional, Specifies the uri to an azure blob that will replace the default - configuration for the package if provided.""" - treat_failure_as_deployment_failure: Optional[bool] = rest_field(name="treatFailureAsDeploymentFailure") - """Optional, If true, any failure for any operation in the VmApplication will fail - the deployment.""" - enable_automatic_upgrade: Optional[bool] = rest_field(name="enableAutomaticUpgrade") - """If set to true, when a new Gallery Application version is available in PIR/SIG, - it will be automatically updated for the VM/VMSS.""" - - @overload - def __init__( - self, - *, - package_reference_id: str, - tags: Optional[str] = None, - order: Optional[int] = None, - configuration_reference: Optional[str] = None, - treat_failure_as_deployment_failure: Optional[bool] = None, - enable_automatic_upgrade: 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 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 - :ivar rank: The rank of the VM size. This is used with - 'RegularPriorityAllocationStrategy.Prioritized' - The lower the number, the higher the priority. Starting with 0. - :vartype rank: int - """ - - name: str = rest_field() - """The Sku name (e.g. 'Standard_DS1_v2'). Required.""" - rank: Optional[int] = rest_field() - """The rank of the VM size. This is used with 'RegularPriorityAllocationStrategy.Prioritized' - The lower the number, the higher the priority. Starting with 0.""" - - @overload - def __init__( - self, - *, - name: str, - rank: Optional[int] = 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 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 - 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 - 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 - """ - - v_c_p_us_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") - """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.**.""" - - @overload - def __init__( - self, - *, - v_c_p_us_available: Optional[int] = None, - v_c_p_us_per_core: Optional[int] = 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 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 - 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 - :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 - updated and updates will take effect on OS reprovisioning. - :vartype enable_automatic_updates: bool - :ivar time_zone: Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". - Possible values can be - `TimeZoneInfo.Id - `_ - value from time zones returned by - `TimeZoneInfo.GetSystemTimeZones - `_. - :vartype time_zone: str - :ivar additional_unattend_content: Specifies additional base-64 encoded XML formatted - information that can be - included in the Unattend.xml file, which is used by Windows Setup. - :vartype additional_unattend_content: - list[~azure.mgmt.computefleet.models.AdditionalUnattendContent] - :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 - PowerShell. - :vartype win_r_m: ~azure.mgmt.computefleet.models.WinRMConfiguration - :ivar enable_v_m_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 - """ - - provision_v_m_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 - extensions can be added to the VM later.""" - enable_automatic_updates: Optional[bool] = rest_field(name="enableAutomaticUpdates") - """Indicates whether Automatic Updates is enabled for the Windows virtual machine. - Default value is true. For virtual machine scale sets, this property can be - updated and updates will take effect on OS reprovisioning.""" - time_zone: Optional[str] = rest_field(name="timeZone") - """Specifies the time zone of the virtual machine. e.g. \"Pacific Standard Time\". - Possible values can be - `TimeZoneInfo.Id - `_ - value from time zones returned by - `TimeZoneInfo.GetSystemTimeZones - `_.""" - additional_unattend_content: Optional[List["_models.AdditionalUnattendContent"]] = rest_field( - name="additionalUnattendContent" - ) - """Specifies additional base-64 encoded XML formatted information that can be - 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") - """Specifies the Windows Remote Management listeners. This enables remote Windows - PowerShell.""" - enable_v_m_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.""" - - @overload - def __init__( - self, - *, - provision_v_m_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, - ): ... - - @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 WindowsVMGuestPatchAutomaticByPlatformSettings(_model_base.Model): # pylint: disable=name-too-long - """Specifies additional settings to be applied when patch mode AutomaticByPlatform - is selected in Windows patch settings. - - :ivar reboot_setting: Specifies the reboot setting for all AutomaticByPlatform patch - installation - operations. Known values are: "Unknown", "IfRequired", "Never", and "Always". - :vartype reboot_setting: str or - ~azure.mgmt.computefleet.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting - :ivar bypass_platform_safety_checks_on_user_schedule: Enables customer to schedule patching - without accidental upgrades. - :vartype bypass_platform_safety_checks_on_user_schedule: bool - """ - - reboot_setting: Optional[Union[str, "_models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting"]] = rest_field( - name="rebootSetting" - ) - """Specifies the reboot setting for all AutomaticByPlatform patch installation - operations. Known values are: \"Unknown\", \"IfRequired\", \"Never\", and \"Always\".""" - bypass_platform_safety_checks_on_user_schedule: Optional[bool] = rest_field( - name="bypassPlatformSafetyChecksOnUserSchedule" - ) - """Enables customer to schedule patching without accidental upgrades.""" - - @overload - def __init__( - self, - *, - reboot_setting: Optional[Union[str, "_models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting"]] = None, - bypass_platform_safety_checks_on_user_schedule: 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 WinRMConfiguration(_model_base.Model): - """Describes Windows Remote Management configuration of the VM. - - :ivar listeners: The list of Windows Remote Management listeners. - :vartype listeners: list[~azure.mgmt.computefleet.models.WinRMListener] - """ - - listeners: Optional[List["_models.WinRMListener"]] = rest_field() - """The list of Windows Remote Management listeners.""" - - @overload - def __init__( - self, - *, - listeners: Optional[List["_models.WinRMListener"]] = 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 WinRMListener(_model_base.Model): - """Describes Protocol and thumbprint of Windows Remote Management listener. - - :ivar protocol: Specifies the protocol of WinRM listener. Possible values are: **http,** - **https.**. Known values are: "Http" and "Https". - :vartype protocol: str or ~azure.mgmt.computefleet.models.ProtocolTypes - :ivar certificate_url: This is the URL of a certificate that has been uploaded to Key Vault as - a - secret. For adding a secret to the Key Vault, see `Add a key or secret to the - key - vault `_. - In this case, your certificate needs to be the Base64 encoding of the following - JSON Object which is encoded in UTF-8: :code:`
`:code:`
` {:code:`
` - "data":":code:``",:code:`
` "dataType":"pfx",:code:`
` - "password":":code:``":code:`
`} :code:`
` To install certificates on - a virtual - machine it is recommended to use the `Azure Key Vault virtual machine extension - for - Linux `_ - or the `Azure Key Vault virtual machine extension for - Windows `_. - :vartype certificate_url: str - """ - - protocol: Optional[Union[str, "_models.ProtocolTypes"]] = rest_field() - """Specifies the protocol of WinRM listener. Possible values are: **http,** - **https.**. Known values are: \"Http\" and \"Https\".""" - certificate_url: Optional[str] = rest_field(name="certificateUrl") - """This is the URL of a certificate that has been uploaded to Key Vault as a - secret. For adding a secret to the Key Vault, see `Add a key or secret to the - key - vault `_. - In this case, your certificate needs to be the Base64 encoding of the following - JSON Object which is encoded in UTF-8: :code:`
`:code:`
` {:code:`
` - \"data\":\":code:``\",:code:`
` - \"dataType\":\"pfx\",:code:`
` - \"password\":\":code:``\":code:`
`} :code:`
` To install certificates - on a virtual - machine it is recommended to use the `Azure Key Vault virtual machine extension - for - Linux `_ - or the `Azure Key Vault virtual machine extension for - Windows `_.""" - - @overload - def __init__( - self, - *, - protocol: Optional[Union[str, "_models.ProtocolTypes"]] = None, - certificate_url: Optional[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) diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_models_py3.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_models_py3.py new file mode 100644 index 000000000000..eb32dde9fcdc --- /dev/null +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_models_py3.py @@ -0,0 +1,5264 @@ +# coding=utf-8 +# pylint: disable=too-many-lines +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Any, Dict, List, Literal, Optional, TYPE_CHECKING, Union + +from .. import _serialization + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models + + +class AdditionalCapabilities(_serialization.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 + """ + + _attribute_map = { + "ultra_ssd_enabled": {"key": "ultraSSDEnabled", "type": "bool"}, + "hibernation_enabled": {"key": "hibernationEnabled", "type": "bool"}, + } + + def __init__( + self, *, ultra_ssd_enabled: Optional[bool] = None, hibernation_enabled: Optional[bool] = None, **kwargs: Any + ) -> None: + """ + :keyword 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. + :paramtype ultra_ssd_enabled: bool + :keyword hibernation_enabled: The flag that enables or disables hibernation capability on the + VM. + :paramtype hibernation_enabled: bool + """ + super().__init__(**kwargs) + self.ultra_ssd_enabled = ultra_ssd_enabled + self.hibernation_enabled = hibernation_enabled + + +class AdditionalLocationsProfile(_serialization.Model): + """Represents the configuration for additional locations where Fleet resources may be deployed. + + All required parameters must be populated in order to send to server. + + :ivar location_profiles: The list of location profiles. Required. + :vartype location_profiles: list[~azure.mgmt.computefleet.models.LocationProfile] + """ + + _validation = { + "location_profiles": {"required": True}, + } + + _attribute_map = { + "location_profiles": {"key": "locationProfiles", "type": "[LocationProfile]"}, + } + + def __init__(self, *, location_profiles: List["_models.LocationProfile"], **kwargs: Any) -> None: + """ + :keyword location_profiles: The list of location profiles. Required. + :paramtype location_profiles: list[~azure.mgmt.computefleet.models.LocationProfile] + """ + super().__init__(**kwargs) + self.location_profiles = location_profiles + + +class AdditionalUnattendContent(_serialization.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 + setting name, component name, and the pass in which the content is applied. + + :ivar pass_name: The pass name. Currently, the only allowable value is OobeSystem. Default + value is "OobeSystem". + :vartype pass_name: str + :ivar component_name: The component name. Currently, the only allowable value is + Microsoft-Windows-Shell-Setup. Default value is "Microsoft-Windows-Shell-Setup". + :vartype component_name: str + :ivar setting_name: Specifies the name of the setting to which the content applies. Possible + values + are: FirstLogonCommands and AutoLogon. Known values are: "AutoLogon" and "FirstLogonCommands". + :vartype setting_name: str or ~azure.mgmt.computefleet.models.SettingNames + :ivar content: Specifies the XML formatted content that is added to the unattend.xml file for + the specified path and component. The XML must be less than 4KB and must + include the root element for the setting or feature that is being inserted. + :vartype content: str + """ + + _attribute_map = { + "pass_name": {"key": "passName", "type": "str"}, + "component_name": {"key": "componentName", "type": "str"}, + "setting_name": {"key": "settingName", "type": "str"}, + "content": {"key": "content", "type": "str"}, + } + + def __init__( + self, + *, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, + setting_name: Optional[Union[str, "_models.SettingNames"]] = None, + content: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword pass_name: The pass name. Currently, the only allowable value is OobeSystem. Default + value is "OobeSystem". + :paramtype pass_name: str + :keyword component_name: The component name. Currently, the only allowable value is + Microsoft-Windows-Shell-Setup. Default value is "Microsoft-Windows-Shell-Setup". + :paramtype component_name: str + :keyword setting_name: Specifies the name of the setting to which the content applies. Possible + values + are: FirstLogonCommands and AutoLogon. Known values are: "AutoLogon" and "FirstLogonCommands". + :paramtype setting_name: str or ~azure.mgmt.computefleet.models.SettingNames + :keyword content: Specifies the XML formatted content that is added to the unattend.xml file + for + the specified path and component. The XML must be less than 4KB and must + include the root element for the setting or feature that is being inserted. + :paramtype content: str + """ + super().__init__(**kwargs) + self.pass_name = pass_name + self.component_name = component_name + self.setting_name = setting_name + self.content = content + + +class ApiEntityReference(_serialization.Model): + """The API entity reference. + + :ivar id: The ARM resource id in the form of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: The ARM resource id in the form of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class ApiError(_serialization.Model): + """ApiError for Fleet. + + :ivar code: The error code. + :vartype code: str + :ivar target: The target of the particular error. + :vartype target: str + :ivar message: The error message. + :vartype message: str + :ivar details: The API error details. + :vartype details: list[~azure.mgmt.computefleet.models.ApiErrorBase] + :ivar innererror: The API inner error. + :vartype innererror: ~azure.mgmt.computefleet.models.InnerError + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "details": {"key": "details", "type": "[ApiErrorBase]"}, + "innererror": {"key": "innererror", "type": "InnerError"}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + target: Optional[str] = None, + message: Optional[str] = None, + details: Optional[List["_models.ApiErrorBase"]] = None, + innererror: Optional["_models.InnerError"] = None, + **kwargs: Any + ) -> None: + """ + :keyword code: The error code. + :paramtype code: str + :keyword target: The target of the particular error. + :paramtype target: str + :keyword message: The error message. + :paramtype message: str + :keyword details: The API error details. + :paramtype details: list[~azure.mgmt.computefleet.models.ApiErrorBase] + :keyword innererror: The API inner error. + :paramtype innererror: ~azure.mgmt.computefleet.models.InnerError + """ + super().__init__(**kwargs) + self.code = code + self.target = target + self.message = message + self.details = details + self.innererror = innererror + + +class ApiErrorBase(_serialization.Model): + """API error base. + + :ivar code: The error code. + :vartype code: str + :ivar target: The target of the particular error. + :vartype target: str + :ivar message: The error message. + :vartype message: str + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "message": {"key": "message", "type": "str"}, + } + + def __init__( + self, *, code: Optional[str] = None, target: Optional[str] = None, message: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword code: The error code. + :paramtype code: str + :keyword target: The target of the particular error. + :paramtype target: str + :keyword message: The error message. + :paramtype message: str + """ + super().__init__(**kwargs) + self.code = code + self.target = target + self.message = message + + +class ApplicationProfile(_serialization.Model): + """Contains the list of gallery applications that should be made available to the + VM/VMSS. + + :ivar gallery_applications: Specifies the gallery applications that should be made available to + the VM/VMSS. + :vartype gallery_applications: list[~azure.mgmt.computefleet.models.VMGalleryApplication] + """ + + _attribute_map = { + "gallery_applications": {"key": "galleryApplications", "type": "[VMGalleryApplication]"}, + } + + def __init__( + self, *, gallery_applications: Optional[List["_models.VMGalleryApplication"]] = None, **kwargs: Any + ) -> None: + """ + :keyword gallery_applications: Specifies the gallery applications that should be made available + to the VM/VMSS. + :paramtype gallery_applications: list[~azure.mgmt.computefleet.models.VMGalleryApplication] + """ + super().__init__(**kwargs) + self.gallery_applications = gallery_applications + + +class BasePriorityProfile(_serialization.Model): + """Contains common properties that are applicable to both Spot and Regular. + + :ivar capacity: Total capacity to achieve. It is currently in terms of number of VMs. + :vartype capacity: int + :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 + """ + + _validation = { + "capacity": {"minimum": 0}, + "min_capacity": {"minimum": 0}, + } + + _attribute_map = { + "capacity": {"key": "capacity", "type": "int"}, + "min_capacity": {"key": "minCapacity", "type": "int"}, + } + + def __init__(self, *, capacity: Optional[int] = None, min_capacity: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword capacity: Total capacity to achieve. It is currently in terms of number of VMs. + :paramtype capacity: int + :keyword 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. + :paramtype min_capacity: int + """ + super().__init__(**kwargs) + self.capacity = capacity + self.min_capacity = min_capacity + + +class BaseVirtualMachineProfile(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Describes the base virtual machine profile for fleet. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar os_profile: Specifies the operating system settings for the virtual machines in the scale + set. + :vartype os_profile: ~azure.mgmt.computefleet.models.VirtualMachineScaleSetOSProfile + :ivar storage_profile: Specifies the storage settings for the virtual machine disks. + :vartype storage_profile: ~azure.mgmt.computefleet.models.VirtualMachineScaleSetStorageProfile + :ivar network_profile: Specifies properties of the network interfaces of the virtual machines + in the + scale set. + :vartype network_profile: ~azure.mgmt.computefleet.models.VirtualMachineScaleSetNetworkProfile + :ivar security_profile: Specifies the Security related profile settings for the virtual + machines in the + scale set. + :vartype security_profile: ~azure.mgmt.computefleet.models.SecurityProfile + :ivar diagnostics_profile: Specifies the boot diagnostic settings state. + :vartype diagnostics_profile: ~azure.mgmt.computefleet.models.DiagnosticsProfile + :ivar extension_profile: Specifies a collection of settings for extensions installed on virtual + machines + in the scale set. + :vartype extension_profile: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetExtensionProfile + :ivar license_type: Specifies that the image or disk that is being used was licensed + on-premises. + :code:`
`:code:`
` Possible values for Windows Server operating system are: + :code:`
`:code:`
` + Windows_Client :code:`
`:code:`
` Windows_Server :code:`
`:code:`
` Possible + values for Linux + Server operating system are: :code:`
`:code:`
` RHEL_BYOS (for RHEL) + :code:`
`:code:`
` SLES_BYOS + (for SUSE) :code:`
`:code:`
` For more information, see `Azure Hybrid Use Benefit for + Windows + Server + `_ + :code:`
`:code:`
` `Azure Hybrid Use Benefit for Linux + Server `_ + :code:`
`:code:`
` Minimum api-version: 2015-06-15. + :vartype license_type: str + :ivar scheduled_events_profile: Specifies Scheduled Event related configurations. + :vartype scheduled_events_profile: ~azure.mgmt.computefleet.models.ScheduledEventsProfile + :ivar user_data: UserData for the virtual machines in the scale set, which must be base-64 + encoded. Customer should not pass any secrets in here. Minimum api-version: + 2021-03-01. + :vartype user_data: str + :ivar capacity_reservation: Specifies the capacity reservation related details of a scale set. + Minimum + api-version: 2021-04-01. + :vartype capacity_reservation: ~azure.mgmt.computefleet.models.CapacityReservationProfile + :ivar application_profile: Specifies the gallery applications that should be made available to + the VM/VMSS. + :vartype application_profile: ~azure.mgmt.computefleet.models.ApplicationProfile + :ivar hardware_profile: Specifies the hardware profile related details of a scale set. Minimum + api-version: 2021-11-01. + :vartype hardware_profile: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetHardwareProfile + :ivar service_artifact_reference: Specifies the service artifact reference id used to set same + image version for + all virtual machines in the scale set when using 'latest' image version. + Minimum api-version: 2022-11-01. + :vartype service_artifact_reference: ~azure.mgmt.computefleet.models.ServiceArtifactReference + :ivar security_posture_reference: Specifies the security posture to be used for all virtual + machines in the scale + set. Minimum api-version: 2023-03-01. + :vartype security_posture_reference: ~azure.mgmt.computefleet.models.SecurityPostureReference + :ivar time_created: Specifies the time in which this VM profile for the Virtual Machine Scale + Set + was created. Minimum API version for this property is 2023-09-01. This value + will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile + with minimum api-version 2023-09-01. Examples: "2024-07-01T00:00:01.1234567+00:00". + :vartype time_created: ~datetime.datetime + """ + + _validation = { + "time_created": {"readonly": True}, + } + + _attribute_map = { + "os_profile": {"key": "osProfile", "type": "VirtualMachineScaleSetOSProfile"}, + "storage_profile": {"key": "storageProfile", "type": "VirtualMachineScaleSetStorageProfile"}, + "network_profile": {"key": "networkProfile", "type": "VirtualMachineScaleSetNetworkProfile"}, + "security_profile": {"key": "securityProfile", "type": "SecurityProfile"}, + "diagnostics_profile": {"key": "diagnosticsProfile", "type": "DiagnosticsProfile"}, + "extension_profile": {"key": "extensionProfile", "type": "VirtualMachineScaleSetExtensionProfile"}, + "license_type": {"key": "licenseType", "type": "str"}, + "scheduled_events_profile": {"key": "scheduledEventsProfile", "type": "ScheduledEventsProfile"}, + "user_data": {"key": "userData", "type": "str"}, + "capacity_reservation": {"key": "capacityReservation", "type": "CapacityReservationProfile"}, + "application_profile": {"key": "applicationProfile", "type": "ApplicationProfile"}, + "hardware_profile": {"key": "hardwareProfile", "type": "VirtualMachineScaleSetHardwareProfile"}, + "service_artifact_reference": {"key": "serviceArtifactReference", "type": "ServiceArtifactReference"}, + "security_posture_reference": {"key": "securityPostureReference", "type": "SecurityPostureReference"}, + "time_created": {"key": "timeCreated", "type": "iso-8601"}, + } + + def __init__( + self, + *, + os_profile: Optional["_models.VirtualMachineScaleSetOSProfile"] = None, + storage_profile: Optional["_models.VirtualMachineScaleSetStorageProfile"] = None, + network_profile: Optional["_models.VirtualMachineScaleSetNetworkProfile"] = None, + security_profile: Optional["_models.SecurityProfile"] = None, + diagnostics_profile: Optional["_models.DiagnosticsProfile"] = None, + extension_profile: Optional["_models.VirtualMachineScaleSetExtensionProfile"] = None, + license_type: Optional[str] = None, + scheduled_events_profile: Optional["_models.ScheduledEventsProfile"] = None, + user_data: Optional[str] = None, + capacity_reservation: Optional["_models.CapacityReservationProfile"] = None, + application_profile: Optional["_models.ApplicationProfile"] = None, + hardware_profile: Optional["_models.VirtualMachineScaleSetHardwareProfile"] = None, + service_artifact_reference: Optional["_models.ServiceArtifactReference"] = None, + security_posture_reference: Optional["_models.SecurityPostureReference"] = None, + **kwargs: Any + ) -> None: + """ + :keyword os_profile: Specifies the operating system settings for the virtual machines in the + scale + set. + :paramtype os_profile: ~azure.mgmt.computefleet.models.VirtualMachineScaleSetOSProfile + :keyword storage_profile: Specifies the storage settings for the virtual machine disks. + :paramtype storage_profile: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetStorageProfile + :keyword network_profile: Specifies properties of the network interfaces of the virtual + machines in the + scale set. + :paramtype network_profile: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetNetworkProfile + :keyword security_profile: Specifies the Security related profile settings for the virtual + machines in the + scale set. + :paramtype security_profile: ~azure.mgmt.computefleet.models.SecurityProfile + :keyword diagnostics_profile: Specifies the boot diagnostic settings state. + :paramtype diagnostics_profile: ~azure.mgmt.computefleet.models.DiagnosticsProfile + :keyword extension_profile: Specifies a collection of settings for extensions installed on + virtual machines + in the scale set. + :paramtype extension_profile: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetExtensionProfile + :keyword license_type: Specifies that the image or disk that is being used was licensed + on-premises. + :code:`
`:code:`
` Possible values for Windows Server operating system are: + :code:`
`:code:`
` + Windows_Client :code:`
`:code:`
` Windows_Server :code:`
`:code:`
` Possible + values for Linux + Server operating system are: :code:`
`:code:`
` RHEL_BYOS (for RHEL) + :code:`
`:code:`
` SLES_BYOS + (for SUSE) :code:`
`:code:`
` For more information, see `Azure Hybrid Use Benefit for + Windows + Server + `_ + :code:`
`:code:`
` `Azure Hybrid Use Benefit for Linux + Server `_ + :code:`
`:code:`
` Minimum api-version: 2015-06-15. + :paramtype license_type: str + :keyword scheduled_events_profile: Specifies Scheduled Event related configurations. + :paramtype scheduled_events_profile: ~azure.mgmt.computefleet.models.ScheduledEventsProfile + :keyword user_data: UserData for the virtual machines in the scale set, which must be base-64 + encoded. Customer should not pass any secrets in here. Minimum api-version: + 2021-03-01. + :paramtype user_data: str + :keyword capacity_reservation: Specifies the capacity reservation related details of a scale + set. Minimum + api-version: 2021-04-01. + :paramtype capacity_reservation: ~azure.mgmt.computefleet.models.CapacityReservationProfile + :keyword application_profile: Specifies the gallery applications that should be made available + to the VM/VMSS. + :paramtype application_profile: ~azure.mgmt.computefleet.models.ApplicationProfile + :keyword hardware_profile: Specifies the hardware profile related details of a scale set. + Minimum + api-version: 2021-11-01. + :paramtype hardware_profile: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetHardwareProfile + :keyword service_artifact_reference: Specifies the service artifact reference id used to set + same image version for + all virtual machines in the scale set when using 'latest' image version. + Minimum api-version: 2022-11-01. + :paramtype service_artifact_reference: ~azure.mgmt.computefleet.models.ServiceArtifactReference + :keyword security_posture_reference: Specifies the security posture to be used for all virtual + machines in the scale + set. Minimum api-version: 2023-03-01. + :paramtype security_posture_reference: ~azure.mgmt.computefleet.models.SecurityPostureReference + """ + super().__init__(**kwargs) + self.os_profile = os_profile + self.storage_profile = storage_profile + self.network_profile = network_profile + self.security_profile = security_profile + self.diagnostics_profile = diagnostics_profile + self.extension_profile = extension_profile + self.license_type = license_type + self.scheduled_events_profile = scheduled_events_profile + self.user_data = user_data + self.capacity_reservation = capacity_reservation + self.application_profile = application_profile + self.hardware_profile = hardware_profile + self.service_artifact_reference = service_artifact_reference + self.security_posture_reference = security_posture_reference + self.time_created = None + + +class BootDiagnostics(_serialization.Model): + """Boot Diagnostics is a debugging feature which allows you to view Console Output + and Screenshot to diagnose VM status. You can easily view the output of your + console log. Azure also enables you to see a screenshot of the VM from the + hypervisor. + + :ivar enabled: Whether boot diagnostics should be enabled on the Virtual Machine. + :vartype enabled: bool + :ivar storage_uri: Uri of the storage account to use for placing the console output and + screenshot. If storageUri is not specified while enabling boot diagnostics, + managed storage will be used. + :vartype storage_uri: str + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "storage_uri": {"key": "storageUri", "type": "str"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, storage_uri: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether boot diagnostics should be enabled on the Virtual Machine. + :paramtype enabled: bool + :keyword storage_uri: Uri of the storage account to use for placing the console output and + screenshot. If storageUri is not specified while enabling boot diagnostics, + managed storage will be used. + :paramtype storage_uri: str + """ + super().__init__(**kwargs) + self.enabled = enabled + self.storage_uri = storage_uri + + +class CapacityReservationProfile(_serialization.Model): + """The parameters of a capacity reservation Profile. + + :ivar capacity_reservation_group: Specifies the capacity reservation group resource id that + should be used for + allocating the virtual machine or scaleset vm instances provided enough + capacity has been reserved. Please refer to https://aka.ms/CapacityReservation + for more details. + :vartype capacity_reservation_group: ~azure.mgmt.computefleet.models.SubResource + """ + + _attribute_map = { + "capacity_reservation_group": {"key": "capacityReservationGroup", "type": "SubResource"}, + } + + def __init__(self, *, capacity_reservation_group: Optional["_models.SubResource"] = None, **kwargs: Any) -> None: + """ + :keyword capacity_reservation_group: Specifies the capacity reservation group resource id that + should be used for + allocating the virtual machine or scaleset vm instances provided enough + capacity has been reserved. Please refer to https://aka.ms/CapacityReservation + for more details. + :paramtype capacity_reservation_group: ~azure.mgmt.computefleet.models.SubResource + """ + super().__init__(**kwargs) + self.capacity_reservation_group = capacity_reservation_group + + +class UserAssignedIdentity(_serialization.Model): + """User assigned identity properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + _validation = { + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ComponentsQjfoe3SchemasManagedserviceidentityupdatePropertiesUserassignedidentitiesAdditionalproperties( + UserAssignedIdentity +): # pylint: disable=name-too-long + """ComponentsQjfoe3SchemasManagedserviceidentityupdatePropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + +class ComputeProfile(_serialization.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 + "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile". # pylint: disable=line-too-long + Required. + :vartype base_virtual_machine_profile: + ~azure.mgmt.computefleet.models.BaseVirtualMachineProfile + :ivar compute_api_version: Specifies the Microsoft.Compute API version to use when creating + underlying Virtual Machine scale sets and Virtual Machines. + The default value will be the latest supported computeApiVersion by Compute Fleet. + :vartype compute_api_version: str + :ivar platform_fault_domain_count: Specifies the number of fault domains to use when creating + the underlying VMSS. + A fault domain is a logical group of hardware within an Azure datacenter. + VMs in the same fault domain share a common power source and network switch. + If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains + 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 + """ + + _validation = { + "base_virtual_machine_profile": {"required": True}, + } + + _attribute_map = { + "base_virtual_machine_profile": {"key": "baseVirtualMachineProfile", "type": "BaseVirtualMachineProfile"}, + "compute_api_version": {"key": "computeApiVersion", "type": "str"}, + "platform_fault_domain_count": {"key": "platformFaultDomainCount", "type": "int"}, + "additional_virtual_machine_capabilities": { + "key": "additionalVirtualMachineCapabilities", + "type": "AdditionalCapabilities", + }, + } + + def __init__( + self, + *, + 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, + **kwargs: Any + ) -> None: + """ + :keyword base_virtual_machine_profile: Base Virtual Machine Profile Properties to be specified + according to + "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile". # pylint: disable=line-too-long + Required. + :paramtype base_virtual_machine_profile: + ~azure.mgmt.computefleet.models.BaseVirtualMachineProfile + :keyword compute_api_version: Specifies the Microsoft.Compute API version to use when creating + underlying Virtual Machine scale sets and Virtual Machines. + The default value will be the latest supported computeApiVersion by Compute Fleet. + :paramtype compute_api_version: str + :keyword platform_fault_domain_count: Specifies the number of fault domains to use when + creating the underlying VMSS. + A fault domain is a logical group of hardware within an Azure datacenter. + VMs in the same fault domain share a common power source and network switch. + If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains + as possible). + This property cannot be updated. + :paramtype platform_fault_domain_count: int + :keyword 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. + :paramtype additional_virtual_machine_capabilities: + ~azure.mgmt.computefleet.models.AdditionalCapabilities + """ + super().__init__(**kwargs) + self.base_virtual_machine_profile = base_virtual_machine_profile + self.compute_api_version = compute_api_version + self.platform_fault_domain_count = platform_fault_domain_count + self.additional_virtual_machine_capabilities = additional_virtual_machine_capabilities + + +class DiagnosticsProfile(_serialization.Model): + """Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. + + :ivar boot_diagnostics: Boot Diagnostics is a debugging feature which allows you to view + Console Output + and Screenshot to diagnose VM status. **NOTE**\\ : If storageUri is being + specified then ensure that the storage account is in the same region and + subscription as the VM. You can easily view the output of your console log. + Azure also enables you to see a screenshot of the VM from the hypervisor. + :vartype boot_diagnostics: ~azure.mgmt.computefleet.models.BootDiagnostics + """ + + _attribute_map = { + "boot_diagnostics": {"key": "bootDiagnostics", "type": "BootDiagnostics"}, + } + + def __init__(self, *, boot_diagnostics: Optional["_models.BootDiagnostics"] = None, **kwargs: Any) -> None: + """ + :keyword boot_diagnostics: Boot Diagnostics is a debugging feature which allows you to view + Console Output + and Screenshot to diagnose VM status. **NOTE**\\ : If storageUri is being + specified then ensure that the storage account is in the same region and + subscription as the VM. You can easily view the output of your console log. + Azure also enables you to see a screenshot of the VM from the hypervisor. + :paramtype boot_diagnostics: ~azure.mgmt.computefleet.models.BootDiagnostics + """ + super().__init__(**kwargs) + self.boot_diagnostics = boot_diagnostics + + +class DiffDiskSettings(_serialization.Model): + """Describes the parameters of ephemeral disk settings that can be specified for + operating system disk. **Note:** The ephemeral disk settings can only be + specified for managed disk. + + :ivar option: Specifies the ephemeral disk settings for operating system disk. "Local" + :vartype option: str or ~azure.mgmt.computefleet.models.DiffDiskOptions + :ivar placement: Specifies the ephemeral disk placement for operating system disk. Possible + values are: **CacheDisk,** **ResourceDisk.** The defaulting behavior is: + **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** + is used. Refer to the VM size documentation for Windows VM at + https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM + sizes exposes a cache disk. Known values are: "CacheDisk", "ResourceDisk", and "NvmeDisk". + :vartype placement: str or ~azure.mgmt.computefleet.models.DiffDiskPlacement + """ + + _attribute_map = { + "option": {"key": "option", "type": "str"}, + "placement": {"key": "placement", "type": "str"}, + } + + def __init__( + self, + *, + option: Optional[Union[str, "_models.DiffDiskOptions"]] = None, + placement: Optional[Union[str, "_models.DiffDiskPlacement"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword option: Specifies the ephemeral disk settings for operating system disk. "Local" + :paramtype option: str or ~azure.mgmt.computefleet.models.DiffDiskOptions + :keyword placement: Specifies the ephemeral disk placement for operating system disk. Possible + values are: **CacheDisk,** **ResourceDisk.** The defaulting behavior is: + **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** + is used. Refer to the VM size documentation for Windows VM at + https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM + sizes exposes a cache disk. Known values are: "CacheDisk", "ResourceDisk", and "NvmeDisk". + :paramtype placement: str or ~azure.mgmt.computefleet.models.DiffDiskPlacement + """ + super().__init__(**kwargs) + self.option = option + self.placement = placement + + +class DiskEncryptionSetParameters(_serialization.Model): + """Describes the parameter of customer managed disk encryption set resource id + that can be specified for disk. **Note:** The disk encryption set resource id + can only be specified for managed disk. Please refer + https://aka.ms/mdssewithcmkoverview for more details. + + :ivar id: Resource Id. + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: Resource Id. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class EncryptionIdentity(_serialization.Model): + """Specifies the Managed Identity used by ADE to get access token for keyvault + operations. + + :ivar user_assigned_identity_resource_id: Specifies ARM Resource ID of one of the user + identities associated with the VM. + :vartype user_assigned_identity_resource_id: str + """ + + _attribute_map = { + "user_assigned_identity_resource_id": {"key": "userAssignedIdentityResourceId", "type": "str"}, + } + + def __init__(self, *, user_assigned_identity_resource_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword user_assigned_identity_resource_id: Specifies ARM Resource ID of one of the user + identities associated with the VM. + :paramtype user_assigned_identity_resource_id: str + """ + super().__init__(**kwargs) + self.user_assigned_identity_resource_id = user_assigned_identity_resource_id + + +class ErrorAdditionalInfo(_serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: JSON + """ + + _validation = { + "type": {"readonly": True}, + "info": {"readonly": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(_serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.computefleet.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.computefleet.models.ErrorAdditionalInfo] + """ + + _validation = { + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, + } + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(_serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). + + :ivar error: The error object. + :vartype error: ~azure.mgmt.computefleet.models.ErrorDetail + """ + + _attribute_map = { + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.computefleet.models.ErrorDetail + """ + super().__init__(**kwargs) + self.error = error + + +class Resource(_serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.computefleet.models.SystemData + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.computefleet.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + } + + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + """ + super().__init__(**kwargs) + self.tags = tags + self.location = location + + +class Fleet(TrackedResource): # pylint: disable=too-many-instance-attributes + """An Compute Fleet resource. + + 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. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.computefleet.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar zones: Zones in which the Compute Fleet is available. + :vartype zones: list[str] + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.computefleet.models.ManagedServiceIdentity + :ivar plan: Details of the resource plan. + :vartype plan: ~azure.mgmt.computefleet.models.Plan + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Creating", "Updating", "Deleting", and "Migrating". + :vartype provisioning_state: str or ~azure.mgmt.computefleet.models.ProvisioningState + :ivar spot_priority_profile: Configuration Options for Spot instances in Compute Fleet. + :vartype spot_priority_profile: ~azure.mgmt.computefleet.models.SpotPriorityProfile + :ivar regular_priority_profile: Configuration Options for Regular instances in Compute Fleet. + :vartype regular_priority_profile: ~azure.mgmt.computefleet.models.RegularPriorityProfile + :ivar vm_sizes_profile: List of VM sizes supported for Compute Fleet. + :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. + :vartype compute_profile: ~azure.mgmt.computefleet.models.ComputeProfile + :ivar time_created: Specifies the time at which the Compute Fleet is created. + :vartype time_created: ~datetime.datetime + :ivar unique_id: Specifies the ID which uniquely identifies a Compute Fleet. + :vartype unique_id: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "provisioning_state": {"readonly": True}, + "time_created": {"readonly": True}, + "unique_id": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "zones": {"key": "zones", "type": "[str]"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "plan": {"key": "plan", "type": "Plan"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "spot_priority_profile": {"key": "properties.spotPriorityProfile", "type": "SpotPriorityProfile"}, + "regular_priority_profile": {"key": "properties.regularPriorityProfile", "type": "RegularPriorityProfile"}, + "vm_sizes_profile": {"key": "properties.vmSizesProfile", "type": "[VmSizeProfile]"}, + "vm_attributes": {"key": "properties.vmAttributes", "type": "VMAttributes"}, + "additional_locations_profile": { + "key": "properties.additionalLocationsProfile", + "type": "AdditionalLocationsProfile", + }, + "compute_profile": {"key": "properties.computeProfile", "type": "ComputeProfile"}, + "time_created": {"key": "properties.timeCreated", "type": "iso-8601"}, + "unique_id": {"key": "properties.uniqueId", "type": "str"}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + zones: Optional[List[str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + plan: Optional["_models.Plan"] = None, + spot_priority_profile: Optional["_models.SpotPriorityProfile"] = None, + regular_priority_profile: Optional["_models.RegularPriorityProfile"] = None, + vm_sizes_profile: Optional[List["_models.VmSizeProfile"]] = None, + vm_attributes: Optional["_models.VMAttributes"] = None, + additional_locations_profile: Optional["_models.AdditionalLocationsProfile"] = None, + compute_profile: Optional["_models.ComputeProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword zones: Zones in which the Compute Fleet is available. + :paramtype zones: list[str] + :keyword identity: The managed service identities assigned to this resource. + :paramtype identity: ~azure.mgmt.computefleet.models.ManagedServiceIdentity + :keyword plan: Details of the resource plan. + :paramtype plan: ~azure.mgmt.computefleet.models.Plan + :keyword spot_priority_profile: Configuration Options for Spot instances in Compute Fleet. + :paramtype spot_priority_profile: ~azure.mgmt.computefleet.models.SpotPriorityProfile + :keyword regular_priority_profile: Configuration Options for Regular instances in Compute + Fleet. + :paramtype regular_priority_profile: ~azure.mgmt.computefleet.models.RegularPriorityProfile + :keyword vm_sizes_profile: List of VM sizes supported for Compute Fleet. + :paramtype vm_sizes_profile: list[~azure.mgmt.computefleet.models.VmSizeProfile] + :keyword vm_attributes: Attribute based Fleet. + :paramtype vm_attributes: ~azure.mgmt.computefleet.models.VMAttributes + :keyword additional_locations_profile: Represents the configuration for additional locations + where Fleet resources may be deployed. + :paramtype additional_locations_profile: + ~azure.mgmt.computefleet.models.AdditionalLocationsProfile + :keyword compute_profile: Compute Profile to use for running user's workloads. + :paramtype compute_profile: ~azure.mgmt.computefleet.models.ComputeProfile + """ + super().__init__(tags=tags, location=location, **kwargs) + self.zones = zones + self.identity = identity + self.plan = plan + self.provisioning_state = None + self.spot_priority_profile = spot_priority_profile + self.regular_priority_profile = regular_priority_profile + self.vm_sizes_profile = vm_sizes_profile + self.vm_attributes = vm_attributes + self.additional_locations_profile = additional_locations_profile + self.compute_profile = compute_profile + self.time_created = None + self.unique_id = None + + +class FleetListResult(_serialization.Model): + """The response of a Fleet list operation. + + All required parameters must be populated in order to send to server. + + :ivar value: The Fleet items on this page. Required. + :vartype value: list[~azure.mgmt.computefleet.models.Fleet] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Fleet]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.Fleet"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: The Fleet items on this page. Required. + :paramtype value: list[~azure.mgmt.computefleet.models.Fleet] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class FleetProperties(_serialization.Model): + """Details of the Compute Fleet. + + 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". + :vartype provisioning_state: str or ~azure.mgmt.computefleet.models.ProvisioningState + :ivar spot_priority_profile: Configuration Options for Spot instances in Compute Fleet. + :vartype spot_priority_profile: ~azure.mgmt.computefleet.models.SpotPriorityProfile + :ivar regular_priority_profile: Configuration Options for Regular instances in Compute Fleet. + :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. + :vartype time_created: ~datetime.datetime + :ivar unique_id: Specifies the ID which uniquely identifies a Compute Fleet. + :vartype unique_id: str + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "vm_sizes_profile": {"required": True}, + "compute_profile": {"required": True}, + "time_created": {"readonly": True}, + "unique_id": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "spot_priority_profile": {"key": "spotPriorityProfile", "type": "SpotPriorityProfile"}, + "regular_priority_profile": {"key": "regularPriorityProfile", "type": "RegularPriorityProfile"}, + "vm_sizes_profile": {"key": "vmSizesProfile", "type": "[VmSizeProfile]"}, + "vm_attributes": {"key": "vmAttributes", "type": "VMAttributes"}, + "additional_locations_profile": {"key": "additionalLocationsProfile", "type": "AdditionalLocationsProfile"}, + "compute_profile": {"key": "computeProfile", "type": "ComputeProfile"}, + "time_created": {"key": "timeCreated", "type": "iso-8601"}, + "unique_id": {"key": "uniqueId", "type": "str"}, + } + + def __init__( + self, + *, + vm_sizes_profile: List["_models.VmSizeProfile"], + 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, + **kwargs: Any + ) -> None: + """ + :keyword spot_priority_profile: Configuration Options for Spot instances in Compute Fleet. + :paramtype spot_priority_profile: ~azure.mgmt.computefleet.models.SpotPriorityProfile + :keyword regular_priority_profile: Configuration Options for Regular instances in Compute + Fleet. + :paramtype regular_priority_profile: ~azure.mgmt.computefleet.models.RegularPriorityProfile + :keyword vm_sizes_profile: List of VM sizes supported for Compute Fleet. Required. + :paramtype vm_sizes_profile: list[~azure.mgmt.computefleet.models.VmSizeProfile] + :keyword vm_attributes: Attribute based Fleet. + :paramtype vm_attributes: ~azure.mgmt.computefleet.models.VMAttributes + :keyword additional_locations_profile: Represents the configuration for additional locations + where Fleet resources may be deployed. + :paramtype additional_locations_profile: + ~azure.mgmt.computefleet.models.AdditionalLocationsProfile + :keyword compute_profile: Compute Profile to use for running user's workloads. Required. + :paramtype compute_profile: ~azure.mgmt.computefleet.models.ComputeProfile + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.spot_priority_profile = spot_priority_profile + self.regular_priority_profile = regular_priority_profile + self.vm_sizes_profile = vm_sizes_profile + self.vm_attributes = vm_attributes + self.additional_locations_profile = additional_locations_profile + self.compute_profile = compute_profile + self.time_created = None + self.unique_id = None + + +class FleetUpdate(_serialization.Model): + """Fleet Update Model. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: Updatable managed service identity. + :vartype identity: ~azure.mgmt.computefleet.models.ManagedServiceIdentityUpdate + :ivar plan: Updatable resource plan. + :vartype plan: ~azure.mgmt.computefleet.models.ResourcePlanUpdate + :ivar properties: RP-specific updatable properties. + :vartype properties: ~azure.mgmt.computefleet.models.FleetProperties + """ + + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentityUpdate"}, + "plan": {"key": "plan", "type": "ResourcePlanUpdate"}, + "properties": {"key": "properties", "type": "FleetProperties"}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentityUpdate"] = None, + plan: Optional["_models.ResourcePlanUpdate"] = None, + properties: Optional["_models.FleetProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: Updatable managed service identity. + :paramtype identity: ~azure.mgmt.computefleet.models.ManagedServiceIdentityUpdate + :keyword plan: Updatable resource plan. + :paramtype plan: ~azure.mgmt.computefleet.models.ResourcePlanUpdate + :keyword properties: RP-specific updatable properties. + :paramtype properties: ~azure.mgmt.computefleet.models.FleetProperties + """ + super().__init__(**kwargs) + self.tags = tags + self.identity = identity + self.plan = plan + self.properties = properties + + +class ImageReference(_serialization.Model): + """Specifies information about the image to use. You can specify information about + platform images, marketplace images, or virtual machine images. This element is + required when you want to use a platform image, marketplace image, or virtual + machine image, but is not used in other creation operations. NOTE: Image + reference publisher and offer can only be set when you create the scale set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar publisher: The image publisher. + :vartype publisher: str + :ivar offer: Specifies the offer of the platform image or marketplace image used to create + the virtual machine. + :vartype offer: str + :ivar sku: The image SKU. + :vartype sku: str + :ivar version: Specifies the version of the platform image or marketplace image used to create + the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest + version of an image available at deploy time. Even if you use 'latest', the VM + image will not automatically update after deploy time even if a new version + becomes available. Please do not use field 'version' for gallery image + deployment, gallery image should always use 'id' field for deployment, to use 'latest' + version of gallery image, just set + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' # pylint: disable=line-too-long + in the 'id' field without version input. + :vartype version: str + :ivar exact_version: Specifies in decimal numbers, the version of platform image or marketplace + image used to create the virtual machine. This readonly field differs from 'version', + only if the value specified in 'version' field is 'latest'. + :vartype exact_version: str + :ivar shared_gallery_image_id: Specified the shared gallery image unique id for vm deployment. + This can be + fetched from shared gallery image GET call. + :vartype shared_gallery_image_id: str + :ivar community_gallery_image_id: Specified the community gallery image unique id for vm + deployment. This can be + fetched from community gallery image GET call. + :vartype community_gallery_image_id: str + """ + + _validation = { + "exact_version": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "publisher": {"key": "publisher", "type": "str"}, + "offer": {"key": "offer", "type": "str"}, + "sku": {"key": "sku", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "exact_version": {"key": "exactVersion", "type": "str"}, + "shared_gallery_image_id": {"key": "sharedGalleryImageId", "type": "str"}, + "community_gallery_image_id": {"key": "communityGalleryImageId", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + publisher: Optional[str] = None, + offer: Optional[str] = None, + sku: Optional[str] = None, + version: Optional[str] = None, + shared_gallery_image_id: Optional[str] = None, + community_gallery_image_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Resource Id. + :paramtype id: str + :keyword publisher: The image publisher. + :paramtype publisher: str + :keyword offer: Specifies the offer of the platform image or marketplace image used to create + the virtual machine. + :paramtype offer: str + :keyword sku: The image SKU. + :paramtype sku: str + :keyword version: Specifies the version of the platform image or marketplace image used to + create + the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest + version of an image available at deploy time. Even if you use 'latest', the VM + image will not automatically update after deploy time even if a new version + becomes available. Please do not use field 'version' for gallery image + deployment, gallery image should always use 'id' field for deployment, to use 'latest' + version of gallery image, just set + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' # pylint: disable=line-too-long + in the 'id' field without version input. + :paramtype version: str + :keyword shared_gallery_image_id: Specified the shared gallery image unique id for vm + deployment. This can be + fetched from shared gallery image GET call. + :paramtype shared_gallery_image_id: str + :keyword community_gallery_image_id: Specified the community gallery image unique id for vm + deployment. This can be + fetched from community gallery image GET call. + :paramtype community_gallery_image_id: str + """ + super().__init__(**kwargs) + self.id = id + self.publisher = publisher + self.offer = offer + self.sku = sku + self.version = version + self.exact_version = None + self.shared_gallery_image_id = shared_gallery_image_id + self.community_gallery_image_id = community_gallery_image_id + + +class InnerError(_serialization.Model): + """Inner error details. + + :ivar exception_type: The exception type. + :vartype exception_type: str + :ivar error_detail: The internal error message or exception dump. + :vartype error_detail: str + """ + + _attribute_map = { + "exception_type": {"key": "exceptionType", "type": "str"}, + "error_detail": {"key": "errorDetail", "type": "str"}, + } + + def __init__( + self, *, exception_type: Optional[str] = None, error_detail: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword exception_type: The exception type. + :paramtype exception_type: str + :keyword error_detail: The internal error message or exception dump. + :paramtype error_detail: str + """ + super().__init__(**kwargs) + self.exception_type = exception_type + self.error_detail = error_detail + + +class KeyVaultSecretReference(_serialization.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 + :ivar source_vault: The relative URL of the Key Vault containing the secret. Required. + :vartype source_vault: ~azure.mgmt.computefleet.models.SubResource + """ + + _validation = { + "secret_url": {"required": True}, + "source_vault": {"required": True}, + } + + _attribute_map = { + "secret_url": {"key": "secretUrl", "type": "str"}, + "source_vault": {"key": "sourceVault", "type": "SubResource"}, + } + + def __init__(self, *, secret_url: str, source_vault: "_models.SubResource", **kwargs: Any) -> None: + """ + :keyword secret_url: The URL referencing a secret in a Key Vault. Required. + :paramtype secret_url: str + :keyword source_vault: The relative URL of the Key Vault containing the secret. Required. + :paramtype source_vault: ~azure.mgmt.computefleet.models.SubResource + """ + super().__init__(**kwargs) + self.secret_url = secret_url + self.source_vault = source_vault + + +class LinuxConfiguration(_serialization.Model): + """Specifies the Linux operating system settings on the virtual machine. For a + list of supported Linux distributions, see `Linux on Azure-Endorsed + Distributions `_. + + :ivar disable_password_authentication: Specifies whether password authentication should be + disabled. + :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_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_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_vm_agent_platform_updates: Indicates whether VMAgent Platform Updates is enabled + for the Linux virtual + machine. Default value is false. + :vartype enable_vm_agent_platform_updates: bool + """ + + _attribute_map = { + "disable_password_authentication": {"key": "disablePasswordAuthentication", "type": "bool"}, + "ssh": {"key": "ssh", "type": "SshConfiguration"}, + "provision_vm_agent": {"key": "provisionVMAgent", "type": "bool"}, + "patch_settings": {"key": "patchSettings", "type": "LinuxPatchSettings"}, + "enable_vm_agent_platform_updates": {"key": "enableVMAgentPlatformUpdates", "type": "bool"}, + } + + def __init__( + self, + *, + disable_password_authentication: Optional[bool] = None, + ssh: Optional["_models.SshConfiguration"] = None, + provision_vm_agent: Optional[bool] = None, + patch_settings: Optional["_models.LinuxPatchSettings"] = None, + enable_vm_agent_platform_updates: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword disable_password_authentication: Specifies whether password authentication should be + disabled. + :paramtype disable_password_authentication: bool + :keyword ssh: Specifies the ssh key configuration for a Linux OS. + :paramtype ssh: ~azure.mgmt.computefleet.models.SshConfiguration + :keyword 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. + :paramtype provision_vm_agent: bool + :keyword patch_settings: [Preview Feature] Specifies settings related to VM Guest Patching on + Linux. + :paramtype patch_settings: ~azure.mgmt.computefleet.models.LinuxPatchSettings + :keyword enable_vm_agent_platform_updates: Indicates whether VMAgent Platform Updates is + enabled for the Linux virtual + machine. Default value is false. + :paramtype enable_vm_agent_platform_updates: bool + """ + super().__init__(**kwargs) + self.disable_password_authentication = disable_password_authentication + self.ssh = ssh + self.provision_vm_agent = provision_vm_agent + self.patch_settings = patch_settings + self.enable_vm_agent_platform_updates = enable_vm_agent_platform_updates + + +class LinuxPatchSettings(_serialization.Model): + """Specifies settings related to VM Guest Patching on Linux. + + :ivar patch_mode: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + machines associated to virtual machine scale set with OrchestrationMode as + Flexible.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` + **ImageDefault** - The + virtual machine's default patching configuration is used. :code:`
`:code:`
` + **AutomaticByPlatform** - The virtual machine will be automatically updated by + the platform. The property provisionVMAgent must be true. Known values are: "ImageDefault" and + "AutomaticByPlatform". + :vartype patch_mode: str or ~azure.mgmt.computefleet.models.LinuxVMGuestPatchMode + :ivar assessment_mode: Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + machine.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` + **ImageDefault** - You + control the timing of patch assessments on a virtual machine. :code:`
`:code:`
` + **AutomaticByPlatform** - The platform will trigger periodic patch assessments. + The property provisionVMAgent must be true. Known values are: "ImageDefault" and + "AutomaticByPlatform". + :vartype assessment_mode: str or ~azure.mgmt.computefleet.models.LinuxPatchAssessmentMode + :ivar automatic_by_platform_settings: Specifies additional settings for patch mode + AutomaticByPlatform in VM Guest + Patching on Linux. + :vartype automatic_by_platform_settings: + ~azure.mgmt.computefleet.models.LinuxVMGuestPatchAutomaticByPlatformSettings + """ + + _attribute_map = { + "patch_mode": {"key": "patchMode", "type": "str"}, + "assessment_mode": {"key": "assessmentMode", "type": "str"}, + "automatic_by_platform_settings": { + "key": "automaticByPlatformSettings", + "type": "LinuxVMGuestPatchAutomaticByPlatformSettings", + }, + } + + def __init__( + self, + *, + patch_mode: Optional[Union[str, "_models.LinuxVMGuestPatchMode"]] = None, + assessment_mode: Optional[Union[str, "_models.LinuxPatchAssessmentMode"]] = None, + automatic_by_platform_settings: Optional["_models.LinuxVMGuestPatchAutomaticByPlatformSettings"] = None, + **kwargs: Any + ) -> None: + """ + :keyword patch_mode: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + machines associated to virtual machine scale set with OrchestrationMode as + Flexible.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` + **ImageDefault** - The + virtual machine's default patching configuration is used. :code:`
`:code:`
` + **AutomaticByPlatform** - The virtual machine will be automatically updated by + the platform. The property provisionVMAgent must be true. Known values are: "ImageDefault" and + "AutomaticByPlatform". + :paramtype patch_mode: str or ~azure.mgmt.computefleet.models.LinuxVMGuestPatchMode + :keyword assessment_mode: Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + machine.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` + **ImageDefault** - You + control the timing of patch assessments on a virtual machine. :code:`
`:code:`
` + **AutomaticByPlatform** - The platform will trigger periodic patch assessments. + The property provisionVMAgent must be true. Known values are: "ImageDefault" and + "AutomaticByPlatform". + :paramtype assessment_mode: str or ~azure.mgmt.computefleet.models.LinuxPatchAssessmentMode + :keyword automatic_by_platform_settings: Specifies additional settings for patch mode + AutomaticByPlatform in VM Guest + Patching on Linux. + :paramtype automatic_by_platform_settings: + ~azure.mgmt.computefleet.models.LinuxVMGuestPatchAutomaticByPlatformSettings + """ + super().__init__(**kwargs) + self.patch_mode = patch_mode + self.assessment_mode = assessment_mode + self.automatic_by_platform_settings = automatic_by_platform_settings + + +class LinuxVMGuestPatchAutomaticByPlatformSettings(_serialization.Model): # pylint: disable=name-too-long + """Specifies additional settings to be applied when patch mode AutomaticByPlatform + is selected in Linux patch settings. + + :ivar reboot_setting: Specifies the reboot setting for all AutomaticByPlatform patch + installation + operations. Known values are: "Unknown", "IfRequired", "Never", and "Always". + :vartype reboot_setting: str or + ~azure.mgmt.computefleet.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting + :ivar bypass_platform_safety_checks_on_user_schedule: Enables customer to schedule patching + without accidental upgrades. + :vartype bypass_platform_safety_checks_on_user_schedule: bool + """ + + _attribute_map = { + "reboot_setting": {"key": "rebootSetting", "type": "str"}, + "bypass_platform_safety_checks_on_user_schedule": { + "key": "bypassPlatformSafetyChecksOnUserSchedule", + "type": "bool", + }, + } + + def __init__( + self, + *, + reboot_setting: Optional[Union[str, "_models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting"]] = None, + bypass_platform_safety_checks_on_user_schedule: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword reboot_setting: Specifies the reboot setting for all AutomaticByPlatform patch + installation + operations. Known values are: "Unknown", "IfRequired", "Never", and "Always". + :paramtype reboot_setting: str or + ~azure.mgmt.computefleet.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting + :keyword bypass_platform_safety_checks_on_user_schedule: Enables customer to schedule patching + without accidental upgrades. + :paramtype bypass_platform_safety_checks_on_user_schedule: bool + """ + super().__init__(**kwargs) + self.reboot_setting = reboot_setting + self.bypass_platform_safety_checks_on_user_schedule = bypass_platform_safety_checks_on_user_schedule + + +class LocationProfile(_serialization.Model): + """Represents the profile for a single additional location in the Fleet. The location and the + (optional). + + All required parameters must be populated in order to send to server. + + :ivar location: The ARM location name of the additional region. Required. + :vartype location: str + :ivar virtual_machine_profile_override: Base Virtual Machine Profile Properties to be specified + according to + "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile". # pylint: disable=line-too-long + Required. + :vartype virtual_machine_profile_override: + ~azure.mgmt.computefleet.models.BaseVirtualMachineProfile + """ + + _validation = { + "location": {"required": True}, + "virtual_machine_profile_override": {"required": True}, + } + + _attribute_map = { + "location": {"key": "location", "type": "str"}, + "virtual_machine_profile_override": { + "key": "virtualMachineProfileOverride", + "type": "BaseVirtualMachineProfile", + }, + } + + def __init__( + self, *, location: str, virtual_machine_profile_override: "_models.BaseVirtualMachineProfile", **kwargs: Any + ) -> None: + """ + :keyword location: The ARM location name of the additional region. Required. + :paramtype location: str + :keyword virtual_machine_profile_override: Base Virtual Machine Profile Properties to be + specified according to + "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile". # pylint: disable=line-too-long + Required. + :paramtype virtual_machine_profile_override: + ~azure.mgmt.computefleet.models.BaseVirtualMachineProfile + """ + super().__init__(**kwargs) + self.location = location + self.virtual_machine_profile_override = virtual_machine_profile_override + + +class ManagedServiceIdentity(_serialization.Model): + """Managed service identity (system assigned and/or user assigned identities). + + 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. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: Type of managed service identity (where both SystemAssigned and UserAssigned types + are allowed). Required. Known values are: "None", "SystemAssigned", "UserAssigned", and + "SystemAssigned,UserAssigned". + :vartype type: str or ~azure.mgmt.computefleet.models.ManagedServiceIdentityType + :ivar user_assigned_identities: The set of user assigned identities associated with the + resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long + The dictionary values can be empty objects ({}) in requests. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.computefleet.models.UserAssignedIdentity] + """ + + _validation = { + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentity}"}, + } + + def __init__( + self, + *, + type: Union[str, "_models.ManagedServiceIdentityType"], + user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword type: Type of managed service identity (where both SystemAssigned and UserAssigned + types are allowed). Required. Known values are: "None", "SystemAssigned", "UserAssigned", and + "SystemAssigned,UserAssigned". + :paramtype type: str or ~azure.mgmt.computefleet.models.ManagedServiceIdentityType + :keyword user_assigned_identities: The set of user assigned identities associated with the + resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long + The dictionary values can be empty objects ({}) in requests. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.computefleet.models.UserAssignedIdentity] + """ + super().__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class ManagedServiceIdentityUpdate(_serialization.Model): + """The template for adding optional properties. + + :ivar type: The type of managed identity assigned to this resource. Known values are: "None", + "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: str or ~azure.mgmt.computefleet.models.ManagedServiceIdentityType + :ivar user_assigned_identities: The identities assigned to this resource by the user. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.computefleet.models.ComponentsQjfoe3SchemasManagedserviceidentityupdatePropertiesUserassignedidentitiesAdditionalproperties] # pylint: disable=line-too-long + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{ComponentsQjfoe3SchemasManagedserviceidentityupdatePropertiesUserassignedidentitiesAdditionalproperties}", + }, + } + + def __init__( + self, + *, + type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = None, + user_assigned_identities: Optional[ + Dict[ + str, + "_models.ComponentsQjfoe3SchemasManagedserviceidentityupdatePropertiesUserassignedidentitiesAdditionalproperties", + ] + ] = None, + **kwargs: Any + ) -> None: + """ + :keyword type: The type of managed identity assigned to this resource. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :paramtype type: str or ~azure.mgmt.computefleet.models.ManagedServiceIdentityType + :keyword user_assigned_identities: The identities assigned to this resource by the user. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.computefleet.models.ComponentsQjfoe3SchemasManagedserviceidentityupdatePropertiesUserassignedidentitiesAdditionalproperties] # pylint: disable=line-too-long + """ + super().__init__(**kwargs) + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class Operation(_serialization.Model): + """Details of a REST API operation, returned from the Resource Provider Operations API. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for ARM/control-plane operations. + :vartype is_data_action: bool + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.computefleet.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". + :vartype origin: str or ~azure.mgmt.computefleet.models.Origin + :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for + internal only APIs. "Internal" + :vartype action_type: str or ~azure.mgmt.computefleet.models.ActionType + """ + + _validation = { + "name": {"readonly": True}, + "is_data_action": {"readonly": True}, + "origin": {"readonly": True}, + "action_type": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, + "display": {"key": "display", "type": "OperationDisplay"}, + "origin": {"key": "origin", "type": "str"}, + "action_type": {"key": "actionType", "type": "str"}, + } + + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: + """ + :keyword display: Localized display information for this particular operation. + :paramtype display: ~azure.mgmt.computefleet.models.OperationDisplay + """ + super().__init__(**kwargs) + self.name = None + self.is_data_action = None + self.display = display + self.origin = None + self.action_type = None + + +class OperationDisplay(_serialization.Model): + """Localized display information for this particular operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str + """ + + _validation = { + "provider": {"readonly": True}, + "resource": {"readonly": True}, + "operation": {"readonly": True}, + "description": {"readonly": True}, + } + + _attribute_map = { + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationListResult(_serialization.Model): + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link + to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations supported by the resource provider. + :vartype value: list[~azure.mgmt.computefleet.models.Operation] + :ivar next_link: URL to get the next set of operation list results (if there are any). + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Operation]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class OSImageNotificationProfile(_serialization.Model): + """Specifies OS Image Scheduled Event related configurations. + + :ivar not_before_timeout: Length of time a Virtual Machine being reimaged or having its OS + upgraded will + have to potentially approve the OS Image Scheduled Event before the event is + auto approved (timed out). The configuration is specified in ISO 8601 format, + and the value must not exceed 15 minutes (PT15M). + :vartype not_before_timeout: str + :ivar enable: Specifies whether the OS Image Scheduled event is enabled or disabled. + :vartype enable: bool + """ + + _attribute_map = { + "not_before_timeout": {"key": "notBeforeTimeout", "type": "str"}, + "enable": {"key": "enable", "type": "bool"}, + } + + def __init__( + self, *, not_before_timeout: Optional[str] = None, enable: Optional[bool] = None, **kwargs: Any + ) -> None: + """ + :keyword not_before_timeout: Length of time a Virtual Machine being reimaged or having its OS + upgraded will + have to potentially approve the OS Image Scheduled Event before the event is + auto approved (timed out). The configuration is specified in ISO 8601 format, + and the value must not exceed 15 minutes (PT15M). + :paramtype not_before_timeout: str + :keyword enable: Specifies whether the OS Image Scheduled event is enabled or disabled. + :paramtype enable: bool + """ + super().__init__(**kwargs) + self.not_before_timeout = not_before_timeout + self.enable = enable + + +class PatchSettings(_serialization.Model): + """Specifies settings related to VM Guest Patching on Windows. + + :ivar patch_mode: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + machines associated to virtual machine scale set with OrchestrationMode as + Flexible.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` + **Manual** - You + control the application of patches to a virtual machine. You do this by + applying patches manually inside the VM. In this mode, automatic updates are + disabled; the property WindowsConfiguration.enableAutomaticUpdates must be + false:code:`
`:code:`
` **AutomaticByOS** - The virtual machine will automatically + be + updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates + must be true. :code:`
`:code:`
` **AutomaticByPlatform** - the virtual machine will + automatically updated by the platform. The properties provisionVMAgent and + WindowsConfiguration.enableAutomaticUpdates must be true. Known values are: "Manual", + "AutomaticByOS", and "AutomaticByPlatform". + :vartype patch_mode: str or ~azure.mgmt.computefleet.models.WindowsVMGuestPatchMode + :ivar enable_hotpatching: Enables customers to patch their Azure VMs without requiring a + reboot. For + enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' + must be set to 'AutomaticByPlatform'. + :vartype enable_hotpatching: bool + :ivar assessment_mode: Specifies the mode of VM Guest patch assessment for the IaaS virtual + machine.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` + **ImageDefault** - You + control the timing of patch assessments on a virtual machine.:code:`
`:code:`
` + **AutomaticByPlatform** - The platform will trigger periodic patch assessments. + The property provisionVMAgent must be true. Known values are: "ImageDefault" and + "AutomaticByPlatform". + :vartype assessment_mode: str or ~azure.mgmt.computefleet.models.WindowsPatchAssessmentMode + :ivar automatic_by_platform_settings: Specifies additional settings for patch mode + AutomaticByPlatform in VM Guest + Patching on Windows. + :vartype automatic_by_platform_settings: + ~azure.mgmt.computefleet.models.WindowsVMGuestPatchAutomaticByPlatformSettings + """ + + _attribute_map = { + "patch_mode": {"key": "patchMode", "type": "str"}, + "enable_hotpatching": {"key": "enableHotpatching", "type": "bool"}, + "assessment_mode": {"key": "assessmentMode", "type": "str"}, + "automatic_by_platform_settings": { + "key": "automaticByPlatformSettings", + "type": "WindowsVMGuestPatchAutomaticByPlatformSettings", + }, + } + + def __init__( + self, + *, + patch_mode: Optional[Union[str, "_models.WindowsVMGuestPatchMode"]] = None, + enable_hotpatching: Optional[bool] = None, + assessment_mode: Optional[Union[str, "_models.WindowsPatchAssessmentMode"]] = None, + automatic_by_platform_settings: Optional["_models.WindowsVMGuestPatchAutomaticByPlatformSettings"] = None, + **kwargs: Any + ) -> None: + """ + :keyword patch_mode: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + machines associated to virtual machine scale set with OrchestrationMode as + Flexible.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` + **Manual** - You + control the application of patches to a virtual machine. You do this by + applying patches manually inside the VM. In this mode, automatic updates are + disabled; the property WindowsConfiguration.enableAutomaticUpdates must be + false:code:`
`:code:`
` **AutomaticByOS** - The virtual machine will automatically + be + updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates + must be true. :code:`
`:code:`
` **AutomaticByPlatform** - the virtual machine will + automatically updated by the platform. The properties provisionVMAgent and + WindowsConfiguration.enableAutomaticUpdates must be true. Known values are: "Manual", + "AutomaticByOS", and "AutomaticByPlatform". + :paramtype patch_mode: str or ~azure.mgmt.computefleet.models.WindowsVMGuestPatchMode + :keyword enable_hotpatching: Enables customers to patch their Azure VMs without requiring a + reboot. For + enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' + must be set to 'AutomaticByPlatform'. + :paramtype enable_hotpatching: bool + :keyword assessment_mode: Specifies the mode of VM Guest patch assessment for the IaaS virtual + machine.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` + **ImageDefault** - You + control the timing of patch assessments on a virtual machine.:code:`
`:code:`
` + **AutomaticByPlatform** - The platform will trigger periodic patch assessments. + The property provisionVMAgent must be true. Known values are: "ImageDefault" and + "AutomaticByPlatform". + :paramtype assessment_mode: str or ~azure.mgmt.computefleet.models.WindowsPatchAssessmentMode + :keyword automatic_by_platform_settings: Specifies additional settings for patch mode + AutomaticByPlatform in VM Guest + Patching on Windows. + :paramtype automatic_by_platform_settings: + ~azure.mgmt.computefleet.models.WindowsVMGuestPatchAutomaticByPlatformSettings + """ + super().__init__(**kwargs) + self.patch_mode = patch_mode + self.enable_hotpatching = enable_hotpatching + self.assessment_mode = assessment_mode + self.automatic_by_platform_settings = automatic_by_platform_settings + + +class Plan(_serialization.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 + :ivar publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + Required. + :vartype publisher: str + :ivar product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to + the OfferID specified for the artifact at the time of Data Market onboarding. Required. + :vartype product: str + :ivar promotion_code: A publisher provided promotion code as provisioned in Data Market for the + said product/artifact. + :vartype promotion_code: str + :ivar version: The version of the desired product/artifact. + :vartype version: str + """ + + _validation = { + "name": {"required": True}, + "publisher": {"required": True}, + "product": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "publisher": {"key": "publisher", "type": "str"}, + "product": {"key": "product", "type": "str"}, + "promotion_code": {"key": "promotionCode", "type": "str"}, + "version": {"key": "version", "type": "str"}, + } + + def __init__( + self, + *, + name: str, + publisher: str, + product: str, + promotion_code: Optional[str] = None, + version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: A user defined name of the 3rd Party Artifact that is being procured. Required. + :paramtype name: str + :keyword publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. + NewRelic. Required. + :paramtype publisher: str + :keyword product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to + the OfferID specified for the artifact at the time of Data Market onboarding. Required. + :paramtype product: str + :keyword promotion_code: A publisher provided promotion code as provisioned in Data Market for + the said product/artifact. + :paramtype promotion_code: str + :keyword version: The version of the desired product/artifact. + :paramtype version: str + """ + super().__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code + self.version = version + + +class ProxyAgentSettings(_serialization.Model): + """Specifies ProxyAgent settings while creating the virtual machine. Minimum + api-version: 2023-09-01. + + :ivar enabled: Specifies whether ProxyAgent feature should be enabled on the virtual machine + or virtual machine scale set. + :vartype enabled: bool + :ivar mode: Specifies the mode that ProxyAgent will execute on if the feature is enabled. + ProxyAgent will start to audit or monitor but not enforce access control over + requests to host endpoints in Audit mode, while in Enforce mode it will enforce + access control. The default value is Enforce mode. Known values are: "Audit" and "Enforce". + :vartype mode: str or ~azure.mgmt.computefleet.models.Mode + :ivar key_incarnation_id: Increase the value of this property allows user to reset the key used + for + securing communication channel between guest and host. + :vartype key_incarnation_id: int + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "mode": {"key": "mode", "type": "str"}, + "key_incarnation_id": {"key": "keyIncarnationId", "type": "int"}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + mode: Optional[Union[str, "_models.Mode"]] = None, + key_incarnation_id: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Specifies whether ProxyAgent feature should be enabled on the virtual machine + or virtual machine scale set. + :paramtype enabled: bool + :keyword mode: Specifies the mode that ProxyAgent will execute on if the feature is enabled. + ProxyAgent will start to audit or monitor but not enforce access control over + requests to host endpoints in Audit mode, while in Enforce mode it will enforce + access control. The default value is Enforce mode. Known values are: "Audit" and "Enforce". + :paramtype mode: str or ~azure.mgmt.computefleet.models.Mode + :keyword key_incarnation_id: Increase the value of this property allows user to reset the key + used for + securing communication channel between guest and host. + :paramtype key_incarnation_id: int + """ + super().__init__(**kwargs) + self.enabled = enabled + self.mode = mode + self.key_incarnation_id = key_incarnation_id + + +class PublicIPAddressSku(_serialization.Model): + """Describes the public IP Sku. It can only be set with OrchestrationMode as + Flexible. + + :ivar name: Specify public IP sku name. Known values are: "Basic" and "Standard". + :vartype name: str or ~azure.mgmt.computefleet.models.PublicIPAddressSkuName + :ivar tier: Specify public IP sku tier. Known values are: "Regional", "Global", and "Global". + :vartype tier: str or ~azure.mgmt.computefleet.models.PublicIPAddressSkuTier + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "_models.PublicIPAddressSkuName"]] = None, + tier: Optional[Union[str, "_models.PublicIPAddressSkuTier"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Specify public IP sku name. Known values are: "Basic" and "Standard". + :paramtype name: str or ~azure.mgmt.computefleet.models.PublicIPAddressSkuName + :keyword tier: Specify public IP sku tier. Known values are: "Regional", "Global", and + "Global". + :paramtype tier: str or ~azure.mgmt.computefleet.models.PublicIPAddressSkuTier + """ + super().__init__(**kwargs) + self.name = name + self.tier = tier + + +class RegularPriorityProfile(_serialization.Model): + """Configuration Options for Regular instances in Compute Fleet. + + :ivar capacity: Total capacity to achieve. It is currently in terms of number of VMs. + :vartype capacity: int + :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 allocation_strategy: Allocation strategy to follow when determining the VM sizes + distribution for Regular VMs. Known values are: "LowestPrice" and "Prioritized". + :vartype allocation_strategy: str or + ~azure.mgmt.computefleet.models.RegularPriorityAllocationStrategy + """ + + _validation = { + "capacity": {"minimum": 0}, + "min_capacity": {"minimum": 0}, + } + + _attribute_map = { + "capacity": {"key": "capacity", "type": "int"}, + "min_capacity": {"key": "minCapacity", "type": "int"}, + "allocation_strategy": {"key": "allocationStrategy", "type": "str"}, + } + + def __init__( + self, + *, + capacity: Optional[int] = None, + min_capacity: Optional[int] = None, + allocation_strategy: Optional[Union[str, "_models.RegularPriorityAllocationStrategy"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword capacity: Total capacity to achieve. It is currently in terms of number of VMs. + :paramtype capacity: int + :keyword 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. + :paramtype min_capacity: int + :keyword allocation_strategy: Allocation strategy to follow when determining the VM sizes + distribution for Regular VMs. Known values are: "LowestPrice" and "Prioritized". + :paramtype allocation_strategy: str or + ~azure.mgmt.computefleet.models.RegularPriorityAllocationStrategy + """ + super().__init__(**kwargs) + self.capacity = capacity + self.min_capacity = min_capacity + self.allocation_strategy = allocation_strategy + + +class ResourcePlanUpdate(_serialization.Model): + """The template for adding optional properties. + + :ivar name: A user defined name of the 3rd Party Artifact that is being procured. + :vartype name: str + :ivar publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + :vartype publisher: str + :ivar product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to + the OfferID specified for the artifact at the time of Data Market onboarding. + :vartype product: str + :ivar promotion_code: A publisher provided promotion code as provisioned in Data Market for the + said product/artifact. + :vartype promotion_code: str + :ivar version: The version of the desired product/artifact. + :vartype version: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "publisher": {"key": "publisher", "type": "str"}, + "product": {"key": "product", "type": "str"}, + "promotion_code": {"key": "promotionCode", "type": "str"}, + "version": {"key": "version", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + publisher: Optional[str] = None, + product: Optional[str] = None, + promotion_code: Optional[str] = None, + version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: A user defined name of the 3rd Party Artifact that is being procured. + :paramtype name: str + :keyword publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. + NewRelic. + :paramtype publisher: str + :keyword product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to + the OfferID specified for the artifact at the time of Data Market onboarding. + :paramtype product: str + :keyword promotion_code: A publisher provided promotion code as provisioned in Data Market for + the said product/artifact. + :paramtype promotion_code: str + :keyword version: The version of the desired product/artifact. + :paramtype version: str + """ + super().__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code + self.version = version + + +class ScheduledEventsProfile(_serialization.Model): + """Specifies Scheduled Event related configurations. + + :ivar terminate_notification_profile: Specifies Terminate Scheduled Event related + configurations. + :vartype terminate_notification_profile: + ~azure.mgmt.computefleet.models.TerminateNotificationProfile + :ivar os_image_notification_profile: Specifies OS Image Scheduled Event related configurations. + :vartype os_image_notification_profile: + ~azure.mgmt.computefleet.models.OSImageNotificationProfile + """ + + _attribute_map = { + "terminate_notification_profile": { + "key": "terminateNotificationProfile", + "type": "TerminateNotificationProfile", + }, + "os_image_notification_profile": {"key": "osImageNotificationProfile", "type": "OSImageNotificationProfile"}, + } + + def __init__( + self, + *, + terminate_notification_profile: Optional["_models.TerminateNotificationProfile"] = None, + os_image_notification_profile: Optional["_models.OSImageNotificationProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword terminate_notification_profile: Specifies Terminate Scheduled Event related + configurations. + :paramtype terminate_notification_profile: + ~azure.mgmt.computefleet.models.TerminateNotificationProfile + :keyword os_image_notification_profile: Specifies OS Image Scheduled Event related + configurations. + :paramtype os_image_notification_profile: + ~azure.mgmt.computefleet.models.OSImageNotificationProfile + """ + super().__init__(**kwargs) + self.terminate_notification_profile = terminate_notification_profile + self.os_image_notification_profile = os_image_notification_profile + + +class SecurityPostureReference(_serialization.Model): + """Specifies the security posture to be used for all virtual machines in the scale + set. Minimum api-version: 2023-03-01. + + :ivar id: The security posture reference id in the form of + /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest. # pylint: disable=line-too-long + :vartype id: str + :ivar exclude_extensions: List of virtual machine extension names to exclude when applying the + security + posture. + :vartype exclude_extensions: list[str] + :ivar is_overridable: Whether the security posture can be overridden by the user. + :vartype is_overridable: bool + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "exclude_extensions": {"key": "excludeExtensions", "type": "[str]"}, + "is_overridable": {"key": "isOverridable", "type": "bool"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + exclude_extensions: Optional[List[str]] = None, + is_overridable: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: The security posture reference id in the form of + /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest. # pylint: disable=line-too-long + :paramtype id: str + :keyword exclude_extensions: List of virtual machine extension names to exclude when applying + the security + posture. + :paramtype exclude_extensions: list[str] + :keyword is_overridable: Whether the security posture can be overridden by the user. + :paramtype is_overridable: bool + """ + super().__init__(**kwargs) + self.id = id + self.exclude_extensions = exclude_extensions + self.is_overridable = is_overridable + + +class SecurityProfile(_serialization.Model): + """Specifies the Security profile settings for the virtual machine or virtual + machine scale set. + + :ivar uefi_settings: Specifies the security settings like secure boot and vTPM used while + creating + the virtual machine. Minimum api-version: 2020-12-01. + :vartype uefi_settings: ~azure.mgmt.computefleet.models.UefiSettings + :ivar encryption_at_host: This property can be used by user in the request to enable or disable + the Host + Encryption for the virtual machine or virtual machine scale set. This will + enable the encryption for all the disks including Resource/Temp disk at host + itself. The default behavior is: The Encryption at host will be disabled unless + this property is set to true for the resource. + :vartype encryption_at_host: bool + :ivar security_type: Specifies the SecurityType of the virtual machine. It has to be set to any + specified value to enable UefiSettings. The default behavior is: UefiSettings + will not be enabled unless this property is set. Known values are: "TrustedLaunch" and + "ConfidentialVM". + :vartype security_type: str or ~azure.mgmt.computefleet.models.SecurityTypes + :ivar encryption_identity: Specifies the Managed Identity used by ADE to get access token for + keyvault + operations. + :vartype encryption_identity: ~azure.mgmt.computefleet.models.EncryptionIdentity + :ivar proxy_agent_settings: Specifies ProxyAgent settings while creating the virtual machine. + Minimum + api-version: 2023-09-01. + :vartype proxy_agent_settings: ~azure.mgmt.computefleet.models.ProxyAgentSettings + """ + + _attribute_map = { + "uefi_settings": {"key": "uefiSettings", "type": "UefiSettings"}, + "encryption_at_host": {"key": "encryptionAtHost", "type": "bool"}, + "security_type": {"key": "securityType", "type": "str"}, + "encryption_identity": {"key": "encryptionIdentity", "type": "EncryptionIdentity"}, + "proxy_agent_settings": {"key": "proxyAgentSettings", "type": "ProxyAgentSettings"}, + } + + def __init__( + self, + *, + uefi_settings: Optional["_models.UefiSettings"] = None, + encryption_at_host: Optional[bool] = None, + security_type: Optional[Union[str, "_models.SecurityTypes"]] = None, + encryption_identity: Optional["_models.EncryptionIdentity"] = None, + proxy_agent_settings: Optional["_models.ProxyAgentSettings"] = None, + **kwargs: Any + ) -> None: + """ + :keyword uefi_settings: Specifies the security settings like secure boot and vTPM used while + creating + the virtual machine. Minimum api-version: 2020-12-01. + :paramtype uefi_settings: ~azure.mgmt.computefleet.models.UefiSettings + :keyword encryption_at_host: This property can be used by user in the request to enable or + disable the Host + Encryption for the virtual machine or virtual machine scale set. This will + enable the encryption for all the disks including Resource/Temp disk at host + itself. The default behavior is: The Encryption at host will be disabled unless + this property is set to true for the resource. + :paramtype encryption_at_host: bool + :keyword security_type: Specifies the SecurityType of the virtual machine. It has to be set to + any + specified value to enable UefiSettings. The default behavior is: UefiSettings + will not be enabled unless this property is set. Known values are: "TrustedLaunch" and + "ConfidentialVM". + :paramtype security_type: str or ~azure.mgmt.computefleet.models.SecurityTypes + :keyword encryption_identity: Specifies the Managed Identity used by ADE to get access token + for keyvault + operations. + :paramtype encryption_identity: ~azure.mgmt.computefleet.models.EncryptionIdentity + :keyword proxy_agent_settings: Specifies ProxyAgent settings while creating the virtual + machine. Minimum + api-version: 2023-09-01. + :paramtype proxy_agent_settings: ~azure.mgmt.computefleet.models.ProxyAgentSettings + """ + super().__init__(**kwargs) + self.uefi_settings = uefi_settings + self.encryption_at_host = encryption_at_host + self.security_type = security_type + self.encryption_identity = encryption_identity + self.proxy_agent_settings = proxy_agent_settings + + +class ServiceArtifactReference(_serialization.Model): + """Specifies the service artifact reference id used to set same image version for + all virtual machines in the scale set when using 'latest' image version. + Minimum api-version: 2022-11-01. + + :ivar id: The service artifact reference id in the form of + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. # pylint: disable=line-too-long + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: The service artifact reference id in the form of + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. # pylint: disable=line-too-long + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class SpotPriorityProfile(_serialization.Model): + """Configuration Options for Spot instances in Compute Fleet. + + :ivar capacity: Total capacity to achieve. It is currently in terms of number of VMs. + :vartype capacity: int + :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_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 + :ivar allocation_strategy: Allocation strategy to follow when determining the VM sizes + distribution for Spot VMs. Known values are: "PriceCapacityOptimized", "LowestPrice", and + "CapacityOptimized". + :vartype allocation_strategy: str or ~azure.mgmt.computefleet.models.SpotAllocationStrategy + :ivar maintain: Flag to enable/disable continuous goal seeking for the desired capacity and + restoration of evicted Spot VMs. + If maintain is enabled, AzureFleetRP will use all VM sizes in vmSizesProfile to create new VMs + (if VMs are evicted deleted) + or update existing VMs with new VM sizes (if VMs are evicted deallocated or failed to allocate + due to capacity constraint) in order to achieve the desired capacity. + Maintain is enabled by default. + :vartype maintain: bool + """ + + _validation = { + "capacity": {"minimum": 0}, + "min_capacity": {"minimum": 0}, + } + + _attribute_map = { + "capacity": {"key": "capacity", "type": "int"}, + "min_capacity": {"key": "minCapacity", "type": "int"}, + "max_price_per_vm": {"key": "maxPricePerVM", "type": "float"}, + "eviction_policy": {"key": "evictionPolicy", "type": "str"}, + "allocation_strategy": {"key": "allocationStrategy", "type": "str"}, + "maintain": {"key": "maintain", "type": "bool"}, + } + + def __init__( + self, + *, + capacity: Optional[int] = None, + min_capacity: Optional[int] = 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, + **kwargs: Any + ) -> None: + """ + :keyword capacity: Total capacity to achieve. It is currently in terms of number of VMs. + :paramtype capacity: int + :keyword 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. + :paramtype min_capacity: int + :keyword max_price_per_vm: Price per hour of each Spot VM will never exceed this. + :paramtype max_price_per_vm: float + :keyword eviction_policy: Eviction Policy to follow when evicting Spot VMs. Known values are: + "Delete" and "Deallocate". + :paramtype eviction_policy: str or ~azure.mgmt.computefleet.models.EvictionPolicy + :keyword allocation_strategy: Allocation strategy to follow when determining the VM sizes + distribution for Spot VMs. Known values are: "PriceCapacityOptimized", "LowestPrice", and + "CapacityOptimized". + :paramtype allocation_strategy: str or ~azure.mgmt.computefleet.models.SpotAllocationStrategy + :keyword maintain: Flag to enable/disable continuous goal seeking for the desired capacity and + restoration of evicted Spot VMs. + If maintain is enabled, AzureFleetRP will use all VM sizes in vmSizesProfile to create new VMs + (if VMs are evicted deleted) + or update existing VMs with new VM sizes (if VMs are evicted deallocated or failed to allocate + due to capacity constraint) in order to achieve the desired capacity. + Maintain is enabled by default. + :paramtype maintain: bool + """ + super().__init__(**kwargs) + self.capacity = capacity + self.min_capacity = min_capacity + self.max_price_per_vm = max_price_per_vm + self.eviction_policy = eviction_policy + self.allocation_strategy = allocation_strategy + self.maintain = maintain + + +class SshConfiguration(_serialization.Model): + """SSH configuration for Linux based VMs running on Azure. + + :ivar public_keys: The list of SSH public keys used to authenticate with linux based VMs. + :vartype public_keys: list[~azure.mgmt.computefleet.models.SshPublicKey] + """ + + _attribute_map = { + "public_keys": {"key": "publicKeys", "type": "[SshPublicKey]"}, + } + + def __init__(self, *, public_keys: Optional[List["_models.SshPublicKey"]] = None, **kwargs: Any) -> None: + """ + :keyword public_keys: The list of SSH public keys used to authenticate with linux based VMs. + :paramtype public_keys: list[~azure.mgmt.computefleet.models.SshPublicKey] + """ + super().__init__(**kwargs) + self.public_keys = public_keys + + +class SshPublicKey(_serialization.Model): + """Contains information about SSH certificate public key and the path on the Linux + VM where the public key is placed. + + :ivar path: Specifies the full path on the created VM where ssh public key is stored. If + the file already exists, the specified key is appended to the file. Example: + /home/user/.ssh/authorized_keys. + :vartype path: str + :ivar key_data: SSH public key certificate used to authenticate with the VM through ssh. The + key needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, + see [Create SSH keys on Linux and Mac for Linux VMs in + Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + :vartype key_data: str + """ + + _attribute_map = { + "path": {"key": "path", "type": "str"}, + "key_data": {"key": "keyData", "type": "str"}, + } + + def __init__(self, *, path: Optional[str] = None, key_data: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword path: Specifies the full path on the created VM where ssh public key is stored. If + the file already exists, the specified key is appended to the file. Example: + /home/user/.ssh/authorized_keys. + :paramtype path: str + :keyword key_data: SSH public key certificate used to authenticate with the VM through ssh. The + key needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, + see [Create SSH keys on Linux and Mac for Linux VMs in + Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + :paramtype key_data: str + """ + super().__init__(**kwargs) + self.path = path + self.key_data = key_data + + +class SubResource(_serialization.Model): + """Describes SubResource. + + :ivar id: Resource Id. + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: Resource Id. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class SubResourceReadOnly(_serialization.Model): + """Describes a Readonly subresource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + """ + + _validation = { + "id": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + + +class SystemData(_serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.computefleet.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.computefleet.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :paramtype created_by_type: str or ~azure.mgmt.computefleet.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Known + values are: "User", "Application", "ManagedIdentity", and "Key". + :paramtype last_modified_by_type: str or ~azure.mgmt.computefleet.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super().__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TerminateNotificationProfile(_serialization.Model): + """Specifies Terminate Scheduled Event related configurations. + + :ivar not_before_timeout: Configurable length of time a Virtual Machine being deleted will have + to + potentially approve the Terminate Scheduled Event before the event is auto + approved (timed out). The configuration must be specified in ISO 8601 format, + the default value is 5 minutes (PT5M). + :vartype not_before_timeout: str + :ivar enable: Specifies whether the Terminate Scheduled event is enabled or disabled. + :vartype enable: bool + """ + + _attribute_map = { + "not_before_timeout": {"key": "notBeforeTimeout", "type": "str"}, + "enable": {"key": "enable", "type": "bool"}, + } + + def __init__( + self, *, not_before_timeout: Optional[str] = None, enable: Optional[bool] = None, **kwargs: Any + ) -> None: + """ + :keyword not_before_timeout: Configurable length of time a Virtual Machine being deleted will + have to + potentially approve the Terminate Scheduled Event before the event is auto + approved (timed out). The configuration must be specified in ISO 8601 format, + the default value is 5 minutes (PT5M). + :paramtype not_before_timeout: str + :keyword enable: Specifies whether the Terminate Scheduled event is enabled or disabled. + :paramtype enable: bool + """ + super().__init__(**kwargs) + self.not_before_timeout = not_before_timeout + self.enable = enable + + +class UefiSettings(_serialization.Model): + """Specifies the security settings like secure boot and vTPM used while creating + the virtual machine. Minimum api-version: 2020-12-01. + + :ivar secure_boot_enabled: Specifies whether secure boot should be enabled on the virtual + machine. Minimum + api-version: 2020-12-01. + :vartype secure_boot_enabled: bool + :ivar v_tpm_enabled: Specifies whether vTPM should be enabled on the virtual machine. Minimum + api-version: 2020-12-01. + :vartype v_tpm_enabled: bool + """ + + _attribute_map = { + "secure_boot_enabled": {"key": "secureBootEnabled", "type": "bool"}, + "v_tpm_enabled": {"key": "vTpmEnabled", "type": "bool"}, + } + + def __init__( + self, *, secure_boot_enabled: Optional[bool] = None, v_tpm_enabled: Optional[bool] = None, **kwargs: Any + ) -> None: + """ + :keyword secure_boot_enabled: Specifies whether secure boot should be enabled on the virtual + machine. Minimum + api-version: 2020-12-01. + :paramtype secure_boot_enabled: bool + :keyword v_tpm_enabled: Specifies whether vTPM should be enabled on the virtual machine. + Minimum + api-version: 2020-12-01. + :paramtype v_tpm_enabled: bool + """ + super().__init__(**kwargs) + self.secure_boot_enabled = secure_boot_enabled + self.v_tpm_enabled = v_tpm_enabled + + +class VaultCertificate(_serialization.Model): + """Describes a single certificate reference in a Key Vault, and where the + certificate should reside on the VM. + + :ivar certificate_url: This is the URL of a certificate that has been uploaded to Key Vault as + a + secret. For adding a secret to the Key Vault, see `Add a key or secret to the + key + vault `_. + In this case, your certificate needs to be It is the Base64 encoding of the + following JSON Object which is encoded in UTF-8: :code:`
`:code:`
` {:code:`
` + "data":":code:``",:code:`
` "dataType":"pfx",:code:`
` + "password":":code:``":code:`
`} :code:`
` To install certificates on + a virtual + machine it is recommended to use the `Azure Key Vault virtual machine extension + for + Linux `_ + or the `Azure Key Vault virtual machine extension for + Windows `_. + :vartype certificate_url: str + :ivar certificate_store: For Windows VMs, specifies the certificate store on the Virtual + Machine to + which the certificate should be added. The specified certificate store is + implicitly in the LocalMachine account. For Linux VMs, the certificate file is + placed under the /var/lib/waagent directory, with the file name + <UppercaseThumbprint>.crt for the X509 certificate file and + <UppercaseThumbprint>.prv for private key. Both of these files are .pem + formatted. + :vartype certificate_store: str + """ + + _attribute_map = { + "certificate_url": {"key": "certificateUrl", "type": "str"}, + "certificate_store": {"key": "certificateStore", "type": "str"}, + } + + def __init__( + self, *, certificate_url: Optional[str] = None, certificate_store: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword certificate_url: This is the URL of a certificate that has been uploaded to Key Vault + as a + secret. For adding a secret to the Key Vault, see `Add a key or secret to the + key + vault `_. + In this case, your certificate needs to be It is the Base64 encoding of the + following JSON Object which is encoded in UTF-8: :code:`
`:code:`
` {:code:`
` + "data":":code:``",:code:`
` "dataType":"pfx",:code:`
` + "password":":code:``":code:`
`} :code:`
` To install certificates on + a virtual + machine it is recommended to use the `Azure Key Vault virtual machine extension + for + Linux `_ + or the `Azure Key Vault virtual machine extension for + Windows `_. + :paramtype certificate_url: str + :keyword certificate_store: For Windows VMs, specifies the certificate store on the Virtual + Machine to + which the certificate should be added. The specified certificate store is + implicitly in the LocalMachine account. For Linux VMs, the certificate file is + placed under the /var/lib/waagent directory, with the file name + <UppercaseThumbprint>.crt for the X509 certificate file and + <UppercaseThumbprint>.prv for private key. Both of these files are .pem + formatted. + :paramtype certificate_store: str + """ + super().__init__(**kwargs) + self.certificate_url = certificate_url + self.certificate_store = certificate_store + + +class VaultSecretGroup(_serialization.Model): + """Describes a set of certificates which are all in the same Key Vault. + + :ivar source_vault: The relative URL of the Key Vault containing all of the certificates in + VaultCertificates. + :vartype source_vault: ~azure.mgmt.computefleet.models.SubResource + :ivar vault_certificates: The list of key vault references in SourceVault which contain + certificates. + :vartype vault_certificates: list[~azure.mgmt.computefleet.models.VaultCertificate] + """ + + _attribute_map = { + "source_vault": {"key": "sourceVault", "type": "SubResource"}, + "vault_certificates": {"key": "vaultCertificates", "type": "[VaultCertificate]"}, + } + + def __init__( + self, + *, + source_vault: Optional["_models.SubResource"] = None, + vault_certificates: Optional[List["_models.VaultCertificate"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword source_vault: The relative URL of the Key Vault containing all of the certificates in + VaultCertificates. + :paramtype source_vault: ~azure.mgmt.computefleet.models.SubResource + :keyword vault_certificates: The list of key vault references in SourceVault which contain + certificates. + :paramtype vault_certificates: list[~azure.mgmt.computefleet.models.VaultCertificate] + """ + super().__init__(**kwargs) + self.source_vault = source_vault + self.vault_certificates = vault_certificates + + +class VirtualHardDisk(_serialization.Model): + """Describes the uri of a disk. + + :ivar uri: Specifies the virtual hard disk's uri. + :vartype uri: str + """ + + _attribute_map = { + "uri": {"key": "uri", "type": "str"}, + } + + def __init__(self, *, uri: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword uri: Specifies the virtual hard disk's uri. + :paramtype uri: str + """ + super().__init__(**kwargs) + self.uri = uri + + +class VirtualMachineScaleSet(_serialization.Model): + """An AzureFleet's virtualMachineScaleSet. + + 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 name: The name of the virtualMachineScaleSet. Required. + :vartype name: str + :ivar id: The compute RP resource id of the virtualMachineScaleSet + "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}". + Required. + :vartype id: str + :ivar type: Type of the virtualMachineScaleSet. + :vartype type: str + :ivar operation_status: This represents the operationStatus of the VMSS in response to the last + operation that was performed on it by Azure Fleet resource. Required. Known values are: + "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting", and "Migrating". + :vartype operation_status: str or ~azure.mgmt.computefleet.models.ProvisioningState + :ivar error: Error Information when ``operationStatus`` is ``Failed``. + :vartype error: ~azure.mgmt.computefleet.models.ApiError + """ + + _validation = { + "name": {"required": True, "readonly": True}, + "id": {"required": True, "readonly": True}, + "type": {"readonly": True}, + "operation_status": {"required": True, "readonly": True}, + "error": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "operation_status": {"key": "operationStatus", "type": "str"}, + "error": {"key": "error", "type": "ApiError"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.operation_status = None + self.error = None + + +class VirtualMachineScaleSetDataDisk(_serialization.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 + :ivar lun: Specifies the logical unit number of the data disk. This value is used to + identify data disks within the VM and therefore must be unique for each data + disk attached to a VM. Required. + :vartype lun: int + :ivar caching: Specifies the caching requirements. Possible values are: **None,** + **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + storage. ReadOnly for Premium storage.**. Known values are: "None", "ReadOnly", and + "ReadWrite". + :vartype caching: str or ~azure.mgmt.computefleet.models.CachingTypes + :ivar write_accelerator_enabled: Specifies whether writeAccelerator should be enabled or + disabled on the disk. + :vartype write_accelerator_enabled: bool + :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_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_gb: int + :ivar managed_disk: The managed disk parameters. + :vartype managed_disk: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetManagedDiskParameters + :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_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 + would be assigned based on diskSizeGB. + :vartype disk_m_bps_read_write: int + :ivar delete_option: Specifies whether data disk should be deleted or detached upon VMSS Flex + deletion (This feature is available for VMSS with Flexible OrchestrationMode + only).:code:`
`:code:`
` Possible values: :code:`
`:code:`
` **Delete** If this + value is used, the + data disk is deleted when the VMSS Flex VM is deleted.:code:`
`:code:`
` **Detach** If + this value is used, the data disk is retained after VMSS Flex VM is + deleted.:code:`
`:code:`
` The default value is set to **Delete**. Known values are: + "Delete" and "Detach". + :vartype delete_option: str or ~azure.mgmt.computefleet.models.DiskDeleteOptionTypes + """ + + _validation = { + "lun": {"required": True}, + "create_option": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "lun": {"key": "lun", "type": "int"}, + "caching": {"key": "caching", "type": "str"}, + "write_accelerator_enabled": {"key": "writeAcceleratorEnabled", "type": "bool"}, + "create_option": {"key": "createOption", "type": "str"}, + "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, + "managed_disk": {"key": "managedDisk", "type": "VirtualMachineScaleSetManagedDiskParameters"}, + "disk_iops_read_write": {"key": "diskIOPSReadWrite", "type": "int"}, + "disk_m_bps_read_write": {"key": "diskMBpsReadWrite", "type": "int"}, + "delete_option": {"key": "deleteOption", "type": "str"}, + } + + def __init__( + self, + *, + lun: int, + create_option: Union[str, "_models.DiskCreateOptionTypes"], + name: Optional[str] = None, + caching: Optional[Union[str, "_models.CachingTypes"]] = None, + write_accelerator_enabled: Optional[bool] = None, + disk_size_gb: Optional[int] = None, + managed_disk: Optional["_models.VirtualMachineScaleSetManagedDiskParameters"] = None, + disk_iops_read_write: Optional[int] = None, + disk_m_bps_read_write: Optional[int] = None, + delete_option: Optional[Union[str, "_models.DiskDeleteOptionTypes"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The disk name. + :paramtype name: str + :keyword lun: Specifies the logical unit number of the data disk. This value is used to + identify data disks within the VM and therefore must be unique for each data + disk attached to a VM. Required. + :paramtype lun: int + :keyword caching: Specifies the caching requirements. Possible values are: **None,** + **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + storage. ReadOnly for Premium storage.**. Known values are: "None", "ReadOnly", and + "ReadWrite". + :paramtype caching: str or ~azure.mgmt.computefleet.models.CachingTypes + :keyword write_accelerator_enabled: Specifies whether writeAccelerator should be enabled or + disabled on the disk. + :paramtype write_accelerator_enabled: bool + :keyword create_option: The create option. Required. Known values are: "FromImage", "Empty", + "Attach", "Copy", and "Restore". + :paramtype create_option: str or ~azure.mgmt.computefleet.models.DiskCreateOptionTypes + :keyword 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. + :paramtype disk_size_gb: int + :keyword managed_disk: The managed disk parameters. + :paramtype managed_disk: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetManagedDiskParameters + :keyword 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. + :paramtype disk_iops_read_write: int + :keyword 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 + would be assigned based on diskSizeGB. + :paramtype disk_m_bps_read_write: int + :keyword delete_option: Specifies whether data disk should be deleted or detached upon VMSS + Flex + deletion (This feature is available for VMSS with Flexible OrchestrationMode + only).:code:`
`:code:`
` Possible values: :code:`
`:code:`
` **Delete** If this + value is used, the + data disk is deleted when the VMSS Flex VM is deleted.:code:`
`:code:`
` **Detach** If + this value is used, the data disk is retained after VMSS Flex VM is + deleted.:code:`
`:code:`
` The default value is set to **Delete**. Known values are: + "Delete" and "Detach". + :paramtype delete_option: str or ~azure.mgmt.computefleet.models.DiskDeleteOptionTypes + """ + super().__init__(**kwargs) + self.name = name + self.lun = lun + self.caching = caching + self.write_accelerator_enabled = write_accelerator_enabled + self.create_option = create_option + self.disk_size_gb = disk_size_gb + self.managed_disk = managed_disk + self.disk_iops_read_write = disk_iops_read_write + self.disk_m_bps_read_write = disk_m_bps_read_write + self.delete_option = delete_option + + +class VirtualMachineScaleSetExtension(_serialization.Model): + """Describes a Virtual Machine Scale Set Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: The name of the extension. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Describes the properties of a Virtual Machine Scale Set Extension. + :vartype properties: ~azure.mgmt.computefleet.models.VirtualMachineScaleSetExtensionProperties + """ + + _validation = { + "id": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "properties": {"key": "properties", "type": "VirtualMachineScaleSetExtensionProperties"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + properties: Optional["_models.VirtualMachineScaleSetExtensionProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the extension. + :paramtype name: str + :keyword properties: Describes the properties of a Virtual Machine Scale Set Extension. + :paramtype properties: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetExtensionProperties + """ + super().__init__(**kwargs) + self.id = None + self.name = name + self.type = None + self.properties = properties + + +class VirtualMachineScaleSetExtensionProfile(_serialization.Model): + """Describes a virtual machine scale set extension profile. + + :ivar extensions: The virtual machine scale set child extension resources. + :vartype extensions: list[~azure.mgmt.computefleet.models.VirtualMachineScaleSetExtension] + :ivar extensions_time_budget: Specifies the time alloted for all extensions to start. The time + duration + should be between 15 minutes and 120 minutes (inclusive) and should be + specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). + Minimum api-version: 2020-06-01. + :vartype extensions_time_budget: str + """ + + _attribute_map = { + "extensions": {"key": "extensions", "type": "[VirtualMachineScaleSetExtension]"}, + "extensions_time_budget": {"key": "extensionsTimeBudget", "type": "str"}, + } + + def __init__( + self, + *, + extensions: Optional[List["_models.VirtualMachineScaleSetExtension"]] = None, + extensions_time_budget: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword extensions: The virtual machine scale set child extension resources. + :paramtype extensions: list[~azure.mgmt.computefleet.models.VirtualMachineScaleSetExtension] + :keyword extensions_time_budget: Specifies the time alloted for all extensions to start. The + time duration + should be between 15 minutes and 120 minutes (inclusive) and should be + specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). + Minimum api-version: 2020-06-01. + :paramtype extensions_time_budget: str + """ + super().__init__(**kwargs) + self.extensions = extensions + self.extensions_time_budget = extensions_time_budget + + +class VirtualMachineScaleSetExtensionProperties( + _serialization.Model +): # pylint: disable=too-many-instance-attributes,name-too-long + """Describes the properties of a Virtual Machine Scale Set Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar force_update_tag: If a value is provided and is different from the previous value, the + extension + handler will be forced to update even if the extension configuration has not + changed. + :vartype force_update_tag: str + :ivar publisher: The name of the extension handler publisher. + :vartype publisher: str + :ivar type: Specifies the type of the extension; an example is "CustomScriptExtension". + :vartype type: str + :ivar type_handler_version: Specifies the version of the script handler. + :vartype type_handler_version: str + :ivar auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is + available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :vartype auto_upgrade_minor_version: bool + :ivar enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the + platform if there is a newer version of the extension available. + :vartype enable_automatic_upgrade: bool + :ivar settings: Json formatted public settings for the extension. + :vartype settings: dict[str, any] + :ivar protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :vartype protected_settings: dict[str, any] + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar provision_after_extensions: Collection of extension names after which this extension + needs to be + provisioned. + :vartype provision_after_extensions: list[str] + :ivar suppress_failures: Indicates whether failures stemming from the extension will be + suppressed + (Operational failures such as not connecting to the VM will not be suppressed + regardless of this value). The default is false. + :vartype suppress_failures: bool + :ivar protected_settings_from_key_vault: The extensions protected settings that are passed by + reference, and consumed + from key vault. + :vartype protected_settings_from_key_vault: + ~azure.mgmt.computefleet.models.KeyVaultSecretReference + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "force_update_tag": {"key": "forceUpdateTag", "type": "str"}, + "publisher": {"key": "publisher", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "type_handler_version": {"key": "typeHandlerVersion", "type": "str"}, + "auto_upgrade_minor_version": {"key": "autoUpgradeMinorVersion", "type": "bool"}, + "enable_automatic_upgrade": {"key": "enableAutomaticUpgrade", "type": "bool"}, + "settings": {"key": "settings", "type": "{object}"}, + "protected_settings": {"key": "protectedSettings", "type": "{object}"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "provision_after_extensions": {"key": "provisionAfterExtensions", "type": "[str]"}, + "suppress_failures": {"key": "suppressFailures", "type": "bool"}, + "protected_settings_from_key_vault": { + "key": "protectedSettingsFromKeyVault", + "type": "KeyVaultSecretReference", + }, + } + + def __init__( + self, + *, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + enable_automatic_upgrade: Optional[bool] = None, + settings: Optional[Dict[str, Any]] = None, + protected_settings: Optional[Dict[str, Any]] = None, + provision_after_extensions: Optional[List[str]] = None, + suppress_failures: Optional[bool] = None, + protected_settings_from_key_vault: Optional["_models.KeyVaultSecretReference"] = None, + **kwargs: Any + ) -> None: + """ + :keyword force_update_tag: If a value is provided and is different from the previous value, the + extension + handler will be forced to update even if the extension configuration has not + changed. + :paramtype force_update_tag: str + :keyword publisher: The name of the extension handler publisher. + :paramtype publisher: str + :keyword type: Specifies the type of the extension; an example is "CustomScriptExtension". + :paramtype type: str + :keyword type_handler_version: Specifies the version of the script handler. + :paramtype type_handler_version: str + :keyword auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is + available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :paramtype auto_upgrade_minor_version: bool + :keyword enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the + platform if there is a newer version of the extension available. + :paramtype enable_automatic_upgrade: bool + :keyword settings: Json formatted public settings for the extension. + :paramtype settings: dict[str, any] + :keyword protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :paramtype protected_settings: dict[str, any] + :keyword provision_after_extensions: Collection of extension names after which this extension + needs to be + provisioned. + :paramtype provision_after_extensions: list[str] + :keyword suppress_failures: Indicates whether failures stemming from the extension will be + suppressed + (Operational failures such as not connecting to the VM will not be suppressed + regardless of this value). The default is false. + :paramtype suppress_failures: bool + :keyword protected_settings_from_key_vault: The extensions protected settings that are passed + by reference, and consumed + from key vault. + :paramtype protected_settings_from_key_vault: + ~azure.mgmt.computefleet.models.KeyVaultSecretReference + """ + super().__init__(**kwargs) + self.force_update_tag = force_update_tag + self.publisher = publisher + self.type = type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.enable_automatic_upgrade = enable_automatic_upgrade + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None + self.provision_after_extensions = provision_after_extensions + self.suppress_failures = suppress_failures + self.protected_settings_from_key_vault = protected_settings_from_key_vault + + +class VirtualMachineScaleSetHardwareProfile(_serialization.Model): + """Specifies the hardware settings for the virtual machine scale set. + + :ivar vm_size_properties: Specifies the properties for customizing the size of the virtual + machine. + Minimum api-version: 2021-11-01. Please follow the instructions in `VM + Customization `_ for more details. + :vartype vm_size_properties: ~azure.mgmt.computefleet.models.VMSizeProperties + """ + + _attribute_map = { + "vm_size_properties": {"key": "vmSizeProperties", "type": "VMSizeProperties"}, + } + + def __init__(self, *, vm_size_properties: Optional["_models.VMSizeProperties"] = None, **kwargs: Any) -> None: + """ + :keyword vm_size_properties: Specifies the properties for customizing the size of the virtual + machine. + Minimum api-version: 2021-11-01. Please follow the instructions in `VM + Customization `_ for more details. + :paramtype vm_size_properties: ~azure.mgmt.computefleet.models.VMSizeProperties + """ + super().__init__(**kwargs) + self.vm_size_properties = vm_size_properties + + +class VirtualMachineScaleSetIPConfiguration(_serialization.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 + :ivar properties: Describes a virtual machine scale set network profile's IP configuration + properties. + :vartype properties: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetIPConfigurationProperties + """ + + _validation = { + "name": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "properties": {"key": "properties", "type": "VirtualMachineScaleSetIPConfigurationProperties"}, + } + + def __init__( + self, + *, + name: str, + properties: Optional["_models.VirtualMachineScaleSetIPConfigurationProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The IP configuration name. Required. + :paramtype name: str + :keyword properties: Describes a virtual machine scale set network profile's IP configuration + properties. + :paramtype properties: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetIPConfigurationProperties + """ + super().__init__(**kwargs) + self.name = name + self.properties = properties + + +class VirtualMachineScaleSetIPConfigurationProperties(_serialization.Model): # pylint: disable=name-too-long + """Describes a virtual machine scale set network profile's IP configuration + properties. + + :ivar subnet: Specifies the identifier of the subnet. + :vartype subnet: ~azure.mgmt.computefleet.models.ApiEntityReference + :ivar primary: Specifies the primary network interface in case the virtual machine has more + than 1 network interface. + :vartype primary: bool + :ivar public_ip_address_configuration: The publicIPAddressConfiguration. + :vartype public_ip_address_configuration: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetPublicIPAddressConfiguration + :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_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 + application gateways. Multiple scale sets cannot use the same application + gateway. + :vartype application_gateway_backend_address_pools: + list[~azure.mgmt.computefleet.models.SubResource] + :ivar application_security_groups: Specifies an array of references to application security + group. + :vartype application_security_groups: list[~azure.mgmt.computefleet.models.SubResource] + :ivar load_balancer_backend_address_pools: Specifies an array of references to backend address + pools of load balancers. A + scale set can reference backend address pools of one public and one internal + load balancer. Multiple scale sets cannot use the same basic sku load balancer. + :vartype load_balancer_backend_address_pools: list[~azure.mgmt.computefleet.models.SubResource] + :ivar load_balancer_inbound_nat_pools: Specifies an array of references to inbound Nat pools of + the load balancers. A + scale set can reference inbound nat pools of one public and one internal load + balancer. Multiple scale sets cannot use the same basic sku load balancer. + :vartype load_balancer_inbound_nat_pools: list[~azure.mgmt.computefleet.models.SubResource] + """ + + _attribute_map = { + "subnet": {"key": "subnet", "type": "ApiEntityReference"}, + "primary": {"key": "primary", "type": "bool"}, + "public_ip_address_configuration": { + "key": "publicIPAddressConfiguration", + "type": "VirtualMachineScaleSetPublicIPAddressConfiguration", + }, + "private_ip_address_version": {"key": "privateIPAddressVersion", "type": "str"}, + "application_gateway_backend_address_pools": { + "key": "applicationGatewayBackendAddressPools", + "type": "[SubResource]", + }, + "application_security_groups": {"key": "applicationSecurityGroups", "type": "[SubResource]"}, + "load_balancer_backend_address_pools": {"key": "loadBalancerBackendAddressPools", "type": "[SubResource]"}, + "load_balancer_inbound_nat_pools": {"key": "loadBalancerInboundNatPools", "type": "[SubResource]"}, + } + + def __init__( + self, + *, + subnet: Optional["_models.ApiEntityReference"] = None, + primary: Optional[bool] = 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, + load_balancer_inbound_nat_pools: Optional[List["_models.SubResource"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword subnet: Specifies the identifier of the subnet. + :paramtype subnet: ~azure.mgmt.computefleet.models.ApiEntityReference + :keyword primary: Specifies the primary network interface in case the virtual machine has more + than 1 network interface. + :paramtype primary: bool + :keyword public_ip_address_configuration: The publicIPAddressConfiguration. + :paramtype public_ip_address_configuration: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetPublicIPAddressConfiguration + :keyword 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". + :paramtype private_ip_address_version: str or ~azure.mgmt.computefleet.models.IPVersion + :keyword 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 + application gateways. Multiple scale sets cannot use the same application + gateway. + :paramtype application_gateway_backend_address_pools: + list[~azure.mgmt.computefleet.models.SubResource] + :keyword application_security_groups: Specifies an array of references to application security + group. + :paramtype application_security_groups: list[~azure.mgmt.computefleet.models.SubResource] + :keyword load_balancer_backend_address_pools: Specifies an array of references to backend + address pools of load balancers. A + scale set can reference backend address pools of one public and one internal + load balancer. Multiple scale sets cannot use the same basic sku load balancer. + :paramtype load_balancer_backend_address_pools: + list[~azure.mgmt.computefleet.models.SubResource] + :keyword load_balancer_inbound_nat_pools: Specifies an array of references to inbound Nat pools + of the load balancers. A + scale set can reference inbound nat pools of one public and one internal load + balancer. Multiple scale sets cannot use the same basic sku load balancer. + :paramtype load_balancer_inbound_nat_pools: list[~azure.mgmt.computefleet.models.SubResource] + """ + super().__init__(**kwargs) + self.subnet = subnet + self.primary = primary + self.public_ip_address_configuration = public_ip_address_configuration + self.private_ip_address_version = private_ip_address_version + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.application_security_groups = application_security_groups + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools + + +class VirtualMachineScaleSetIpTag(_serialization.Model): + """Contains the IP tag associated with the public IP address. + + :ivar ip_tag_type: IP tag type. Example: FirstPartyUsage. + :vartype ip_tag_type: str + :ivar tag: IP tag associated with the public IP. Example: SQL, Storage etc. + :vartype tag: str + """ + + _attribute_map = { + "ip_tag_type": {"key": "ipTagType", "type": "str"}, + "tag": {"key": "tag", "type": "str"}, + } + + def __init__(self, *, ip_tag_type: Optional[str] = None, tag: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword ip_tag_type: IP tag type. Example: FirstPartyUsage. + :paramtype ip_tag_type: str + :keyword tag: IP tag associated with the public IP. Example: SQL, Storage etc. + :paramtype tag: str + """ + super().__init__(**kwargs) + self.ip_tag_type = ip_tag_type + self.tag = tag + + +class VirtualMachineScaleSetListResult(_serialization.Model): + """The response of a VirtualMachineScaleSet list operation. + + All required parameters must be populated in order to send to server. + + :ivar value: The VirtualMachineScaleSet items on this page. Required. + :vartype value: list[~azure.mgmt.computefleet.models.VirtualMachineScaleSet] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualMachineScaleSet]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: List["_models.VirtualMachineScaleSet"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The VirtualMachineScaleSet items on this page. Required. + :paramtype value: list[~azure.mgmt.computefleet.models.VirtualMachineScaleSet] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualMachineScaleSetManagedDiskParameters(_serialization.Model): # pylint: disable=name-too-long + """Describes the parameters of a ScaleSet managed disk. + + :ivar storage_account_type: Specifies the storage account type for the managed disk. NOTE: + UltraSSD_LRS can + only be used with data disks, it cannot be used with OS Disk. Known values are: + "Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS", "Premium_ZRS", + "StandardSSD_ZRS", and "PremiumV2_LRS". + :vartype storage_account_type: str or ~azure.mgmt.computefleet.models.StorageAccountTypes + :ivar disk_encryption_set: Specifies the customer managed disk encryption set resource id for + the managed + disk. + :vartype disk_encryption_set: ~azure.mgmt.computefleet.models.DiskEncryptionSetParameters + :ivar security_profile: Specifies the security profile for the managed disk. + :vartype security_profile: ~azure.mgmt.computefleet.models.VMDiskSecurityProfile + """ + + _attribute_map = { + "storage_account_type": {"key": "storageAccountType", "type": "str"}, + "disk_encryption_set": {"key": "diskEncryptionSet", "type": "DiskEncryptionSetParameters"}, + "security_profile": {"key": "securityProfile", "type": "VMDiskSecurityProfile"}, + } + + def __init__( + self, + *, + storage_account_type: Optional[Union[str, "_models.StorageAccountTypes"]] = None, + disk_encryption_set: Optional["_models.DiskEncryptionSetParameters"] = None, + security_profile: Optional["_models.VMDiskSecurityProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword storage_account_type: Specifies the storage account type for the managed disk. NOTE: + UltraSSD_LRS can + only be used with data disks, it cannot be used with OS Disk. Known values are: + "Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS", "Premium_ZRS", + "StandardSSD_ZRS", and "PremiumV2_LRS". + :paramtype storage_account_type: str or ~azure.mgmt.computefleet.models.StorageAccountTypes + :keyword disk_encryption_set: Specifies the customer managed disk encryption set resource id + for the managed + disk. + :paramtype disk_encryption_set: ~azure.mgmt.computefleet.models.DiskEncryptionSetParameters + :keyword security_profile: Specifies the security profile for the managed disk. + :paramtype security_profile: ~azure.mgmt.computefleet.models.VMDiskSecurityProfile + """ + super().__init__(**kwargs) + self.storage_account_type = storage_account_type + self.disk_encryption_set = disk_encryption_set + self.security_profile = security_profile + + +class VirtualMachineScaleSetNetworkConfiguration(_serialization.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 + :ivar properties: Describes a virtual machine scale set network profile's IP configuration. + :vartype properties: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetNetworkConfigurationProperties + """ + + _validation = { + "name": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "properties": {"key": "properties", "type": "VirtualMachineScaleSetNetworkConfigurationProperties"}, + } + + def __init__( + self, + *, + name: str, + properties: Optional["_models.VirtualMachineScaleSetNetworkConfigurationProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The network configuration name. Required. + :paramtype name: str + :keyword properties: Describes a virtual machine scale set network profile's IP configuration. + :paramtype properties: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetNetworkConfigurationProperties + """ + super().__init__(**kwargs) + self.name = name + self.properties = properties + + +class VirtualMachineScaleSetNetworkConfigurationDnsSettings(_serialization.Model): # pylint: disable=name-too-long + """Describes a virtual machines scale sets network configuration's DNS settings. + + :ivar dns_servers: List of DNS servers IP addresses. + :vartype dns_servers: list[str] + """ + + _attribute_map = { + "dns_servers": {"key": "dnsServers", "type": "[str]"}, + } + + def __init__(self, *, dns_servers: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword dns_servers: List of DNS servers IP addresses. + :paramtype dns_servers: list[str] + """ + super().__init__(**kwargs) + self.dns_servers = dns_servers + + +class VirtualMachineScaleSetNetworkConfigurationProperties( + _serialization.Model +): # 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. + :vartype primary: bool + :ivar enable_accelerated_networking: Specifies whether the network interface is accelerated + networking-enabled. + :vartype enable_accelerated_networking: bool + :ivar disable_tcp_state_tracking: Specifies whether the network interface is disabled for tcp + state tracking. + :vartype disable_tcp_state_tracking: bool + :ivar enable_fpga: Specifies whether the network interface is FPGA networking-enabled. + :vartype enable_fpga: bool + :ivar network_security_group: The network security group. + :vartype network_security_group: ~azure.mgmt.computefleet.models.SubResource + :ivar dns_settings: The dns settings to be applied on the network interfaces. + :vartype dns_settings: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings + :ivar ip_configurations: Specifies the IP configurations of the network interface. Required. + :vartype ip_configurations: + list[~azure.mgmt.computefleet.models.VirtualMachineScaleSetIPConfiguration] + :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 + :ivar auxiliary_mode: Specifies whether the Auxiliary mode is enabled for the Network Interface + resource. Known values are: "None", "AcceleratedConnections", and "Floating". + :vartype auxiliary_mode: str or ~azure.mgmt.computefleet.models.NetworkInterfaceAuxiliaryMode + :ivar auxiliary_sku: Specifies whether the Auxiliary sku is enabled for the Network Interface + resource. Known values are: "None", "A1", "A2", "A4", and "A8". + :vartype auxiliary_sku: str or ~azure.mgmt.computefleet.models.NetworkInterfaceAuxiliarySku + """ + + _validation = { + "ip_configurations": {"required": True}, + } + + _attribute_map = { + "primary": {"key": "primary", "type": "bool"}, + "enable_accelerated_networking": {"key": "enableAcceleratedNetworking", "type": "bool"}, + "disable_tcp_state_tracking": {"key": "disableTcpStateTracking", "type": "bool"}, + "enable_fpga": {"key": "enableFpga", "type": "bool"}, + "network_security_group": {"key": "networkSecurityGroup", "type": "SubResource"}, + "dns_settings": {"key": "dnsSettings", "type": "VirtualMachineScaleSetNetworkConfigurationDnsSettings"}, + "ip_configurations": {"key": "ipConfigurations", "type": "[VirtualMachineScaleSetIPConfiguration]"}, + "enable_ip_forwarding": {"key": "enableIPForwarding", "type": "bool"}, + "delete_option": {"key": "deleteOption", "type": "str"}, + "auxiliary_mode": {"key": "auxiliaryMode", "type": "str"}, + "auxiliary_sku": {"key": "auxiliarySku", "type": "str"}, + } + + def __init__( + self, + *, + ip_configurations: List["_models.VirtualMachineScaleSetIPConfiguration"], + primary: Optional[bool] = None, + enable_accelerated_networking: Optional[bool] = None, + disable_tcp_state_tracking: Optional[bool] = None, + enable_fpga: Optional[bool] = None, + network_security_group: Optional["_models.SubResource"] = None, + dns_settings: Optional["_models.VirtualMachineScaleSetNetworkConfigurationDnsSettings"] = 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, + **kwargs: Any + ) -> None: + """ + :keyword primary: Specifies the primary network interface in case the virtual machine has more + than 1 network interface. + :paramtype primary: bool + :keyword enable_accelerated_networking: Specifies whether the network interface is accelerated + networking-enabled. + :paramtype enable_accelerated_networking: bool + :keyword disable_tcp_state_tracking: Specifies whether the network interface is disabled for + tcp state tracking. + :paramtype disable_tcp_state_tracking: bool + :keyword enable_fpga: Specifies whether the network interface is FPGA networking-enabled. + :paramtype enable_fpga: bool + :keyword network_security_group: The network security group. + :paramtype network_security_group: ~azure.mgmt.computefleet.models.SubResource + :keyword dns_settings: The dns settings to be applied on the network interfaces. + :paramtype dns_settings: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings + :keyword ip_configurations: Specifies the IP configurations of the network interface. Required. + :paramtype ip_configurations: + list[~azure.mgmt.computefleet.models.VirtualMachineScaleSetIPConfiguration] + :keyword enable_ip_forwarding: Whether IP forwarding enabled on this NIC. + :paramtype enable_ip_forwarding: bool + :keyword delete_option: Specify what happens to the network interface when the VM is deleted. + Known values are: "Delete" and "Detach". + :paramtype delete_option: str or ~azure.mgmt.computefleet.models.DeleteOptions + :keyword auxiliary_mode: Specifies whether the Auxiliary mode is enabled for the Network + Interface + resource. Known values are: "None", "AcceleratedConnections", and "Floating". + :paramtype auxiliary_mode: str or ~azure.mgmt.computefleet.models.NetworkInterfaceAuxiliaryMode + :keyword auxiliary_sku: Specifies whether the Auxiliary sku is enabled for the Network + Interface + resource. Known values are: "None", "A1", "A2", "A4", and "A8". + :paramtype auxiliary_sku: str or ~azure.mgmt.computefleet.models.NetworkInterfaceAuxiliarySku + """ + super().__init__(**kwargs) + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.disable_tcp_state_tracking = disable_tcp_state_tracking + self.enable_fpga = enable_fpga + self.network_security_group = network_security_group + self.dns_settings = dns_settings + self.ip_configurations = ip_configurations + self.enable_ip_forwarding = enable_ip_forwarding + self.delete_option = delete_option + self.auxiliary_mode = auxiliary_mode + self.auxiliary_sku = auxiliary_sku + + +class VirtualMachineScaleSetNetworkProfile(_serialization.Model): + """Describes a virtual machine scale set network profile. + + :ivar health_probe: A reference to a load balancer probe used to determine the health of an + instance in the virtual machine scale set. The reference will be in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. # pylint: disable=line-too-long + :vartype health_probe: ~azure.mgmt.computefleet.models.ApiEntityReference + :ivar network_interface_configurations: The list of network configurations. + :vartype network_interface_configurations: + list[~azure.mgmt.computefleet.models.VirtualMachineScaleSetNetworkConfiguration] + :ivar network_api_version: specifies the Microsoft.Network API version used when creating + networking + resources in the Network Interface Configurations for Virtual Machine Scale Set + with orchestration mode 'Flexible'. "2020-11-01" + :vartype network_api_version: str or ~azure.mgmt.computefleet.models.NetworkApiVersion + """ + + _attribute_map = { + "health_probe": {"key": "healthProbe", "type": "ApiEntityReference"}, + "network_interface_configurations": { + "key": "networkInterfaceConfigurations", + "type": "[VirtualMachineScaleSetNetworkConfiguration]", + }, + "network_api_version": {"key": "networkApiVersion", "type": "str"}, + } + + def __init__( + self, + *, + health_probe: Optional["_models.ApiEntityReference"] = None, + network_interface_configurations: Optional[List["_models.VirtualMachineScaleSetNetworkConfiguration"]] = None, + network_api_version: Optional[Union[str, "_models.NetworkApiVersion"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword health_probe: A reference to a load balancer probe used to determine the health of an + instance in the virtual machine scale set. The reference will be in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. # pylint: disable=line-too-long + :paramtype health_probe: ~azure.mgmt.computefleet.models.ApiEntityReference + :keyword network_interface_configurations: The list of network configurations. + :paramtype network_interface_configurations: + list[~azure.mgmt.computefleet.models.VirtualMachineScaleSetNetworkConfiguration] + :keyword network_api_version: specifies the Microsoft.Network API version used when creating + networking + resources in the Network Interface Configurations for Virtual Machine Scale Set + with orchestration mode 'Flexible'. "2020-11-01" + :paramtype network_api_version: str or ~azure.mgmt.computefleet.models.NetworkApiVersion + """ + super().__init__(**kwargs) + self.health_probe = health_probe + self.network_interface_configurations = network_interface_configurations + self.network_api_version = network_api_version + + +class VirtualMachineScaleSetOSDisk(_serialization.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 + :ivar caching: Specifies the caching requirements. Possible values are: **None,** + **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + storage. ReadOnly for Premium storage.**. Known values are: "None", "ReadOnly", and + "ReadWrite". + :vartype caching: str or ~azure.mgmt.computefleet.models.CachingTypes + :ivar write_accelerator_enabled: Specifies whether writeAccelerator should be enabled or + disabled on the disk. + :vartype write_accelerator_enabled: bool + :ivar create_option: Specifies how the virtual machines in the scale set should be created. The + only + allowed value is: **FromImage.** This value is used when you are using an image + to create the virtual machine. If you are using a platform image, you also use + the imageReference element described above. If you are using a marketplace + image, you also use the plan element previously described. Required. Known values are: + "FromImage", "Empty", "Attach", "Copy", and "Restore". + :vartype create_option: str or ~azure.mgmt.computefleet.models.DiskCreateOptionTypes + :ivar diff_disk_settings: Specifies the ephemeral disk Settings for the operating system disk + used by the + virtual machine scale set. + :vartype diff_disk_settings: ~azure.mgmt.computefleet.models.DiffDiskSettings + :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_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". + :vartype os_type: str or ~azure.mgmt.computefleet.models.OperatingSystemTypes + :ivar image: Specifies information about the unmanaged user image to base the scale set on. + :vartype image: ~azure.mgmt.computefleet.models.VirtualHardDisk + :ivar vhd_containers: Specifies the container urls that are used to store operating system + disks for + the scale set. + :vartype vhd_containers: list[str] + :ivar managed_disk: The managed disk parameters. + :vartype managed_disk: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetManagedDiskParameters + :ivar delete_option: Specifies whether OS Disk should be deleted or detached upon VMSS Flex + deletion + (This feature is available for VMSS with Flexible OrchestrationMode only). + :code:`
`:code:`
` Possible values: :code:`
`:code:`
` **Delete** If this value is + used, the OS + disk is deleted when VMSS Flex VM is deleted.:code:`
`:code:`
` **Detach** If this value + is used, the OS disk is retained after VMSS Flex VM is deleted. :code:`
`:code:`
` The + default value is set to **Delete**. For an Ephemeral OS Disk, the default value + is set to **Delete**. User cannot change the delete option for Ephemeral OS + Disk. Known values are: "Delete" and "Detach". + :vartype delete_option: str or ~azure.mgmt.computefleet.models.DiskDeleteOptionTypes + """ + + _validation = { + "create_option": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "caching": {"key": "caching", "type": "str"}, + "write_accelerator_enabled": {"key": "writeAcceleratorEnabled", "type": "bool"}, + "create_option": {"key": "createOption", "type": "str"}, + "diff_disk_settings": {"key": "diffDiskSettings", "type": "DiffDiskSettings"}, + "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, + "os_type": {"key": "osType", "type": "str"}, + "image": {"key": "image", "type": "VirtualHardDisk"}, + "vhd_containers": {"key": "vhdContainers", "type": "[str]"}, + "managed_disk": {"key": "managedDisk", "type": "VirtualMachineScaleSetManagedDiskParameters"}, + "delete_option": {"key": "deleteOption", "type": "str"}, + } + + def __init__( + self, + *, + create_option: Union[str, "_models.DiskCreateOptionTypes"], + name: Optional[str] = None, + caching: Optional[Union[str, "_models.CachingTypes"]] = None, + write_accelerator_enabled: Optional[bool] = None, + diff_disk_settings: Optional["_models.DiffDiskSettings"] = 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, + managed_disk: Optional["_models.VirtualMachineScaleSetManagedDiskParameters"] = None, + delete_option: Optional[Union[str, "_models.DiskDeleteOptionTypes"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The disk name. + :paramtype name: str + :keyword caching: Specifies the caching requirements. Possible values are: **None,** + **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + storage. ReadOnly for Premium storage.**. Known values are: "None", "ReadOnly", and + "ReadWrite". + :paramtype caching: str or ~azure.mgmt.computefleet.models.CachingTypes + :keyword write_accelerator_enabled: Specifies whether writeAccelerator should be enabled or + disabled on the disk. + :paramtype write_accelerator_enabled: bool + :keyword create_option: Specifies how the virtual machines in the scale set should be created. + The only + allowed value is: **FromImage.** This value is used when you are using an image + to create the virtual machine. If you are using a platform image, you also use + the imageReference element described above. If you are using a marketplace + image, you also use the plan element previously described. Required. Known values are: + "FromImage", "Empty", "Attach", "Copy", and "Restore". + :paramtype create_option: str or ~azure.mgmt.computefleet.models.DiskCreateOptionTypes + :keyword diff_disk_settings: Specifies the ephemeral disk Settings for the operating system + disk used by the + virtual machine scale set. + :paramtype diff_disk_settings: ~azure.mgmt.computefleet.models.DiffDiskSettings + :keyword 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. + :paramtype disk_size_gb: int + :keyword 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". + :paramtype os_type: str or ~azure.mgmt.computefleet.models.OperatingSystemTypes + :keyword image: Specifies information about the unmanaged user image to base the scale set on. + :paramtype image: ~azure.mgmt.computefleet.models.VirtualHardDisk + :keyword vhd_containers: Specifies the container urls that are used to store operating system + disks for + the scale set. + :paramtype vhd_containers: list[str] + :keyword managed_disk: The managed disk parameters. + :paramtype managed_disk: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetManagedDiskParameters + :keyword delete_option: Specifies whether OS Disk should be deleted or detached upon VMSS Flex + deletion + (This feature is available for VMSS with Flexible OrchestrationMode only). + :code:`
`:code:`
` Possible values: :code:`
`:code:`
` **Delete** If this value is + used, the OS + disk is deleted when VMSS Flex VM is deleted.:code:`
`:code:`
` **Detach** If this value + is used, the OS disk is retained after VMSS Flex VM is deleted. :code:`
`:code:`
` The + default value is set to **Delete**. For an Ephemeral OS Disk, the default value + is set to **Delete**. User cannot change the delete option for Ephemeral OS + Disk. Known values are: "Delete" and "Detach". + :paramtype delete_option: str or ~azure.mgmt.computefleet.models.DiskDeleteOptionTypes + """ + super().__init__(**kwargs) + self.name = name + self.caching = caching + self.write_accelerator_enabled = write_accelerator_enabled + self.create_option = create_option + self.diff_disk_settings = diff_disk_settings + self.disk_size_gb = disk_size_gb + self.os_type = os_type + self.image = image + self.vhd_containers = vhd_containers + self.managed_disk = managed_disk + self.delete_option = delete_option + + +class VirtualMachineScaleSetOSProfile(_serialization.Model): + """Describes a virtual machine scale set OS profile. + + :ivar computer_name_prefix: Specifies the computer name prefix for all of the virtual machines + in the scale + set. Computer name prefixes must be 1 to 15 characters long. + :vartype computer_name_prefix: str + :ivar admin_username: Specifies the name of the administrator account. :code:`
`:code:`
` + **Windows-only + restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** + "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", + "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", + "console", "david", "guest", "john", "owner", "root", "server", "sql", + "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". + :code:`
`:code:`
` **Minimum-length (Linux):** 1 character :code:`
`:code:`
` + **Max-length + (Linux):** 64 characters :code:`
`:code:`
` **Max-length (Windows):** 20 characters. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length + (Windows):** 8 characters :code:`
`:code:`
` **Minimum-length (Linux):** 6 characters + :code:`
`:code:`
` **Max-length (Windows):** 123 characters :code:`
`:code:`
` + **Max-length + (Linux):** 72 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", + "Password22", "iloveyou!" :code:`
`:code:`
` For resetting the password, see `How to + reset the Remote Desktop service or its login password in a Windows + VM `_ + :code:`
`:code:`
` For resetting root password, see `Manage users, SSH, and check or + repair disks on Azure Linux VMs using the VMAccess + Extension + `_. + :vartype admin_password: str + :ivar custom_data: Specifies a base-64 encoded string of custom data. The base-64 encoded + string + is decoded to a binary array that is saved as a file on the Virtual Machine. + The maximum length of the binary array is 65535 bytes. For using cloud-init for + your VM, see `Using cloud-init to customize a Linux VM during + creation `_. + :vartype custom_data: str + :ivar windows_configuration: Specifies Windows operating system settings on the virtual + machine. + :vartype windows_configuration: ~azure.mgmt.computefleet.models.WindowsConfiguration + :ivar linux_configuration: Specifies the Linux operating system settings on the virtual + machine. For a + list of supported Linux distributions, see `Linux on Azure-Endorsed + Distributions `_. + :vartype linux_configuration: ~azure.mgmt.computefleet.models.LinuxConfiguration + :ivar secrets: Specifies set of certificates that should be installed onto the virtual + machines in the scale set. To install certificates on a virtual machine it is + recommended to use the `Azure Key Vault virtual machine extension for + Linux `_ + or the `Azure Key Vault virtual machine extension for + Windows `_. + :vartype secrets: list[~azure.mgmt.computefleet.models.VaultSecretGroup] + :ivar allow_extension_operations: Specifies whether extension operations should be allowed on + the virtual machine + scale set. This may only be set to False when no extensions are present on the + virtual machine scale set. + :vartype allow_extension_operations: bool + :ivar require_guest_provision_signal: Optional property which must either be set to True or + omitted. + :vartype require_guest_provision_signal: bool + """ + + _attribute_map = { + "computer_name_prefix": {"key": "computerNamePrefix", "type": "str"}, + "admin_username": {"key": "adminUsername", "type": "str"}, + "admin_password": {"key": "adminPassword", "type": "str"}, + "custom_data": {"key": "customData", "type": "str"}, + "windows_configuration": {"key": "windowsConfiguration", "type": "WindowsConfiguration"}, + "linux_configuration": {"key": "linuxConfiguration", "type": "LinuxConfiguration"}, + "secrets": {"key": "secrets", "type": "[VaultSecretGroup]"}, + "allow_extension_operations": {"key": "allowExtensionOperations", "type": "bool"}, + "require_guest_provision_signal": {"key": "requireGuestProvisionSignal", "type": "bool"}, + } + + def __init__( + self, + *, + computer_name_prefix: Optional[str] = None, + admin_username: Optional[str] = None, + admin_password: Optional[str] = None, + custom_data: Optional[str] = None, + windows_configuration: Optional["_models.WindowsConfiguration"] = None, + linux_configuration: Optional["_models.LinuxConfiguration"] = None, + secrets: Optional[List["_models.VaultSecretGroup"]] = None, + allow_extension_operations: Optional[bool] = None, + require_guest_provision_signal: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword computer_name_prefix: Specifies the computer name prefix for all of the virtual + machines in the scale + set. Computer name prefixes must be 1 to 15 characters long. + :paramtype computer_name_prefix: str + :keyword admin_username: Specifies the name of the administrator account. + :code:`
`:code:`
` **Windows-only + restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** + "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", + "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", + "console", "david", "guest", "john", "owner", "root", "server", "sql", + "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". + :code:`
`:code:`
` **Minimum-length (Linux):** 1 character :code:`
`:code:`
` + **Max-length + (Linux):** 64 characters :code:`
`:code:`
` **Max-length (Windows):** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length + (Windows):** 8 characters :code:`
`:code:`
` **Minimum-length (Linux):** 6 characters + :code:`
`:code:`
` **Max-length (Windows):** 123 characters :code:`
`:code:`
` + **Max-length + (Linux):** 72 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", + "Password22", "iloveyou!" :code:`
`:code:`
` For resetting the password, see `How to + reset the Remote Desktop service or its login password in a Windows + VM `_ + :code:`
`:code:`
` For resetting root password, see `Manage users, SSH, and check or + repair disks on Azure Linux VMs using the VMAccess + Extension + `_. + :paramtype admin_password: str + :keyword custom_data: Specifies a base-64 encoded string of custom data. The base-64 encoded + string + is decoded to a binary array that is saved as a file on the Virtual Machine. + The maximum length of the binary array is 65535 bytes. For using cloud-init for + your VM, see `Using cloud-init to customize a Linux VM during + creation `_. + :paramtype custom_data: str + :keyword windows_configuration: Specifies Windows operating system settings on the virtual + machine. + :paramtype windows_configuration: ~azure.mgmt.computefleet.models.WindowsConfiguration + :keyword linux_configuration: Specifies the Linux operating system settings on the virtual + machine. For a + list of supported Linux distributions, see `Linux on Azure-Endorsed + Distributions `_. + :paramtype linux_configuration: ~azure.mgmt.computefleet.models.LinuxConfiguration + :keyword secrets: Specifies set of certificates that should be installed onto the virtual + machines in the scale set. To install certificates on a virtual machine it is + recommended to use the `Azure Key Vault virtual machine extension for + Linux `_ + or the `Azure Key Vault virtual machine extension for + Windows `_. + :paramtype secrets: list[~azure.mgmt.computefleet.models.VaultSecretGroup] + :keyword allow_extension_operations: Specifies whether extension operations should be allowed + on the virtual machine + scale set. This may only be set to False when no extensions are present on the + virtual machine scale set. + :paramtype allow_extension_operations: bool + :keyword require_guest_provision_signal: Optional property which must either be set to True or + omitted. + :paramtype require_guest_provision_signal: bool + """ + super().__init__(**kwargs) + self.computer_name_prefix = computer_name_prefix + self.admin_username = admin_username + self.admin_password = admin_password + self.custom_data = custom_data + self.windows_configuration = windows_configuration + self.linux_configuration = linux_configuration + self.secrets = secrets + self.allow_extension_operations = allow_extension_operations + self.require_guest_provision_signal = require_guest_provision_signal + + +class VirtualMachineScaleSetPublicIPAddressConfiguration(_serialization.Model): # pylint: disable=name-too-long + """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 + :ivar properties: Describes a virtual machines scale set IP Configuration's PublicIPAddress + configuration. + :vartype properties: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetPublicIPAddressConfigurationProperties + :ivar sku: Describes the public IP Sku. It can only be set with OrchestrationMode as + Flexible. + :vartype sku: ~azure.mgmt.computefleet.models.PublicIPAddressSku + """ + + _validation = { + "name": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "properties": {"key": "properties", "type": "VirtualMachineScaleSetPublicIPAddressConfigurationProperties"}, + "sku": {"key": "sku", "type": "PublicIPAddressSku"}, + } + + def __init__( + self, + *, + name: str, + properties: Optional["_models.VirtualMachineScaleSetPublicIPAddressConfigurationProperties"] = None, + sku: Optional["_models.PublicIPAddressSku"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The publicIP address configuration name. Required. + :paramtype name: str + :keyword properties: Describes a virtual machines scale set IP Configuration's PublicIPAddress + configuration. + :paramtype properties: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetPublicIPAddressConfigurationProperties + :keyword sku: Describes the public IP Sku. It can only be set with OrchestrationMode as + Flexible. + :paramtype sku: ~azure.mgmt.computefleet.models.PublicIPAddressSku + """ + super().__init__(**kwargs) + self.name = name + self.properties = properties + self.sku = sku + + +class VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings( + _serialization.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 + will be the domain name labels of the PublicIPAddress resources that will be + created. Required. + :vartype domain_name_label: str + :ivar domain_name_label_scope: The Domain name label scope.The concatenation of the hashed + domain name label + that generated according to the policy from domain name label scope and vm + index will be the domain name labels of the PublicIPAddress resources that will + be created. Known values are: "TenantReuse", "SubscriptionReuse", "ResourceGroupReuse", and + "NoReuse". + :vartype domain_name_label_scope: str or + ~azure.mgmt.computefleet.models.DomainNameLabelScopeTypes + """ + + _validation = { + "domain_name_label": {"required": True}, + } + + _attribute_map = { + "domain_name_label": {"key": "domainNameLabel", "type": "str"}, + "domain_name_label_scope": {"key": "domainNameLabelScope", "type": "str"}, + } + + def __init__( + self, + *, + domain_name_label: str, + domain_name_label_scope: Optional[Union[str, "_models.DomainNameLabelScopeTypes"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword domain_name_label: The Domain name label.The concatenation of the domain name label + and vm index + will be the domain name labels of the PublicIPAddress resources that will be + created. Required. + :paramtype domain_name_label: str + :keyword domain_name_label_scope: The Domain name label scope.The concatenation of the hashed + domain name label + that generated according to the policy from domain name label scope and vm + index will be the domain name labels of the PublicIPAddress resources that will + be created. Known values are: "TenantReuse", "SubscriptionReuse", "ResourceGroupReuse", and + "NoReuse". + :paramtype domain_name_label_scope: str or + ~azure.mgmt.computefleet.models.DomainNameLabelScopeTypes + """ + super().__init__(**kwargs) + self.domain_name_label = domain_name_label + self.domain_name_label_scope = domain_name_label_scope + + +class VirtualMachineScaleSetPublicIPAddressConfigurationProperties( + _serialization.Model +): # pylint: disable=name-too-long + """Describes a virtual machines scale set IP Configuration's PublicIPAddress + configuration. + + :ivar idle_timeout_in_minutes: The idle timeout of the public IP address. + :vartype idle_timeout_in_minutes: int + :ivar dns_settings: The dns settings to be applied on the publicIP addresses . + :vartype dns_settings: + ~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_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_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 + """ + + _attribute_map = { + "idle_timeout_in_minutes": {"key": "idleTimeoutInMinutes", "type": "int"}, + "dns_settings": {"key": "dnsSettings", "type": "VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings"}, + "ip_tags": {"key": "ipTags", "type": "[VirtualMachineScaleSetIpTag]"}, + "public_ip_prefix": {"key": "publicIPPrefix", "type": "SubResource"}, + "public_ip_address_version": {"key": "publicIPAddressVersion", "type": "str"}, + "delete_option": {"key": "deleteOption", "type": "str"}, + } + + def __init__( + self, + *, + idle_timeout_in_minutes: Optional[int] = None, + dns_settings: Optional["_models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings"] = None, + ip_tags: Optional[List["_models.VirtualMachineScaleSetIpTag"]] = 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, + **kwargs: Any + ) -> None: + """ + :keyword idle_timeout_in_minutes: The idle timeout of the public IP address. + :paramtype idle_timeout_in_minutes: int + :keyword dns_settings: The dns settings to be applied on the publicIP addresses . + :paramtype dns_settings: + ~azure.mgmt.computefleet.models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + :keyword ip_tags: The list of IP tags associated with the public IP address. + :paramtype ip_tags: list[~azure.mgmt.computefleet.models.VirtualMachineScaleSetIpTag] + :keyword public_ip_prefix: The PublicIPPrefix from which to allocate publicIP addresses. + :paramtype public_ip_prefix: ~azure.mgmt.computefleet.models.SubResource + :keyword 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". + :paramtype public_ip_address_version: str or ~azure.mgmt.computefleet.models.IPVersion + :keyword delete_option: Specify what happens to the public IP when the VM is deleted. Known + values are: "Delete" and "Detach". + :paramtype delete_option: str or ~azure.mgmt.computefleet.models.DeleteOptions + """ + super().__init__(**kwargs) + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.dns_settings = dns_settings + self.ip_tags = ip_tags + self.public_ip_prefix = public_ip_prefix + self.public_ip_address_version = public_ip_address_version + self.delete_option = delete_option + + +class VirtualMachineScaleSetStorageProfile(_serialization.Model): + """Describes a virtual machine scale set storage profile. + + :ivar image_reference: Specifies information about the image to use. You can specify + information about + platform images, marketplace images, or virtual machine images. This element is + required when you want to use a platform image, marketplace image, or virtual + machine image, but is not used in other creation operations. + :vartype image_reference: ~azure.mgmt.computefleet.models.ImageReference + :ivar os_disk: Specifies information about the operating system disk used by the virtual + machines in the scale set. For more information about disks, see `About disks + and VHDs for Azure virtual + machines `_. + :vartype os_disk: ~azure.mgmt.computefleet.models.VirtualMachineScaleSetOSDisk + :ivar data_disks: Specifies the parameters that are used to add data disks to the virtual + machines in the scale set. For more information about disks, see `About disks + and VHDs for Azure virtual + machines `_. + :vartype data_disks: list[~azure.mgmt.computefleet.models.VirtualMachineScaleSetDataDisk] + :ivar disk_controller_type: Specifies the disk controller type configured for the virtual + machines in the scale set. Minimum api-version: 2022-08-01. Known values are: "SCSI" and + "NVMe". + :vartype disk_controller_type: str or ~azure.mgmt.computefleet.models.DiskControllerTypes + """ + + _attribute_map = { + "image_reference": {"key": "imageReference", "type": "ImageReference"}, + "os_disk": {"key": "osDisk", "type": "VirtualMachineScaleSetOSDisk"}, + "data_disks": {"key": "dataDisks", "type": "[VirtualMachineScaleSetDataDisk]"}, + "disk_controller_type": {"key": "diskControllerType", "type": "str"}, + } + + def __init__( + self, + *, + image_reference: Optional["_models.ImageReference"] = None, + os_disk: Optional["_models.VirtualMachineScaleSetOSDisk"] = None, + data_disks: Optional[List["_models.VirtualMachineScaleSetDataDisk"]] = None, + disk_controller_type: Optional[Union[str, "_models.DiskControllerTypes"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword image_reference: Specifies information about the image to use. You can specify + information about + platform images, marketplace images, or virtual machine images. This element is + required when you want to use a platform image, marketplace image, or virtual + machine image, but is not used in other creation operations. + :paramtype image_reference: ~azure.mgmt.computefleet.models.ImageReference + :keyword os_disk: Specifies information about the operating system disk used by the virtual + machines in the scale set. For more information about disks, see `About disks + and VHDs for Azure virtual + machines `_. + :paramtype os_disk: ~azure.mgmt.computefleet.models.VirtualMachineScaleSetOSDisk + :keyword data_disks: Specifies the parameters that are used to add data disks to the virtual + machines in the scale set. For more information about disks, see `About disks + and VHDs for Azure virtual + machines `_. + :paramtype data_disks: list[~azure.mgmt.computefleet.models.VirtualMachineScaleSetDataDisk] + :keyword disk_controller_type: Specifies the disk controller type configured for the virtual + machines in the scale set. Minimum api-version: 2022-08-01. Known values are: "SCSI" and + "NVMe". + :paramtype disk_controller_type: str or ~azure.mgmt.computefleet.models.DiskControllerTypes + """ + super().__init__(**kwargs) + self.image_reference = image_reference + self.os_disk = os_disk + self.data_disks = data_disks + self.disk_controller_type = disk_controller_type + + +class VMAttributeMinMax(_serialization.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: Maz VMSize from CRS, Max = 4294967295 (uint.MaxValue) if not specified. + :vartype max: int + """ + + _attribute_map = { + "min": {"key": "min", "type": "int"}, + "max": {"key": "max", "type": "int"}, + } + + def __init__( + self, + *, + min: Optional[int] = None, # pylint: disable=redefined-builtin + max: Optional[int] = None, # pylint: disable=redefined-builtin + **kwargs: Any + ) -> None: + """ + :keyword min: Min VMSize from CRS, Min = 0 (uint.MinValue) if not specified. + :paramtype min: int + :keyword max: Maz VMSize from CRS, Max = 4294967295 (uint.MaxValue) if not specified. + :paramtype max: int + """ + super().__init__(**kwargs) + self.min = min + self.max = max + + +class VMAttributes(_serialization.Model): # pylint: disable=too-many-instance-attributes + """VMAttributes that will be used to filter VMSizes which will be used to build Fleet. + + All required parameters must be populated in order to send to server. + + :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.VMAttributeMinMax + :ivar memory_in_mi_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_mi_b: ~azure.mgmt.computefleet.models.VMAttributeMinMax + :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_disk_type: The local storage disk types specified as a list. If gpuSupport + is Excluded, this VMAttribute can not be used. Required. + :vartype local_storage_disk_type: list[str or + ~azure.mgmt.computefleet.models.LocalStorageDiskType] + :ivar local_storage_in_gb: The range of local storage in GB specified from Min to Max. + Required. + :vartype local_storage_in_gb: ~azure.mgmt.computefleet.models.VMAttributeMinMax + :ivar local_storage_disk_types: The local storage disk types specified as a list. Required. + :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. Required. + :vartype data_disk_count: ~azure.mgmt.computefleet.models.VMAttributeMinMax + :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. Required. + :vartype network_interface_count: ~azure.mgmt.computefleet.models.VMAttributeMinMax + :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. Required. + :vartype network_bandwidth_in_mbps: ~azure.mgmt.computefleet.models.VMAttributeMinMax + :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. Required. + :vartype rdma_network_interface_count: ~azure.mgmt.computefleet.models.VMAttributeMinMax + :ivar gpu_support: Specifies whether the VMSize supporting GPU should be used to build Fleet or + not. Known values are: "Excluded", "Included", and "Required". + :vartype gpu_support: str or ~azure.mgmt.computefleet.models.VMAttributeSupport + :ivar gpu_manufacturers: The GPU manufacturers specified as a list. gpuSupport should be set to + Included or Required to use this VMAttribute. Default GPU manufacturers if not specified are + ANY of the valid values. Required. + :vartype gpu_manufacturers: list[str or ~azure.mgmt.computefleet.models.GpuManufacturer] + :ivar vm_categories: The VM category specified as a list. Optional parameter. Required. + :vartype vm_categories: list[str or ~azure.mgmt.computefleet.models.VMCategory] + :ivar architecture_types: The VM architecture types specified as a list. Optional parameter. + Required. + :vartype architecture_types: list[str or ~azure.mgmt.computefleet.models.ArchitectureType] + :ivar cpu_manufacturers: The VM CPU manufacturers specified as a list. Optional parameter. + Required. + :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. Required. + :vartype excluded_vm_sizes: list[str] + """ + + _validation = { + "v_cpu_count": {"required": True}, + "memory_in_mi_b": {"required": True}, + "local_storage_disk_type": {"required": True}, + "local_storage_in_gb": {"required": True}, + "local_storage_disk_types": {"required": True}, + "data_disk_count": {"required": True}, + "network_interface_count": {"required": True}, + "network_bandwidth_in_mbps": {"required": True}, + "rdma_network_interface_count": {"required": True}, + "gpu_manufacturers": {"required": True}, + "vm_categories": {"required": True}, + "architecture_types": {"required": True}, + "cpu_manufacturers": {"required": True}, + "excluded_vm_sizes": {"required": True}, + } + + _attribute_map = { + "v_cpu_count": {"key": "vCpuCount", "type": "VMAttributeMinMax"}, + "memory_in_mi_b": {"key": "memoryInMiB", "type": "VMAttributeMinMax"}, + "local_storage_support": {"key": "localStorageSupport", "type": "str"}, + "local_storage_disk_type": {"key": "localStorageDiskType", "type": "[str]"}, + "local_storage_in_gb": {"key": "localStorageInGB", "type": "VMAttributeMinMax"}, + "local_storage_disk_types": {"key": "localStorageDiskTypes", "type": "[str]"}, + "data_disk_count": {"key": "dataDiskCount", "type": "VMAttributeMinMax"}, + "network_interface_count": {"key": "networkInterfaceCount", "type": "VMAttributeMinMax"}, + "network_bandwidth_in_mbps": {"key": "networkBandwidthInMbps", "type": "VMAttributeMinMax"}, + "rdma_support": {"key": "rdmaSupport", "type": "str"}, + "rdma_network_interface_count": {"key": "rdmaNetworkInterfaceCount", "type": "VMAttributeMinMax"}, + "gpu_support": {"key": "gpuSupport", "type": "str"}, + "gpu_manufacturers": {"key": "gpuManufacturers", "type": "[str]"}, + "vm_categories": {"key": "vmCategories", "type": "[str]"}, + "architecture_types": {"key": "architectureTypes", "type": "[str]"}, + "cpu_manufacturers": {"key": "cpuManufacturers", "type": "[str]"}, + "burstable_support": {"key": "burstableSupport", "type": "str"}, + "excluded_vm_sizes": {"key": "excludedVMSizes", "type": "[str]"}, + } + + def __init__( + self, + *, + v_cpu_count: "_models.VMAttributeMinMax", + memory_in_mi_b: "_models.VMAttributeMinMax", + local_storage_disk_type: List[Union[str, "_models.LocalStorageDiskType"]], + local_storage_in_gb: "_models.VMAttributeMinMax", + local_storage_disk_types: List[Union[str, "_models.LocalStorageDiskType"]], + data_disk_count: "_models.VMAttributeMinMax", + network_interface_count: "_models.VMAttributeMinMax", + network_bandwidth_in_mbps: "_models.VMAttributeMinMax", + rdma_network_interface_count: "_models.VMAttributeMinMax", + gpu_manufacturers: List[Union[str, "_models.GpuManufacturer"]], + vm_categories: List[Union[str, "_models.VMCategory"]], + architecture_types: List[Union[str, "_models.ArchitectureType"]], + cpu_manufacturers: List[Union[str, "_models.CpuManufacturer"]], + excluded_vm_sizes: List[str], + local_storage_support: Optional[Union[str, "_models.VMAttributeSupport"]] = None, + rdma_support: Optional[Union[str, "_models.VMAttributeSupport"]] = None, + gpu_support: Optional[Union[str, "_models.VMAttributeSupport"]] = None, + burstable_support: Optional[Union[str, "_models.VMAttributeSupport"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword 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. + :paramtype v_cpu_count: ~azure.mgmt.computefleet.models.VMAttributeMinMax + :keyword memory_in_mi_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. + :paramtype memory_in_mi_b: ~azure.mgmt.computefleet.models.VMAttributeMinMax + :keyword 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". + :paramtype local_storage_support: str or ~azure.mgmt.computefleet.models.VMAttributeSupport + :keyword local_storage_disk_type: The local storage disk types specified as a list. If + gpuSupport is Excluded, this VMAttribute can not be used. Required. + :paramtype local_storage_disk_type: list[str or + ~azure.mgmt.computefleet.models.LocalStorageDiskType] + :keyword local_storage_in_gb: The range of local storage in GB specified from Min to Max. + Required. + :paramtype local_storage_in_gb: ~azure.mgmt.computefleet.models.VMAttributeMinMax + :keyword local_storage_disk_types: The local storage disk types specified as a list. Required. + :paramtype local_storage_disk_types: list[str or + ~azure.mgmt.computefleet.models.LocalStorageDiskType] + :keyword data_disk_count: The range of data disk count specified from Min to Max. Optional + parameter. Either Min or Max is required if specified. Required. + :paramtype data_disk_count: ~azure.mgmt.computefleet.models.VMAttributeMinMax + :keyword network_interface_count: The range of network interface count specified from Min to + Max. Optional parameter. Either Min or Max is required if specified. Required. + :paramtype network_interface_count: ~azure.mgmt.computefleet.models.VMAttributeMinMax + :keyword 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. Required. + :paramtype network_bandwidth_in_mbps: ~azure.mgmt.computefleet.models.VMAttributeMinMax + :keyword 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". + :paramtype rdma_support: str or ~azure.mgmt.computefleet.models.VMAttributeSupport + :keyword 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. Required. + :paramtype rdma_network_interface_count: ~azure.mgmt.computefleet.models.VMAttributeMinMax + :keyword gpu_support: Specifies whether the VMSize supporting GPU should be used to build Fleet + or not. Known values are: "Excluded", "Included", and "Required". + :paramtype gpu_support: str or ~azure.mgmt.computefleet.models.VMAttributeSupport + :keyword gpu_manufacturers: The GPU manufacturers specified as a list. gpuSupport should be set + to Included or Required to use this VMAttribute. Default GPU manufacturers if not specified are + ANY of the valid values. Required. + :paramtype gpu_manufacturers: list[str or ~azure.mgmt.computefleet.models.GpuManufacturer] + :keyword vm_categories: The VM category specified as a list. Optional parameter. Required. + :paramtype vm_categories: list[str or ~azure.mgmt.computefleet.models.VMCategory] + :keyword architecture_types: The VM architecture types specified as a list. Optional parameter. + Required. + :paramtype architecture_types: list[str or ~azure.mgmt.computefleet.models.ArchitectureType] + :keyword cpu_manufacturers: The VM CPU manufacturers specified as a list. Optional parameter. + Required. + :paramtype cpu_manufacturers: list[str or ~azure.mgmt.computefleet.models.CpuManufacturer] + :keyword burstable_support: Specifies whether the VMSize supporting burstable capability should + be used to build Fleet or not. Known values are: "Excluded", "Included", and "Required". + :paramtype burstable_support: str or ~azure.mgmt.computefleet.models.VMAttributeSupport + :keyword excluded_vm_sizes: Specifies which VMSizes should be excluded while building Fleet. + Optional parameter. Required. + :paramtype excluded_vm_sizes: list[str] + """ + super().__init__(**kwargs) + self.v_cpu_count = v_cpu_count + self.memory_in_mi_b = memory_in_mi_b + self.local_storage_support = local_storage_support + self.local_storage_disk_type = local_storage_disk_type + self.local_storage_in_gb = local_storage_in_gb + self.local_storage_disk_types = local_storage_disk_types + self.data_disk_count = data_disk_count + self.network_interface_count = network_interface_count + self.network_bandwidth_in_mbps = network_bandwidth_in_mbps + self.rdma_support = rdma_support + self.rdma_network_interface_count = rdma_network_interface_count + self.gpu_support = gpu_support + self.gpu_manufacturers = gpu_manufacturers + self.vm_categories = vm_categories + self.architecture_types = architecture_types + self.cpu_manufacturers = cpu_manufacturers + self.burstable_support = burstable_support + self.excluded_vm_sizes = excluded_vm_sizes + + +class VMAttributesList(_serialization.Model): + """List of VMAttributes that will be used to filter VMSizes which will be used to build Fleet. + + All required parameters must be populated in order to send to server. + + :ivar vm_attributes: List of VMAttributes that will be used to filter VMSizes which will be + used to build Fleet. Required. + :vartype vm_attributes: list[~azure.mgmt.computefleet.models.VMAttributes] + """ + + _validation = { + "vm_attributes": {"required": True}, + } + + _attribute_map = { + "vm_attributes": {"key": "vmAttributes", "type": "[VMAttributes]"}, + } + + def __init__(self, *, vm_attributes: List["_models.VMAttributes"], **kwargs: Any) -> None: + """ + :keyword vm_attributes: List of VMAttributes that will be used to filter VMSizes which will be + used to build Fleet. Required. + :paramtype vm_attributes: list[~azure.mgmt.computefleet.models.VMAttributes] + """ + super().__init__(**kwargs) + self.vm_attributes = vm_attributes + + +class VMDiskSecurityProfile(_serialization.Model): + """Specifies the security profile settings for the managed disk. **Note:** It can + only be set for Confidential VMs. + + :ivar security_encryption_type: Specifies the EncryptionType of the managed disk. It is set to + DiskWithVMGuestState for encryption of the managed disk along with VMGuestState + blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and + NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. + **Note:** It can be set for only Confidential VMs. Known values are: "VMGuestStateOnly", + "DiskWithVMGuestState", and "NonPersistedTPM". + :vartype security_encryption_type: str or + ~azure.mgmt.computefleet.models.SecurityEncryptionTypes + :ivar disk_encryption_set: Specifies the customer managed disk encryption set resource id for + the managed + disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and + VMGuest blob. + :vartype disk_encryption_set: ~azure.mgmt.computefleet.models.DiskEncryptionSetParameters + """ + + _attribute_map = { + "security_encryption_type": {"key": "securityEncryptionType", "type": "str"}, + "disk_encryption_set": {"key": "diskEncryptionSet", "type": "DiskEncryptionSetParameters"}, + } + + def __init__( + self, + *, + security_encryption_type: Optional[Union[str, "_models.SecurityEncryptionTypes"]] = None, + disk_encryption_set: Optional["_models.DiskEncryptionSetParameters"] = None, + **kwargs: Any + ) -> None: + """ + :keyword security_encryption_type: Specifies the EncryptionType of the managed disk. It is set + to + DiskWithVMGuestState for encryption of the managed disk along with VMGuestState + blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and + NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. + **Note:** It can be set for only Confidential VMs. Known values are: "VMGuestStateOnly", + "DiskWithVMGuestState", and "NonPersistedTPM". + :paramtype security_encryption_type: str or + ~azure.mgmt.computefleet.models.SecurityEncryptionTypes + :keyword disk_encryption_set: Specifies the customer managed disk encryption set resource id + for the managed + disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and + VMGuest blob. + :paramtype disk_encryption_set: ~azure.mgmt.computefleet.models.DiskEncryptionSetParameters + """ + super().__init__(**kwargs) + self.security_encryption_type = security_encryption_type + self.disk_encryption_set = disk_encryption_set + + +class VMGalleryApplication(_serialization.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 + :ivar order: Optional, Specifies the order in which the packages have to be installed. + :vartype order: int + :ivar package_reference_id: Specifies the GalleryApplicationVersion resource id on the form of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version}. # pylint: disable=line-too-long + Required. + :vartype package_reference_id: str + :ivar configuration_reference: Optional, Specifies the uri to an azure blob that will replace + the default + configuration for the package if provided. + :vartype configuration_reference: str + :ivar treat_failure_as_deployment_failure: Optional, If true, any failure for any operation in + the VmApplication will fail + the deployment. + :vartype treat_failure_as_deployment_failure: bool + :ivar enable_automatic_upgrade: If set to true, when a new Gallery Application version is + available in PIR/SIG, + it will be automatically updated for the VM/VMSS. + :vartype enable_automatic_upgrade: bool + """ + + _validation = { + "package_reference_id": {"required": True}, + } + + _attribute_map = { + "tags": {"key": "tags", "type": "str"}, + "order": {"key": "order", "type": "int"}, + "package_reference_id": {"key": "packageReferenceId", "type": "str"}, + "configuration_reference": {"key": "configurationReference", "type": "str"}, + "treat_failure_as_deployment_failure": {"key": "treatFailureAsDeploymentFailure", "type": "bool"}, + "enable_automatic_upgrade": {"key": "enableAutomaticUpgrade", "type": "bool"}, + } + + def __init__( + self, + *, + package_reference_id: str, + tags: Optional[str] = None, + order: Optional[int] = None, + configuration_reference: Optional[str] = None, + treat_failure_as_deployment_failure: Optional[bool] = None, + enable_automatic_upgrade: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Optional, Specifies a passthrough value for more generic context. + :paramtype tags: str + :keyword order: Optional, Specifies the order in which the packages have to be installed. + :paramtype order: int + :keyword package_reference_id: Specifies the GalleryApplicationVersion resource id on the form + of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version}. # pylint: disable=line-too-long + Required. + :paramtype package_reference_id: str + :keyword configuration_reference: Optional, Specifies the uri to an azure blob that will + replace the default + configuration for the package if provided. + :paramtype configuration_reference: str + :keyword treat_failure_as_deployment_failure: Optional, If true, any failure for any operation + in the VmApplication will fail + the deployment. + :paramtype treat_failure_as_deployment_failure: bool + :keyword enable_automatic_upgrade: If set to true, when a new Gallery Application version is + available in PIR/SIG, + it will be automatically updated for the VM/VMSS. + :paramtype enable_automatic_upgrade: bool + """ + super().__init__(**kwargs) + self.tags = tags + self.order = order + self.package_reference_id = package_reference_id + self.configuration_reference = configuration_reference + self.treat_failure_as_deployment_failure = treat_failure_as_deployment_failure + self.enable_automatic_upgrade = enable_automatic_upgrade + + +class VmSizeProfile(_serialization.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 + :ivar rank: The rank of the VM size. This is used with + 'RegularPriorityAllocationStrategy.Prioritized' + The lower the number, the higher the priority. Starting with 0. + :vartype rank: int + """ + + _validation = { + "name": {"required": True}, + "rank": {"maximum": 65535, "minimum": 0}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "rank": {"key": "rank", "type": "int"}, + } + + def __init__(self, *, name: str, rank: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword name: The Sku name (e.g. 'Standard_DS1_v2'). Required. + :paramtype name: str + :keyword rank: The rank of the VM size. This is used with + 'RegularPriorityAllocationStrategy.Prioritized' + The lower the number, the higher the priority. Starting with 0. + :paramtype rank: int + """ + super().__init__(**kwargs) + self.name = name + self.rank = rank + + +class VMSizeProperties(_serialization.Model): + """Specifies VM Size Property settings on the virtual machine. + + :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_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_cpus_per_core: int + """ + + _attribute_map = { + "v_cpus_available": {"key": "vCPUsAvailable", "type": "int"}, + "v_cpus_per_core": {"key": "vCPUsPerCore", "type": "int"}, + } + + def __init__( + self, *, v_cpus_available: Optional[int] = None, v_cpus_per_core: Optional[int] = None, **kwargs: Any + ) -> None: + """ + :keyword 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 `_. + :paramtype v_cpus_available: int + :keyword 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.**. + :paramtype v_cpus_per_core: int + """ + super().__init__(**kwargs) + self.v_cpus_available = v_cpus_available + self.v_cpus_per_core = v_cpus_per_core + + +class WindowsConfiguration(_serialization.Model): + """Specifies Windows operating system settings on the virtual machine. + + :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_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 + updated and updates will take effect on OS reprovisioning. + :vartype enable_automatic_updates: bool + :ivar time_zone: Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". + Possible values can be + `TimeZoneInfo.Id + `_ + value from time zones returned by + `TimeZoneInfo.GetSystemTimeZones + `_. + :vartype time_zone: str + :ivar additional_unattend_content: Specifies additional base-64 encoded XML formatted + information that can be + included in the Unattend.xml file, which is used by Windows Setup. + :vartype additional_unattend_content: + list[~azure.mgmt.computefleet.models.AdditionalUnattendContent] + :ivar patch_settings: [Preview Feature] Specifies settings related to VM Guest Patching on + Windows. + :vartype patch_settings: ~azure.mgmt.computefleet.models.PatchSettings + :ivar win_rm: Specifies the Windows Remote Management listeners. This enables remote Windows + PowerShell. + :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_vm_agent_platform_updates: bool + """ + + _attribute_map = { + "provision_vm_agent": {"key": "provisionVMAgent", "type": "bool"}, + "enable_automatic_updates": {"key": "enableAutomaticUpdates", "type": "bool"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "additional_unattend_content": {"key": "additionalUnattendContent", "type": "[AdditionalUnattendContent]"}, + "patch_settings": {"key": "patchSettings", "type": "PatchSettings"}, + "win_rm": {"key": "winRM", "type": "WinRMConfiguration"}, + "enable_vm_agent_platform_updates": {"key": "enableVMAgentPlatformUpdates", "type": "bool"}, + } + + def __init__( + self, + *, + 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_rm: Optional["_models.WinRMConfiguration"] = None, + enable_vm_agent_platform_updates: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword 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. + :paramtype provision_vm_agent: bool + :keyword 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 + updated and updates will take effect on OS reprovisioning. + :paramtype enable_automatic_updates: bool + :keyword time_zone: Specifies the time zone of the virtual machine. e.g. "Pacific Standard + Time". + Possible values can be + `TimeZoneInfo.Id + `_ + value from time zones returned by + `TimeZoneInfo.GetSystemTimeZones + `_. + :paramtype time_zone: str + :keyword additional_unattend_content: Specifies additional base-64 encoded XML formatted + information that can be + included in the Unattend.xml file, which is used by Windows Setup. + :paramtype additional_unattend_content: + list[~azure.mgmt.computefleet.models.AdditionalUnattendContent] + :keyword patch_settings: [Preview Feature] Specifies settings related to VM Guest Patching on + Windows. + :paramtype patch_settings: ~azure.mgmt.computefleet.models.PatchSettings + :keyword win_rm: Specifies the Windows Remote Management listeners. This enables remote Windows + PowerShell. + :paramtype win_rm: ~azure.mgmt.computefleet.models.WinRMConfiguration + :keyword enable_vm_agent_platform_updates: Indicates whether VMAgent Platform Updates is + enabled for the Windows virtual + machine. Default value is false. + :paramtype enable_vm_agent_platform_updates: bool + """ + super().__init__(**kwargs) + self.provision_vm_agent = provision_vm_agent + self.enable_automatic_updates = enable_automatic_updates + self.time_zone = time_zone + self.additional_unattend_content = additional_unattend_content + self.patch_settings = patch_settings + self.win_rm = win_rm + self.enable_vm_agent_platform_updates = enable_vm_agent_platform_updates + + +class WindowsVMGuestPatchAutomaticByPlatformSettings(_serialization.Model): # pylint: disable=name-too-long + """Specifies additional settings to be applied when patch mode AutomaticByPlatform + is selected in Windows patch settings. + + :ivar reboot_setting: Specifies the reboot setting for all AutomaticByPlatform patch + installation + operations. Known values are: "Unknown", "IfRequired", "Never", and "Always". + :vartype reboot_setting: str or + ~azure.mgmt.computefleet.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting + :ivar bypass_platform_safety_checks_on_user_schedule: Enables customer to schedule patching + without accidental upgrades. + :vartype bypass_platform_safety_checks_on_user_schedule: bool + """ + + _attribute_map = { + "reboot_setting": {"key": "rebootSetting", "type": "str"}, + "bypass_platform_safety_checks_on_user_schedule": { + "key": "bypassPlatformSafetyChecksOnUserSchedule", + "type": "bool", + }, + } + + def __init__( + self, + *, + reboot_setting: Optional[Union[str, "_models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting"]] = None, + bypass_platform_safety_checks_on_user_schedule: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword reboot_setting: Specifies the reboot setting for all AutomaticByPlatform patch + installation + operations. Known values are: "Unknown", "IfRequired", "Never", and "Always". + :paramtype reboot_setting: str or + ~azure.mgmt.computefleet.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting + :keyword bypass_platform_safety_checks_on_user_schedule: Enables customer to schedule patching + without accidental upgrades. + :paramtype bypass_platform_safety_checks_on_user_schedule: bool + """ + super().__init__(**kwargs) + self.reboot_setting = reboot_setting + self.bypass_platform_safety_checks_on_user_schedule = bypass_platform_safety_checks_on_user_schedule + + +class WinRMConfiguration(_serialization.Model): + """Describes Windows Remote Management configuration of the VM. + + :ivar listeners: The list of Windows Remote Management listeners. + :vartype listeners: list[~azure.mgmt.computefleet.models.WinRMListener] + """ + + _attribute_map = { + "listeners": {"key": "listeners", "type": "[WinRMListener]"}, + } + + def __init__(self, *, listeners: Optional[List["_models.WinRMListener"]] = None, **kwargs: Any) -> None: + """ + :keyword listeners: The list of Windows Remote Management listeners. + :paramtype listeners: list[~azure.mgmt.computefleet.models.WinRMListener] + """ + super().__init__(**kwargs) + self.listeners = listeners + + +class WinRMListener(_serialization.Model): + """Describes Protocol and thumbprint of Windows Remote Management listener. + + :ivar protocol: Specifies the protocol of WinRM listener. Possible values are: **http,** + **https.**. Known values are: "Http" and "Https". + :vartype protocol: str or ~azure.mgmt.computefleet.models.ProtocolTypes + :ivar certificate_url: This is the URL of a certificate that has been uploaded to Key Vault as + a + secret. For adding a secret to the Key Vault, see `Add a key or secret to the + key + vault `_. + In this case, your certificate needs to be the Base64 encoding of the following + JSON Object which is encoded in UTF-8: :code:`
`:code:`
` {:code:`
` + "data":":code:``",:code:`
` "dataType":"pfx",:code:`
` + "password":":code:``":code:`
`} :code:`
` To install certificates on + a virtual + machine it is recommended to use the `Azure Key Vault virtual machine extension + for + Linux `_ + or the `Azure Key Vault virtual machine extension for + Windows `_. + :vartype certificate_url: str + """ + + _attribute_map = { + "protocol": {"key": "protocol", "type": "str"}, + "certificate_url": {"key": "certificateUrl", "type": "str"}, + } + + def __init__( + self, + *, + protocol: Optional[Union[str, "_models.ProtocolTypes"]] = None, + certificate_url: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword protocol: Specifies the protocol of WinRM listener. Possible values are: **http,** + **https.**. Known values are: "Http" and "Https". + :paramtype protocol: str or ~azure.mgmt.computefleet.models.ProtocolTypes + :keyword certificate_url: This is the URL of a certificate that has been uploaded to Key Vault + as a + secret. For adding a secret to the Key Vault, see `Add a key or secret to the + key + vault `_. + In this case, your certificate needs to be the Base64 encoding of the following + JSON Object which is encoded in UTF-8: :code:`
`:code:`
` {:code:`
` + "data":":code:``",:code:`
` "dataType":"pfx",:code:`
` + "password":":code:``":code:`
`} :code:`
` To install certificates on + a virtual + machine it is recommended to use the `Azure Key Vault virtual machine extension + for + Linux `_ + or the `Azure Key Vault virtual machine extension for + Windows `_. + :paramtype certificate_url: str + """ + super().__init__(**kwargs) + self.protocol = protocol + self.certificate_url = certificate_url diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/operations/__init__.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/operations/__init__.py index 180cf6d7d211..6fac9ac6d5df 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/operations/__init__.py +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/operations/__init__.py @@ -2,12 +2,12 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._operations import Operations -from ._operations import FleetsOperations +from ._fleets_operations import FleetsOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import diff --git a/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/operations/_fleets_operations.py b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/operations/_fleets_operations.py new file mode 100644 index 000000000000..640fe9b3be80 --- /dev/null +++ b/sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/operations/_fleets_operations.py @@ -0,0 +1,1072 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._serialization import Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AzureFleet/fleets") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request(resource_group_name: str, fleet_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "fleetName": _SERIALIZER.url("fleet_name", fleet_name, "str", pattern=r"^[^_\W][\w\-._]{0,79}(? HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "fleetName": _SERIALIZER.url("fleet_name", fleet_name, "str", pattern=r"^[^_\W][\w\-._]{0,79}(? HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "fleetName": _SERIALIZER.url("fleet_name", fleet_name, "str", pattern=r"^[^_\W][\w\-._]{0,79}(? HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "fleetName": _SERIALIZER.url("fleet_name", fleet_name, "str", pattern=r"^[^_\W][\w\-._]{0,79}(? HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{name}/virtualMachineScaleSets", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "name": _SERIALIZER.url("name", name, "str", pattern=r"^[^_\W][\w\-._]{0,79}(? Iterable["_models.Fleet"]: + """List Fleet resources by subscription ID. + + :return: An iterator like instance of either Fleet or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.computefleet.models.Fleet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.FleetListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("FleetListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Fleet"]: + """List Fleet resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of either Fleet or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.computefleet.models.Fleet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.FleetListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("FleetListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> _models.Fleet: + """Get a Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param fleet_name: The name of the Compute Fleet. Required. + :type fleet_name: str + :return: Fleet or the result of cls(response) + :rtype: ~azure.mgmt.computefleet.models.Fleet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Fleet] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + fleet_name=fleet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Fleet", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, resource_group_name: str, fleet_name: str, resource: Union[_models.Fleet, IO[bytes]], **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _json = self._serialize.body(resource, "Fleet") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + fleet_name=fleet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + fleet_name: str, + resource: _models.Fleet, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Fleet]: + """Create a Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param fleet_name: The name of the Compute Fleet. Required. + :type fleet_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.computefleet.models.Fleet + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either Fleet or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.computefleet.models.Fleet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + fleet_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Fleet]: + """Create a Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param fleet_name: The name of the Compute Fleet. Required. + :type fleet_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either Fleet or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.computefleet.models.Fleet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, resource_group_name: str, fleet_name: str, resource: Union[_models.Fleet, IO[bytes]], **kwargs: Any + ) -> LROPoller[_models.Fleet]: + """Create a Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param fleet_name: The name of the Compute Fleet. Required. + :type fleet_name: str + :param resource: Resource create parameters. Is either a Fleet type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.computefleet.models.Fleet or IO[bytes] + :return: An instance of LROPoller that returns either Fleet or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.computefleet.models.Fleet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Fleet] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + fleet_name=fleet_name, + resource=resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Fleet", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Fleet].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Fleet]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + fleet_name: str, + properties: Union[_models.FleetUpdate, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _json = self._serialize.body(properties, "FleetUpdate") + + _request = build_update_request( + resource_group_name=resource_group_name, + fleet_name=fleet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + 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.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + fleet_name: str, + properties: _models.FleetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Fleet]: + """Update a Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param fleet_name: The name of the Compute Fleet. Required. + :type fleet_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.computefleet.models.FleetUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either Fleet or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.computefleet.models.Fleet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + fleet_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Fleet]: + """Update a Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param fleet_name: The name of the Compute Fleet. Required. + :type fleet_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either Fleet or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.computefleet.models.Fleet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + fleet_name: str, + properties: Union[_models.FleetUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Fleet]: + """Update a Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param fleet_name: The name of the Compute Fleet. Required. + :type fleet_name: str + :param properties: The resource properties to be updated. Is either a FleetUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.computefleet.models.FleetUpdate or IO[bytes] + :return: An instance of LROPoller that returns either Fleet or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.computefleet.models.Fleet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Fleet] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + fleet_name=fleet_name, + properties=properties, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Fleet", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Fleet].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Fleet]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + fleet_name=fleet_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + 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.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete a Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param fleet_name: The name of the Compute Fleet. Required. + :type fleet_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + fleet_name=fleet_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_virtual_machine_scale_sets( + self, resource_group_name: str, name: str, **kwargs: Any + ) -> Iterable["_models.VirtualMachineScaleSet"]: + """List VirtualMachineScaleSet resources by Fleet. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param name: The name of the Fleet. Required. + :type name: str + :return: An iterator like instance of either VirtualMachineScaleSet or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.computefleet.models.VirtualMachineScaleSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.VirtualMachineScaleSetListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_virtual_machine_scale_sets_request( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualMachineScaleSetListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) 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..22eb224fe6a2 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 @@ -3,13 +3,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -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, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -18,21 +16,16 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._model_base import SdkJSONEncoder, _deserialize from .._serialization import Serializer if sys.version_info >= (3, 9): @@ -41,220 +34,20 @@ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_operations_list_request(**kwargs: Any) -> HttpRequest: +def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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 - _url = "/providers/Microsoft.AzureFleet/operations" - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_fleets_get_request( - resource_group_name: str, fleet_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}" # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "fleetName": _SERIALIZER.url("fleet_name", fleet_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_fleets_create_or_update_request( - resource_group_name: str, fleet_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _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")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}" # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "fleetName": _SERIALIZER.url("fleet_name", fleet_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_fleets_update_request( - resource_group_name: str, fleet_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _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")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}" # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "fleetName": _SERIALIZER.url("fleet_name", fleet_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_fleets_delete_request( - resource_group_name: str, fleet_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}" # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "fleetName": _SERIALIZER.url("fleet_name", fleet_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_fleets_list_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_fleets_list_by_subscription_request( # pylint: disable=name-too-long - subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureFleet/fleets" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_fleets_list_virtual_machine_scale_sets_request( # pylint: disable=name-too-long - resource_group_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{name}/virtualMachineScaleSets" # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = kwargs.pop("template_url", "/providers/Microsoft.AzureFleet/operations") # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -271,10 +64,12 @@ class Operations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.computefleet.ComputeFleetMgmtClient`'s + :class:`~azure.mgmt.computefleet.MicrosoftAzureFleet`'s :attr:`operations` attribute. """ + models = _models + def __init__(self, *args, **kwargs): input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") @@ -286,6735 +81,15 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: """List the operations for the provider. - :return: An iterator like instance of Operation + :return: An iterator like instance of either Operation or the result of cls(response) :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]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_operations_list_request( - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized["value"]) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class FleetsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.computefleet.ComputeFleetMgmtClient`'s - :attr:`fleets` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> _models.Fleet: - """Get a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :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]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Fleet] = kwargs.pop("cls", None) - - _request = build_fleets_get_request( - resource_group_name=resource_group_name, - fleet_name=fleet_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Fleet, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - 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]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_fleets_create_or_update_request( - resource_group_name=resource_group_name, - fleet_name=fleet_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) - 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() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - fleet_name: str, - resource: _models.Fleet, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Fleet]: - """Create a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.computefleet.models.Fleet - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Fleet. The Fleet is compatible with - 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 - def begin_create_or_update( - self, - resource_group_name: str, - fleet_name: str, - resource: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Fleet]: - """Create a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Fleet. The Fleet is compatible with - 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 - def begin_create_or_update( - self, - resource_group_name: str, - fleet_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Fleet]: - """Create a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Fleet. The Fleet is compatible with - 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 - def begin_create_or_update( - self, resource_group_name: str, fleet_name: str, resource: Union[_models.Fleet, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Fleet]: - """Create a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :param resource: Resource create parameters. Is one of the following types: Fleet, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.computefleet.models.Fleet or JSON or IO[bytes] - :return: An instance of LROPoller that returns Fleet. The Fleet is compatible with - 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 {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Fleet] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - fleet_name=fleet_name, - resource=resource, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Fleet, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Fleet].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Fleet]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - fleet_name: str, - properties: Union[_models.FleetUpdate, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_fleets_update_request( - resource_group_name=resource_group_name, - fleet_name=fleet_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) - 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() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - fleet_name: str, - properties: _models.FleetUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Fleet]: - """Update a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.computefleet.models.FleetUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Fleet. The Fleet is compatible with - 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 - def begin_update( - self, - resource_group_name: str, - fleet_name: str, - properties: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Fleet]: - """Update a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Fleet. The Fleet is compatible with - 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 - def begin_update( - self, - resource_group_name: str, - fleet_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Fleet]: - """Update a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Fleet. The Fleet is compatible with - 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 - def begin_update( - self, - resource_group_name: str, - fleet_name: str, - properties: Union[_models.FleetUpdate, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Fleet]: - """Update a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :param properties: The resource properties to be updated. Is one of the following types: - FleetUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.computefleet.models.FleetUpdate or JSON or IO[bytes] - :return: An instance of LROPoller that returns Fleet. The Fleet is compatible with - 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 {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Fleet] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - fleet_name=fleet_name, - properties=properties, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Fleet, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Fleet].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Fleet]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_fleets_delete_request( - resource_group_name=resource_group_name, - fleet_name=fleet_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - response_headers = {} - 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() - - if response.status_code == 204: - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete a Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param fleet_name: The name of the Compute Fleet. Required. - :type fleet_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - fleet_name=fleet_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Fleet"]: - """List Fleet resources by resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :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) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -7027,10 +102,8 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite def prepare_request(next_link=None): if not next_link: - _request = build_fleets_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, + _request = build_list_request( + api_version=api_version, headers=_headers, params=_params, ) @@ -7050,630 +123,15 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Fleet], deserialized["value"]) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Fleet"]: - """List Fleet resources by subscription ID. - - :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]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_fleets_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Fleet], deserialized["value"]) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_virtual_machine_scale_sets( - self, resource_group_name: str, name: str, **kwargs: Any - ) -> Iterable["_models.VirtualMachineScaleSet"]: - """List VirtualMachineScaleSet resources by Fleet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param name: The name of the Fleet. Required. - :type name: str - :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]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_fleets_list_virtual_machine_scale_sets_request( - resource_group_name=resource_group_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - + _request.method = "GET" return _request def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.VirtualMachineScaleSet], deserialized["value"]) + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -7686,7 +144,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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..7ef12a3f3f89 --- /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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import MicrosoftAzureFleet + +""" +# 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 = MicrosoftAzureFleet( + credential=DefaultAzureCredential(), + subscription_id="1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", + ) + + 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: specification/azurefleet/resource-manager/Microsoft.AzureFleet/stable/2024-11-01/examples/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..65c1645aec3e --- /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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import MicrosoftAzureFleet + +""" +# 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 = MicrosoftAzureFleet( + credential=DefaultAzureCredential(), + subscription_id="1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", + ) + + 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: specification/azurefleet/resource-manager/Microsoft.AzureFleet/stable/2024-11-01/examples/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..f579ab646aac --- /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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import MicrosoftAzureFleet + +""" +# 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 = MicrosoftAzureFleet( + credential=DefaultAzureCredential(), + subscription_id="1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", + ) + + client.fleets.begin_delete( + resource_group_name="rgazurefleet", + fleet_name="testFleet", + ).result() + + +# x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/stable/2024-11-01/examples/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..88dd0b20fad0 --- /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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import MicrosoftAzureFleet + +""" +# 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 = MicrosoftAzureFleet( + credential=DefaultAzureCredential(), + subscription_id="1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", + ) + + response = client.fleets.get( + resource_group_name="rgazurefleet", + fleet_name="testFleet", + ) + print(response) + + +# x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/stable/2024-11-01/examples/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..f3bd2e0a10f7 --- /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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import MicrosoftAzureFleet + +""" +# 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 = MicrosoftAzureFleet( + credential=DefaultAzureCredential(), + subscription_id="1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", + ) + + response = client.fleets.list_by_resource_group( + resource_group_name="rgazurefleet", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/stable/2024-11-01/examples/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..e83f2eb34ff9 --- /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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import MicrosoftAzureFleet + +""" +# 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 = MicrosoftAzureFleet( + credential=DefaultAzureCredential(), + subscription_id="1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", + ) + + response = client.fleets.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/stable/2024-11-01/examples/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..200d706d08a2 --- /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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import MicrosoftAzureFleet + +""" +# 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 = MicrosoftAzureFleet( + credential=DefaultAzureCredential(), + subscription_id="1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", + ) + + response = client.fleets.list_virtual_machine_scale_sets( + resource_group_name="rgazurefleet", + name="myFleet", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/stable/2024-11-01/examples/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..82dcc86a8e0d --- /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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import MicrosoftAzureFleet + +""" +# 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 = MicrosoftAzureFleet( + credential=DefaultAzureCredential(), + subscription_id="1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", + ) + + 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: specification/azurefleet/resource-manager/Microsoft.AzureFleet/stable/2024-11-01/examples/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..fb03852dce7e --- /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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.computefleet import MicrosoftAzureFleet + +""" +# 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 = MicrosoftAzureFleet( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.operations.list() + for item in response: + print(item) + + +# x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/stable/2024-11-01/examples/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..adb01f355682 100644 --- a/sdk/computefleet/azure-mgmt-computefleet/generated_tests/conftest.py +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/conftest.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import os @@ -21,14 +21,16 @@ # aovid 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") - computefleetmgmt_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") - computefleetmgmt_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") - computefleetmgmt_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=computefleetmgmt_subscription_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=computefleetmgmt_tenant_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=computefleetmgmt_client_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=computefleetmgmt_client_secret, value="00000000-0000-0000-0000-000000000000") + microsoftazurefleet_subscription_id = os.environ.get( + "AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" + ) + microsoftazurefleet_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + microsoftazurefleet_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + microsoftazurefleet_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=microsoftazurefleet_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=microsoftazurefleet_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=microsoftazurefleet_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=microsoftazurefleet_client_secret, value="00000000-0000-0000-0000-000000000000") add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") add_header_regex_sanitizer(key="Cookie", value="cookie;") diff --git a/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_microsoft_azure_fleet_fleets_operations.py b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_microsoft_azure_fleet_fleets_operations.py new file mode 100644 index 000000000000..16a1543f18f6 --- /dev/null +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_microsoft_azure_fleet_fleets_operations.py @@ -0,0 +1,1103 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.computefleet import MicrosoftAzureFleet + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestMicrosoftAzureFleetFleetsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(MicrosoftAzureFleet) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list_by_subscription(self, resource_group): + response = self.client.fleets.list_by_subscription( + api_version="2024-11-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list_by_resource_group(self, resource_group): + response = self.client.fleets.list_by_resource_group( + resource_group_name=resource_group.name, + api_version="2024-11-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get(self, resource_group): + response = self.client.fleets.get( + resource_group_name=resource_group.name, + fleet_name="str", + api_version="2024-11-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_create_or_update(self, resource_group): + response = self.client.fleets.begin_create_or_update( + resource_group_name=resource_group.name, + fleet_name="str", + resource={ + "location": "str", + "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", + }, + } + ] + }, + "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", + }, + "additionalVirtualMachineCapabilities": {"hibernationEnabled": bool, "ultraSSDEnabled": bool}, + "computeApiVersion": "str", + "platformFaultDomainCount": 0, + }, + "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"}, + "provisioningState": "str", + "regularPriorityProfile": {"allocationStrategy": "str", "capacity": 0, "minCapacity": 0}, + "spotPriorityProfile": { + "allocationStrategy": "str", + "capacity": 0, + "evictionPolicy": "str", + "maintain": bool, + "maxPricePerVM": 0.0, + "minCapacity": 0, + }, + "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"}, + "timeCreated": "2020-02-20 00:00:00", + "type": "str", + "uniqueId": "str", + "vmAttributes": { + "architectureTypes": ["str"], + "cpuManufacturers": ["str"], + "dataDiskCount": {"max": 0, "min": 0}, + "excludedVMSizes": ["str"], + "gpuManufacturers": ["str"], + "localStorageDiskType": ["str"], + "localStorageDiskTypes": ["str"], + "localStorageInGB": {"max": 0, "min": 0}, + "memoryInMiB": {"max": 0, "min": 0}, + "networkBandwidthInMbps": {"max": 0, "min": 0}, + "networkInterfaceCount": {"max": 0, "min": 0}, + "rdmaNetworkInterfaceCount": {"max": 0, "min": 0}, + "vCpuCount": {"max": 0, "min": 0}, + "vmCategories": ["str"], + "burstableSupport": "str", + "gpuSupport": "str", + "localStorageSupport": "str", + "rdmaSupport": "str", + }, + "vmSizesProfile": [{"name": "str", "rank": 0}], + "zones": ["str"], + }, + api_version="2024-11-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_update(self, resource_group): + response = self.client.fleets.begin_update( + resource_group_name=resource_group.name, + fleet_name="str", + 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", + }, + "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": { + "allocationStrategy": "str", + "capacity": 0, + "evictionPolicy": "str", + "maintain": bool, + "maxPricePerVM": 0.0, + "minCapacity": 0, + }, + "timeCreated": "2020-02-20 00:00:00", + "uniqueId": "str", + "vmAttributes": { + "architectureTypes": ["str"], + "cpuManufacturers": ["str"], + "dataDiskCount": {"max": 0, "min": 0}, + "excludedVMSizes": ["str"], + "gpuManufacturers": ["str"], + "localStorageDiskType": ["str"], + "localStorageDiskTypes": ["str"], + "localStorageInGB": {"max": 0, "min": 0}, + "memoryInMiB": {"max": 0, "min": 0}, + "networkBandwidthInMbps": {"max": 0, "min": 0}, + "networkInterfaceCount": {"max": 0, "min": 0}, + "rdmaNetworkInterfaceCount": {"max": 0, "min": 0}, + "vCpuCount": {"max": 0, "min": 0}, + "vmCategories": ["str"], + "burstableSupport": "str", + "gpuSupport": "str", + "localStorageSupport": "str", + "rdmaSupport": "str", + }, + }, + "tags": {"str": "str"}, + }, + api_version="2024-11-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_delete(self, resource_group): + response = self.client.fleets.begin_delete( + resource_group_name=resource_group.name, + fleet_name="str", + api_version="2024-11-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_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", + api_version="2024-11-01", + ) + 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_microsoft_azure_fleet_fleets_operations_async.py b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_microsoft_azure_fleet_fleets_operations_async.py new file mode 100644 index 000000000000..47a87c04738a --- /dev/null +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_microsoft_azure_fleet_fleets_operations_async.py @@ -0,0 +1,1143 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.computefleet.aio import MicrosoftAzureFleet + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestMicrosoftAzureFleetFleetsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(MicrosoftAzureFleet, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list_by_subscription(self, resource_group): + response = self.client.fleets.list_by_subscription( + api_version="2024-11-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list_by_resource_group(self, resource_group): + response = self.client.fleets.list_by_resource_group( + resource_group_name=resource_group.name, + api_version="2024-11-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_get(self, resource_group): + response = await self.client.fleets.get( + resource_group_name=resource_group.name, + fleet_name="str", + api_version="2024-11-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_begin_create_or_update(self, resource_group): + response = await ( + await self.client.fleets.begin_create_or_update( + resource_group_name=resource_group.name, + fleet_name="str", + resource={ + "location": "str", + "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", + }, + } + ] + }, + "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", + }, + "additionalVirtualMachineCapabilities": {"hibernationEnabled": bool, "ultraSSDEnabled": bool}, + "computeApiVersion": "str", + "platformFaultDomainCount": 0, + }, + "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", + }, + "provisioningState": "str", + "regularPriorityProfile": {"allocationStrategy": "str", "capacity": 0, "minCapacity": 0}, + "spotPriorityProfile": { + "allocationStrategy": "str", + "capacity": 0, + "evictionPolicy": "str", + "maintain": bool, + "maxPricePerVM": 0.0, + "minCapacity": 0, + }, + "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"}, + "timeCreated": "2020-02-20 00:00:00", + "type": "str", + "uniqueId": "str", + "vmAttributes": { + "architectureTypes": ["str"], + "cpuManufacturers": ["str"], + "dataDiskCount": {"max": 0, "min": 0}, + "excludedVMSizes": ["str"], + "gpuManufacturers": ["str"], + "localStorageDiskType": ["str"], + "localStorageDiskTypes": ["str"], + "localStorageInGB": {"max": 0, "min": 0}, + "memoryInMiB": {"max": 0, "min": 0}, + "networkBandwidthInMbps": {"max": 0, "min": 0}, + "networkInterfaceCount": {"max": 0, "min": 0}, + "rdmaNetworkInterfaceCount": {"max": 0, "min": 0}, + "vCpuCount": {"max": 0, "min": 0}, + "vmCategories": ["str"], + "burstableSupport": "str", + "gpuSupport": "str", + "localStorageSupport": "str", + "rdmaSupport": "str", + }, + "vmSizesProfile": [{"name": "str", "rank": 0}], + "zones": ["str"], + }, + api_version="2024-11-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_begin_update(self, resource_group): + response = await ( + await self.client.fleets.begin_update( + resource_group_name=resource_group.name, + fleet_name="str", + 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", + }, + "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": { + "allocationStrategy": "str", + "capacity": 0, + "evictionPolicy": "str", + "maintain": bool, + "maxPricePerVM": 0.0, + "minCapacity": 0, + }, + "timeCreated": "2020-02-20 00:00:00", + "uniqueId": "str", + "vmAttributes": { + "architectureTypes": ["str"], + "cpuManufacturers": ["str"], + "dataDiskCount": {"max": 0, "min": 0}, + "excludedVMSizes": ["str"], + "gpuManufacturers": ["str"], + "localStorageDiskType": ["str"], + "localStorageDiskTypes": ["str"], + "localStorageInGB": {"max": 0, "min": 0}, + "memoryInMiB": {"max": 0, "min": 0}, + "networkBandwidthInMbps": {"max": 0, "min": 0}, + "networkInterfaceCount": {"max": 0, "min": 0}, + "rdmaNetworkInterfaceCount": {"max": 0, "min": 0}, + "vCpuCount": {"max": 0, "min": 0}, + "vmCategories": ["str"], + "burstableSupport": "str", + "gpuSupport": "str", + "localStorageSupport": "str", + "rdmaSupport": "str", + }, + }, + "tags": {"str": "str"}, + }, + api_version="2024-11-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_begin_delete(self, resource_group): + response = await ( + await self.client.fleets.begin_delete( + resource_group_name=resource_group.name, + fleet_name="str", + api_version="2024-11-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_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", + api_version="2024-11-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_microsoft_azure_fleet_operations.py b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_microsoft_azure_fleet_operations.py new file mode 100644 index 000000000000..246c8fc67108 --- /dev/null +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_microsoft_azure_fleet_operations.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.computefleet import MicrosoftAzureFleet + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestMicrosoftAzureFleetOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(MicrosoftAzureFleet) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list(self, resource_group): + response = self.client.operations.list( + api_version="2024-11-01", + ) + 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_microsoft_azure_fleet_operations_async.py b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_microsoft_azure_fleet_operations_async.py new file mode 100644 index 000000000000..b24416318678 --- /dev/null +++ b/sdk/computefleet/azure-mgmt-computefleet/generated_tests/test_microsoft_azure_fleet_operations_async.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.computefleet.aio import MicrosoftAzureFleet + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestMicrosoftAzureFleetOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(MicrosoftAzureFleet, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list(self, resource_group): + response = self.client.operations.list( + api_version="2024-11-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/computefleet/azure-mgmt-computefleet/tsp-location.yaml b/sdk/computefleet/azure-mgmt-computefleet/tsp-location.yaml deleted file mode 100644 index 3edda0322bc0..000000000000 --- a/sdk/computefleet/azure-mgmt-computefleet/tsp-location.yaml +++ /dev/null @@ -1,4 +0,0 @@ -directory: specification/azurefleet/AzureFleet.Management -commit: c1cea38fb7e5cec9afe223a2ed15cbe2fbeecbdb -repo: Azure/azure-rest-api-specs -additionalDirectories: