diff --git a/azure-mgmt-compute/HISTORY.rst b/azure-mgmt-compute/HISTORY.rst index 67a64f561191..f180f19bbfe9 100644 --- a/azure-mgmt-compute/HISTORY.rst +++ b/azure-mgmt-compute/HISTORY.rst @@ -3,6 +3,42 @@ Release History =============== +4.0.0rc1 (2018-XX-XX) ++++++++++++++++++++++ + +**General Breaking changes** + +This version uses a next-generation code generator that *might* introduce breaking changes. + +- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments. + To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments. +- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered. + While this is not a breaking change, the distinctions are important, and are documented here: + https://docs.python.org/3/library/enum.html#others + At a glance: + + - "is" should not be used at all. + - "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered. + +- New Long Running Operation: + + - Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same. + - Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used. + - The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`, + without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`. + - New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`, + the response of the initial call will be returned without polling. + - `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`. + - `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away. + +**Compute features** + +- Support zone resilient for image/snapshots (new ApiVersion 2018-04-01) +- Add "operations" operation group +- Add availability_set.update +- Add images.update +- Add virtual_machine.update + 3.1.0rc3 (2018-11-01) +++++++++++++++++++++ diff --git a/azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py b/azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py index 1057757a705b..c54a9cac4d06 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py +++ b/azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py @@ -79,9 +79,9 @@ class ComputeManagementClient(object): DEFAULT_API_VERSION = '2017-12-01' DEFAULT_PROFILE = { - 'disks': '2017-03-30', + 'disks': '2018-04-01', 'resource_skus': '2017-09-01', - 'snapshots': '2017-03-30', + 'snapshots': '2018-04-01', } def __init__(self, credentials, subscription_id, api_version=DEFAULT_API_VERSION, base_url=None, profile=DEFAULT_PROFILE): @@ -108,6 +108,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2017-03-30: :mod:`v2017_03_30.models` * 2017-09-01: :mod:`v2017_09_01.models` * 2017-12-01: :mod:`v2017_12_01.models` + * 2018-04-01: :mod:`v2018_04_01.models` """ if api_version == '2015-06-15': from .v2015_06_15 import models @@ -127,6 +128,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2017-12-01': from .v2017_12_01 import models return models + elif api_version == '2018-04-01': + from .v2018_04_01 import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) @property @@ -160,12 +164,15 @@ def disks(self): * 2016-04-30-preview: :class:`DisksOperations` * 2017-03-30: :class:`DisksOperations` + * 2018-04-01: :class:`DisksOperations` """ api_version = self.profile.get('disks', self.api_version) if api_version == '2016-04-30-preview': from .v2016_04_30_preview.operations import DisksOperations as OperationClass elif api_version == '2017-03-30': from .v2017_03_30.operations import DisksOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import DisksOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -189,6 +196,32 @@ def images(self): raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def log_analytics(self): + """Instance depends on the API version: + + * 2017-12-01: :class:`LogAnalyticsOperations` + """ + api_version = self.profile.get('log_analytics', self.api_version) + if api_version == '2017-12-01': + from .v2017_12_01.operations import LogAnalyticsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def operations(self): + """Instance depends on the API version: + + * 2017-12-01: :class:`Operations` + """ + api_version = self.profile.get('operations', self.api_version) + if api_version == '2017-12-01': + from .v2017_12_01.operations import Operations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def resource_skus(self): """Instance depends on the API version: @@ -211,12 +244,15 @@ def snapshots(self): * 2016-04-30-preview: :class:`SnapshotsOperations` * 2017-03-30: :class:`SnapshotsOperations` + * 2018-04-01: :class:`SnapshotsOperations` """ api_version = self.profile.get('snapshots', self.api_version) if api_version == '2016-04-30-preview': from .v2016_04_30_preview.operations import SnapshotsOperations as OperationClass elif api_version == '2017-03-30': from .v2017_03_30.operations import SnapshotsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import SnapshotsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/azure-mgmt-compute/azure/mgmt/compute/models.py b/azure-mgmt-compute/azure/mgmt/compute/models.py index 35c05c2bdaeb..3f996e628912 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/models.py +++ b/azure-mgmt-compute/azure/mgmt/compute/models.py @@ -6,9 +6,9 @@ # -------------------------------------------------------------------------- import warnings -from .v2017_03_30.models import * from .v2017_09_01.models import * -from .v2017_12_01.models import * # Note that this line is overriding some models of 2017-03-30. See link below for details. +from .v2017_12_01.models import * +from .v2018_04_01.models import * # Note that this line is overriding some models of 2017-12-01. See link below for details. warnings.warn("Import models from this file is deprecated. See https://aka.ms/pysdkmodels", DeprecationWarning) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/__init__.py index 00630f63ce9d..e90c8dab3a08 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/__init__.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/__init__.py @@ -9,81 +9,158 @@ # regenerated. # -------------------------------------------------------------------------- -from .instance_view_status import InstanceViewStatus -from .sub_resource import SubResource -from .availability_set import AvailabilitySet -from .virtual_machine_size import VirtualMachineSize -from .virtual_machine_extension_image import VirtualMachineExtensionImage -from .virtual_machine_image_resource import VirtualMachineImageResource -from .virtual_machine_extension_instance_view import VirtualMachineExtensionInstanceView -from .virtual_machine_extension import VirtualMachineExtension -from .purchase_plan import PurchasePlan -from .os_disk_image import OSDiskImage -from .data_disk_image import DataDiskImage -from .virtual_machine_image import VirtualMachineImage -from .usage_name import UsageName -from .usage import Usage -from .virtual_machine_capture_parameters import VirtualMachineCaptureParameters -from .virtual_machine_capture_result import VirtualMachineCaptureResult -from .plan import Plan -from .hardware_profile import HardwareProfile -from .image_reference import ImageReference -from .key_vault_secret_reference import KeyVaultSecretReference -from .key_vault_key_reference import KeyVaultKeyReference -from .disk_encryption_settings import DiskEncryptionSettings -from .virtual_hard_disk import VirtualHardDisk -from .os_disk import OSDisk -from .data_disk import DataDisk -from .storage_profile import StorageProfile -from .additional_unattend_content import AdditionalUnattendContent -from .win_rm_listener import WinRMListener -from .win_rm_configuration import WinRMConfiguration -from .windows_configuration import WindowsConfiguration -from .ssh_public_key import SshPublicKey -from .ssh_configuration import SshConfiguration -from .linux_configuration import LinuxConfiguration -from .vault_certificate import VaultCertificate -from .vault_secret_group import VaultSecretGroup -from .os_profile import OSProfile -from .network_interface_reference import NetworkInterfaceReference -from .network_profile import NetworkProfile -from .boot_diagnostics import BootDiagnostics -from .diagnostics_profile import DiagnosticsProfile -from .virtual_machine_extension_handler_instance_view import VirtualMachineExtensionHandlerInstanceView -from .virtual_machine_agent_instance_view import VirtualMachineAgentInstanceView -from .disk_instance_view import DiskInstanceView -from .boot_diagnostics_instance_view import BootDiagnosticsInstanceView -from .virtual_machine_instance_view import VirtualMachineInstanceView -from .virtual_machine import VirtualMachine -from .sku import Sku -from .upgrade_policy import UpgradePolicy -from .virtual_machine_scale_set_os_profile import VirtualMachineScaleSetOSProfile -from .virtual_machine_scale_set_os_disk import VirtualMachineScaleSetOSDisk -from .virtual_machine_scale_set_storage_profile import VirtualMachineScaleSetStorageProfile -from .api_entity_reference import ApiEntityReference -from .virtual_machine_scale_set_ip_configuration import VirtualMachineScaleSetIPConfiguration -from .virtual_machine_scale_set_network_configuration import VirtualMachineScaleSetNetworkConfiguration -from .virtual_machine_scale_set_network_profile import VirtualMachineScaleSetNetworkProfile -from .virtual_machine_scale_set_extension import VirtualMachineScaleSetExtension -from .virtual_machine_scale_set_extension_profile import VirtualMachineScaleSetExtensionProfile -from .virtual_machine_scale_set_vm_profile import VirtualMachineScaleSetVMProfile -from .virtual_machine_scale_set import VirtualMachineScaleSet -from .virtual_machine_scale_set_vm_instance_ids import VirtualMachineScaleSetVMInstanceIDs -from .virtual_machine_scale_set_vm_instance_required_ids import VirtualMachineScaleSetVMInstanceRequiredIDs -from .virtual_machine_status_code_count import VirtualMachineStatusCodeCount -from .virtual_machine_scale_set_instance_view_statuses_summary import VirtualMachineScaleSetInstanceViewStatusesSummary -from .virtual_machine_scale_set_vm_extensions_summary import VirtualMachineScaleSetVMExtensionsSummary -from .virtual_machine_scale_set_instance_view import VirtualMachineScaleSetInstanceView -from .virtual_machine_scale_set_sku_capacity import VirtualMachineScaleSetSkuCapacity -from .virtual_machine_scale_set_sku import VirtualMachineScaleSetSku -from .virtual_machine_scale_set_vm import VirtualMachineScaleSetVM -from .virtual_machine_scale_set_vm_instance_view import VirtualMachineScaleSetVMInstanceView -from .api_error_base import ApiErrorBase -from .inner_error import InnerError -from .api_error import ApiError -from .compute_long_running_operation_properties import ComputeLongRunningOperationProperties -from .resource import Resource -from .operation_status_response import OperationStatusResponse +try: + from .instance_view_status_py3 import InstanceViewStatus + from .sub_resource_py3 import SubResource + from .availability_set_py3 import AvailabilitySet + from .virtual_machine_size_py3 import VirtualMachineSize + from .virtual_machine_extension_image_py3 import VirtualMachineExtensionImage + from .virtual_machine_image_resource_py3 import VirtualMachineImageResource + from .virtual_machine_extension_instance_view_py3 import VirtualMachineExtensionInstanceView + from .virtual_machine_extension_py3 import VirtualMachineExtension + from .purchase_plan_py3 import PurchasePlan + from .os_disk_image_py3 import OSDiskImage + from .data_disk_image_py3 import DataDiskImage + from .virtual_machine_image_py3 import VirtualMachineImage + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .virtual_machine_capture_parameters_py3 import VirtualMachineCaptureParameters + from .virtual_machine_capture_result_py3 import VirtualMachineCaptureResult + from .plan_py3 import Plan + from .hardware_profile_py3 import HardwareProfile + from .image_reference_py3 import ImageReference + from .key_vault_secret_reference_py3 import KeyVaultSecretReference + from .key_vault_key_reference_py3 import KeyVaultKeyReference + from .disk_encryption_settings_py3 import DiskEncryptionSettings + from .virtual_hard_disk_py3 import VirtualHardDisk + from .os_disk_py3 import OSDisk + from .data_disk_py3 import DataDisk + from .storage_profile_py3 import StorageProfile + from .additional_unattend_content_py3 import AdditionalUnattendContent + from .win_rm_listener_py3 import WinRMListener + from .win_rm_configuration_py3 import WinRMConfiguration + from .windows_configuration_py3 import WindowsConfiguration + from .ssh_public_key_py3 import SshPublicKey + from .ssh_configuration_py3 import SshConfiguration + from .linux_configuration_py3 import LinuxConfiguration + from .vault_certificate_py3 import VaultCertificate + from .vault_secret_group_py3 import VaultSecretGroup + from .os_profile_py3 import OSProfile + from .network_interface_reference_py3 import NetworkInterfaceReference + from .network_profile_py3 import NetworkProfile + from .boot_diagnostics_py3 import BootDiagnostics + from .diagnostics_profile_py3 import DiagnosticsProfile + from .virtual_machine_extension_handler_instance_view_py3 import VirtualMachineExtensionHandlerInstanceView + from .virtual_machine_agent_instance_view_py3 import VirtualMachineAgentInstanceView + from .disk_instance_view_py3 import DiskInstanceView + from .boot_diagnostics_instance_view_py3 import BootDiagnosticsInstanceView + from .virtual_machine_instance_view_py3 import VirtualMachineInstanceView + from .virtual_machine_py3 import VirtualMachine + from .sku_py3 import Sku + from .upgrade_policy_py3 import UpgradePolicy + from .virtual_machine_scale_set_os_profile_py3 import VirtualMachineScaleSetOSProfile + from .virtual_machine_scale_set_os_disk_py3 import VirtualMachineScaleSetOSDisk + from .virtual_machine_scale_set_storage_profile_py3 import VirtualMachineScaleSetStorageProfile + from .api_entity_reference_py3 import ApiEntityReference + from .virtual_machine_scale_set_ip_configuration_py3 import VirtualMachineScaleSetIPConfiguration + from .virtual_machine_scale_set_network_configuration_py3 import VirtualMachineScaleSetNetworkConfiguration + from .virtual_machine_scale_set_network_profile_py3 import VirtualMachineScaleSetNetworkProfile + from .virtual_machine_scale_set_extension_py3 import VirtualMachineScaleSetExtension + from .virtual_machine_scale_set_extension_profile_py3 import VirtualMachineScaleSetExtensionProfile + from .virtual_machine_scale_set_vm_profile_py3 import VirtualMachineScaleSetVMProfile + from .virtual_machine_scale_set_py3 import VirtualMachineScaleSet + from .virtual_machine_scale_set_vm_instance_ids_py3 import VirtualMachineScaleSetVMInstanceIDs + from .virtual_machine_scale_set_vm_instance_required_ids_py3 import VirtualMachineScaleSetVMInstanceRequiredIDs + from .virtual_machine_status_code_count_py3 import VirtualMachineStatusCodeCount + from .virtual_machine_scale_set_instance_view_statuses_summary_py3 import VirtualMachineScaleSetInstanceViewStatusesSummary + from .virtual_machine_scale_set_vm_extensions_summary_py3 import VirtualMachineScaleSetVMExtensionsSummary + from .virtual_machine_scale_set_instance_view_py3 import VirtualMachineScaleSetInstanceView + from .virtual_machine_scale_set_sku_capacity_py3 import VirtualMachineScaleSetSkuCapacity + from .virtual_machine_scale_set_sku_py3 import VirtualMachineScaleSetSku + from .virtual_machine_scale_set_vm_py3 import VirtualMachineScaleSetVM + from .virtual_machine_scale_set_vm_instance_view_py3 import VirtualMachineScaleSetVMInstanceView + from .api_error_base_py3 import ApiErrorBase + from .inner_error_py3 import InnerError + from .api_error_py3 import ApiError + from .compute_long_running_operation_properties_py3 import ComputeLongRunningOperationProperties + from .resource_py3 import Resource + from .operation_status_response_py3 import OperationStatusResponse +except (SyntaxError, ImportError): + from .instance_view_status import InstanceViewStatus + from .sub_resource import SubResource + from .availability_set import AvailabilitySet + from .virtual_machine_size import VirtualMachineSize + from .virtual_machine_extension_image import VirtualMachineExtensionImage + from .virtual_machine_image_resource import VirtualMachineImageResource + from .virtual_machine_extension_instance_view import VirtualMachineExtensionInstanceView + from .virtual_machine_extension import VirtualMachineExtension + from .purchase_plan import PurchasePlan + from .os_disk_image import OSDiskImage + from .data_disk_image import DataDiskImage + from .virtual_machine_image import VirtualMachineImage + from .usage_name import UsageName + from .usage import Usage + from .virtual_machine_capture_parameters import VirtualMachineCaptureParameters + from .virtual_machine_capture_result import VirtualMachineCaptureResult + from .plan import Plan + from .hardware_profile import HardwareProfile + from .image_reference import ImageReference + from .key_vault_secret_reference import KeyVaultSecretReference + from .key_vault_key_reference import KeyVaultKeyReference + from .disk_encryption_settings import DiskEncryptionSettings + from .virtual_hard_disk import VirtualHardDisk + from .os_disk import OSDisk + from .data_disk import DataDisk + from .storage_profile import StorageProfile + from .additional_unattend_content import AdditionalUnattendContent + from .win_rm_listener import WinRMListener + from .win_rm_configuration import WinRMConfiguration + from .windows_configuration import WindowsConfiguration + from .ssh_public_key import SshPublicKey + from .ssh_configuration import SshConfiguration + from .linux_configuration import LinuxConfiguration + from .vault_certificate import VaultCertificate + from .vault_secret_group import VaultSecretGroup + from .os_profile import OSProfile + from .network_interface_reference import NetworkInterfaceReference + from .network_profile import NetworkProfile + from .boot_diagnostics import BootDiagnostics + from .diagnostics_profile import DiagnosticsProfile + from .virtual_machine_extension_handler_instance_view import VirtualMachineExtensionHandlerInstanceView + from .virtual_machine_agent_instance_view import VirtualMachineAgentInstanceView + from .disk_instance_view import DiskInstanceView + from .boot_diagnostics_instance_view import BootDiagnosticsInstanceView + from .virtual_machine_instance_view import VirtualMachineInstanceView + from .virtual_machine import VirtualMachine + from .sku import Sku + from .upgrade_policy import UpgradePolicy + from .virtual_machine_scale_set_os_profile import VirtualMachineScaleSetOSProfile + from .virtual_machine_scale_set_os_disk import VirtualMachineScaleSetOSDisk + from .virtual_machine_scale_set_storage_profile import VirtualMachineScaleSetStorageProfile + from .api_entity_reference import ApiEntityReference + from .virtual_machine_scale_set_ip_configuration import VirtualMachineScaleSetIPConfiguration + from .virtual_machine_scale_set_network_configuration import VirtualMachineScaleSetNetworkConfiguration + from .virtual_machine_scale_set_network_profile import VirtualMachineScaleSetNetworkProfile + from .virtual_machine_scale_set_extension import VirtualMachineScaleSetExtension + from .virtual_machine_scale_set_extension_profile import VirtualMachineScaleSetExtensionProfile + from .virtual_machine_scale_set_vm_profile import VirtualMachineScaleSetVMProfile + from .virtual_machine_scale_set import VirtualMachineScaleSet + from .virtual_machine_scale_set_vm_instance_ids import VirtualMachineScaleSetVMInstanceIDs + from .virtual_machine_scale_set_vm_instance_required_ids import VirtualMachineScaleSetVMInstanceRequiredIDs + from .virtual_machine_status_code_count import VirtualMachineStatusCodeCount + from .virtual_machine_scale_set_instance_view_statuses_summary import VirtualMachineScaleSetInstanceViewStatusesSummary + from .virtual_machine_scale_set_vm_extensions_summary import VirtualMachineScaleSetVMExtensionsSummary + from .virtual_machine_scale_set_instance_view import VirtualMachineScaleSetInstanceView + from .virtual_machine_scale_set_sku_capacity import VirtualMachineScaleSetSkuCapacity + from .virtual_machine_scale_set_sku import VirtualMachineScaleSetSku + from .virtual_machine_scale_set_vm import VirtualMachineScaleSetVM + from .virtual_machine_scale_set_vm_instance_view import VirtualMachineScaleSetVMInstanceView + from .api_error_base import ApiErrorBase + from .inner_error import InnerError + from .api_error import ApiError + from .compute_long_running_operation_properties import ComputeLongRunningOperationProperties + from .resource import Resource + from .operation_status_response import OperationStatusResponse from .availability_set_paged import AvailabilitySetPaged from .virtual_machine_size_paged import VirtualMachineSizePaged from .usage_paged import UsagePaged diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/additional_unattend_content.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/additional_unattend_content.py index 16a3fd357595..13297864f6d3 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/additional_unattend_content.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/additional_unattend_content.py @@ -44,9 +44,9 @@ class AdditionalUnattendContent(Model): 'content': {'key': 'content', 'type': 'str'}, } - def __init__(self, pass_name=None, component_name=None, setting_name=None, content=None): - super(AdditionalUnattendContent, self).__init__() - self.pass_name = pass_name - self.component_name = component_name - self.setting_name = setting_name - self.content = content + def __init__(self, **kwargs): + super(AdditionalUnattendContent, self).__init__(**kwargs) + self.pass_name = kwargs.get('pass_name', None) + self.component_name = kwargs.get('component_name', None) + self.setting_name = kwargs.get('setting_name', None) + self.content = kwargs.get('content', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/additional_unattend_content_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/additional_unattend_content_py3.py new file mode 100644 index 000000000000..c003a69e41a0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/additional_unattend_content_py3.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class AdditionalUnattendContent(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. + + :param pass_name: The pass name. Currently, the only allowable value is + OobeSystem. Possible values include: 'OobeSystem' + :type pass_name: str or ~azure.mgmt.compute.v2015_06_15.models.PassNames + :param component_name: The component name. Currently, the only allowable + value is Microsoft-Windows-Shell-Setup. Possible values include: + 'Microsoft-Windows-Shell-Setup' + :type component_name: str or + ~azure.mgmt.compute.v2015_06_15.models.ComponentNames + :param setting_name: Specifies the name of the setting to which the + content applies. Possible values are: FirstLogonCommands and AutoLogon. + Possible values include: 'AutoLogon', 'FirstLogonCommands' + :type setting_name: str or + ~azure.mgmt.compute.v2015_06_15.models.SettingNames + :param 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. + :type content: str + """ + + _attribute_map = { + 'pass_name': {'key': 'passName', 'type': 'PassNames'}, + 'component_name': {'key': 'componentName', 'type': 'ComponentNames'}, + 'setting_name': {'key': 'settingName', 'type': 'SettingNames'}, + 'content': {'key': 'content', 'type': 'str'}, + } + + def __init__(self, *, pass_name=None, component_name=None, setting_name=None, content: str=None, **kwargs) -> None: + super(AdditionalUnattendContent, self).__init__(**kwargs) + self.pass_name = pass_name + self.component_name = component_name + self.setting_name = setting_name + self.content = content diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_entity_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_entity_reference.py index 27696aacc3dc..d1bf572e916d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_entity_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_entity_reference.py @@ -24,6 +24,6 @@ class ApiEntityReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(ApiEntityReference, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(ApiEntityReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_entity_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_entity_reference_py3.py new file mode 100644 index 000000000000..da3e07082381 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_entity_reference_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApiEntityReference(Model): + """The API entity reference. + + :param id: The ARM resource id in the form of + /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(ApiEntityReference, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_error.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_error.py index 84aa0b473897..79b4f00b21d6 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_error.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_error.py @@ -35,10 +35,10 @@ class ApiError(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, details=None, innererror=None, code=None, target=None, message=None): - super(ApiError, self).__init__() - self.details = details - self.innererror = innererror - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ApiError, self).__init__(**kwargs) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_error_base.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_error_base.py index 2fb33a0ff411..655c08638905 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_error_base.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_error_base.py @@ -29,8 +29,8 @@ class ApiErrorBase(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, target=None, message=None): - super(ApiErrorBase, self).__init__() - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ApiErrorBase, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_error_base_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_error_base_py3.py new file mode 100644 index 000000000000..5ba95aa0283e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_error_base_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ApiErrorBase(Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ApiErrorBase, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_error_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_error_py3.py new file mode 100644 index 000000000000..5aa2f113bea0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/api_error_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApiError(Model): + """Api error. + + :param details: The Api error details + :type details: list[~azure.mgmt.compute.v2015_06_15.models.ApiErrorBase] + :param innererror: The Api inner error + :type innererror: ~azure.mgmt.compute.v2015_06_15.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, details=None, innererror=None, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ApiError, self).__init__(**kwargs) + self.details = details + self.innererror = innererror + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/availability_set.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/availability_set.py index c683cf490198..eb83102f6d73 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/availability_set.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/availability_set.py @@ -28,13 +28,15 @@ class AvailabilitySet(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -71,9 +73,9 @@ class AvailabilitySet(Resource): 'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, location, tags=None, platform_update_domain_count=None, platform_fault_domain_count=None, virtual_machines=None): - super(AvailabilitySet, self).__init__(location=location, tags=tags) - self.platform_update_domain_count = platform_update_domain_count - self.platform_fault_domain_count = platform_fault_domain_count - self.virtual_machines = virtual_machines + def __init__(self, **kwargs): + super(AvailabilitySet, self).__init__(**kwargs) + self.platform_update_domain_count = kwargs.get('platform_update_domain_count', None) + self.platform_fault_domain_count = kwargs.get('platform_fault_domain_count', None) + self.virtual_machines = kwargs.get('virtual_machines', None) self.statuses = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/availability_set_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/availability_set_py3.py new file mode 100644 index 000000000000..3df77ebfa38c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/availability_set_py3.py @@ -0,0 +1,81 @@ +# 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 .resource import Resource + + +class AvailabilitySet(Resource): + """Specifies information about the availability set that the virtual machine + should be assigned to. Virtual machines specified in the same availability + set are allocated to different nodes to maximize availability. For more + information about availability sets, see [Manage the availability of + virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param platform_update_domain_count: Update Domain count. + :type platform_update_domain_count: int + :param platform_fault_domain_count: Fault Domain count. + :type platform_fault_domain_count: int + :param virtual_machines: A list of references to all virtual machines in + the availability set. + :type virtual_machines: + list[~azure.mgmt.compute.v2015_06_15.models.SubResource] + :ivar statuses: The resource status information. + :vartype statuses: + list[~azure.mgmt.compute.v2015_06_15.models.InstanceViewStatus] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'statuses': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'platform_update_domain_count': {'key': 'properties.platformUpdateDomainCount', 'type': 'int'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResource]'}, + 'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, location: str, tags=None, platform_update_domain_count: int=None, platform_fault_domain_count: int=None, virtual_machines=None, **kwargs) -> None: + super(AvailabilitySet, self).__init__(location=location, tags=tags, **kwargs) + self.platform_update_domain_count = platform_update_domain_count + self.platform_fault_domain_count = platform_fault_domain_count + self.virtual_machines = virtual_machines + self.statuses = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/boot_diagnostics.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/boot_diagnostics.py index c94d188e3fba..ca3dbdd4f23c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/boot_diagnostics.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/boot_diagnostics.py @@ -32,7 +32,7 @@ class BootDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, enabled=None, storage_uri=None): - super(BootDiagnostics, self).__init__() - self.enabled = enabled - self.storage_uri = storage_uri + def __init__(self, **kwargs): + super(BootDiagnostics, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.storage_uri = kwargs.get('storage_uri', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/boot_diagnostics_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/boot_diagnostics_instance_view.py index 4ec7b385558d..6fe1f84a3910 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/boot_diagnostics_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/boot_diagnostics_instance_view.py @@ -26,7 +26,7 @@ class BootDiagnosticsInstanceView(Model): 'serial_console_log_blob_uri': {'key': 'serialConsoleLogBlobUri', 'type': 'str'}, } - def __init__(self, console_screenshot_blob_uri=None, serial_console_log_blob_uri=None): - super(BootDiagnosticsInstanceView, self).__init__() - self.console_screenshot_blob_uri = console_screenshot_blob_uri - self.serial_console_log_blob_uri = serial_console_log_blob_uri + def __init__(self, **kwargs): + super(BootDiagnosticsInstanceView, self).__init__(**kwargs) + self.console_screenshot_blob_uri = kwargs.get('console_screenshot_blob_uri', None) + self.serial_console_log_blob_uri = kwargs.get('serial_console_log_blob_uri', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/boot_diagnostics_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/boot_diagnostics_instance_view_py3.py new file mode 100644 index 000000000000..d85b51981ab9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/boot_diagnostics_instance_view_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class BootDiagnosticsInstanceView(Model): + """The instance view of a virtual machine boot diagnostics. + + :param console_screenshot_blob_uri: The console screenshot blob URI. + :type console_screenshot_blob_uri: str + :param serial_console_log_blob_uri: The Linux serial console log blob Uri. + :type serial_console_log_blob_uri: str + """ + + _attribute_map = { + 'console_screenshot_blob_uri': {'key': 'consoleScreenshotBlobUri', 'type': 'str'}, + 'serial_console_log_blob_uri': {'key': 'serialConsoleLogBlobUri', 'type': 'str'}, + } + + def __init__(self, *, console_screenshot_blob_uri: str=None, serial_console_log_blob_uri: str=None, **kwargs) -> None: + super(BootDiagnosticsInstanceView, self).__init__(**kwargs) + self.console_screenshot_blob_uri = console_screenshot_blob_uri + self.serial_console_log_blob_uri = serial_console_log_blob_uri diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/boot_diagnostics_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/boot_diagnostics_py3.py new file mode 100644 index 000000000000..b0a756ea4fa0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/boot_diagnostics_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class BootDiagnostics(Model): + """Boot Diagnostics is a debugging feature which allows you to view Console + Output and Screenshot to diagnose VM status.

For Linux Virtual + Machines, you can easily view the output of your console log.

For + both Windows and Linux virtual machines, Azure also enables you to see a + screenshot of the VM from the hypervisor. + + :param enabled: Whether boot diagnostics should be enabled on the Virtual + Machine. + :type enabled: bool + :param storage_uri: Uri of the storage account to use for placing the + console output and screenshot. + :type storage_uri: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, storage_uri: str=None, **kwargs) -> None: + super(BootDiagnostics, self).__init__(**kwargs) + self.enabled = enabled + self.storage_uri = storage_uri diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/compute_long_running_operation_properties.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/compute_long_running_operation_properties.py index f8ca23e0ccdf..66ff353eb206 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/compute_long_running_operation_properties.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/compute_long_running_operation_properties.py @@ -23,6 +23,6 @@ class ComputeLongRunningOperationProperties(Model): 'output': {'key': 'output', 'type': 'object'}, } - def __init__(self, output=None): - super(ComputeLongRunningOperationProperties, self).__init__() - self.output = output + def __init__(self, **kwargs): + super(ComputeLongRunningOperationProperties, self).__init__(**kwargs) + self.output = kwargs.get('output', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/compute_long_running_operation_properties_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/compute_long_running_operation_properties_py3.py new file mode 100644 index 000000000000..a4ffd6c8c32f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/compute_long_running_operation_properties_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class ComputeLongRunningOperationProperties(Model): + """Compute-specific operation properties, including output. + + :param output: Operation output data (raw JSON) + :type output: object + """ + + _attribute_map = { + 'output': {'key': 'output', 'type': 'object'}, + } + + def __init__(self, *, output=None, **kwargs) -> None: + super(ComputeLongRunningOperationProperties, self).__init__(**kwargs) + self.output = output diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/compute_management_client_enums.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/compute_management_client_enums.py index f09f0ffb3526..1276832aadd7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/compute_management_client_enums.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/compute_management_client_enums.py @@ -12,20 +12,20 @@ from enum import Enum -class StatusLevelTypes(Enum): +class StatusLevelTypes(str, Enum): info = "Info" warning = "Warning" error = "Error" -class OperatingSystemTypes(Enum): +class OperatingSystemTypes(str, Enum): windows = "Windows" linux = "Linux" -class VirtualMachineSizeTypes(Enum): +class VirtualMachineSizeTypes(str, Enum): basic_a0 = "Basic_A0" basic_a1 = "Basic_A1" @@ -81,54 +81,54 @@ class VirtualMachineSizeTypes(Enum): standard_gs5 = "Standard_GS5" -class CachingTypes(Enum): +class CachingTypes(str, Enum): none = "None" read_only = "ReadOnly" read_write = "ReadWrite" -class DiskCreateOptionTypes(Enum): +class DiskCreateOptionTypes(str, Enum): from_image = "FromImage" empty = "Empty" attach = "Attach" -class PassNames(Enum): +class PassNames(str, Enum): oobe_system = "OobeSystem" -class ComponentNames(Enum): +class ComponentNames(str, Enum): microsoft_windows_shell_setup = "Microsoft-Windows-Shell-Setup" -class SettingNames(Enum): +class SettingNames(str, Enum): auto_logon = "AutoLogon" first_logon_commands = "FirstLogonCommands" -class ProtocolTypes(Enum): +class ProtocolTypes(str, Enum): http = "Http" https = "Https" -class UpgradeMode(Enum): +class UpgradeMode(str, Enum): automatic = "Automatic" manual = "Manual" -class VirtualMachineScaleSetSkuScaleType(Enum): +class VirtualMachineScaleSetSkuScaleType(str, Enum): automatic = "Automatic" none = "None" -class InstanceViewTypes(Enum): +class InstanceViewTypes(str, Enum): instance_view = "instanceView" diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/data_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/data_disk.py index 3cf5517e09c0..d21d64c3c2ea 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/data_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/data_disk.py @@ -15,13 +15,15 @@ class DataDisk(Model): """Describes a data disk. - :param 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. + All required parameters must be populated in order to send to Azure. + + :param lun: Required. 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. :type lun: int - :param name: The disk name. + :param name: Required. The disk name. :type name: str - :param vhd: The virtual hard disk. + :param vhd: Required. The virtual hard disk. :type vhd: ~azure.mgmt.compute.v2015_06_15.models.VirtualHardDisk :param image: The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If @@ -33,8 +35,8 @@ class DataDisk(Model):

Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2015_06_15.models.CachingTypes - :param create_option: Specifies how the virtual machine should be - created.

Possible values are:

**Attach** \\u2013 This + :param create_option: Required. Specifies how the virtual machine should + be created.

Possible values are:

**Attach** \\u2013 This value is used when you are using a specialized disk to create the virtual machine.

**FromImage** \\u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform @@ -66,12 +68,12 @@ class DataDisk(Model): 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, } - def __init__(self, lun, name, vhd, create_option, image=None, caching=None, disk_size_gb=None): - super(DataDisk, self).__init__() - self.lun = lun - self.name = name - self.vhd = vhd - self.image = image - self.caching = caching - self.create_option = create_option - self.disk_size_gb = disk_size_gb + def __init__(self, **kwargs): + super(DataDisk, self).__init__(**kwargs) + self.lun = kwargs.get('lun', None) + self.name = kwargs.get('name', None) + self.vhd = kwargs.get('vhd', None) + self.image = kwargs.get('image', None) + self.caching = kwargs.get('caching', None) + self.create_option = kwargs.get('create_option', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/data_disk_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/data_disk_image.py index 60a4befc525f..b5dbfcefb472 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/data_disk_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/data_disk_image.py @@ -32,6 +32,6 @@ class DataDiskImage(Model): 'lun': {'key': 'lun', 'type': 'int'}, } - def __init__(self): - super(DataDiskImage, self).__init__() + def __init__(self, **kwargs): + super(DataDiskImage, self).__init__(**kwargs) self.lun = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/data_disk_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/data_disk_image_py3.py new file mode 100644 index 000000000000..8431a3988502 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/data_disk_image_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class DataDiskImage(Model): + """Contains the data disk images information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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. + :vartype lun: int + """ + + _validation = { + 'lun': {'readonly': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(DataDiskImage, self).__init__(**kwargs) + self.lun = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/data_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/data_disk_py3.py new file mode 100644 index 000000000000..c273f2037df3 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/data_disk_py3.py @@ -0,0 +1,79 @@ +# 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 msrest.serialization import Model + + +class DataDisk(Model): + """Describes a data disk. + + All required parameters must be populated in order to send to Azure. + + :param lun: Required. 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. + :type lun: int + :param name: Required. The disk name. + :type name: str + :param vhd: Required. The virtual hard disk. + :type vhd: ~azure.mgmt.compute.v2015_06_15.models.VirtualHardDisk + :param image: The source user image virtual hard disk. The virtual hard + disk will be copied before being attached to the virtual machine. If + SourceImage is provided, the destination virtual hard drive must not + exist. + :type image: ~azure.mgmt.compute.v2015_06_15.models.VirtualHardDisk + :param caching: Specifies the caching requirements.

Possible + values are:

**None**

**ReadOnly**

**ReadWrite** +

Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2015_06_15.models.CachingTypes + :param create_option: Required. Specifies how the virtual machine should + be created.

Possible values are:

**Attach** \\u2013 This + value is used when you are using a specialized disk to create the virtual + machine.

**FromImage** \\u2013 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. Possible values include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2015_06_15.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in + gigabytes. This element can be used to overwrite the name of the disk in a + virtual machine image.

This value cannot be larger than 1023 GB + :type disk_size_gb: int + """ + + _validation = { + 'lun': {'required': True}, + 'name': {'required': True}, + 'vhd': {'required': True}, + 'create_option': {'required': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'vhd': {'key': 'vhd', 'type': 'VirtualHardDisk'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + } + + def __init__(self, *, lun: int, name: str, vhd, create_option, image=None, caching=None, disk_size_gb: int=None, **kwargs) -> None: + super(DataDisk, self).__init__(**kwargs) + self.lun = lun + self.name = name + self.vhd = vhd + self.image = image + self.caching = caching + self.create_option = create_option + self.disk_size_gb = disk_size_gb diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/diagnostics_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/diagnostics_profile.py index 0971788fa80e..d801c39f51d5 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/diagnostics_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/diagnostics_profile.py @@ -29,6 +29,6 @@ class DiagnosticsProfile(Model): 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnostics'}, } - def __init__(self, boot_diagnostics=None): - super(DiagnosticsProfile, self).__init__() - self.boot_diagnostics = boot_diagnostics + def __init__(self, **kwargs): + super(DiagnosticsProfile, self).__init__(**kwargs) + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/diagnostics_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/diagnostics_profile_py3.py new file mode 100644 index 000000000000..c2fee8c4a669 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/diagnostics_profile_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class DiagnosticsProfile(Model): + """Specifies the boot diagnostic settings state.

Minimum api-version: + 2015-06-15. + + :param boot_diagnostics: Boot Diagnostics is a debugging feature which + allows you to view Console Output and Screenshot to diagnose VM status. +

For Linux Virtual Machines, you can easily view the output of + your console log.

For both Windows and Linux virtual machines, + Azure also enables you to see a screenshot of the VM from the hypervisor. + :type boot_diagnostics: + ~azure.mgmt.compute.v2015_06_15.models.BootDiagnostics + """ + + _attribute_map = { + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnostics'}, + } + + def __init__(self, *, boot_diagnostics=None, **kwargs) -> None: + super(DiagnosticsProfile, self).__init__(**kwargs) + self.boot_diagnostics = boot_diagnostics diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/disk_encryption_settings.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/disk_encryption_settings.py index edb96710e7f5..145e72b0f2c9 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/disk_encryption_settings.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/disk_encryption_settings.py @@ -15,8 +15,10 @@ class DiskEncryptionSettings(Model): """Describes a Encryption Settings for a Disk. - :param disk_encryption_key: Specifies the location of the disk encryption - key, which is a Key Vault Secret. + All required parameters must be populated in order to send to Azure. + + :param disk_encryption_key: Required. Specifies the location of the disk + encryption key, which is a Key Vault Secret. :type disk_encryption_key: ~azure.mgmt.compute.v2015_06_15.models.KeyVaultSecretReference :param key_encryption_key: Specifies the location of the key encryption @@ -38,8 +40,8 @@ class DiskEncryptionSettings(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, disk_encryption_key, key_encryption_key=None, enabled=None): - super(DiskEncryptionSettings, self).__init__() - self.disk_encryption_key = disk_encryption_key - self.key_encryption_key = key_encryption_key - self.enabled = enabled + def __init__(self, **kwargs): + super(DiskEncryptionSettings, self).__init__(**kwargs) + self.disk_encryption_key = kwargs.get('disk_encryption_key', None) + self.key_encryption_key = kwargs.get('key_encryption_key', None) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/disk_encryption_settings_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/disk_encryption_settings_py3.py new file mode 100644 index 000000000000..a260d7468780 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/disk_encryption_settings_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class DiskEncryptionSettings(Model): + """Describes a Encryption Settings for a Disk. + + All required parameters must be populated in order to send to Azure. + + :param disk_encryption_key: Required. Specifies the location of the disk + encryption key, which is a Key Vault Secret. + :type disk_encryption_key: + ~azure.mgmt.compute.v2015_06_15.models.KeyVaultSecretReference + :param key_encryption_key: Specifies the location of the key encryption + key in Key Vault. + :type key_encryption_key: + ~azure.mgmt.compute.v2015_06_15.models.KeyVaultKeyReference + :param enabled: Specifies whether disk encryption should be enabled on the + virtual machine. + :type enabled: bool + """ + + _validation = { + 'disk_encryption_key': {'required': True}, + } + + _attribute_map = { + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultKeyReference'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, disk_encryption_key, key_encryption_key=None, enabled: bool=None, **kwargs) -> None: + super(DiskEncryptionSettings, self).__init__(**kwargs) + self.disk_encryption_key = disk_encryption_key + self.key_encryption_key = key_encryption_key + self.enabled = enabled diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/disk_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/disk_instance_view.py index e6a9a0de6e8c..027d59e825e3 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/disk_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/disk_instance_view.py @@ -27,7 +27,7 @@ class DiskInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, name=None, statuses=None): - super(DiskInstanceView, self).__init__() - self.name = name - self.statuses = statuses + def __init__(self, **kwargs): + super(DiskInstanceView, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/disk_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/disk_instance_view_py3.py new file mode 100644 index 000000000000..cc4b78b3c2b3 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/disk_instance_view_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class DiskInstanceView(Model): + """The instance view of the disk. + + :param name: The disk name. + :type name: str + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2015_06_15.models.InstanceViewStatus] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, name: str=None, statuses=None, **kwargs) -> None: + super(DiskInstanceView, self).__init__(**kwargs) + self.name = name + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/hardware_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/hardware_profile.py index c95cd4dc83d6..7a999140c70a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/hardware_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/hardware_profile.py @@ -47,6 +47,6 @@ class HardwareProfile(Model): 'vm_size': {'key': 'vmSize', 'type': 'str'}, } - def __init__(self, vm_size=None): - super(HardwareProfile, self).__init__() - self.vm_size = vm_size + def __init__(self, **kwargs): + super(HardwareProfile, self).__init__(**kwargs) + self.vm_size = kwargs.get('vm_size', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/hardware_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/hardware_profile_py3.py new file mode 100644 index 000000000000..32cc5fac61eb --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/hardware_profile_py3.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class HardwareProfile(Model): + """Specifies the hardware settings for the virtual machine. + + :param vm_size: Specifies the size of the virtual machine. For more + information about virtual machine sizes, see [Sizes for virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

The available VM sizes depend on region and availability set. For + a list of available sizes use these APIs:

[List all available + virtual machine sizes in an availability + set](virtualmachines-list-sizes-availability-set.md)

[List all + available virtual machine sizes in a + region](virtualmachines-list-sizes-region.md)

[List all available + virtual machine sizes for + resizing](virtualmachines-list-sizes-for-resizing.md). Possible values + include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', + 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', + 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', + 'Standard_A10', 'Standard_A11', 'Standard_D1', 'Standard_D2', + 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', + 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', + 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', + 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_DS1', + 'Standard_DS2', 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', + 'Standard_DS12', 'Standard_DS13', 'Standard_DS14', 'Standard_G1', + 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', + 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', + 'Standard_GS5' + :type vm_size: str or + ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineSizeTypes + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + } + + def __init__(self, *, vm_size=None, **kwargs) -> None: + super(HardwareProfile, self).__init__(**kwargs) + self.vm_size = vm_size diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/image_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/image_reference.py index 3aa6e4826ee8..d83cc00f394f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/image_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/image_reference.py @@ -43,9 +43,9 @@ class ImageReference(Model): 'version': {'key': 'version', 'type': 'str'}, } - def __init__(self, publisher=None, offer=None, sku=None, version=None): - super(ImageReference, self).__init__() - self.publisher = publisher - self.offer = offer - self.sku = sku - self.version = version + def __init__(self, **kwargs): + super(ImageReference, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.offer = kwargs.get('offer', None) + self.sku = kwargs.get('sku', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/image_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/image_reference_py3.py new file mode 100644 index 000000000000..ec4e3f91dee4 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/image_reference_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class ImageReference(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. + + :param publisher: The image publisher. + :type publisher: str + :param offer: Specifies the offer of the platform image or marketplace + image used to create the virtual machine. + :type offer: str + :param sku: The image SKU. + :type sku: str + :param 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. + :type version: str + """ + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'offer': {'key': 'offer', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, publisher: str=None, offer: str=None, sku: str=None, version: str=None, **kwargs) -> None: + super(ImageReference, self).__init__(**kwargs) + self.publisher = publisher + self.offer = offer + self.sku = sku + self.version = version diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/inner_error.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/inner_error.py index de77683e2fc8..6324249d7c19 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/inner_error.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/inner_error.py @@ -26,7 +26,7 @@ class InnerError(Model): 'errordetail': {'key': 'errordetail', 'type': 'str'}, } - def __init__(self, exceptiontype=None, errordetail=None): - super(InnerError, self).__init__() - self.exceptiontype = exceptiontype - self.errordetail = errordetail + def __init__(self, **kwargs): + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = kwargs.get('exceptiontype', None) + self.errordetail = kwargs.get('errordetail', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/inner_error_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/inner_error_py3.py new file mode 100644 index 000000000000..ccec30d7b53f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/inner_error_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class InnerError(Model): + """Inner error details. + + :param exceptiontype: The exception type. + :type exceptiontype: str + :param errordetail: The internal error message or exception dump. + :type errordetail: str + """ + + _attribute_map = { + 'exceptiontype': {'key': 'exceptiontype', 'type': 'str'}, + 'errordetail': {'key': 'errordetail', 'type': 'str'}, + } + + def __init__(self, *, exceptiontype: str=None, errordetail: str=None, **kwargs) -> None: + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = exceptiontype + self.errordetail = errordetail diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/instance_view_status.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/instance_view_status.py index dc1e3e1ff33a..c1932d34ba85 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/instance_view_status.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/instance_view_status.py @@ -38,10 +38,10 @@ class InstanceViewStatus(Model): 'time': {'key': 'time', 'type': 'iso-8601'}, } - def __init__(self, code=None, level=None, display_status=None, message=None, time=None): - super(InstanceViewStatus, self).__init__() - self.code = code - self.level = level - self.display_status = display_status - self.message = message - self.time = time + def __init__(self, **kwargs): + super(InstanceViewStatus, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.level = kwargs.get('level', None) + self.display_status = kwargs.get('display_status', None) + self.message = kwargs.get('message', None) + self.time = kwargs.get('time', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/instance_view_status_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/instance_view_status_py3.py new file mode 100644 index 000000000000..cb721ac714cc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/instance_view_status_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class InstanceViewStatus(Model): + """Instance view status. + + :param code: The status code. + :type code: str + :param level: The level code. Possible values include: 'Info', 'Warning', + 'Error' + :type level: str or + ~azure.mgmt.compute.v2015_06_15.models.StatusLevelTypes + :param display_status: The short localizable label for the status. + :type display_status: str + :param message: The detailed status message, including for alerts and + error messages. + :type message: str + :param time: The time of the status. + :type time: datetime + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'StatusLevelTypes'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__(self, *, code: str=None, level=None, display_status: str=None, message: str=None, time=None, **kwargs) -> None: + super(InstanceViewStatus, self).__init__(**kwargs) + self.code = code + self.level = level + self.display_status = display_status + self.message = message + self.time = time diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/key_vault_key_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/key_vault_key_reference.py index 140432dae108..8d508c43671c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/key_vault_key_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/key_vault_key_reference.py @@ -15,9 +15,13 @@ class KeyVaultKeyReference(Model): """Describes a reference to Key Vault Key. - :param key_url: The URL referencing a key encryption key in Key Vault. + All required parameters must be populated in order to send to Azure. + + :param key_url: Required. The URL referencing a key encryption key in Key + Vault. :type key_url: str - :param source_vault: The relative URL of the Key Vault containing the key. + :param source_vault: Required. The relative URL of the Key Vault + containing the key. :type source_vault: ~azure.mgmt.compute.v2015_06_15.models.SubResource """ @@ -31,7 +35,7 @@ class KeyVaultKeyReference(Model): 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, } - def __init__(self, key_url, source_vault): - super(KeyVaultKeyReference, self).__init__() - self.key_url = key_url - self.source_vault = source_vault + def __init__(self, **kwargs): + super(KeyVaultKeyReference, self).__init__(**kwargs) + self.key_url = kwargs.get('key_url', None) + self.source_vault = kwargs.get('source_vault', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/key_vault_key_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/key_vault_key_reference_py3.py new file mode 100644 index 000000000000..630042c29596 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/key_vault_key_reference_py3.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 msrest.serialization import Model + + +class KeyVaultKeyReference(Model): + """Describes a reference to Key Vault Key. + + All required parameters must be populated in order to send to Azure. + + :param key_url: Required. The URL referencing a key encryption key in Key + Vault. + :type key_url: str + :param source_vault: Required. The relative URL of the Key Vault + containing the key. + :type source_vault: ~azure.mgmt.compute.v2015_06_15.models.SubResource + """ + + _validation = { + 'key_url': {'required': True}, + 'source_vault': {'required': True}, + } + + _attribute_map = { + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, + } + + def __init__(self, *, key_url: str, source_vault, **kwargs) -> None: + super(KeyVaultKeyReference, self).__init__(**kwargs) + self.key_url = key_url + self.source_vault = source_vault diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/key_vault_secret_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/key_vault_secret_reference.py index eb6562ff39d2..ddd5ce2a668a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/key_vault_secret_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/key_vault_secret_reference.py @@ -15,10 +15,12 @@ class KeyVaultSecretReference(Model): """Describes a reference to Key Vault Secret. - :param secret_url: The URL referencing a secret in a Key Vault. + All required parameters must be populated in order to send to Azure. + + :param secret_url: Required. The URL referencing a secret in a Key Vault. :type secret_url: str - :param source_vault: The relative URL of the Key Vault containing the - secret. + :param source_vault: Required. The relative URL of the Key Vault + containing the secret. :type source_vault: ~azure.mgmt.compute.v2015_06_15.models.SubResource """ @@ -32,7 +34,7 @@ class KeyVaultSecretReference(Model): 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, } - def __init__(self, secret_url, source_vault): - super(KeyVaultSecretReference, self).__init__() - self.secret_url = secret_url - self.source_vault = source_vault + def __init__(self, **kwargs): + super(KeyVaultSecretReference, self).__init__(**kwargs) + self.secret_url = kwargs.get('secret_url', None) + self.source_vault = kwargs.get('source_vault', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/key_vault_secret_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/key_vault_secret_reference_py3.py new file mode 100644 index 000000000000..517f66ed3180 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/key_vault_secret_reference_py3.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 msrest.serialization import Model + + +class KeyVaultSecretReference(Model): + """Describes a reference to Key Vault Secret. + + All required parameters must be populated in order to send to Azure. + + :param secret_url: Required. The URL referencing a secret in a Key Vault. + :type secret_url: str + :param source_vault: Required. The relative URL of the Key Vault + containing the secret. + :type source_vault: ~azure.mgmt.compute.v2015_06_15.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, **kwargs) -> None: + super(KeyVaultSecretReference, self).__init__(**kwargs) + self.secret_url = secret_url + self.source_vault = source_vault diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/linux_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/linux_configuration.py index 1df4be677c27..562b1fbb78ce 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/linux_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/linux_configuration.py @@ -33,7 +33,7 @@ class LinuxConfiguration(Model): 'ssh': {'key': 'ssh', 'type': 'SshConfiguration'}, } - def __init__(self, disable_password_authentication=None, ssh=None): - super(LinuxConfiguration, self).__init__() - self.disable_password_authentication = disable_password_authentication - self.ssh = ssh + def __init__(self, **kwargs): + super(LinuxConfiguration, self).__init__(**kwargs) + self.disable_password_authentication = kwargs.get('disable_password_authentication', None) + self.ssh = kwargs.get('ssh', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/linux_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/linux_configuration_py3.py new file mode 100644 index 000000000000..bfc384d66e23 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/linux_configuration_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class LinuxConfiguration(Model): + """Specifies the Linux operating system settings on the virtual machine. +

For a list of supported Linux distributions, see [Linux on + Azure-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) +

For running non-endorsed distributions, see [Information for + Non-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + + :param disable_password_authentication: Specifies whether password + authentication should be disabled. + :type disable_password_authentication: bool + :param ssh: Specifies the ssh key configuration for a Linux OS. + :type ssh: ~azure.mgmt.compute.v2015_06_15.models.SshConfiguration + """ + + _attribute_map = { + 'disable_password_authentication': {'key': 'disablePasswordAuthentication', 'type': 'bool'}, + 'ssh': {'key': 'ssh', 'type': 'SshConfiguration'}, + } + + def __init__(self, *, disable_password_authentication: bool=None, ssh=None, **kwargs) -> None: + super(LinuxConfiguration, self).__init__(**kwargs) + self.disable_password_authentication = disable_password_authentication + self.ssh = ssh diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/network_interface_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/network_interface_reference.py index 80c743c0d8e3..b86e305e3f74 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/network_interface_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/network_interface_reference.py @@ -27,6 +27,6 @@ class NetworkInterfaceReference(SubResource): 'primary': {'key': 'properties.primary', 'type': 'bool'}, } - def __init__(self, id=None, primary=None): - super(NetworkInterfaceReference, self).__init__(id=id) - self.primary = primary + def __init__(self, **kwargs): + super(NetworkInterfaceReference, self).__init__(**kwargs) + self.primary = kwargs.get('primary', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/network_interface_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/network_interface_reference_py3.py new file mode 100644 index 000000000000..f42ead50fc36 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/network_interface_reference_py3.py @@ -0,0 +1,32 @@ +# 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 .sub_resource import SubResource + + +class NetworkInterfaceReference(SubResource): + """Describes a network interface reference. + + :param id: Resource Id + :type id: str + :param primary: Specifies the primary network interface in case the + virtual machine has more than 1 network interface. + :type primary: bool + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + } + + def __init__(self, *, id: str=None, primary: bool=None, **kwargs) -> None: + super(NetworkInterfaceReference, self).__init__(id=id, **kwargs) + self.primary = primary diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/network_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/network_profile.py index ab13f8117e62..4ac8348e2f50 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/network_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/network_profile.py @@ -25,6 +25,6 @@ class NetworkProfile(Model): 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceReference]'}, } - def __init__(self, network_interfaces=None): - super(NetworkProfile, self).__init__() - self.network_interfaces = network_interfaces + def __init__(self, **kwargs): + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/network_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/network_profile_py3.py new file mode 100644 index 000000000000..83519262caa0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/network_profile_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkProfile(Model): + """Specifies the network interfaces of the virtual machine. + + :param network_interfaces: Specifies the list of resource Ids for the + network interfaces associated with the virtual machine. + :type network_interfaces: + list[~azure.mgmt.compute.v2015_06_15.models.NetworkInterfaceReference] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceReference]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = network_interfaces diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/operation_status_response.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/operation_status_response.py index e3db2989d5b7..6d351d32b65a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/operation_status_response.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/operation_status_response.py @@ -46,8 +46,8 @@ class OperationStatusResponse(Model): 'error': {'key': 'error', 'type': 'ApiError'}, } - def __init__(self): - super(OperationStatusResponse, self).__init__() + def __init__(self, **kwargs): + super(OperationStatusResponse, self).__init__(**kwargs) self.name = None self.status = None self.start_time = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/operation_status_response_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/operation_status_response_py3.py new file mode 100644 index 000000000000..3528bd0d9434 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/operation_status_response_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class OperationStatusResponse(Model): + """Operation status response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation ID + :vartype name: str + :ivar status: Operation status + :vartype status: str + :ivar start_time: Start time of the operation + :vartype start_time: datetime + :ivar end_time: End time of the operation + :vartype end_time: datetime + :ivar error: Api error + :vartype error: ~azure.mgmt.compute.v2015_06_15.models.ApiError + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationStatusResponse, self).__init__(**kwargs) + self.name = None + self.status = None + self.start_time = None + self.end_time = None + self.error = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_disk.py index f0c6e337d8ca..79b03a5188a7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_disk.py @@ -18,6 +18,8 @@ class OSDisk(Model): VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + All required parameters must be populated in order to send to Azure. + :param 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** @@ -28,9 +30,9 @@ class OSDisk(Model): Disk.

Minimum api-version: 2015-06-15 :type encryption_settings: ~azure.mgmt.compute.v2015_06_15.models.DiskEncryptionSettings - :param name: The disk name. + :param name: Required. The disk name. :type name: str - :param vhd: The virtual hard disk. + :param vhd: Required. The virtual hard disk. :type vhd: ~azure.mgmt.compute.v2015_06_15.models.VirtualHardDisk :param image: The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If @@ -42,8 +44,8 @@ class OSDisk(Model):

Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2015_06_15.models.CachingTypes - :param create_option: Specifies how the virtual machine should be - created.

Possible values are:

**Attach** \\u2013 This + :param create_option: Required. Specifies how the virtual machine should + be created.

Possible values are:

**Attach** \\u2013 This value is used when you are using a specialized disk to create the virtual machine.

**FromImage** \\u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform @@ -75,13 +77,13 @@ class OSDisk(Model): 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, } - def __init__(self, name, vhd, create_option, os_type=None, encryption_settings=None, image=None, caching=None, disk_size_gb=None): - super(OSDisk, self).__init__() - self.os_type = os_type - self.encryption_settings = encryption_settings - self.name = name - self.vhd = vhd - self.image = image - self.caching = caching - self.create_option = create_option - self.disk_size_gb = disk_size_gb + def __init__(self, **kwargs): + super(OSDisk, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.encryption_settings = kwargs.get('encryption_settings', None) + self.name = kwargs.get('name', None) + self.vhd = kwargs.get('vhd', None) + self.image = kwargs.get('image', None) + self.caching = kwargs.get('caching', None) + self.create_option = kwargs.get('create_option', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_disk_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_disk_image.py index 161e8ca033e7..75d1d853bee4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_disk_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_disk_image.py @@ -15,8 +15,10 @@ class OSDiskImage(Model): """Contains the os disk image information. - :param operating_system: The operating system of the osDiskImage. Possible - values include: 'Windows', 'Linux' + All required parameters must be populated in order to send to Azure. + + :param operating_system: Required. The operating system of the + osDiskImage. Possible values include: 'Windows', 'Linux' :type operating_system: str or ~azure.mgmt.compute.v2015_06_15.models.OperatingSystemTypes """ @@ -29,6 +31,6 @@ class OSDiskImage(Model): 'operating_system': {'key': 'operatingSystem', 'type': 'OperatingSystemTypes'}, } - def __init__(self, operating_system): - super(OSDiskImage, self).__init__() - self.operating_system = operating_system + def __init__(self, **kwargs): + super(OSDiskImage, self).__init__(**kwargs) + self.operating_system = kwargs.get('operating_system', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_disk_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_disk_image_py3.py new file mode 100644 index 000000000000..8a13d6b47d8f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_disk_image_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class OSDiskImage(Model): + """Contains the os disk image information. + + All required parameters must be populated in order to send to Azure. + + :param operating_system: Required. The operating system of the + osDiskImage. Possible values include: 'Windows', 'Linux' + :type operating_system: str or + ~azure.mgmt.compute.v2015_06_15.models.OperatingSystemTypes + """ + + _validation = { + 'operating_system': {'required': True}, + } + + _attribute_map = { + 'operating_system': {'key': 'operatingSystem', 'type': 'OperatingSystemTypes'}, + } + + def __init__(self, *, operating_system, **kwargs) -> None: + super(OSDiskImage, self).__init__(**kwargs) + self.operating_system = operating_system diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_disk_py3.py new file mode 100644 index 000000000000..2b5a1686e286 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_disk_py3.py @@ -0,0 +1,89 @@ +# 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 msrest.serialization import Model + + +class OSDisk(Model): + """Specifies information about the operating system disk used by the virtual + machine.

For more information about disks, see [About disks and + VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + + All required parameters must be populated in order to send to Azure. + + :param 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**. Possible values include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2015_06_15.models.OperatingSystemTypes + :param encryption_settings: Specifies the encryption settings for the OS + Disk.

Minimum api-version: 2015-06-15 + :type encryption_settings: + ~azure.mgmt.compute.v2015_06_15.models.DiskEncryptionSettings + :param name: Required. The disk name. + :type name: str + :param vhd: Required. The virtual hard disk. + :type vhd: ~azure.mgmt.compute.v2015_06_15.models.VirtualHardDisk + :param image: The source user image virtual hard disk. The virtual hard + disk will be copied before being attached to the virtual machine. If + SourceImage is provided, the destination virtual hard drive must not + exist. + :type image: ~azure.mgmt.compute.v2015_06_15.models.VirtualHardDisk + :param caching: Specifies the caching requirements.

Possible + values are:

**None**

**ReadOnly**

**ReadWrite** +

Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2015_06_15.models.CachingTypes + :param create_option: Required. Specifies how the virtual machine should + be created.

Possible values are:

**Attach** \\u2013 This + value is used when you are using a specialized disk to create the virtual + machine.

**FromImage** \\u2013 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. Possible values include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2015_06_15.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in + gigabytes. This element can be used to overwrite the name of the disk in a + virtual machine image.

This value cannot be larger than 1023 GB + :type disk_size_gb: int + """ + + _validation = { + 'name': {'required': True}, + 'vhd': {'required': True}, + 'create_option': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': 'DiskEncryptionSettings'}, + 'name': {'key': 'name', 'type': 'str'}, + 'vhd': {'key': 'vhd', 'type': 'VirtualHardDisk'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + } + + def __init__(self, *, name: str, vhd, create_option, os_type=None, encryption_settings=None, image=None, caching=None, disk_size_gb: int=None, **kwargs) -> None: + super(OSDisk, self).__init__(**kwargs) + self.os_type = os_type + self.encryption_settings = encryption_settings + self.name = name + self.vhd = vhd + self.image = image + self.caching = caching + self.create_option = create_option + self.disk_size_gb = disk_size_gb diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_profile.py index e55d67908a90..2b9a8853857c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_profile.py @@ -88,12 +88,12 @@ class OSProfile(Model): 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, } - def __init__(self, computer_name=None, admin_username=None, admin_password=None, custom_data=None, windows_configuration=None, linux_configuration=None, secrets=None): - super(OSProfile, self).__init__() - self.computer_name = computer_name - 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 + def __init__(self, **kwargs): + super(OSProfile, self).__init__(**kwargs) + self.computer_name = kwargs.get('computer_name', None) + self.admin_username = kwargs.get('admin_username', None) + self.admin_password = kwargs.get('admin_password', None) + self.custom_data = kwargs.get('custom_data', None) + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + self.secrets = kwargs.get('secrets', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_profile_py3.py new file mode 100644 index 000000000000..56fe8ba474dc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/os_profile_py3.py @@ -0,0 +1,99 @@ +# 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 msrest.serialization import Model + + +class OSProfile(Model): + """Specifies the operating system settings for the virtual machine. + + :param computer_name: Specifies the host OS name of the virtual machine. +

**Max-length (Windows):** 15 characters

**Max-length + (Linux):** 64 characters.

For naming conventions and restrictions + see [Azure infrastructure services implementation + guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + :type computer_name: str + :param admin_username: Specifies the name of the administrator account. +

**Windows-only restriction:** Cannot end in "."

+ **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".

**Minimum-length (Linux):** 1 + character

**Max-length (Linux):** 64 characters

+ **Max-length (Windows):** 20 characters

  • For root access to + the Linux VM, see [Using root privileges on Linux virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + For a list of built-in system users on Linux that should not be used in + this field, see [Selecting User Names for Linux on + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type admin_username: str + :param admin_password: Specifies the password of the administrator + account.

    **Minimum-length (Windows):** 8 characters

    + **Minimum-length (Linux):** 6 characters

    **Max-length + (Windows):** 123 characters

    **Max-length (Linux):** 72 characters +

    **Complexity requirements:** 3 out of 4 conditions below need to + be fulfilled
    Has lower characters
    Has upper characters
    Has a + digit
    Has a special character (Regex match [\\W_])

    + **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + "iloveyou!"

    For resetting the password, see [How to reset the + Remote Desktop service or its login password in a Windows + VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    For resetting root password, see [Manage users, SSH, and check or + repair disks on Azure Linux VMs using the VMAccess + Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + :type admin_password: str + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type custom_data: str + :param windows_configuration: Specifies Windows operating system settings + on the virtual machine. + :type windows_configuration: + ~azure.mgmt.compute.v2015_06_15.models.WindowsConfiguration + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) +

    For running non-endorsed distributions, see [Information for + Non-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + :type linux_configuration: + ~azure.mgmt.compute.v2015_06_15.models.LinuxConfiguration + :param secrets: Specifies set of certificates that should be installed + onto the virtual machine. + :type secrets: + list[~azure.mgmt.compute.v2015_06_15.models.VaultSecretGroup] + """ + + _attribute_map = { + 'computer_name': {'key': 'computerName', '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]'}, + } + + def __init__(self, *, computer_name: str=None, admin_username: str=None, admin_password: str=None, custom_data: str=None, windows_configuration=None, linux_configuration=None, secrets=None, **kwargs) -> None: + super(OSProfile, self).__init__(**kwargs) + self.computer_name = computer_name + 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 diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/plan.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/plan.py index 772160aef635..d42b6b32cfac 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/plan.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/plan.py @@ -38,9 +38,9 @@ class Plan(Model): 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, } - def __init__(self, name=None, publisher=None, product=None, promotion_code=None): - super(Plan, self).__init__() - self.name = name - self.publisher = publisher - self.product = product - self.promotion_code = promotion_code + def __init__(self, **kwargs): + super(Plan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/plan_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/plan_py3.py new file mode 100644 index 000000000000..9cca2c78a123 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/plan_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class Plan(Model): + """Specifies information about the marketplace image used to create the + virtual machine. This element is only used for marketplace images. Before + you can use a marketplace image from an API, you must enable the image for + programmatic use. In the Azure portal, find the marketplace image that you + want to use and then click **Want to deploy programmatically, Get Started + ->**. Enter any required information and then click **Save**. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: Specifies the product of the image from the marketplace. + This is the same value as Offer under the imageReference element. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, publisher: str=None, product: str=None, promotion_code: str=None, **kwargs) -> None: + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/purchase_plan.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/purchase_plan.py index aa29cb02ab78..2e1509addca6 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/purchase_plan.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/purchase_plan.py @@ -16,12 +16,15 @@ class PurchasePlan(Model): """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - :param publisher: The publisher ID. + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The publisher ID. :type publisher: str - :param name: The plan ID. + :param name: Required. The plan ID. :type name: str - :param product: Specifies the product of the image from the marketplace. - This is the same value as Offer under the imageReference element. + :param product: Required. Specifies the product of the image from the + marketplace. This is the same value as Offer under the imageReference + element. :type product: str """ @@ -37,8 +40,8 @@ class PurchasePlan(Model): 'product': {'key': 'product', 'type': 'str'}, } - def __init__(self, publisher, name, product): - super(PurchasePlan, self).__init__() - self.publisher = publisher - self.name = name - self.product = product + def __init__(self, **kwargs): + super(PurchasePlan, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.name = kwargs.get('name', None) + self.product = kwargs.get('product', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/purchase_plan_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/purchase_plan_py3.py new file mode 100644 index 000000000000..26f7996f1633 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/purchase_plan_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class PurchasePlan(Model): + """Used for establishing the purchase context of any 3rd Party artifact + through MarketPlace. + + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The publisher ID. + :type publisher: str + :param name: Required. The plan ID. + :type name: str + :param product: Required. Specifies the product of the image from the + marketplace. This is the same value as Offer under the imageReference + element. + :type product: str + """ + + _validation = { + 'publisher': {'required': True}, + 'name': {'required': True}, + 'product': {'required': True}, + } + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__(self, *, publisher: str, name: str, product: str, **kwargs) -> None: + super(PurchasePlan, self).__init__(**kwargs) + self.publisher = publisher + self.name = name + self.product = product diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/resource.py index 10269b591c68..5dd7d481c685 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/resource.py @@ -18,13 +18,15 @@ class Resource(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -45,10 +47,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/resource_py3.py new file mode 100644 index 000000000000..2f3702caf609 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/resource_py3.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/sku.py index 16755dc57b65..5c07709435e0 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/sku.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/sku.py @@ -31,8 +31,8 @@ class Sku(Model): 'capacity': {'key': 'capacity', 'type': 'long'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(Sku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/sku_py3.py new file mode 100644 index 000000000000..f6bc74afaadc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/sku_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class Sku(Model): + """Describes a virtual machine scale set sku. + + :param name: The sku name. + :type name: str + :param tier: Specifies the tier of virtual machines in a scale set.

    Possible Values:

    **Standard**

    **Basic** + :type tier: str + :param capacity: Specifies the number of virtual machines in the scale + set. + :type capacity: long + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'long'}, + } + + def __init__(self, *, name: str=None, tier: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/ssh_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/ssh_configuration.py index 52d4925d8051..10c604242030 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/ssh_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/ssh_configuration.py @@ -25,6 +25,6 @@ class SshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[SshPublicKey]'}, } - def __init__(self, public_keys=None): - super(SshConfiguration, self).__init__() - self.public_keys = public_keys + def __init__(self, **kwargs): + super(SshConfiguration, self).__init__(**kwargs) + self.public_keys = kwargs.get('public_keys', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/ssh_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/ssh_configuration_py3.py new file mode 100644 index 000000000000..6781d53e3e3a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/ssh_configuration_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SshConfiguration(Model): + """SSH configuration for Linux based VMs running on Azure. + + :param public_keys: The list of SSH public keys used to authenticate with + linux based VMs. + :type public_keys: + list[~azure.mgmt.compute.v2015_06_15.models.SshPublicKey] + """ + + _attribute_map = { + 'public_keys': {'key': 'publicKeys', 'type': '[SshPublicKey]'}, + } + + def __init__(self, *, public_keys=None, **kwargs) -> None: + super(SshConfiguration, self).__init__(**kwargs) + self.public_keys = public_keys diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/ssh_public_key.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/ssh_public_key.py index 2fe6756641cb..122e0d3b9fdd 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/ssh_public_key.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/ssh_public_key.py @@ -33,7 +33,7 @@ class SshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, path=None, key_data=None): - super(SshPublicKey, self).__init__() - self.path = path - self.key_data = key_data + def __init__(self, **kwargs): + super(SshPublicKey, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.key_data = kwargs.get('key_data', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/ssh_public_key_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/ssh_public_key_py3.py new file mode 100644 index 000000000000..b16ee085b36b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/ssh_public_key_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class SshPublicKey(Model): + """Contains information about SSH certificate public key and the path on the + Linux VM where the public key is placed. + + :param 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 + :type path: str + :param 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/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + :type key_data: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'key_data': {'key': 'keyData', 'type': 'str'}, + } + + def __init__(self, *, path: str=None, key_data: str=None, **kwargs) -> None: + super(SshPublicKey, self).__init__(**kwargs) + self.path = path + self.key_data = key_data diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/storage_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/storage_profile.py index 311c859e7a64..867bd965561e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/storage_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/storage_profile.py @@ -40,8 +40,8 @@ class StorageProfile(Model): 'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'}, } - def __init__(self, image_reference=None, os_disk=None, data_disks=None): - super(StorageProfile, self).__init__() - self.image_reference = image_reference - self.os_disk = os_disk - self.data_disks = data_disks + def __init__(self, **kwargs): + super(StorageProfile, self).__init__(**kwargs) + self.image_reference = kwargs.get('image_reference', None) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/storage_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/storage_profile_py3.py new file mode 100644 index 000000000000..6fbf8335d47a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/storage_profile_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class StorageProfile(Model): + """Specifies the storage settings for the virtual machine disks. + + :param 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. + :type image_reference: + ~azure.mgmt.compute.v2015_06_15.models.ImageReference + :param os_disk: Specifies information about the operating system disk used + by the virtual machine.

    For more information about disks, see + [About disks and VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type os_disk: ~azure.mgmt.compute.v2015_06_15.models.OSDisk + :param data_disks: Specifies the parameters that are used to add a data + disk to a virtual machine.

    For more information about disks, see + [About disks and VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type data_disks: list[~azure.mgmt.compute.v2015_06_15.models.DataDisk] + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'OSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'}, + } + + def __init__(self, *, image_reference=None, os_disk=None, data_disks=None, **kwargs) -> None: + super(StorageProfile, self).__init__(**kwargs) + self.image_reference = image_reference + self.os_disk = os_disk + self.data_disks = data_disks diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/sub_resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/sub_resource.py index b32875f54c8e..11e092cc6ff5 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/sub_resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/sub_resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/sub_resource_py3.py new file mode 100644 index 000000000000..29e5afee38f9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class SubResource(Model): + """SubResource. + + :param id: Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/upgrade_policy.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/upgrade_policy.py index 046c8ed9414b..44f90ffe6ee6 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/upgrade_policy.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/upgrade_policy.py @@ -28,6 +28,6 @@ class UpgradePolicy(Model): 'mode': {'key': 'mode', 'type': 'UpgradeMode'}, } - def __init__(self, mode=None): - super(UpgradePolicy, self).__init__() - self.mode = mode + def __init__(self, **kwargs): + super(UpgradePolicy, self).__init__(**kwargs) + self.mode = kwargs.get('mode', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/upgrade_policy_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/upgrade_policy_py3.py new file mode 100644 index 000000000000..c12f9aa7f3b1 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/upgrade_policy_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class UpgradePolicy(Model): + """Describes an upgrade policy - automatic or manual. + + :param mode: Specifies the mode of an upgrade to virtual machines in the + scale set.

    Possible values are:

    **Manual** - You + control the application of updates to virtual machines in the scale set. + You do this by using the manualUpgrade action.

    **Automatic** - + All virtual machines in the scale set are automatically updated at the + same time. Possible values include: 'Automatic', 'Manual' + :type mode: str or ~azure.mgmt.compute.v2015_06_15.models.UpgradeMode + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'UpgradeMode'}, + } + + def __init__(self, *, mode=None, **kwargs) -> None: + super(UpgradePolicy, self).__init__(**kwargs) + self.mode = mode diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/usage.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/usage.py index 00f3be0d2b58..01ed97fc4de6 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/usage.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/usage.py @@ -18,14 +18,16 @@ class Usage(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar unit: An enum describing the unit of usage measurement. Default - value: "Count" . + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of usage measurement. + Default value: "Count" . :vartype unit: str - :param current_value: The current usage of the resource. + :param current_value: Required. The current usage of the resource. :type current_value: int - :param limit: The maximum permitted usage of the resource. + :param limit: Required. The maximum permitted usage of the resource. :type limit: long - :param name: The name of the type of usage. + :param name: Required. The name of the type of usage. :type name: ~azure.mgmt.compute.v2015_06_15.models.UsageName """ @@ -45,8 +47,8 @@ class Usage(Model): unit = "Count" - def __init__(self, current_value, limit, name): - super(Usage, self).__init__() - self.current_value = current_value - self.limit = limit - self.name = name + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/usage_name.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/usage_name.py index 799c1f896da3..e2560936493e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/usage_name.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/usage_name.py @@ -26,7 +26,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(UsageName, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/usage_name_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/usage_name_py3.py new file mode 100644 index 000000000000..ad0b77459f75 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class UsageName(Model): + """The Usage Names. + + :param value: The name of the resource. + :type value: str + :param localized_value: The localized name of the resource. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/usage_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/usage_py3.py new file mode 100644 index 000000000000..73b319c36b9d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/usage_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class Usage(Model): + """Describes Compute Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of usage measurement. + Default value: "Count" . + :vartype unit: str + :param current_value: Required. The current usage of the resource. + :type current_value: int + :param limit: Required. The maximum permitted usage of the resource. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.compute.v2015_06_15.models.UsageName + """ + + _validation = { + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__(self, *, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/vault_certificate.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/vault_certificate.py index 8d4d05955de4..b173def6f820 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/vault_certificate.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/vault_certificate.py @@ -40,7 +40,7 @@ class VaultCertificate(Model): 'certificate_store': {'key': 'certificateStore', 'type': 'str'}, } - def __init__(self, certificate_url=None, certificate_store=None): - super(VaultCertificate, self).__init__() - self.certificate_url = certificate_url - self.certificate_store = certificate_store + def __init__(self, **kwargs): + super(VaultCertificate, self).__init__(**kwargs) + self.certificate_url = kwargs.get('certificate_url', None) + self.certificate_store = kwargs.get('certificate_store', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/vault_certificate_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/vault_certificate_py3.py new file mode 100644 index 000000000000..eda5ba1c3f1d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/vault_certificate_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VaultCertificate(Model): + """Describes a single certificate reference in a Key Vault, and where the + certificate should reside on the VM. + + :param 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](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + In this case, your certificate needs to be It is the Base64 encoding of + the following JSON Object which is encoded in UTF-8:

    {
    + "data":"",
    "dataType":"pfx",
    + "password":""
    } + :type certificate_url: str + :param 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 .crt + for the X509 certificate file and .prv for private + key. Both of these files are .pem formatted. + :type certificate_store: str + """ + + _attribute_map = { + 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, + 'certificate_store': {'key': 'certificateStore', 'type': 'str'}, + } + + def __init__(self, *, certificate_url: str=None, certificate_store: str=None, **kwargs) -> None: + super(VaultCertificate, self).__init__(**kwargs) + self.certificate_url = certificate_url + self.certificate_store = certificate_store diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/vault_secret_group.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/vault_secret_group.py index 5ebb98d43c3b..404557b15d2a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/vault_secret_group.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/vault_secret_group.py @@ -29,7 +29,7 @@ class VaultSecretGroup(Model): 'vault_certificates': {'key': 'vaultCertificates', 'type': '[VaultCertificate]'}, } - def __init__(self, source_vault=None, vault_certificates=None): - super(VaultSecretGroup, self).__init__() - self.source_vault = source_vault - self.vault_certificates = vault_certificates + def __init__(self, **kwargs): + super(VaultSecretGroup, self).__init__(**kwargs) + self.source_vault = kwargs.get('source_vault', None) + self.vault_certificates = kwargs.get('vault_certificates', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/vault_secret_group_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/vault_secret_group_py3.py new file mode 100644 index 000000000000..f9b4e9def34d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/vault_secret_group_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class VaultSecretGroup(Model): + """Describes a set of certificates which are all in the same Key Vault. + + :param source_vault: The relative URL of the Key Vault containing all of + the certificates in VaultCertificates. + :type source_vault: ~azure.mgmt.compute.v2015_06_15.models.SubResource + :param vault_certificates: The list of key vault references in SourceVault + which contain certificates. + :type vault_certificates: + list[~azure.mgmt.compute.v2015_06_15.models.VaultCertificate] + """ + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, + 'vault_certificates': {'key': 'vaultCertificates', 'type': '[VaultCertificate]'}, + } + + def __init__(self, *, source_vault=None, vault_certificates=None, **kwargs) -> None: + super(VaultSecretGroup, self).__init__(**kwargs) + self.source_vault = source_vault + self.vault_certificates = vault_certificates diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_hard_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_hard_disk.py index af1725d302af..5e3ad9dea7d4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_hard_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_hard_disk.py @@ -23,6 +23,6 @@ class VirtualHardDisk(Model): 'uri': {'key': 'uri', 'type': 'str'}, } - def __init__(self, uri=None): - super(VirtualHardDisk, self).__init__() - self.uri = uri + def __init__(self, **kwargs): + super(VirtualHardDisk, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_hard_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_hard_disk_py3.py new file mode 100644 index 000000000000..9c069b95f084 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_hard_disk_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class VirtualHardDisk(Model): + """Describes the uri of a disk. + + :param uri: Specifies the virtual hard disk's uri. + :type uri: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__(self, *, uri: str=None, **kwargs) -> None: + super(VirtualHardDisk, self).__init__(**kwargs) + self.uri = uri diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine.py index d3d91e3cdeda..3c96a569b5ff 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine.py @@ -18,13 +18,15 @@ class VirtualMachine(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -117,16 +119,16 @@ class VirtualMachine(Resource): 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, } - def __init__(self, location, tags=None, plan=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type=None): - super(VirtualMachine, self).__init__(location=location, tags=tags) - self.plan = plan - self.hardware_profile = hardware_profile - self.storage_profile = storage_profile - self.os_profile = os_profile - self.network_profile = network_profile - self.diagnostics_profile = diagnostics_profile - self.availability_set = availability_set + def __init__(self, **kwargs): + super(VirtualMachine, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.os_profile = kwargs.get('os_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.availability_set = kwargs.get('availability_set', None) self.provisioning_state = None self.instance_view = None - self.license_type = license_type + self.license_type = kwargs.get('license_type', None) self.resources = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_agent_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_agent_instance_view.py index f79a79e0c7fa..2354a65bf52b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_agent_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_agent_instance_view.py @@ -32,8 +32,8 @@ class VirtualMachineAgentInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, vm_agent_version=None, extension_handlers=None, statuses=None): - super(VirtualMachineAgentInstanceView, self).__init__() - self.vm_agent_version = vm_agent_version - self.extension_handlers = extension_handlers - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineAgentInstanceView, self).__init__(**kwargs) + self.vm_agent_version = kwargs.get('vm_agent_version', None) + self.extension_handlers = kwargs.get('extension_handlers', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_agent_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_agent_instance_view_py3.py new file mode 100644 index 000000000000..26483dd9ebbb --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_agent_instance_view_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineAgentInstanceView(Model): + """The instance view of the VM Agent running on the virtual machine. + + :param vm_agent_version: The VM Agent full version. + :type vm_agent_version: str + :param extension_handlers: The virtual machine extension handler instance + view. + :type extension_handlers: + list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtensionHandlerInstanceView] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2015_06_15.models.InstanceViewStatus] + """ + + _attribute_map = { + 'vm_agent_version': {'key': 'vmAgentVersion', 'type': 'str'}, + 'extension_handlers': {'key': 'extensionHandlers', 'type': '[VirtualMachineExtensionHandlerInstanceView]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, vm_agent_version: str=None, extension_handlers=None, statuses=None, **kwargs) -> None: + super(VirtualMachineAgentInstanceView, self).__init__(**kwargs) + self.vm_agent_version = vm_agent_version + self.extension_handlers = extension_handlers + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_capture_parameters.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_capture_parameters.py index b406f387ffed..4e6ffbea7a4f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_capture_parameters.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_capture_parameters.py @@ -15,12 +15,15 @@ class VirtualMachineCaptureParameters(Model): """Capture Virtual Machine parameters. - :param vhd_prefix: The captured virtual hard disk's name prefix. + All required parameters must be populated in order to send to Azure. + + :param vhd_prefix: Required. The captured virtual hard disk's name prefix. :type vhd_prefix: str - :param destination_container_name: The destination container name. + :param destination_container_name: Required. The destination container + name. :type destination_container_name: str - :param overwrite_vhds: Specifies whether to overwrite the destination - virtual hard disk, in case of conflict. + :param overwrite_vhds: Required. Specifies whether to overwrite the + destination virtual hard disk, in case of conflict. :type overwrite_vhds: bool """ @@ -36,8 +39,8 @@ class VirtualMachineCaptureParameters(Model): 'overwrite_vhds': {'key': 'overwriteVhds', 'type': 'bool'}, } - def __init__(self, vhd_prefix, destination_container_name, overwrite_vhds): - super(VirtualMachineCaptureParameters, self).__init__() - self.vhd_prefix = vhd_prefix - self.destination_container_name = destination_container_name - self.overwrite_vhds = overwrite_vhds + def __init__(self, **kwargs): + super(VirtualMachineCaptureParameters, self).__init__(**kwargs) + self.vhd_prefix = kwargs.get('vhd_prefix', None) + self.destination_container_name = kwargs.get('destination_container_name', None) + self.overwrite_vhds = kwargs.get('overwrite_vhds', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_capture_parameters_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_capture_parameters_py3.py new file mode 100644 index 000000000000..1866cdc23300 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_capture_parameters_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineCaptureParameters(Model): + """Capture Virtual Machine parameters. + + All required parameters must be populated in order to send to Azure. + + :param vhd_prefix: Required. The captured virtual hard disk's name prefix. + :type vhd_prefix: str + :param destination_container_name: Required. The destination container + name. + :type destination_container_name: str + :param overwrite_vhds: Required. Specifies whether to overwrite the + destination virtual hard disk, in case of conflict. + :type overwrite_vhds: bool + """ + + _validation = { + 'vhd_prefix': {'required': True}, + 'destination_container_name': {'required': True}, + 'overwrite_vhds': {'required': True}, + } + + _attribute_map = { + 'vhd_prefix': {'key': 'vhdPrefix', 'type': 'str'}, + 'destination_container_name': {'key': 'destinationContainerName', 'type': 'str'}, + 'overwrite_vhds': {'key': 'overwriteVhds', 'type': 'bool'}, + } + + def __init__(self, *, vhd_prefix: str, destination_container_name: str, overwrite_vhds: bool, **kwargs) -> None: + super(VirtualMachineCaptureParameters, self).__init__(**kwargs) + self.vhd_prefix = vhd_prefix + self.destination_container_name = destination_container_name + self.overwrite_vhds = overwrite_vhds diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_capture_result.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_capture_result.py index 95e26a427e83..2b0df7406a34 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_capture_result.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_capture_result.py @@ -26,6 +26,6 @@ class VirtualMachineCaptureResult(SubResource): 'output': {'key': 'properties.output', 'type': 'object'}, } - def __init__(self, id=None, output=None): - super(VirtualMachineCaptureResult, self).__init__(id=id) - self.output = output + def __init__(self, **kwargs): + super(VirtualMachineCaptureResult, self).__init__(**kwargs) + self.output = kwargs.get('output', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_capture_result_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_capture_result_py3.py new file mode 100644 index 000000000000..da449b8e9154 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_capture_result_py3.py @@ -0,0 +1,31 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineCaptureResult(SubResource): + """Resource Id. + + :param id: Resource Id + :type id: str + :param output: Operation output data (raw JSON) + :type output: object + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'output': {'key': 'properties.output', 'type': 'object'}, + } + + def __init__(self, *, id: str=None, output=None, **kwargs) -> None: + super(VirtualMachineCaptureResult, self).__init__(id=id, **kwargs) + self.output = output diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension.py index 232d17f3227d..f8518c889105 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension.py @@ -18,13 +18,15 @@ class VirtualMachineExtension(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -82,14 +84,14 @@ class VirtualMachineExtension(Resource): 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineExtensionInstanceView'}, } - def __init__(self, location, tags=None, force_update_tag=None, publisher=None, virtual_machine_extension_type=None, type_handler_version=None, auto_upgrade_minor_version=None, settings=None, protected_settings=None, instance_view=None): - super(VirtualMachineExtension, self).__init__(location=location, tags=tags) - self.force_update_tag = force_update_tag - self.publisher = publisher - self.virtual_machine_extension_type = virtual_machine_extension_type - self.type_handler_version = type_handler_version - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings + def __init__(self, **kwargs): + super(VirtualMachineExtension, self).__init__(**kwargs) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.virtual_machine_extension_type = kwargs.get('virtual_machine_extension_type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) self.provisioning_state = None - self.instance_view = instance_view + self.instance_view = kwargs.get('instance_view', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_handler_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_handler_instance_view.py index 988d7df8141b..68fc656cac2f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_handler_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_handler_instance_view.py @@ -30,8 +30,8 @@ class VirtualMachineExtensionHandlerInstanceView(Model): 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, } - def __init__(self, type=None, type_handler_version=None, status=None): - super(VirtualMachineExtensionHandlerInstanceView, self).__init__() - self.type = type - self.type_handler_version = type_handler_version - self.status = status + def __init__(self, **kwargs): + super(VirtualMachineExtensionHandlerInstanceView, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.status = kwargs.get('status', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_handler_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_handler_instance_view_py3.py new file mode 100644 index 000000000000..2b6383f78fcc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_handler_instance_view_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineExtensionHandlerInstanceView(Model): + """The instance view of a virtual machine extension handler. + + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param status: The extension handler status. + :type status: ~azure.mgmt.compute.v2015_06_15.models.InstanceViewStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, + } + + def __init__(self, *, type: str=None, type_handler_version: str=None, status=None, **kwargs) -> None: + super(VirtualMachineExtensionHandlerInstanceView, self).__init__(**kwargs) + self.type = type + self.type_handler_version = type_handler_version + self.status = status diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_image.py index 7614699a78da..7273e2b84754 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_image.py @@ -18,23 +18,26 @@ class VirtualMachineExtensionImage(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param operating_system: The operating system this extension supports. - :type operating_system: str - :param compute_role: The type of role (IaaS or PaaS) this extension + :param operating_system: Required. The operating system this extension supports. + :type operating_system: str + :param compute_role: Required. The type of role (IaaS or PaaS) this + extension supports. :type compute_role: str - :param handler_schema: The schema defined by publisher, where extension - consumers should provide settings in a matching schema. + :param handler_schema: Required. The schema defined by publisher, where + extension consumers should provide settings in a matching schema. :type handler_schema: str :param vm_scale_set_enabled: Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but @@ -69,10 +72,10 @@ class VirtualMachineExtensionImage(Resource): 'supports_multiple_extensions': {'key': 'properties.supportsMultipleExtensions', 'type': 'bool'}, } - def __init__(self, location, operating_system, compute_role, handler_schema, tags=None, vm_scale_set_enabled=None, supports_multiple_extensions=None): - super(VirtualMachineExtensionImage, self).__init__(location=location, tags=tags) - self.operating_system = operating_system - self.compute_role = compute_role - self.handler_schema = handler_schema - self.vm_scale_set_enabled = vm_scale_set_enabled - self.supports_multiple_extensions = supports_multiple_extensions + def __init__(self, **kwargs): + super(VirtualMachineExtensionImage, self).__init__(**kwargs) + self.operating_system = kwargs.get('operating_system', None) + self.compute_role = kwargs.get('compute_role', None) + self.handler_schema = kwargs.get('handler_schema', None) + self.vm_scale_set_enabled = kwargs.get('vm_scale_set_enabled', None) + self.supports_multiple_extensions = kwargs.get('supports_multiple_extensions', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_image_py3.py new file mode 100644 index 000000000000..217accab02f0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_image_py3.py @@ -0,0 +1,81 @@ +# 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 .resource import Resource + + +class VirtualMachineExtensionImage(Resource): + """Describes a Virtual Machine Extension Image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param operating_system: Required. The operating system this extension + supports. + :type operating_system: str + :param compute_role: Required. The type of role (IaaS or PaaS) this + extension supports. + :type compute_role: str + :param handler_schema: Required. The schema defined by publisher, where + extension consumers should provide settings in a matching schema. + :type handler_schema: str + :param vm_scale_set_enabled: Whether the extension can be used on xRP + VMScaleSets. By default existing extensions are usable on scalesets, but + there might be cases where a publisher wants to explicitly indicate the + extension is only enabled for CRP VMs but not VMSS. + :type vm_scale_set_enabled: bool + :param supports_multiple_extensions: Whether the handler can support + multiple extensions. + :type supports_multiple_extensions: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'operating_system': {'required': True}, + 'compute_role': {'required': True}, + 'handler_schema': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'operating_system': {'key': 'properties.operatingSystem', 'type': 'str'}, + 'compute_role': {'key': 'properties.computeRole', 'type': 'str'}, + 'handler_schema': {'key': 'properties.handlerSchema', 'type': 'str'}, + 'vm_scale_set_enabled': {'key': 'properties.vmScaleSetEnabled', 'type': 'bool'}, + 'supports_multiple_extensions': {'key': 'properties.supportsMultipleExtensions', 'type': 'bool'}, + } + + def __init__(self, *, location: str, operating_system: str, compute_role: str, handler_schema: str, tags=None, vm_scale_set_enabled: bool=None, supports_multiple_extensions: bool=None, **kwargs) -> None: + super(VirtualMachineExtensionImage, self).__init__(location=location, tags=tags, **kwargs) + self.operating_system = operating_system + self.compute_role = compute_role + self.handler_schema = handler_schema + self.vm_scale_set_enabled = vm_scale_set_enabled + self.supports_multiple_extensions = supports_multiple_extensions diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_instance_view.py index 16515cbfe606..aa4725b23c88 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_instance_view.py @@ -38,10 +38,10 @@ class VirtualMachineExtensionInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, name=None, type=None, type_handler_version=None, substatuses=None, statuses=None): - super(VirtualMachineExtensionInstanceView, self).__init__() - self.name = name - self.type = type - self.type_handler_version = type_handler_version - self.substatuses = substatuses - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineExtensionInstanceView, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.substatuses = kwargs.get('substatuses', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_instance_view_py3.py new file mode 100644 index 000000000000..2b6ecac3802c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_instance_view_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineExtensionInstanceView(Model): + """The instance view of a virtual machine extension. + + :param name: The virtual machine extension name. + :type name: str + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param substatuses: The resource status information. + :type substatuses: + list[~azure.mgmt.compute.v2015_06_15.models.InstanceViewStatus] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2015_06_15.models.InstanceViewStatus] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'substatuses': {'key': 'substatuses', 'type': '[InstanceViewStatus]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, name: str=None, type: str=None, type_handler_version: str=None, substatuses=None, statuses=None, **kwargs) -> None: + super(VirtualMachineExtensionInstanceView, self).__init__(**kwargs) + self.name = name + self.type = type + self.type_handler_version = type_handler_version + self.substatuses = substatuses + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_py3.py new file mode 100644 index 000000000000..a3bbe0510df7 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_extension_py3.py @@ -0,0 +1,97 @@ +# 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 .resource import Resource + + +class VirtualMachineExtension(Resource): + """Describes a Virtual Machine Extension. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param force_update_tag: How the extension handler should be forced to + update even if the extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param virtual_machine_extension_type: Specifies the type of the + extension; an example is "CustomScriptExtension". + :type virtual_machine_extension_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either + protectedSettings or protectedSettingsFromKeyVault or no protected + settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :param instance_view: The virtual machine extension instance view. + :type instance_view: + ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtensionInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'virtual_machine_extension_type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineExtensionInstanceView'}, + } + + def __init__(self, *, location: str, tags=None, force_update_tag: str=None, publisher: str=None, virtual_machine_extension_type: str=None, type_handler_version: str=None, auto_upgrade_minor_version: bool=None, settings=None, protected_settings=None, instance_view=None, **kwargs) -> None: + super(VirtualMachineExtension, self).__init__(location=location, tags=tags, **kwargs) + self.force_update_tag = force_update_tag + self.publisher = publisher + self.virtual_machine_extension_type = virtual_machine_extension_type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None + self.instance_view = instance_view diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_image.py index 730e1852db5b..5c1873173b95 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_image.py @@ -15,11 +15,13 @@ class VirtualMachineImage(VirtualMachineImageResource): """Describes a Virtual Machine Image. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The name of the resource. + :param name: Required. The name of the resource. :type name: str - :param location: The supported Azure location of the resource. + :param location: Required. The supported Azure location of the resource. :type location: str :param tags: Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your @@ -50,8 +52,8 @@ class VirtualMachineImage(VirtualMachineImageResource): 'data_disk_images': {'key': 'properties.dataDiskImages', 'type': '[DataDiskImage]'}, } - def __init__(self, name, location, id=None, tags=None, plan=None, os_disk_image=None, data_disk_images=None): - super(VirtualMachineImage, self).__init__(id=id, name=name, location=location, tags=tags) - self.plan = plan - self.os_disk_image = os_disk_image - self.data_disk_images = data_disk_images + def __init__(self, **kwargs): + super(VirtualMachineImage, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.os_disk_image = kwargs.get('os_disk_image', None) + self.data_disk_images = kwargs.get('data_disk_images', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_image_py3.py new file mode 100644 index 000000000000..fb55ba3fa039 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_image_py3.py @@ -0,0 +1,59 @@ +# 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 .virtual_machine_image_resource import VirtualMachineImageResource + + +class VirtualMachineImage(VirtualMachineImageResource): + """Describes a Virtual Machine Image. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The name of the resource. + :type name: str + :param location: Required. The supported Azure location of the resource. + :type location: str + :param tags: Specifies the tags that are assigned to the virtual machine. + For more information about using tags, see [Using tags to organize your + Azure + resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + :type tags: dict[str, str] + :param plan: + :type plan: ~azure.mgmt.compute.v2015_06_15.models.PurchasePlan + :param os_disk_image: + :type os_disk_image: ~azure.mgmt.compute.v2015_06_15.models.OSDiskImage + :param data_disk_images: + :type data_disk_images: + list[~azure.mgmt.compute.v2015_06_15.models.DataDiskImage] + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'properties.plan', 'type': 'PurchasePlan'}, + 'os_disk_image': {'key': 'properties.osDiskImage', 'type': 'OSDiskImage'}, + 'data_disk_images': {'key': 'properties.dataDiskImages', 'type': '[DataDiskImage]'}, + } + + def __init__(self, *, name: str, location: str, id: str=None, tags=None, plan=None, os_disk_image=None, data_disk_images=None, **kwargs) -> None: + super(VirtualMachineImage, self).__init__(id=id, name=name, location=location, tags=tags, **kwargs) + self.plan = plan + self.os_disk_image = os_disk_image + self.data_disk_images = data_disk_images diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_image_resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_image_resource.py index a7029041061d..8807cc8f391b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_image_resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_image_resource.py @@ -15,11 +15,13 @@ class VirtualMachineImageResource(SubResource): """Virtual machine image resource information. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The name of the resource. + :param name: Required. The name of the resource. :type name: str - :param location: The supported Azure location of the resource. + :param location: Required. The supported Azure location of the resource. :type location: str :param tags: Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your @@ -40,8 +42,8 @@ class VirtualMachineImageResource(SubResource): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, name, location, id=None, tags=None): - super(VirtualMachineImageResource, self).__init__(id=id) - self.name = name - self.location = location - self.tags = tags + def __init__(self, **kwargs): + super(VirtualMachineImageResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_image_resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_image_resource_py3.py new file mode 100644 index 000000000000..48a968bf2fbf --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_image_resource_py3.py @@ -0,0 +1,49 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineImageResource(SubResource): + """Virtual machine image resource information. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The name of the resource. + :type name: str + :param location: Required. The supported Azure location of the resource. + :type location: str + :param tags: Specifies the tags that are assigned to the virtual machine. + For more information about using tags, see [Using tags to organize your + Azure + resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + :type tags: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, name: str, location: str, id: str=None, tags=None, **kwargs) -> None: + super(VirtualMachineImageResource, self).__init__(id=id, **kwargs) + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_instance_view.py index 4e729b2bc401..088d69be6a30 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_instance_view.py @@ -54,13 +54,13 @@ class VirtualMachineInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, platform_update_domain=None, platform_fault_domain=None, rdp_thumb_print=None, vm_agent=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None): - super(VirtualMachineInstanceView, self).__init__() - self.platform_update_domain = platform_update_domain - self.platform_fault_domain = platform_fault_domain - self.rdp_thumb_print = rdp_thumb_print - self.vm_agent = vm_agent - self.disks = disks - self.extensions = extensions - self.boot_diagnostics = boot_diagnostics - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineInstanceView, self).__init__(**kwargs) + self.platform_update_domain = kwargs.get('platform_update_domain', None) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.rdp_thumb_print = kwargs.get('rdp_thumb_print', None) + self.vm_agent = kwargs.get('vm_agent', None) + self.disks = kwargs.get('disks', None) + self.extensions = kwargs.get('extensions', None) + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_instance_view_py3.py new file mode 100644 index 000000000000..0583e610ceeb --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_instance_view_py3.py @@ -0,0 +1,66 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineInstanceView(Model): + """The instance view of a virtual machine. + + :param platform_update_domain: Specifies the update domain of the virtual + machine. + :type platform_update_domain: int + :param platform_fault_domain: Specifies the fault domain of the virtual + machine. + :type platform_fault_domain: int + :param rdp_thumb_print: The Remote desktop certificate thumbprint. + :type rdp_thumb_print: str + :param vm_agent: The VM Agent running on the virtual machine. + :type vm_agent: + ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineAgentInstanceView + :param disks: The virtual machine disk information. + :type disks: list[~azure.mgmt.compute.v2015_06_15.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtensionInstanceView] + :param boot_diagnostics: Boot Diagnostics is a debugging feature which + allows you to view Console Output and Screenshot to diagnose VM status. +

    For Linux Virtual Machines, you can easily view the output of + your console log.

    For both Windows and Linux virtual machines, + Azure also enables you to see a screenshot of the VM from the hypervisor. + :type boot_diagnostics: + ~azure.mgmt.compute.v2015_06_15.models.BootDiagnosticsInstanceView + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2015_06_15.models.InstanceViewStatus] + """ + + _attribute_map = { + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'int'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, + 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, + 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, + 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnosticsInstanceView'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, platform_update_domain: int=None, platform_fault_domain: int=None, rdp_thumb_print: str=None, vm_agent=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None, **kwargs) -> None: + super(VirtualMachineInstanceView, self).__init__(**kwargs) + self.platform_update_domain = platform_update_domain + self.platform_fault_domain = platform_fault_domain + self.rdp_thumb_print = rdp_thumb_print + self.vm_agent = vm_agent + self.disks = disks + self.extensions = extensions + self.boot_diagnostics = boot_diagnostics + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_py3.py new file mode 100644 index 000000000000..6691e50e4b9e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_py3.py @@ -0,0 +1,134 @@ +# 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 .resource import Resource + + +class VirtualMachine(Resource): + """Describes a Virtual Machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2015_06_15.models.Plan + :param hardware_profile: Specifies the hardware settings for the virtual + machine. + :type hardware_profile: + ~azure.mgmt.compute.v2015_06_15.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2015_06_15.models.StorageProfile + :param os_profile: Specifies the operating system settings for the virtual + machine. + :type os_profile: ~azure.mgmt.compute.v2015_06_15.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual + machine. + :type network_profile: + ~azure.mgmt.compute.v2015_06_15.models.NetworkProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. +

    Minimum api-version: 2015-06-15. + :type diagnostics_profile: + ~azure.mgmt.compute.v2015_06_15.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set + that the virtual machine should be assigned to. Virtual machines specified + in the same availability set are allocated to different nodes to maximize + availability. For more information about availability sets, see [Manage + the availability of virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + :type availability_set: ~azure.mgmt.compute.v2015_06_15.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used + was licensed on-premises. This element is only used for images that + contain the Windows Server operating system.

    Possible values are: +

    Windows_Client

    Windows_Server

    If this element + is included in a request for an update, the value must match the initial + value. This value cannot be updated.

    For more information, see + [Azure Hybrid Use Benefit for Windows + Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Minimum api-version: 2015-06-15 + :type license_type: str + :ivar resources: The virtual machine child extension resources. + :vartype resources: + list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, + } + + def __init__(self, *, location: str, tags=None, plan=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type: str=None, **kwargs) -> None: + super(VirtualMachine, self).__init__(location=location, tags=tags, **kwargs) + self.plan = plan + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.os_profile = os_profile + self.network_profile = network_profile + self.diagnostics_profile = diagnostics_profile + self.availability_set = availability_set + self.provisioning_state = None + self.instance_view = None + self.license_type = license_type + self.resources = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set.py index 2b7ae564062b..5f4d8d0f7ee4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set.py @@ -18,13 +18,15 @@ class VirtualMachineScaleSet(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -63,10 +65,10 @@ class VirtualMachineScaleSet(Resource): 'over_provision': {'key': 'properties.overProvision', 'type': 'bool'}, } - def __init__(self, location, tags=None, sku=None, upgrade_policy=None, virtual_machine_profile=None, provisioning_state=None, over_provision=None): - super(VirtualMachineScaleSet, self).__init__(location=location, tags=tags) - self.sku = sku - self.upgrade_policy = upgrade_policy - self.virtual_machine_profile = virtual_machine_profile - self.provisioning_state = provisioning_state - self.over_provision = over_provision + def __init__(self, **kwargs): + super(VirtualMachineScaleSet, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.upgrade_policy = kwargs.get('upgrade_policy', None) + self.virtual_machine_profile = kwargs.get('virtual_machine_profile', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.over_provision = kwargs.get('over_provision', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_extension.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_extension.py index 2c7514755033..d6d8b5fbc51e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_extension.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_extension.py @@ -57,13 +57,13 @@ class VirtualMachineScaleSetExtension(SubResource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, name=None, publisher=None, type=None, type_handler_version=None, auto_upgrade_minor_version=None, settings=None, protected_settings=None): - super(VirtualMachineScaleSetExtension, self).__init__(id=id) - self.name = name - self.publisher = publisher - self.type = type - self.type_handler_version = type_handler_version - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings + def __init__(self, **kwargs): + super(VirtualMachineScaleSetExtension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_extension_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_extension_profile.py index 85c4dba06e22..a231db28e10a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_extension_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_extension_profile.py @@ -25,6 +25,6 @@ class VirtualMachineScaleSetExtensionProfile(Model): 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetExtension]'}, } - def __init__(self, extensions=None): - super(VirtualMachineScaleSetExtensionProfile, self).__init__() - self.extensions = extensions + def __init__(self, **kwargs): + super(VirtualMachineScaleSetExtensionProfile, self).__init__(**kwargs) + self.extensions = kwargs.get('extensions', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_extension_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_extension_profile_py3.py new file mode 100644 index 000000000000..514556c9d425 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_extension_profile_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetExtensionProfile(Model): + """Describes a virtual machine scale set extension profile. + + :param extensions: The virtual machine scale set child extension + resources. + :type extensions: + list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetExtension] + """ + + _attribute_map = { + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetExtension]'}, + } + + def __init__(self, *, extensions=None, **kwargs) -> None: + super(VirtualMachineScaleSetExtensionProfile, self).__init__(**kwargs) + self.extensions = extensions diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_extension_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_extension_py3.py new file mode 100644 index 000000000000..5523e0444c59 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_extension_py3.py @@ -0,0 +1,69 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineScaleSetExtension(SubResource): + """Describes a Virtual Machine Scale Set Extension. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource Id + :type id: str + :param name: The name of the extension. + :type name: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: The type of the extension handler. + :type type: str + :param type_handler_version: The type version of the extension handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Whether the extension handler should be + automatically upgraded across minor versions. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: Json formatted protected settings for the + extension. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name: str=None, publisher: str=None, type: str=None, type_handler_version: str=None, auto_upgrade_minor_version: bool=None, settings=None, protected_settings=None, **kwargs) -> None: + super(VirtualMachineScaleSetExtension, self).__init__(id=id, **kwargs) + self.name = name + self.publisher = publisher + self.type = type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_instance_view.py index 75adcc7ed4d5..6facbd710730 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_instance_view.py @@ -41,8 +41,8 @@ class VirtualMachineScaleSetInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, statuses=None): - super(VirtualMachineScaleSetInstanceView, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetInstanceView, self).__init__(**kwargs) self.virtual_machine = None self.extensions = None - self.statuses = statuses + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_instance_view_py3.py new file mode 100644 index 000000000000..61e39b4ea912 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_instance_view_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetInstanceView(Model): + """The instance view of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar virtual_machine: The instance view status summary for the virtual + machine scale set. + :vartype virtual_machine: + ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetInstanceViewStatusesSummary + :ivar extensions: The extensions information. + :vartype extensions: + list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetVMExtensionsSummary] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2015_06_15.models.InstanceViewStatus] + """ + + _validation = { + 'virtual_machine': {'readonly': True}, + 'extensions': {'readonly': True}, + } + + _attribute_map = { + 'virtual_machine': {'key': 'virtualMachine', 'type': 'VirtualMachineScaleSetInstanceViewStatusesSummary'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetVMExtensionsSummary]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, statuses=None, **kwargs) -> None: + super(VirtualMachineScaleSetInstanceView, self).__init__(**kwargs) + self.virtual_machine = None + self.extensions = None + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_instance_view_statuses_summary.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_instance_view_statuses_summary.py index 7df6072db24b..7654505381d7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_instance_view_statuses_summary.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_instance_view_statuses_summary.py @@ -32,6 +32,6 @@ class VirtualMachineScaleSetInstanceViewStatusesSummary(Model): 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, } - def __init__(self): - super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__(**kwargs) self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_instance_view_statuses_summary_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_instance_view_statuses_summary_py3.py new file mode 100644 index 000000000000..aa1958c81a66 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_instance_view_statuses_summary_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetInstanceViewStatusesSummary(Model): + """Instance view statuses summary for virtual machines of a virtual machine + scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar statuses_summary: The extensions information. + :vartype statuses_summary: + list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineStatusCodeCount] + """ + + _validation = { + 'statuses_summary': {'readonly': True}, + } + + _attribute_map = { + 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__(**kwargs) + self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_ip_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_ip_configuration.py index 9b97390716c1..0461dad30d7f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_ip_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_ip_configuration.py @@ -15,11 +15,13 @@ class VirtualMachineScaleSetIPConfiguration(SubResource): """Describes a virtual machine scale set network profile's IP configuration. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The IP configuration name. + :param name: Required. The IP configuration name. :type name: str - :param subnet: The subnet. + :param subnet: Required. The subnet. :type subnet: ~azure.mgmt.compute.v2015_06_15.models.ApiEntityReference :param load_balancer_backend_address_pools: The load balancer backend address pools. @@ -44,9 +46,9 @@ class VirtualMachineScaleSetIPConfiguration(SubResource): 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, } - def __init__(self, name, subnet, id=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_pools=None): - super(VirtualMachineScaleSetIPConfiguration, self).__init__(id=id) - self.name = name - self.subnet = subnet - self.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools + def __init__(self, **kwargs): + super(VirtualMachineScaleSetIPConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.subnet = kwargs.get('subnet', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_pools = kwargs.get('load_balancer_inbound_nat_pools', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_ip_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_ip_configuration_py3.py new file mode 100644 index 000000000000..e075f019a729 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_ip_configuration_py3.py @@ -0,0 +1,54 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineScaleSetIPConfiguration(SubResource): + """Describes a virtual machine scale set network profile's IP configuration. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The IP configuration name. + :type name: str + :param subnet: Required. The subnet. + :type subnet: ~azure.mgmt.compute.v2015_06_15.models.ApiEntityReference + :param load_balancer_backend_address_pools: The load balancer backend + address pools. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.compute.v2015_06_15.models.SubResource] + :param load_balancer_inbound_nat_pools: The load balancer inbound nat + pools. + :type load_balancer_inbound_nat_pools: + list[~azure.mgmt.compute.v2015_06_15.models.SubResource] + """ + + _validation = { + 'name': {'required': True}, + 'subnet': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'ApiEntityReference'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, + } + + def __init__(self, *, name: str, subnet, id: str=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_pools=None, **kwargs) -> None: + super(VirtualMachineScaleSetIPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.subnet = subnet + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_network_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_network_configuration.py index 8fd468924e6f..ee5c117f24b2 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_network_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_network_configuration.py @@ -16,13 +16,16 @@ class VirtualMachineScaleSetNetworkConfiguration(SubResource): """Describes a virtual machine scale set network profile's network configurations. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The network configuration name. + :param name: Required. The network configuration name. :type name: str :param primary: Whether this is a primary NIC on a virtual machine. :type primary: bool - :param ip_configurations: The virtual machine scale set IP Configuration. + :param ip_configurations: Required. The virtual machine scale set IP + Configuration. :type ip_configurations: list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetIPConfiguration] """ @@ -39,8 +42,8 @@ class VirtualMachineScaleSetNetworkConfiguration(SubResource): 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetIPConfiguration]'}, } - def __init__(self, name, ip_configurations, id=None, primary=None): - super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(id=id) - self.name = name - self.primary = primary - self.ip_configurations = ip_configurations + def __init__(self, **kwargs): + super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.primary = kwargs.get('primary', None) + self.ip_configurations = kwargs.get('ip_configurations', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_network_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_network_configuration_py3.py new file mode 100644 index 000000000000..77933661de7f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_network_configuration_py3.py @@ -0,0 +1,49 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineScaleSetNetworkConfiguration(SubResource): + """Describes a virtual machine scale set network profile's network + configurations. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The network configuration name. + :type name: str + :param primary: Whether this is a primary NIC on a virtual machine. + :type primary: bool + :param ip_configurations: Required. The virtual machine scale set IP + Configuration. + :type ip_configurations: + list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetIPConfiguration] + """ + + _validation = { + 'name': {'required': True}, + 'ip_configurations': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetIPConfiguration]'}, + } + + def __init__(self, *, name: str, ip_configurations, id: str=None, primary: bool=None, **kwargs) -> None: + super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.primary = primary + self.ip_configurations = ip_configurations diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_network_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_network_profile.py index cc7f5ae4fec8..e710af393b0c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_network_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_network_profile.py @@ -25,6 +25,6 @@ class VirtualMachineScaleSetNetworkProfile(Model): 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetNetworkConfiguration]'}, } - def __init__(self, network_interface_configurations=None): - super(VirtualMachineScaleSetNetworkProfile, self).__init__() - self.network_interface_configurations = network_interface_configurations + def __init__(self, **kwargs): + super(VirtualMachineScaleSetNetworkProfile, self).__init__(**kwargs) + self.network_interface_configurations = kwargs.get('network_interface_configurations', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_network_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_network_profile_py3.py new file mode 100644 index 000000000000..b0b43ccb35d6 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_network_profile_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetNetworkProfile(Model): + """Describes a virtual machine scale set network profile. + + :param network_interface_configurations: The list of network + configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetNetworkConfiguration] + """ + + _attribute_map = { + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetNetworkConfiguration]'}, + } + + def __init__(self, *, network_interface_configurations=None, **kwargs) -> None: + super(VirtualMachineScaleSetNetworkProfile, self).__init__(**kwargs) + self.network_interface_configurations = network_interface_configurations diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_os_disk.py index b9b1e1cef809..779a5b58bb71 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_os_disk.py @@ -15,20 +15,22 @@ class VirtualMachineScaleSetOSDisk(Model): """Describes a virtual machine scale set operating system disk. - :param name: The disk name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The disk name. :type name: str :param caching: Specifies the caching requirements.

    Possible values are:

    **None**

    **ReadOnly**

    **ReadWrite**

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2015_06_15.models.CachingTypes - :param create_option: Specifies how the virtual machines in the scale set - should be created.

    The only allowed value is: **FromImage** - \\u2013 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. Possible - values include: 'FromImage', 'Empty', 'Attach' + :param create_option: Required. Specifies how the virtual machines in the + scale set should be created.

    The only allowed value is: + **FromImage** \\u2013 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. + Possible values include: 'FromImage', 'Empty', 'Attach' :type create_option: str or ~azure.mgmt.compute.v2015_06_15.models.DiskCreateOptionTypes :param os_type: This property allows you to specify the type of the OS @@ -59,11 +61,11 @@ class VirtualMachineScaleSetOSDisk(Model): 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, } - def __init__(self, name, create_option, caching=None, os_type=None, image=None, vhd_containers=None): - super(VirtualMachineScaleSetOSDisk, self).__init__() - self.name = name - self.caching = caching - self.create_option = create_option - self.os_type = os_type - self.image = image - self.vhd_containers = vhd_containers + def __init__(self, **kwargs): + super(VirtualMachineScaleSetOSDisk, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.caching = kwargs.get('caching', None) + self.create_option = kwargs.get('create_option', None) + self.os_type = kwargs.get('os_type', None) + self.image = kwargs.get('image', None) + self.vhd_containers = kwargs.get('vhd_containers', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_os_disk_py3.py new file mode 100644 index 000000000000..2a4f5f962911 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_os_disk_py3.py @@ -0,0 +1,71 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetOSDisk(Model): + """Describes a virtual machine scale set operating system disk. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The disk name. + :type name: str + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2015_06_15.models.CachingTypes + :param create_option: Required. Specifies how the virtual machines in the + scale set should be created.

    The only allowed value is: + **FromImage** \\u2013 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. + Possible values include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2015_06_15.models.DiskCreateOptionTypes + :param 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**. Possible values include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2015_06_15.models.OperatingSystemTypes + :param image: The Source User Image VirtualHardDisk. This VirtualHardDisk + will be copied before using it to attach to the Virtual Machine. If + SourceImage is provided, the destination VirtualHardDisk should not exist. + :type image: ~azure.mgmt.compute.v2015_06_15.models.VirtualHardDisk + :param vhd_containers: The list of virtual hard disk container uris. + :type vhd_containers: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'create_option': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, + } + + def __init__(self, *, name: str, create_option, caching=None, os_type=None, image=None, vhd_containers=None, **kwargs) -> None: + super(VirtualMachineScaleSetOSDisk, self).__init__(**kwargs) + self.name = name + self.caching = caching + self.create_option = create_option + self.os_type = os_type + self.image = image + self.vhd_containers = vhd_containers diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_os_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_os_profile.py index ecfff50f42ef..3de628b7b60c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_os_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_os_profile.py @@ -73,12 +73,12 @@ class VirtualMachineScaleSetOSProfile(Model): 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, } - def __init__(self, computer_name_prefix=None, admin_username=None, admin_password=None, custom_data=None, windows_configuration=None, linux_configuration=None, secrets=None): - super(VirtualMachineScaleSetOSProfile, self).__init__() - 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 + def __init__(self, **kwargs): + super(VirtualMachineScaleSetOSProfile, self).__init__(**kwargs) + self.computer_name_prefix = kwargs.get('computer_name_prefix', None) + self.admin_username = kwargs.get('admin_username', None) + self.admin_password = kwargs.get('admin_password', None) + self.custom_data = kwargs.get('custom_data', None) + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + self.secrets = kwargs.get('secrets', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_os_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_os_profile_py3.py new file mode 100644 index 000000000000..e28f4c4ac123 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_os_profile_py3.py @@ -0,0 +1,84 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetOSProfile(Model): + """Describes a virtual machine scale set OS profile. + + :param 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. + :type computer_name_prefix: str + :param admin_username: Specifies the name of the administrator account. +

    **Windows-only restriction:** Cannot end in "."

    + **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".

    **Minimum-length (Linux):** 1 + character

    **Max-length (Linux):** 64 characters

    + **Max-length (Windows):** 20 characters

  • For root access to + the Linux VM, see [Using root privileges on Linux virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + For a list of built-in system users on Linux that should not be used in + this field, see [Selecting User Names for Linux on + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type admin_username: str + :param admin_password: Specifies the password of the administrator + account.

    **Minimum-length (Windows):** 8 characters

    + **Minimum-length (Linux):** 6 characters

    **Max-length + (Windows):** 123 characters

    **Max-length (Linux):** 72 characters +

    **Complexity requirements:** 3 out of 4 conditions below need to + be fulfilled
    Has lower characters
    Has upper characters
    Has a + digit
    Has a special character (Regex match [\\W_])

    + **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + "iloveyou!"

    For resetting the password, see [How to reset the + Remote Desktop service or its login password in a Windows + VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    For resetting root password, see [Manage users, SSH, and check or + repair disks on Azure Linux VMs using the VMAccess + Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + :type admin_password: str + :param custom_data: A base-64 encoded string of custom data. + :type custom_data: str + :param windows_configuration: The Windows Configuration of the OS profile. + :type windows_configuration: + ~azure.mgmt.compute.v2015_06_15.models.WindowsConfiguration + :param linux_configuration: The Linux Configuration of the OS profile. + :type linux_configuration: + ~azure.mgmt.compute.v2015_06_15.models.LinuxConfiguration + :param secrets: The List of certificates for addition to the VM. + :type secrets: + list[~azure.mgmt.compute.v2015_06_15.models.VaultSecretGroup] + """ + + _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]'}, + } + + def __init__(self, *, computer_name_prefix: str=None, admin_username: str=None, admin_password: str=None, custom_data: str=None, windows_configuration=None, linux_configuration=None, secrets=None, **kwargs) -> None: + super(VirtualMachineScaleSetOSProfile, self).__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 diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_py3.py new file mode 100644 index 000000000000..7ef6ab297883 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_py3.py @@ -0,0 +1,74 @@ +# 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 .resource import Resource + + +class VirtualMachineScaleSet(Resource): + """Describes a Virtual Machine Scale Set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The virtual machine scale set sku. + :type sku: ~azure.mgmt.compute.v2015_06_15.models.Sku + :param upgrade_policy: The upgrade policy. + :type upgrade_policy: ~azure.mgmt.compute.v2015_06_15.models.UpgradePolicy + :param virtual_machine_profile: The virtual machine profile. + :type virtual_machine_profile: + ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetVMProfile + :param provisioning_state: The provisioning state, which only appears in + the response. + :type provisioning_state: str + :param over_provision: Specifies whether the Virtual Machine Scale Set + should be overprovisioned. + :type over_provision: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'upgrade_policy': {'key': 'properties.upgradePolicy', 'type': 'UpgradePolicy'}, + 'virtual_machine_profile': {'key': 'properties.virtualMachineProfile', 'type': 'VirtualMachineScaleSetVMProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'over_provision': {'key': 'properties.overProvision', 'type': 'bool'}, + } + + def __init__(self, *, location: str, tags=None, sku=None, upgrade_policy=None, virtual_machine_profile=None, provisioning_state: str=None, over_provision: bool=None, **kwargs) -> None: + super(VirtualMachineScaleSet, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.upgrade_policy = upgrade_policy + self.virtual_machine_profile = virtual_machine_profile + self.provisioning_state = provisioning_state + self.over_provision = over_provision diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_sku.py index 8b49e623b94a..f5f8c8b87bcc 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_sku.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_sku.py @@ -39,8 +39,8 @@ class VirtualMachineScaleSetSku(Model): 'capacity': {'key': 'capacity', 'type': 'VirtualMachineScaleSetSkuCapacity'}, } - def __init__(self): - super(VirtualMachineScaleSetSku, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetSku, self).__init__(**kwargs) self.resource_type = None self.sku = None self.capacity = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_sku_capacity.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_sku_capacity.py index 5b558b796465..0b15c77b345f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_sku_capacity.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_sku_capacity.py @@ -44,8 +44,8 @@ class VirtualMachineScaleSetSkuCapacity(Model): 'scale_type': {'key': 'scaleType', 'type': 'VirtualMachineScaleSetSkuScaleType'}, } - def __init__(self): - super(VirtualMachineScaleSetSkuCapacity, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetSkuCapacity, self).__init__(**kwargs) self.minimum = None self.maximum = None self.default_capacity = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_sku_capacity_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_sku_capacity_py3.py new file mode 100644 index 000000000000..10eb53309d29 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_sku_capacity_py3.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetSkuCapacity(Model): + """Describes scaling information of a sku. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar minimum: The minimum capacity. + :vartype minimum: long + :ivar maximum: The maximum capacity that can be set. + :vartype maximum: long + :ivar default_capacity: The default capacity. + :vartype default_capacity: long + :ivar scale_type: The scale type applicable to the sku. Possible values + include: 'Automatic', 'None' + :vartype scale_type: str or + ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetSkuScaleType + """ + + _validation = { + 'minimum': {'readonly': True}, + 'maximum': {'readonly': True}, + 'default_capacity': {'readonly': True}, + 'scale_type': {'readonly': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'long'}, + 'maximum': {'key': 'maximum', 'type': 'long'}, + 'default_capacity': {'key': 'defaultCapacity', 'type': 'long'}, + 'scale_type': {'key': 'scaleType', 'type': 'VirtualMachineScaleSetSkuScaleType'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetSkuCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default_capacity = None + self.scale_type = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_sku_py3.py new file mode 100644 index 000000000000..f8986ba6206a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_sku_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetSku(Model): + """Describes an available virtual machine scale set sku. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_type: The type of resource the sku applies to. + :vartype resource_type: str + :ivar sku: The Sku. + :vartype sku: ~azure.mgmt.compute.v2015_06_15.models.Sku + :ivar capacity: Specifies the number of virtual machines in the scale set. + :vartype capacity: + ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetSkuCapacity + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'sku': {'readonly': True}, + 'capacity': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'capacity': {'key': 'capacity', 'type': 'VirtualMachineScaleSetSkuCapacity'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetSku, self).__init__(**kwargs) + self.resource_type = None + self.sku = None + self.capacity = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_storage_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_storage_profile.py index bbb787e77d1e..d4f6bb3e25fb 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_storage_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_storage_profile.py @@ -28,7 +28,7 @@ class VirtualMachineScaleSetStorageProfile(Model): 'os_disk': {'key': 'osDisk', 'type': 'VirtualMachineScaleSetOSDisk'}, } - def __init__(self, image_reference=None, os_disk=None): - super(VirtualMachineScaleSetStorageProfile, self).__init__() - self.image_reference = image_reference - self.os_disk = os_disk + def __init__(self, **kwargs): + super(VirtualMachineScaleSetStorageProfile, self).__init__(**kwargs) + self.image_reference = kwargs.get('image_reference', None) + self.os_disk = kwargs.get('os_disk', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_storage_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_storage_profile_py3.py new file mode 100644 index 000000000000..f330b1168857 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_storage_profile_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetStorageProfile(Model): + """Describes a virtual machine scale set storage profile. + + :param image_reference: The image reference. + :type image_reference: + ~azure.mgmt.compute.v2015_06_15.models.ImageReference + :param os_disk: The OS disk. + :type os_disk: + ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetOSDisk + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'VirtualMachineScaleSetOSDisk'}, + } + + def __init__(self, *, image_reference=None, os_disk=None, **kwargs) -> None: + super(VirtualMachineScaleSetStorageProfile, self).__init__(**kwargs) + self.image_reference = image_reference + self.os_disk = os_disk diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm.py index 342e165595d1..e6022b62cddf 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm.py @@ -18,13 +18,15 @@ class VirtualMachineScaleSetVM(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -129,19 +131,19 @@ class VirtualMachineScaleSetVM(Resource): 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, } - def __init__(self, location, tags=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, provisioning_state=None, license_type=None, plan=None): - super(VirtualMachineScaleSetVM, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVM, self).__init__(**kwargs) self.instance_id = None self.sku = None self.latest_model_applied = None self.instance_view = None - self.hardware_profile = hardware_profile - self.storage_profile = storage_profile - self.os_profile = os_profile - self.network_profile = network_profile - self.diagnostics_profile = diagnostics_profile - self.availability_set = availability_set - self.provisioning_state = provisioning_state - self.license_type = license_type - self.plan = plan + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.os_profile = kwargs.get('os_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.availability_set = kwargs.get('availability_set', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.license_type = kwargs.get('license_type', None) + self.plan = kwargs.get('plan', None) self.resources = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_extensions_summary.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_extensions_summary.py index 4bbdf2346de2..9da38fee498a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_extensions_summary.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_extensions_summary.py @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMExtensionsSummary(Model): 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, } - def __init__(self): - super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__(**kwargs) self.name = None self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_extensions_summary_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_extensions_summary_py3.py new file mode 100644 index 000000000000..594a1fc6940d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_extensions_summary_py3.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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMExtensionsSummary(Model): + """Extensions summary for virtual machines of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The extension name. + :vartype name: str + :ivar statuses_summary: The extensions information. + :vartype statuses_summary: + list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineStatusCodeCount] + """ + + _validation = { + 'name': {'readonly': True}, + 'statuses_summary': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__(**kwargs) + self.name = None + self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_ids.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_ids.py index 681ab449f3f2..772c66dad326 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_ids.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_ids.py @@ -25,6 +25,6 @@ class VirtualMachineScaleSetVMInstanceIDs(Model): 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, } - def __init__(self, instance_ids=None): - super(VirtualMachineScaleSetVMInstanceIDs, self).__init__() - self.instance_ids = instance_ids + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMInstanceIDs, self).__init__(**kwargs) + self.instance_ids = kwargs.get('instance_ids', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_ids_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_ids_py3.py new file mode 100644 index 000000000000..658a8ccb87d5 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_ids_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetVMInstanceIDs(Model): + """Specifies a list of virtual machine instance IDs from the VM scale set. + + :param instance_ids: The virtual machine scale set instance ids. Omitting + the virtual machine scale set instance ids will result in the operation + being performed on all virtual machines in the virtual machine scale set. + :type instance_ids: list[str] + """ + + _attribute_map = { + 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, + } + + def __init__(self, *, instance_ids=None, **kwargs) -> None: + super(VirtualMachineScaleSetVMInstanceIDs, self).__init__(**kwargs) + self.instance_ids = instance_ids diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_required_ids.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_required_ids.py index 2a35798001fa..ece250dd4fd4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_required_ids.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_required_ids.py @@ -15,7 +15,9 @@ class VirtualMachineScaleSetVMInstanceRequiredIDs(Model): """Specifies a list of virtual machine instance IDs from the VM scale set. - :param instance_ids: The virtual machine scale set instance ids. + All required parameters must be populated in order to send to Azure. + + :param instance_ids: Required. The virtual machine scale set instance ids. :type instance_ids: list[str] """ @@ -27,6 +29,6 @@ class VirtualMachineScaleSetVMInstanceRequiredIDs(Model): 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, } - def __init__(self, instance_ids): - super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__() - self.instance_ids = instance_ids + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__(**kwargs) + self.instance_ids = kwargs.get('instance_ids', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_required_ids_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_required_ids_py3.py new file mode 100644 index 000000000000..f32c6181467d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_required_ids_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMInstanceRequiredIDs(Model): + """Specifies a list of virtual machine instance IDs from the VM scale set. + + All required parameters must be populated in order to send to Azure. + + :param instance_ids: Required. The virtual machine scale set instance ids. + :type instance_ids: list[str] + """ + + _validation = { + 'instance_ids': {'required': True}, + } + + _attribute_map = { + 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, + } + + def __init__(self, *, instance_ids, **kwargs) -> None: + super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__(**kwargs) + self.instance_ids = instance_ids diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_view.py index f64aa7136d24..f94d635b5955 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_view.py @@ -52,13 +52,13 @@ class VirtualMachineScaleSetVMInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, platform_update_domain=None, platform_fault_domain=None, rdp_thumb_print=None, vm_agent=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None): - super(VirtualMachineScaleSetVMInstanceView, self).__init__() - self.platform_update_domain = platform_update_domain - self.platform_fault_domain = platform_fault_domain - self.rdp_thumb_print = rdp_thumb_print - self.vm_agent = vm_agent - self.disks = disks - self.extensions = extensions - self.boot_diagnostics = boot_diagnostics - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMInstanceView, self).__init__(**kwargs) + self.platform_update_domain = kwargs.get('platform_update_domain', None) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.rdp_thumb_print = kwargs.get('rdp_thumb_print', None) + self.vm_agent = kwargs.get('vm_agent', None) + self.disks = kwargs.get('disks', None) + self.extensions = kwargs.get('extensions', None) + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_view_py3.py new file mode 100644 index 000000000000..f7c9071903cf --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_instance_view_py3.py @@ -0,0 +1,64 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMInstanceView(Model): + """The instance view of a virtual machine scale set VM. + + :param platform_update_domain: The Update Domain count. + :type platform_update_domain: int + :param platform_fault_domain: The Fault Domain count. + :type platform_fault_domain: int + :param rdp_thumb_print: The Remote desktop certificate thumbprint. + :type rdp_thumb_print: str + :param vm_agent: The VM Agent running on the virtual machine. + :type vm_agent: + ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineAgentInstanceView + :param disks: The disks information. + :type disks: list[~azure.mgmt.compute.v2015_06_15.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtensionInstanceView] + :param boot_diagnostics: Boot Diagnostics is a debugging feature which + allows you to view Console Output and Screenshot to diagnose VM status. +

    For Linux Virtual Machines, you can easily view the output of + your console log.

    For both Windows and Linux virtual machines, + Azure also enables you to see a screenshot of the VM from the hypervisor. + :type boot_diagnostics: + ~azure.mgmt.compute.v2015_06_15.models.BootDiagnosticsInstanceView + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2015_06_15.models.InstanceViewStatus] + """ + + _attribute_map = { + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'int'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, + 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, + 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, + 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnosticsInstanceView'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, platform_update_domain: int=None, platform_fault_domain: int=None, rdp_thumb_print: str=None, vm_agent=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None, **kwargs) -> None: + super(VirtualMachineScaleSetVMInstanceView, self).__init__(**kwargs) + self.platform_update_domain = platform_update_domain + self.platform_fault_domain = platform_fault_domain + self.rdp_thumb_print = rdp_thumb_print + self.vm_agent = vm_agent + self.disks = disks + self.extensions = extensions + self.boot_diagnostics = boot_diagnostics + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_profile.py index 74df50229ecf..2379d8cfcbf1 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_profile.py @@ -36,9 +36,9 @@ class VirtualMachineScaleSetVMProfile(Model): 'extension_profile': {'key': 'extensionProfile', 'type': 'VirtualMachineScaleSetExtensionProfile'}, } - def __init__(self, os_profile=None, storage_profile=None, network_profile=None, extension_profile=None): - super(VirtualMachineScaleSetVMProfile, self).__init__() - self.os_profile = os_profile - self.storage_profile = storage_profile - self.network_profile = network_profile - self.extension_profile = extension_profile + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMProfile, self).__init__(**kwargs) + self.os_profile = kwargs.get('os_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.extension_profile = kwargs.get('extension_profile', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_profile_py3.py new file mode 100644 index 000000000000..b09b4007e761 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_profile_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetVMProfile(Model): + """Describes a virtual machine scale set virtual machine profile. + + :param os_profile: The virtual machine scale set OS profile. + :type os_profile: + ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetOSProfile + :param storage_profile: The virtual machine scale set storage profile. + :type storage_profile: + ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetStorageProfile + :param network_profile: The virtual machine scale set network profile. + :type network_profile: + ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetNetworkProfile + :param extension_profile: The virtual machine scale set extension profile. + :type extension_profile: + ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetExtensionProfile + """ + + _attribute_map = { + 'os_profile': {'key': 'osProfile', 'type': 'VirtualMachineScaleSetOSProfile'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'VirtualMachineScaleSetStorageProfile'}, + 'network_profile': {'key': 'networkProfile', 'type': 'VirtualMachineScaleSetNetworkProfile'}, + 'extension_profile': {'key': 'extensionProfile', 'type': 'VirtualMachineScaleSetExtensionProfile'}, + } + + def __init__(self, *, os_profile=None, storage_profile=None, network_profile=None, extension_profile=None, **kwargs) -> None: + super(VirtualMachineScaleSetVMProfile, self).__init__(**kwargs) + self.os_profile = os_profile + self.storage_profile = storage_profile + self.network_profile = network_profile + self.extension_profile = extension_profile diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_py3.py new file mode 100644 index 000000000000..d69fd86bc0cf --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_vm_py3.py @@ -0,0 +1,149 @@ +# 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 .resource import Resource + + +class VirtualMachineScaleSetVM(Resource): + """Describes a virtual machine scale set virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar instance_id: The virtual machine instance ID. + :vartype instance_id: str + :ivar sku: The virtual machine SKU. + :vartype sku: ~azure.mgmt.compute.v2015_06_15.models.Sku + :ivar latest_model_applied: Specifies whether the latest model has been + applied to the virtual machine. + :vartype latest_model_applied: bool + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineInstanceView + :param hardware_profile: Specifies the hardware settings for the virtual + machine. + :type hardware_profile: + ~azure.mgmt.compute.v2015_06_15.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2015_06_15.models.StorageProfile + :param os_profile: Specifies the operating system settings for the virtual + machine. + :type os_profile: ~azure.mgmt.compute.v2015_06_15.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual + machine. + :type network_profile: + ~azure.mgmt.compute.v2015_06_15.models.NetworkProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. +

    Minimum api-version: 2015-06-15. + :type diagnostics_profile: + ~azure.mgmt.compute.v2015_06_15.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set + that the virtual machine should be assigned to. Virtual machines specified + in the same availability set are allocated to different nodes to maximize + availability. For more information about availability sets, see [Manage + the availability of virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + :type availability_set: ~azure.mgmt.compute.v2015_06_15.models.SubResource + :param provisioning_state: The provisioning state, which only appears in + the response. + :type provisioning_state: str + :param license_type: Specifies that the image or disk that is being used + was licensed on-premises. This element is only used for images that + contain the Windows Server operating system.

    Possible values are: +

    Windows_Client

    Windows_Server

    If this element + is included in a request for an update, the value must match the initial + value. This value cannot be updated.

    For more information, see + [Azure Hybrid Use Benefit for Windows + Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Minimum api-version: 2015-06-15 + :type license_type: str + :param plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2015_06_15.models.Plan + :ivar resources: The virtual machine child extension resources. + :vartype resources: + list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'instance_id': {'readonly': True}, + 'sku': {'readonly': True}, + 'latest_model_applied': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'instance_id': {'key': 'instanceId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'latest_model_applied': {'key': 'properties.latestModelApplied', 'type': 'bool'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, + } + + def __init__(self, *, location: str, tags=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, provisioning_state: str=None, license_type: str=None, plan=None, **kwargs) -> None: + super(VirtualMachineScaleSetVM, self).__init__(location=location, tags=tags, **kwargs) + self.instance_id = None + self.sku = None + self.latest_model_applied = None + self.instance_view = None + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.os_profile = os_profile + self.network_profile = network_profile + self.diagnostics_profile = diagnostics_profile + self.availability_set = availability_set + self.provisioning_state = provisioning_state + self.license_type = license_type + self.plan = plan + self.resources = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_size.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_size.py index 3f4fa7f06b70..0fef3efd6c8e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_size.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_size.py @@ -43,11 +43,11 @@ class VirtualMachineSize(Model): 'max_data_disk_count': {'key': 'maxDataDiskCount', 'type': 'int'}, } - def __init__(self, name=None, number_of_cores=None, os_disk_size_in_mb=None, resource_disk_size_in_mb=None, memory_in_mb=None, max_data_disk_count=None): - super(VirtualMachineSize, self).__init__() - self.name = name - self.number_of_cores = number_of_cores - self.os_disk_size_in_mb = os_disk_size_in_mb - self.resource_disk_size_in_mb = resource_disk_size_in_mb - self.memory_in_mb = memory_in_mb - self.max_data_disk_count = max_data_disk_count + def __init__(self, **kwargs): + super(VirtualMachineSize, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.number_of_cores = kwargs.get('number_of_cores', None) + self.os_disk_size_in_mb = kwargs.get('os_disk_size_in_mb', None) + self.resource_disk_size_in_mb = kwargs.get('resource_disk_size_in_mb', None) + self.memory_in_mb = kwargs.get('memory_in_mb', None) + self.max_data_disk_count = kwargs.get('max_data_disk_count', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_size_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_size_py3.py new file mode 100644 index 000000000000..9f99ba20ce42 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_size_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineSize(Model): + """Describes the properties of a VM size. + + :param name: The name of the virtual machine size. + :type name: str + :param number_of_cores: The number of cores supported by the virtual + machine size. + :type number_of_cores: int + :param os_disk_size_in_mb: The OS disk size, in MB, allowed by the virtual + machine size. + :type os_disk_size_in_mb: int + :param resource_disk_size_in_mb: The resource disk size, in MB, allowed by + the virtual machine size. + :type resource_disk_size_in_mb: int + :param memory_in_mb: The amount of memory, in MB, supported by the virtual + machine size. + :type memory_in_mb: int + :param max_data_disk_count: The maximum number of data disks that can be + attached to the virtual machine size. + :type max_data_disk_count: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'number_of_cores': {'key': 'numberOfCores', 'type': 'int'}, + 'os_disk_size_in_mb': {'key': 'osDiskSizeInMB', 'type': 'int'}, + 'resource_disk_size_in_mb': {'key': 'resourceDiskSizeInMB', 'type': 'int'}, + 'memory_in_mb': {'key': 'memoryInMB', 'type': 'int'}, + 'max_data_disk_count': {'key': 'maxDataDiskCount', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, number_of_cores: int=None, os_disk_size_in_mb: int=None, resource_disk_size_in_mb: int=None, memory_in_mb: int=None, max_data_disk_count: int=None, **kwargs) -> None: + super(VirtualMachineSize, self).__init__(**kwargs) + self.name = name + self.number_of_cores = number_of_cores + self.os_disk_size_in_mb = os_disk_size_in_mb + self.resource_disk_size_in_mb = resource_disk_size_in_mb + self.memory_in_mb = memory_in_mb + self.max_data_disk_count = max_data_disk_count diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_status_code_count.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_status_code_count.py index 177515706064..7df7b702acd7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_status_code_count.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_status_code_count.py @@ -35,7 +35,7 @@ class VirtualMachineStatusCodeCount(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self): - super(VirtualMachineStatusCodeCount, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineStatusCodeCount, self).__init__(**kwargs) self.code = None self.count = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_status_code_count_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_status_code_count_py3.py new file mode 100644 index 000000000000..c38800073a95 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_status_code_count_py3.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 msrest.serialization import Model + + +class VirtualMachineStatusCodeCount(Model): + """The status code and count of the virtual machine scale set instance view + status summary. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The instance view status code. + :vartype code: str + :ivar count: The number of instances having a particular status code. + :vartype count: int + """ + + _validation = { + 'code': {'readonly': True}, + 'count': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineStatusCodeCount, self).__init__(**kwargs) + self.code = None + self.count = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/win_rm_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/win_rm_configuration.py index efc18d734d09..12ecbcebb502 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/win_rm_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/win_rm_configuration.py @@ -24,6 +24,6 @@ class WinRMConfiguration(Model): 'listeners': {'key': 'listeners', 'type': '[WinRMListener]'}, } - def __init__(self, listeners=None): - super(WinRMConfiguration, self).__init__() - self.listeners = listeners + def __init__(self, **kwargs): + super(WinRMConfiguration, self).__init__(**kwargs) + self.listeners = kwargs.get('listeners', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/win_rm_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/win_rm_configuration_py3.py new file mode 100644 index 000000000000..9936581e303b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/win_rm_configuration_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WinRMConfiguration(Model): + """Describes Windows Remote Management configuration of the VM. + + :param listeners: The list of Windows Remote Management listeners + :type listeners: + list[~azure.mgmt.compute.v2015_06_15.models.WinRMListener] + """ + + _attribute_map = { + 'listeners': {'key': 'listeners', 'type': '[WinRMListener]'}, + } + + def __init__(self, *, listeners=None, **kwargs) -> None: + super(WinRMConfiguration, self).__init__(**kwargs) + self.listeners = listeners diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/win_rm_listener.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/win_rm_listener.py index de48f1f46af5..d49afa13557f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/win_rm_listener.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/win_rm_listener.py @@ -36,7 +36,7 @@ class WinRMListener(Model): 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, } - def __init__(self, protocol=None, certificate_url=None): - super(WinRMListener, self).__init__() - self.protocol = protocol - self.certificate_url = certificate_url + def __init__(self, **kwargs): + super(WinRMListener, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.certificate_url = kwargs.get('certificate_url', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/win_rm_listener_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/win_rm_listener_py3.py new file mode 100644 index 000000000000..f12546111314 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/win_rm_listener_py3.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 msrest.serialization import Model + + +class WinRMListener(Model): + """Describes Protocol and thumbprint of Windows Remote Management listener. + + :param protocol: Specifies the protocol of listener.

    Possible + values are:
    **http**

    **https**. Possible values include: + 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.compute.v2015_06_15.models.ProtocolTypes + :param 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](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + In this case, your certificate needs to be It is the Base64 encoding of + the following JSON Object which is encoded in UTF-8:

    {
    + "data":"",
    "dataType":"pfx",
    + "password":""
    } + :type certificate_url: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'ProtocolTypes'}, + 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, + } + + def __init__(self, *, protocol=None, certificate_url: str=None, **kwargs) -> None: + super(WinRMListener, self).__init__(**kwargs) + self.protocol = protocol + self.certificate_url = certificate_url diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/windows_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/windows_configuration.py index b51d60452239..1bceb3629800 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/windows_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/windows_configuration.py @@ -45,10 +45,10 @@ class WindowsConfiguration(Model): 'win_rm': {'key': 'winRM', 'type': 'WinRMConfiguration'}, } - def __init__(self, provision_vm_agent=None, enable_automatic_updates=None, time_zone=None, additional_unattend_content=None, win_rm=None): - super(WindowsConfiguration, self).__init__() - 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.win_rm = win_rm + def __init__(self, **kwargs): + super(WindowsConfiguration, self).__init__(**kwargs) + self.provision_vm_agent = kwargs.get('provision_vm_agent', None) + self.enable_automatic_updates = kwargs.get('enable_automatic_updates', None) + self.time_zone = kwargs.get('time_zone', None) + self.additional_unattend_content = kwargs.get('additional_unattend_content', None) + self.win_rm = kwargs.get('win_rm', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/windows_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/windows_configuration_py3.py new file mode 100644 index 000000000000..5b976e421bac --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/windows_configuration_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class WindowsConfiguration(Model): + """Specifies Windows operating system settings on the virtual machine. + + :param 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. + :type provision_vm_agent: bool + :param enable_automatic_updates: Indicates whether virtual machine is + enabled for automatic updates. + :type enable_automatic_updates: bool + :param time_zone: Specifies the time zone of the virtual machine. e.g. + "Pacific Standard Time" + :type time_zone: str + :param 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. + :type additional_unattend_content: + list[~azure.mgmt.compute.v2015_06_15.models.AdditionalUnattendContent] + :param win_rm: Specifies the Windows Remote Management listeners. This + enables remote Windows PowerShell. + :type win_rm: ~azure.mgmt.compute.v2015_06_15.models.WinRMConfiguration + """ + + _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]'}, + 'win_rm': {'key': 'winRM', 'type': 'WinRMConfiguration'}, + } + + def __init__(self, *, provision_vm_agent: bool=None, enable_automatic_updates: bool=None, time_zone: str=None, additional_unattend_content=None, win_rm=None, **kwargs) -> None: + super(WindowsConfiguration, self).__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.win_rm = win_rm diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/availability_sets_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/availability_sets_operations.py index 2d1fac46a113..968b224ab676 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/availability_sets_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/availability_sets_operations.py @@ -22,7 +22,7 @@ class AvailabilitySetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-06-15". """ @@ -60,7 +60,7 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("name", name, 'str'), @@ -105,6 +105,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} def delete( self, resource_group_name, availability_set_name, custom_headers=None, raw=False, **operation_config): @@ -125,7 +126,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -166,6 +167,7 @@ def delete( return client_raw_response return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} def get( self, resource_group_name, availability_set_name, custom_headers=None, raw=False, **operation_config): @@ -186,7 +188,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -227,6 +229,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -248,7 +251,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -294,6 +297,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets'} def list_available_sizes( self, resource_group_name, availability_set_name, custom_headers=None, raw=False, **operation_config): @@ -318,7 +322,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes' + url = self.list_available_sizes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -365,3 +369,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_available_sizes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/usage_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/usage_operations.py index c5aeaf444f50..57aed11c304f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/usage_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/usage_operations.py @@ -22,7 +22,7 @@ class UsageOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-06-15". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -105,3 +105,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_extension_images_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_extension_images_operations.py index 7aa5755fbfbb..09017a98cde6 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_extension_images_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_extension_images_operations.py @@ -22,7 +22,7 @@ class VirtualMachineExtensionImagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-06-15". """ @@ -61,7 +61,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}' + url = self.get.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -104,6 +104,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}'} def list_types( self, location, publisher_name, custom_headers=None, raw=False, **operation_config): @@ -125,7 +126,7 @@ def list_types( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types' + url = self.list_types.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -166,6 +167,7 @@ def list_types( return client_raw_response return deserialized + list_types.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types'} def list_versions( self, location, publisher_name, type, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): @@ -195,7 +197,7 @@ def list_versions( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions' + url = self.list_versions.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -243,3 +245,4 @@ def list_versions( return client_raw_response return deserialized + list_versions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_extensions_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_extensions_operations.py index 29a6122dd026..096988d1f6ec 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_extensions_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_extensions_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineExtensionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -93,7 +93,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -108,13 +108,16 @@ def create_or_update( :type extension_parameters: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineExtension or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachineExtension + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -126,30 +129,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineExtension', response) if raw: @@ -158,18 +139,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} def _delete_initial( self, resource_group_name, vm_name, vm_extension_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -213,7 +196,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_name, vm_extension_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, vm_extension_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -224,13 +207,16 @@ def delete( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -241,30 +227,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -273,12 +237,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} def get( self, resource_group_name, vm_name, vm_extension_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -304,7 +270,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -348,3 +314,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_images_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_images_operations.py index 96ee2d3a513e..e339aff73761 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_images_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_images_operations.py @@ -22,7 +22,7 @@ class VirtualMachineImagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-06-15". """ @@ -62,7 +62,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}' + url = self.get.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -106,6 +106,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}'} def list( self, location, publisher_name, offer, skus, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): @@ -138,7 +139,7 @@ def list( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -187,6 +188,7 @@ def list( return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions'} def list_offers( self, location, publisher_name, custom_headers=None, raw=False, **operation_config): @@ -209,7 +211,7 @@ def list_offers( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers' + url = self.list_offers.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -250,6 +252,7 @@ def list_offers( return client_raw_response return deserialized + list_offers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers'} def list_publishers( self, location, custom_headers=None, raw=False, **operation_config): @@ -270,7 +273,7 @@ def list_publishers( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers' + url = self.list_publishers.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -310,6 +313,7 @@ def list_publishers( return client_raw_response return deserialized + list_publishers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers'} def list_skus( self, location, publisher_name, offer, custom_headers=None, raw=False, **operation_config): @@ -334,7 +338,7 @@ def list_skus( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus' + url = self.list_skus.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -376,3 +380,4 @@ def list_skus( return client_raw_response return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_scale_set_vms_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_scale_set_vms_operations.py index dd1dd7962681..66a9d41aed6e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_scale_set_vms_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_scale_set_vms_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _reimage_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage' + url = self.reimage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -87,7 +87,7 @@ def _reimage_initial( return deserialized def reimage( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. @@ -98,13 +98,16 @@ def reimage( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._reimage_initial( @@ -115,30 +118,8 @@ def reimage( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -147,18 +128,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage'} def _deallocate_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate' + url = self.deallocate.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -202,7 +185,7 @@ def _deallocate_initial( return deserialized def deallocate( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is @@ -215,13 +198,16 @@ def deallocate( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._deallocate_initial( @@ -232,30 +218,8 @@ def deallocate( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -264,18 +228,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate'} def _delete_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -319,7 +285,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -329,13 +295,16 @@ def delete( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -346,30 +315,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -378,12 +325,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} def get( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): @@ -407,7 +356,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -449,6 +398,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} def get_instance_view( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): @@ -473,7 +423,7 @@ def get_instance_view( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView' + url = self.get_instance_view.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -515,6 +465,7 @@ def get_instance_view( return client_raw_response return deserialized + get_instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView'} def list( self, resource_group_name, virtual_machine_scale_set_name, filter=None, select=None, expand=None, custom_headers=None, raw=False, **operation_config): @@ -544,7 +495,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -597,12 +548,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines'} def _power_off_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff' + url = self.power_off.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -646,7 +598,7 @@ def _power_off_initial( return deserialized def power_off( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid @@ -659,13 +611,16 @@ def power_off( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._power_off_initial( @@ -676,30 +631,8 @@ def power_off( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -708,18 +641,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff'} def _restart_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart' + url = self.restart.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -763,7 +698,7 @@ def _restart_initial( return deserialized def restart( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -773,13 +708,16 @@ def restart( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._restart_initial( @@ -790,30 +728,8 @@ def restart( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -822,18 +738,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart'} def _start_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -877,7 +795,7 @@ def _start_initial( return deserialized def start( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -887,13 +805,16 @@ def start( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -904,30 +825,8 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -936,9 +835,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_scale_sets_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_scale_sets_operations.py index cd004278103c..7f5c7ee6d78e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_scale_sets_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_scale_sets_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineScaleSetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("name", name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -103,13 +103,16 @@ def create_or_update( :type parameters: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSet :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineScaleSet or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachineScaleSet + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSet] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSet]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -120,30 +123,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineScaleSet', response) if raw: @@ -152,18 +133,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def _delete_initial( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -206,7 +189,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -214,13 +197,16 @@ def delete( :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -230,30 +216,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -262,12 +226,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def get( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -288,7 +254,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -329,6 +295,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def _deallocate_initial( @@ -338,7 +305,7 @@ def _deallocate_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate' + url = self.deallocate.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -388,7 +355,7 @@ def _deallocate_initial( return deserialized def deallocate( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set @@ -404,13 +371,16 @@ def deallocate( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._deallocate_initial( @@ -421,30 +391,8 @@ def deallocate( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -453,12 +401,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate'} def _delete_instances_initial( @@ -466,7 +416,7 @@ def _delete_instances_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceRequiredIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete' + url = self.delete_instances.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -513,7 +463,7 @@ def _delete_instances_initial( return deserialized def delete_instances( - self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -523,13 +473,16 @@ def delete_instances( :param instance_ids: The virtual machine scale set instance ids. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_instances_initial( @@ -540,30 +493,8 @@ def delete_instances( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -572,12 +503,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_instances.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete'} def get_instance_view( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -600,7 +533,7 @@ def get_instance_view( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView' + url = self.get_instance_view.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -641,6 +574,7 @@ def get_instance_view( return client_raw_response return deserialized + get_instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -662,7 +596,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -708,6 +642,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -730,7 +665,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -775,6 +710,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets'} def list_skus( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -799,7 +735,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus' + url = self.list_skus.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -846,6 +782,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus'} def _power_off_initial( @@ -855,7 +792,7 @@ def _power_off_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff' + url = self.power_off.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -905,7 +842,7 @@ def _power_off_initial( return deserialized def power_off( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid @@ -921,13 +858,16 @@ def power_off( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._power_off_initial( @@ -938,30 +878,8 @@ def power_off( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -970,12 +888,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff'} def _restart_initial( @@ -985,7 +905,7 @@ def _restart_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart' + url = self.restart.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1035,7 +955,7 @@ def _restart_initial( return deserialized def restart( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1048,13 +968,16 @@ def restart( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._restart_initial( @@ -1065,30 +988,8 @@ def restart( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1097,12 +998,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart'} def _start_initial( @@ -1112,7 +1015,7 @@ def _start_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1162,7 +1065,7 @@ def _start_initial( return deserialized def start( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1175,13 +1078,16 @@ def start( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -1192,30 +1098,8 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1224,12 +1108,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start'} def _update_instances_initial( @@ -1237,7 +1123,7 @@ def _update_instances_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceRequiredIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade' + url = self.update_instances.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1284,7 +1170,7 @@ def _update_instances_initial( return deserialized def update_instances( - self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, polling=True, **operation_config): """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. @@ -1295,13 +1181,16 @@ def update_instances( :param instance_ids: The virtual machine scale set instance ids. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._update_instances_initial( @@ -1312,30 +1201,8 @@ def update_instances( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1344,18 +1211,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_instances.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade'} def _reimage_initial( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage' + url = self.reimage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1398,7 +1267,7 @@ def _reimage_initial( return deserialized def reimage( - self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, polling=True, **operation_config): """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. @@ -1407,13 +1276,16 @@ def reimage( :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._reimage_initial( @@ -1423,30 +1295,8 @@ def reimage( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1455,9 +1305,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_sizes_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_sizes_operations.py index cb0cd8eb281d..609b00e4ec30 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_sizes_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machine_sizes_operations.py @@ -22,7 +22,7 @@ class VirtualMachineSizesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-06-15". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -105,3 +105,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machines_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machines_operations.py index 2c61b9d9e9b6..27776073ef24 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machines_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/virtual_machines_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachinesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _capture_initial( self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture' + url = self.capture.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -90,7 +90,7 @@ def _capture_initial( return deserialized def capture( - self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -103,13 +103,17 @@ def capture( :type parameters: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineCaptureParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineCaptureResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualMachineCaptureResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineCaptureResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineCaptureResult]] :raises: :class:`CloudError` """ raw_result = self._capture_initial( @@ -120,30 +124,8 @@ def capture( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineCaptureResult', response) if raw: @@ -152,18 +134,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture'} def _create_or_update_initial( self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -212,7 +196,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -224,13 +208,16 @@ def create_or_update( :type parameters: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachine :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachine or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachine or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.VirtualMachine] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.VirtualMachine]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -241,30 +228,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachine', response) if raw: @@ -273,18 +238,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} def _delete_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -327,7 +294,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -335,13 +302,16 @@ def delete( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -351,30 +321,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -383,12 +331,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} def get( self, resource_group_name, vm_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -414,7 +364,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -457,12 +407,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} def _deallocate_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate' + url = self.deallocate.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -505,7 +456,7 @@ def _deallocate_initial( return deserialized def deallocate( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. @@ -515,13 +466,16 @@ def deallocate( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._deallocate_initial( @@ -531,30 +485,8 @@ def deallocate( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -563,12 +495,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate'} def generalize( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): @@ -589,7 +523,7 @@ def generalize( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize' + url = self.generalize.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -630,6 +564,7 @@ def generalize( return client_raw_response return deserialized + generalize.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -653,7 +588,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -699,6 +634,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -720,7 +656,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -765,6 +701,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines'} def list_available_sizes( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): @@ -789,7 +726,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes' + url = self.list_available_sizes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -836,12 +773,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_available_sizes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes'} def _power_off_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff' + url = self.power_off.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -884,7 +822,7 @@ def _power_off_initial( return deserialized def power_off( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. @@ -894,13 +832,16 @@ def power_off( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._power_off_initial( @@ -910,30 +851,8 @@ def power_off( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -942,18 +861,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff'} def _restart_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart' + url = self.restart.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -996,7 +917,7 @@ def _restart_initial( return deserialized def restart( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1004,13 +925,16 @@ def restart( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._restart_initial( @@ -1020,30 +944,8 @@ def restart( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1052,18 +954,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart'} def _start_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1106,7 +1010,7 @@ def _start_initial( return deserialized def start( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1114,13 +1018,16 @@ def start( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -1130,30 +1037,8 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1162,18 +1047,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start'} def _redeploy_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy' + url = self.redeploy.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1216,7 +1103,7 @@ def _redeploy_initial( return deserialized def redeploy( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to redeploy a virtual machine. :param resource_group_name: The name of the resource group. @@ -1224,13 +1111,16 @@ def redeploy( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._redeploy_initial( @@ -1240,30 +1130,8 @@ def redeploy( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1272,9 +1140,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + redeploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/__init__.py index 0f116cbe6a44..6a083cc17f20 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/__init__.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/__init__.py @@ -9,83 +9,162 @@ # regenerated. # -------------------------------------------------------------------------- -from .instance_view_status import InstanceViewStatus -from .sub_resource import SubResource -from .availability_set import AvailabilitySet -from .virtual_machine_size import VirtualMachineSize -from .virtual_machine_extension_image import VirtualMachineExtensionImage -from .virtual_machine_image_resource import VirtualMachineImageResource -from .virtual_machine_extension_instance_view import VirtualMachineExtensionInstanceView -from .virtual_machine_extension import VirtualMachineExtension -from .purchase_plan import PurchasePlan -from .os_disk_image import OSDiskImage -from .data_disk_image import DataDiskImage -from .virtual_machine_image import VirtualMachineImage -from .usage_name import UsageName -from .usage import Usage -from .virtual_machine_capture_parameters import VirtualMachineCaptureParameters -from .virtual_machine_capture_result import VirtualMachineCaptureResult -from .plan import Plan -from .hardware_profile import HardwareProfile -from .image_reference import ImageReference -from .key_vault_secret_reference import KeyVaultSecretReference -from .key_vault_key_reference import KeyVaultKeyReference -from .disk_encryption_settings import DiskEncryptionSettings -from .virtual_hard_disk import VirtualHardDisk -from .os_disk import OSDisk -from .data_disk import DataDisk -from .storage_profile import StorageProfile -from .additional_unattend_content import AdditionalUnattendContent -from .win_rm_listener import WinRMListener -from .win_rm_configuration import WinRMConfiguration -from .windows_configuration import WindowsConfiguration -from .ssh_public_key import SshPublicKey -from .ssh_configuration import SshConfiguration -from .linux_configuration import LinuxConfiguration -from .vault_certificate import VaultCertificate -from .vault_secret_group import VaultSecretGroup -from .os_profile import OSProfile -from .network_interface_reference import NetworkInterfaceReference -from .network_profile import NetworkProfile -from .boot_diagnostics import BootDiagnostics -from .diagnostics_profile import DiagnosticsProfile -from .virtual_machine_extension_handler_instance_view import VirtualMachineExtensionHandlerInstanceView -from .virtual_machine_agent_instance_view import VirtualMachineAgentInstanceView -from .disk_instance_view import DiskInstanceView -from .boot_diagnostics_instance_view import BootDiagnosticsInstanceView -from .virtual_machine_identity import VirtualMachineIdentity -from .virtual_machine_instance_view import VirtualMachineInstanceView -from .virtual_machine import VirtualMachine -from .sku import Sku -from .upgrade_policy import UpgradePolicy -from .virtual_machine_scale_set_identity import VirtualMachineScaleSetIdentity -from .virtual_machine_scale_set_os_profile import VirtualMachineScaleSetOSProfile -from .virtual_machine_scale_set_os_disk import VirtualMachineScaleSetOSDisk -from .virtual_machine_scale_set_storage_profile import VirtualMachineScaleSetStorageProfile -from .api_entity_reference import ApiEntityReference -from .virtual_machine_scale_set_ip_configuration import VirtualMachineScaleSetIPConfiguration -from .virtual_machine_scale_set_network_configuration import VirtualMachineScaleSetNetworkConfiguration -from .virtual_machine_scale_set_network_profile import VirtualMachineScaleSetNetworkProfile -from .virtual_machine_scale_set_extension import VirtualMachineScaleSetExtension -from .virtual_machine_scale_set_extension_profile import VirtualMachineScaleSetExtensionProfile -from .virtual_machine_scale_set_vm_profile import VirtualMachineScaleSetVMProfile -from .virtual_machine_scale_set import VirtualMachineScaleSet -from .virtual_machine_scale_set_vm_instance_ids import VirtualMachineScaleSetVMInstanceIDs -from .virtual_machine_scale_set_vm_instance_required_ids import VirtualMachineScaleSetVMInstanceRequiredIDs -from .virtual_machine_status_code_count import VirtualMachineStatusCodeCount -from .virtual_machine_scale_set_instance_view_statuses_summary import VirtualMachineScaleSetInstanceViewStatusesSummary -from .virtual_machine_scale_set_vm_extensions_summary import VirtualMachineScaleSetVMExtensionsSummary -from .virtual_machine_scale_set_instance_view import VirtualMachineScaleSetInstanceView -from .virtual_machine_scale_set_sku_capacity import VirtualMachineScaleSetSkuCapacity -from .virtual_machine_scale_set_sku import VirtualMachineScaleSetSku -from .virtual_machine_scale_set_vm import VirtualMachineScaleSetVM -from .virtual_machine_scale_set_vm_instance_view import VirtualMachineScaleSetVMInstanceView -from .api_error_base import ApiErrorBase -from .inner_error import InnerError -from .api_error import ApiError -from .compute_long_running_operation_properties import ComputeLongRunningOperationProperties -from .resource import Resource -from .operation_status_response import OperationStatusResponse +try: + from .instance_view_status_py3 import InstanceViewStatus + from .sub_resource_py3 import SubResource + from .availability_set_py3 import AvailabilitySet + from .virtual_machine_size_py3 import VirtualMachineSize + from .virtual_machine_extension_image_py3 import VirtualMachineExtensionImage + from .virtual_machine_image_resource_py3 import VirtualMachineImageResource + from .virtual_machine_extension_instance_view_py3 import VirtualMachineExtensionInstanceView + from .virtual_machine_extension_py3 import VirtualMachineExtension + from .purchase_plan_py3 import PurchasePlan + from .os_disk_image_py3 import OSDiskImage + from .data_disk_image_py3 import DataDiskImage + from .virtual_machine_image_py3 import VirtualMachineImage + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .virtual_machine_capture_parameters_py3 import VirtualMachineCaptureParameters + from .virtual_machine_capture_result_py3 import VirtualMachineCaptureResult + from .plan_py3 import Plan + from .hardware_profile_py3 import HardwareProfile + from .image_reference_py3 import ImageReference + from .key_vault_secret_reference_py3 import KeyVaultSecretReference + from .key_vault_key_reference_py3 import KeyVaultKeyReference + from .disk_encryption_settings_py3 import DiskEncryptionSettings + from .virtual_hard_disk_py3 import VirtualHardDisk + from .os_disk_py3 import OSDisk + from .data_disk_py3 import DataDisk + from .storage_profile_py3 import StorageProfile + from .additional_unattend_content_py3 import AdditionalUnattendContent + from .win_rm_listener_py3 import WinRMListener + from .win_rm_configuration_py3 import WinRMConfiguration + from .windows_configuration_py3 import WindowsConfiguration + from .ssh_public_key_py3 import SshPublicKey + from .ssh_configuration_py3 import SshConfiguration + from .linux_configuration_py3 import LinuxConfiguration + from .vault_certificate_py3 import VaultCertificate + from .vault_secret_group_py3 import VaultSecretGroup + from .os_profile_py3 import OSProfile + from .network_interface_reference_py3 import NetworkInterfaceReference + from .network_profile_py3 import NetworkProfile + from .boot_diagnostics_py3 import BootDiagnostics + from .diagnostics_profile_py3 import DiagnosticsProfile + from .virtual_machine_extension_handler_instance_view_py3 import VirtualMachineExtensionHandlerInstanceView + from .virtual_machine_agent_instance_view_py3 import VirtualMachineAgentInstanceView + from .disk_instance_view_py3 import DiskInstanceView + from .boot_diagnostics_instance_view_py3 import BootDiagnosticsInstanceView + from .virtual_machine_identity_py3 import VirtualMachineIdentity + from .virtual_machine_instance_view_py3 import VirtualMachineInstanceView + from .virtual_machine_py3 import VirtualMachine + from .sku_py3 import Sku + from .upgrade_policy_py3 import UpgradePolicy + from .virtual_machine_scale_set_identity_py3 import VirtualMachineScaleSetIdentity + from .virtual_machine_scale_set_os_profile_py3 import VirtualMachineScaleSetOSProfile + from .virtual_machine_scale_set_os_disk_py3 import VirtualMachineScaleSetOSDisk + from .virtual_machine_scale_set_storage_profile_py3 import VirtualMachineScaleSetStorageProfile + from .api_entity_reference_py3 import ApiEntityReference + from .virtual_machine_scale_set_ip_configuration_py3 import VirtualMachineScaleSetIPConfiguration + from .virtual_machine_scale_set_network_configuration_py3 import VirtualMachineScaleSetNetworkConfiguration + from .virtual_machine_scale_set_network_profile_py3 import VirtualMachineScaleSetNetworkProfile + from .virtual_machine_scale_set_extension_py3 import VirtualMachineScaleSetExtension + from .virtual_machine_scale_set_extension_profile_py3 import VirtualMachineScaleSetExtensionProfile + from .virtual_machine_scale_set_vm_profile_py3 import VirtualMachineScaleSetVMProfile + from .virtual_machine_scale_set_py3 import VirtualMachineScaleSet + from .virtual_machine_scale_set_vm_instance_ids_py3 import VirtualMachineScaleSetVMInstanceIDs + from .virtual_machine_scale_set_vm_instance_required_ids_py3 import VirtualMachineScaleSetVMInstanceRequiredIDs + from .virtual_machine_status_code_count_py3 import VirtualMachineStatusCodeCount + from .virtual_machine_scale_set_instance_view_statuses_summary_py3 import VirtualMachineScaleSetInstanceViewStatusesSummary + from .virtual_machine_scale_set_vm_extensions_summary_py3 import VirtualMachineScaleSetVMExtensionsSummary + from .virtual_machine_scale_set_instance_view_py3 import VirtualMachineScaleSetInstanceView + from .virtual_machine_scale_set_sku_capacity_py3 import VirtualMachineScaleSetSkuCapacity + from .virtual_machine_scale_set_sku_py3 import VirtualMachineScaleSetSku + from .virtual_machine_scale_set_vm_py3 import VirtualMachineScaleSetVM + from .virtual_machine_scale_set_vm_instance_view_py3 import VirtualMachineScaleSetVMInstanceView + from .api_error_base_py3 import ApiErrorBase + from .inner_error_py3 import InnerError + from .api_error_py3 import ApiError + from .compute_long_running_operation_properties_py3 import ComputeLongRunningOperationProperties + from .resource_py3 import Resource + from .operation_status_response_py3 import OperationStatusResponse +except (SyntaxError, ImportError): + from .instance_view_status import InstanceViewStatus + from .sub_resource import SubResource + from .availability_set import AvailabilitySet + from .virtual_machine_size import VirtualMachineSize + from .virtual_machine_extension_image import VirtualMachineExtensionImage + from .virtual_machine_image_resource import VirtualMachineImageResource + from .virtual_machine_extension_instance_view import VirtualMachineExtensionInstanceView + from .virtual_machine_extension import VirtualMachineExtension + from .purchase_plan import PurchasePlan + from .os_disk_image import OSDiskImage + from .data_disk_image import DataDiskImage + from .virtual_machine_image import VirtualMachineImage + from .usage_name import UsageName + from .usage import Usage + from .virtual_machine_capture_parameters import VirtualMachineCaptureParameters + from .virtual_machine_capture_result import VirtualMachineCaptureResult + from .plan import Plan + from .hardware_profile import HardwareProfile + from .image_reference import ImageReference + from .key_vault_secret_reference import KeyVaultSecretReference + from .key_vault_key_reference import KeyVaultKeyReference + from .disk_encryption_settings import DiskEncryptionSettings + from .virtual_hard_disk import VirtualHardDisk + from .os_disk import OSDisk + from .data_disk import DataDisk + from .storage_profile import StorageProfile + from .additional_unattend_content import AdditionalUnattendContent + from .win_rm_listener import WinRMListener + from .win_rm_configuration import WinRMConfiguration + from .windows_configuration import WindowsConfiguration + from .ssh_public_key import SshPublicKey + from .ssh_configuration import SshConfiguration + from .linux_configuration import LinuxConfiguration + from .vault_certificate import VaultCertificate + from .vault_secret_group import VaultSecretGroup + from .os_profile import OSProfile + from .network_interface_reference import NetworkInterfaceReference + from .network_profile import NetworkProfile + from .boot_diagnostics import BootDiagnostics + from .diagnostics_profile import DiagnosticsProfile + from .virtual_machine_extension_handler_instance_view import VirtualMachineExtensionHandlerInstanceView + from .virtual_machine_agent_instance_view import VirtualMachineAgentInstanceView + from .disk_instance_view import DiskInstanceView + from .boot_diagnostics_instance_view import BootDiagnosticsInstanceView + from .virtual_machine_identity import VirtualMachineIdentity + from .virtual_machine_instance_view import VirtualMachineInstanceView + from .virtual_machine import VirtualMachine + from .sku import Sku + from .upgrade_policy import UpgradePolicy + from .virtual_machine_scale_set_identity import VirtualMachineScaleSetIdentity + from .virtual_machine_scale_set_os_profile import VirtualMachineScaleSetOSProfile + from .virtual_machine_scale_set_os_disk import VirtualMachineScaleSetOSDisk + from .virtual_machine_scale_set_storage_profile import VirtualMachineScaleSetStorageProfile + from .api_entity_reference import ApiEntityReference + from .virtual_machine_scale_set_ip_configuration import VirtualMachineScaleSetIPConfiguration + from .virtual_machine_scale_set_network_configuration import VirtualMachineScaleSetNetworkConfiguration + from .virtual_machine_scale_set_network_profile import VirtualMachineScaleSetNetworkProfile + from .virtual_machine_scale_set_extension import VirtualMachineScaleSetExtension + from .virtual_machine_scale_set_extension_profile import VirtualMachineScaleSetExtensionProfile + from .virtual_machine_scale_set_vm_profile import VirtualMachineScaleSetVMProfile + from .virtual_machine_scale_set import VirtualMachineScaleSet + from .virtual_machine_scale_set_vm_instance_ids import VirtualMachineScaleSetVMInstanceIDs + from .virtual_machine_scale_set_vm_instance_required_ids import VirtualMachineScaleSetVMInstanceRequiredIDs + from .virtual_machine_status_code_count import VirtualMachineStatusCodeCount + from .virtual_machine_scale_set_instance_view_statuses_summary import VirtualMachineScaleSetInstanceViewStatusesSummary + from .virtual_machine_scale_set_vm_extensions_summary import VirtualMachineScaleSetVMExtensionsSummary + from .virtual_machine_scale_set_instance_view import VirtualMachineScaleSetInstanceView + from .virtual_machine_scale_set_sku_capacity import VirtualMachineScaleSetSkuCapacity + from .virtual_machine_scale_set_sku import VirtualMachineScaleSetSku + from .virtual_machine_scale_set_vm import VirtualMachineScaleSetVM + from .virtual_machine_scale_set_vm_instance_view import VirtualMachineScaleSetVMInstanceView + from .api_error_base import ApiErrorBase + from .inner_error import InnerError + from .api_error import ApiError + from .compute_long_running_operation_properties import ComputeLongRunningOperationProperties + from .resource import Resource + from .operation_status_response import OperationStatusResponse from .availability_set_paged import AvailabilitySetPaged from .virtual_machine_size_paged import VirtualMachineSizePaged from .usage_paged import UsagePaged diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/additional_unattend_content.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/additional_unattend_content.py index d23281b2b312..d08808bb1c86 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/additional_unattend_content.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/additional_unattend_content.py @@ -44,9 +44,9 @@ class AdditionalUnattendContent(Model): 'content': {'key': 'content', 'type': 'str'}, } - def __init__(self, pass_name=None, component_name=None, setting_name=None, content=None): - super(AdditionalUnattendContent, self).__init__() - self.pass_name = pass_name - self.component_name = component_name - self.setting_name = setting_name - self.content = content + def __init__(self, **kwargs): + super(AdditionalUnattendContent, self).__init__(**kwargs) + self.pass_name = kwargs.get('pass_name', None) + self.component_name = kwargs.get('component_name', None) + self.setting_name = kwargs.get('setting_name', None) + self.content = kwargs.get('content', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/additional_unattend_content_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/additional_unattend_content_py3.py new file mode 100644 index 000000000000..ae5bfe4f555f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/additional_unattend_content_py3.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class AdditionalUnattendContent(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. + + :param pass_name: The pass name. Currently, the only allowable value is + OobeSystem. Possible values include: 'OobeSystem' + :type pass_name: str or ~azure.mgmt.compute.v2016_03_30.models.PassNames + :param component_name: The component name. Currently, the only allowable + value is Microsoft-Windows-Shell-Setup. Possible values include: + 'Microsoft-Windows-Shell-Setup' + :type component_name: str or + ~azure.mgmt.compute.v2016_03_30.models.ComponentNames + :param setting_name: Specifies the name of the setting to which the + content applies. Possible values are: FirstLogonCommands and AutoLogon. + Possible values include: 'AutoLogon', 'FirstLogonCommands' + :type setting_name: str or + ~azure.mgmt.compute.v2016_03_30.models.SettingNames + :param 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. + :type content: str + """ + + _attribute_map = { + 'pass_name': {'key': 'passName', 'type': 'PassNames'}, + 'component_name': {'key': 'componentName', 'type': 'ComponentNames'}, + 'setting_name': {'key': 'settingName', 'type': 'SettingNames'}, + 'content': {'key': 'content', 'type': 'str'}, + } + + def __init__(self, *, pass_name=None, component_name=None, setting_name=None, content: str=None, **kwargs) -> None: + super(AdditionalUnattendContent, self).__init__(**kwargs) + self.pass_name = pass_name + self.component_name = component_name + self.setting_name = setting_name + self.content = content diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_entity_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_entity_reference.py index 27696aacc3dc..d1bf572e916d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_entity_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_entity_reference.py @@ -24,6 +24,6 @@ class ApiEntityReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(ApiEntityReference, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(ApiEntityReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_entity_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_entity_reference_py3.py new file mode 100644 index 000000000000..da3e07082381 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_entity_reference_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApiEntityReference(Model): + """The API entity reference. + + :param id: The ARM resource id in the form of + /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(ApiEntityReference, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_error.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_error.py index b88bc0c04faa..979a44dc777d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_error.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_error.py @@ -35,10 +35,10 @@ class ApiError(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, details=None, innererror=None, code=None, target=None, message=None): - super(ApiError, self).__init__() - self.details = details - self.innererror = innererror - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ApiError, self).__init__(**kwargs) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_error_base.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_error_base.py index 2fb33a0ff411..655c08638905 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_error_base.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_error_base.py @@ -29,8 +29,8 @@ class ApiErrorBase(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, target=None, message=None): - super(ApiErrorBase, self).__init__() - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ApiErrorBase, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_error_base_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_error_base_py3.py new file mode 100644 index 000000000000..5ba95aa0283e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_error_base_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ApiErrorBase(Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ApiErrorBase, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_error_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_error_py3.py new file mode 100644 index 000000000000..5a68b96923d1 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/api_error_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApiError(Model): + """Api error. + + :param details: The Api error details + :type details: list[~azure.mgmt.compute.v2016_03_30.models.ApiErrorBase] + :param innererror: The Api inner error + :type innererror: ~azure.mgmt.compute.v2016_03_30.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, details=None, innererror=None, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ApiError, self).__init__(**kwargs) + self.details = details + self.innererror = innererror + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/availability_set.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/availability_set.py index 3fb6b532f8a3..cadfd47b6761 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/availability_set.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/availability_set.py @@ -28,13 +28,15 @@ class AvailabilitySet(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -71,9 +73,9 @@ class AvailabilitySet(Resource): 'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, location, tags=None, platform_update_domain_count=None, platform_fault_domain_count=None, virtual_machines=None): - super(AvailabilitySet, self).__init__(location=location, tags=tags) - self.platform_update_domain_count = platform_update_domain_count - self.platform_fault_domain_count = platform_fault_domain_count - self.virtual_machines = virtual_machines + def __init__(self, **kwargs): + super(AvailabilitySet, self).__init__(**kwargs) + self.platform_update_domain_count = kwargs.get('platform_update_domain_count', None) + self.platform_fault_domain_count = kwargs.get('platform_fault_domain_count', None) + self.virtual_machines = kwargs.get('virtual_machines', None) self.statuses = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/availability_set_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/availability_set_py3.py new file mode 100644 index 000000000000..610f6ab71d8c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/availability_set_py3.py @@ -0,0 +1,81 @@ +# 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 .resource import Resource + + +class AvailabilitySet(Resource): + """Specifies information about the availability set that the virtual machine + should be assigned to. Virtual machines specified in the same availability + set are allocated to different nodes to maximize availability. For more + information about availability sets, see [Manage the availability of + virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param platform_update_domain_count: Update Domain count. + :type platform_update_domain_count: int + :param platform_fault_domain_count: Fault Domain count. + :type platform_fault_domain_count: int + :param virtual_machines: A list of references to all virtual machines in + the availability set. + :type virtual_machines: + list[~azure.mgmt.compute.v2016_03_30.models.SubResource] + :ivar statuses: The resource status information. + :vartype statuses: + list[~azure.mgmt.compute.v2016_03_30.models.InstanceViewStatus] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'statuses': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'platform_update_domain_count': {'key': 'properties.platformUpdateDomainCount', 'type': 'int'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResource]'}, + 'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, location: str, tags=None, platform_update_domain_count: int=None, platform_fault_domain_count: int=None, virtual_machines=None, **kwargs) -> None: + super(AvailabilitySet, self).__init__(location=location, tags=tags, **kwargs) + self.platform_update_domain_count = platform_update_domain_count + self.platform_fault_domain_count = platform_fault_domain_count + self.virtual_machines = virtual_machines + self.statuses = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/boot_diagnostics.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/boot_diagnostics.py index c94d188e3fba..ca3dbdd4f23c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/boot_diagnostics.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/boot_diagnostics.py @@ -32,7 +32,7 @@ class BootDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, enabled=None, storage_uri=None): - super(BootDiagnostics, self).__init__() - self.enabled = enabled - self.storage_uri = storage_uri + def __init__(self, **kwargs): + super(BootDiagnostics, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.storage_uri = kwargs.get('storage_uri', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/boot_diagnostics_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/boot_diagnostics_instance_view.py index 4ec7b385558d..6fe1f84a3910 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/boot_diagnostics_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/boot_diagnostics_instance_view.py @@ -26,7 +26,7 @@ class BootDiagnosticsInstanceView(Model): 'serial_console_log_blob_uri': {'key': 'serialConsoleLogBlobUri', 'type': 'str'}, } - def __init__(self, console_screenshot_blob_uri=None, serial_console_log_blob_uri=None): - super(BootDiagnosticsInstanceView, self).__init__() - self.console_screenshot_blob_uri = console_screenshot_blob_uri - self.serial_console_log_blob_uri = serial_console_log_blob_uri + def __init__(self, **kwargs): + super(BootDiagnosticsInstanceView, self).__init__(**kwargs) + self.console_screenshot_blob_uri = kwargs.get('console_screenshot_blob_uri', None) + self.serial_console_log_blob_uri = kwargs.get('serial_console_log_blob_uri', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/boot_diagnostics_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/boot_diagnostics_instance_view_py3.py new file mode 100644 index 000000000000..d85b51981ab9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/boot_diagnostics_instance_view_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class BootDiagnosticsInstanceView(Model): + """The instance view of a virtual machine boot diagnostics. + + :param console_screenshot_blob_uri: The console screenshot blob URI. + :type console_screenshot_blob_uri: str + :param serial_console_log_blob_uri: The Linux serial console log blob Uri. + :type serial_console_log_blob_uri: str + """ + + _attribute_map = { + 'console_screenshot_blob_uri': {'key': 'consoleScreenshotBlobUri', 'type': 'str'}, + 'serial_console_log_blob_uri': {'key': 'serialConsoleLogBlobUri', 'type': 'str'}, + } + + def __init__(self, *, console_screenshot_blob_uri: str=None, serial_console_log_blob_uri: str=None, **kwargs) -> None: + super(BootDiagnosticsInstanceView, self).__init__(**kwargs) + self.console_screenshot_blob_uri = console_screenshot_blob_uri + self.serial_console_log_blob_uri = serial_console_log_blob_uri diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/boot_diagnostics_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/boot_diagnostics_py3.py new file mode 100644 index 000000000000..b0a756ea4fa0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/boot_diagnostics_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class BootDiagnostics(Model): + """Boot Diagnostics is a debugging feature which allows you to view Console + Output and Screenshot to diagnose VM status.

    For Linux Virtual + Machines, you can easily view the output of your console log.

    For + both Windows and Linux virtual machines, Azure also enables you to see a + screenshot of the VM from the hypervisor. + + :param enabled: Whether boot diagnostics should be enabled on the Virtual + Machine. + :type enabled: bool + :param storage_uri: Uri of the storage account to use for placing the + console output and screenshot. + :type storage_uri: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, storage_uri: str=None, **kwargs) -> None: + super(BootDiagnostics, self).__init__(**kwargs) + self.enabled = enabled + self.storage_uri = storage_uri diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/compute_long_running_operation_properties.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/compute_long_running_operation_properties.py index f8ca23e0ccdf..66ff353eb206 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/compute_long_running_operation_properties.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/compute_long_running_operation_properties.py @@ -23,6 +23,6 @@ class ComputeLongRunningOperationProperties(Model): 'output': {'key': 'output', 'type': 'object'}, } - def __init__(self, output=None): - super(ComputeLongRunningOperationProperties, self).__init__() - self.output = output + def __init__(self, **kwargs): + super(ComputeLongRunningOperationProperties, self).__init__(**kwargs) + self.output = kwargs.get('output', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/compute_long_running_operation_properties_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/compute_long_running_operation_properties_py3.py new file mode 100644 index 000000000000..a4ffd6c8c32f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/compute_long_running_operation_properties_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class ComputeLongRunningOperationProperties(Model): + """Compute-specific operation properties, including output. + + :param output: Operation output data (raw JSON) + :type output: object + """ + + _attribute_map = { + 'output': {'key': 'output', 'type': 'object'}, + } + + def __init__(self, *, output=None, **kwargs) -> None: + super(ComputeLongRunningOperationProperties, self).__init__(**kwargs) + self.output = output diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/compute_management_client_enums.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/compute_management_client_enums.py index f73f8041f915..724cbcdb599e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/compute_management_client_enums.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/compute_management_client_enums.py @@ -12,20 +12,20 @@ from enum import Enum -class StatusLevelTypes(Enum): +class StatusLevelTypes(str, Enum): info = "Info" warning = "Warning" error = "Error" -class OperatingSystemTypes(Enum): +class OperatingSystemTypes(str, Enum): windows = "Windows" linux = "Linux" -class VirtualMachineSizeTypes(Enum): +class VirtualMachineSizeTypes(str, Enum): basic_a0 = "Basic_A0" basic_a1 = "Basic_A1" @@ -92,59 +92,59 @@ class VirtualMachineSizeTypes(Enum): standard_gs5 = "Standard_GS5" -class CachingTypes(Enum): +class CachingTypes(str, Enum): none = "None" read_only = "ReadOnly" read_write = "ReadWrite" -class DiskCreateOptionTypes(Enum): +class DiskCreateOptionTypes(str, Enum): from_image = "FromImage" empty = "Empty" attach = "Attach" -class PassNames(Enum): +class PassNames(str, Enum): oobe_system = "OobeSystem" -class ComponentNames(Enum): +class ComponentNames(str, Enum): microsoft_windows_shell_setup = "Microsoft-Windows-Shell-Setup" -class SettingNames(Enum): +class SettingNames(str, Enum): auto_logon = "AutoLogon" first_logon_commands = "FirstLogonCommands" -class ProtocolTypes(Enum): +class ProtocolTypes(str, Enum): http = "Http" https = "Https" -class ResourceIdentityType(Enum): +class ResourceIdentityType(str, Enum): system_assigned = "SystemAssigned" -class UpgradeMode(Enum): +class UpgradeMode(str, Enum): automatic = "Automatic" manual = "Manual" -class VirtualMachineScaleSetSkuScaleType(Enum): +class VirtualMachineScaleSetSkuScaleType(str, Enum): automatic = "Automatic" none = "None" -class InstanceViewTypes(Enum): +class InstanceViewTypes(str, Enum): instance_view = "instanceView" diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/data_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/data_disk.py index 9011f365243b..b7faf4202ea7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/data_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/data_disk.py @@ -15,13 +15,15 @@ class DataDisk(Model): """Describes a data disk. - :param 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. + All required parameters must be populated in order to send to Azure. + + :param lun: Required. 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. :type lun: int - :param name: The disk name. + :param name: Required. The disk name. :type name: str - :param vhd: The virtual hard disk. + :param vhd: Required. The virtual hard disk. :type vhd: ~azure.mgmt.compute.v2016_03_30.models.VirtualHardDisk :param image: The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If @@ -33,8 +35,8 @@ class DataDisk(Model):

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2016_03_30.models.CachingTypes - :param create_option: Specifies how the virtual machine should be - created.

    Possible values are:

    **Attach** \\u2013 This + :param create_option: Required. Specifies how the virtual machine should + be created.

    Possible values are:

    **Attach** \\u2013 This value is used when you are using a specialized disk to create the virtual machine.

    **FromImage** \\u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform @@ -66,12 +68,12 @@ class DataDisk(Model): 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, } - def __init__(self, lun, name, vhd, create_option, image=None, caching=None, disk_size_gb=None): - super(DataDisk, self).__init__() - self.lun = lun - self.name = name - self.vhd = vhd - self.image = image - self.caching = caching - self.create_option = create_option - self.disk_size_gb = disk_size_gb + def __init__(self, **kwargs): + super(DataDisk, self).__init__(**kwargs) + self.lun = kwargs.get('lun', None) + self.name = kwargs.get('name', None) + self.vhd = kwargs.get('vhd', None) + self.image = kwargs.get('image', None) + self.caching = kwargs.get('caching', None) + self.create_option = kwargs.get('create_option', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/data_disk_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/data_disk_image.py index 60a4befc525f..b5dbfcefb472 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/data_disk_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/data_disk_image.py @@ -32,6 +32,6 @@ class DataDiskImage(Model): 'lun': {'key': 'lun', 'type': 'int'}, } - def __init__(self): - super(DataDiskImage, self).__init__() + def __init__(self, **kwargs): + super(DataDiskImage, self).__init__(**kwargs) self.lun = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/data_disk_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/data_disk_image_py3.py new file mode 100644 index 000000000000..8431a3988502 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/data_disk_image_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class DataDiskImage(Model): + """Contains the data disk images information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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. + :vartype lun: int + """ + + _validation = { + 'lun': {'readonly': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(DataDiskImage, self).__init__(**kwargs) + self.lun = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/data_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/data_disk_py3.py new file mode 100644 index 000000000000..71fe40ece87d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/data_disk_py3.py @@ -0,0 +1,79 @@ +# 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 msrest.serialization import Model + + +class DataDisk(Model): + """Describes a data disk. + + All required parameters must be populated in order to send to Azure. + + :param lun: Required. 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. + :type lun: int + :param name: Required. The disk name. + :type name: str + :param vhd: Required. The virtual hard disk. + :type vhd: ~azure.mgmt.compute.v2016_03_30.models.VirtualHardDisk + :param image: The source user image virtual hard disk. The virtual hard + disk will be copied before being attached to the virtual machine. If + SourceImage is provided, the destination virtual hard drive must not + exist. + :type image: ~azure.mgmt.compute.v2016_03_30.models.VirtualHardDisk + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2016_03_30.models.CachingTypes + :param create_option: Required. Specifies how the virtual machine should + be created.

    Possible values are:

    **Attach** \\u2013 This + value is used when you are using a specialized disk to create the virtual + machine.

    **FromImage** \\u2013 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. Possible values include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2016_03_30.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in + gigabytes. This element can be used to overwrite the name of the disk in a + virtual machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + """ + + _validation = { + 'lun': {'required': True}, + 'name': {'required': True}, + 'vhd': {'required': True}, + 'create_option': {'required': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'vhd': {'key': 'vhd', 'type': 'VirtualHardDisk'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + } + + def __init__(self, *, lun: int, name: str, vhd, create_option, image=None, caching=None, disk_size_gb: int=None, **kwargs) -> None: + super(DataDisk, self).__init__(**kwargs) + self.lun = lun + self.name = name + self.vhd = vhd + self.image = image + self.caching = caching + self.create_option = create_option + self.disk_size_gb = disk_size_gb diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/diagnostics_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/diagnostics_profile.py index 3b584296d3a6..5a14b0394223 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/diagnostics_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/diagnostics_profile.py @@ -29,6 +29,6 @@ class DiagnosticsProfile(Model): 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnostics'}, } - def __init__(self, boot_diagnostics=None): - super(DiagnosticsProfile, self).__init__() - self.boot_diagnostics = boot_diagnostics + def __init__(self, **kwargs): + super(DiagnosticsProfile, self).__init__(**kwargs) + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/diagnostics_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/diagnostics_profile_py3.py new file mode 100644 index 000000000000..19ecbb17acbd --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/diagnostics_profile_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class DiagnosticsProfile(Model): + """Specifies the boot diagnostic settings state.

    Minimum api-version: + 2015-06-15. + + :param boot_diagnostics: Boot Diagnostics is a debugging feature which + allows you to view Console Output and Screenshot to diagnose VM status. +

    For Linux Virtual Machines, you can easily view the output of + your console log.

    For both Windows and Linux virtual machines, + Azure also enables you to see a screenshot of the VM from the hypervisor. + :type boot_diagnostics: + ~azure.mgmt.compute.v2016_03_30.models.BootDiagnostics + """ + + _attribute_map = { + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnostics'}, + } + + def __init__(self, *, boot_diagnostics=None, **kwargs) -> None: + super(DiagnosticsProfile, self).__init__(**kwargs) + self.boot_diagnostics = boot_diagnostics diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/disk_encryption_settings.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/disk_encryption_settings.py index 744da2c88271..4ccf7b295cd9 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/disk_encryption_settings.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/disk_encryption_settings.py @@ -34,8 +34,8 @@ class DiskEncryptionSettings(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, disk_encryption_key=None, key_encryption_key=None, enabled=None): - super(DiskEncryptionSettings, self).__init__() - self.disk_encryption_key = disk_encryption_key - self.key_encryption_key = key_encryption_key - self.enabled = enabled + def __init__(self, **kwargs): + super(DiskEncryptionSettings, self).__init__(**kwargs) + self.disk_encryption_key = kwargs.get('disk_encryption_key', None) + self.key_encryption_key = kwargs.get('key_encryption_key', None) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/disk_encryption_settings_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/disk_encryption_settings_py3.py new file mode 100644 index 000000000000..b88964dd19c7 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/disk_encryption_settings_py3.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 msrest.serialization import Model + + +class DiskEncryptionSettings(Model): + """Describes a Encryption Settings for a Disk. + + :param disk_encryption_key: Specifies the location of the disk encryption + key, which is a Key Vault Secret. + :type disk_encryption_key: + ~azure.mgmt.compute.v2016_03_30.models.KeyVaultSecretReference + :param key_encryption_key: Specifies the location of the key encryption + key in Key Vault. + :type key_encryption_key: + ~azure.mgmt.compute.v2016_03_30.models.KeyVaultKeyReference + :param enabled: Specifies whether disk encryption should be enabled on the + virtual machine. + :type enabled: bool + """ + + _attribute_map = { + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultKeyReference'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, disk_encryption_key=None, key_encryption_key=None, enabled: bool=None, **kwargs) -> None: + super(DiskEncryptionSettings, self).__init__(**kwargs) + self.disk_encryption_key = disk_encryption_key + self.key_encryption_key = key_encryption_key + self.enabled = enabled diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/disk_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/disk_instance_view.py index e194a345c730..50ab86fe9eca 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/disk_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/disk_instance_view.py @@ -27,7 +27,7 @@ class DiskInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, name=None, statuses=None): - super(DiskInstanceView, self).__init__() - self.name = name - self.statuses = statuses + def __init__(self, **kwargs): + super(DiskInstanceView, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/disk_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/disk_instance_view_py3.py new file mode 100644 index 000000000000..8da1a08ac029 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/disk_instance_view_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class DiskInstanceView(Model): + """The instance view of the disk. + + :param name: The disk name. + :type name: str + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2016_03_30.models.InstanceViewStatus] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, name: str=None, statuses=None, **kwargs) -> None: + super(DiskInstanceView, self).__init__(**kwargs) + self.name = name + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/hardware_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/hardware_profile.py index 07b71cbe3a97..17905f6abd8d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/hardware_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/hardware_profile.py @@ -50,6 +50,6 @@ class HardwareProfile(Model): 'vm_size': {'key': 'vmSize', 'type': 'str'}, } - def __init__(self, vm_size=None): - super(HardwareProfile, self).__init__() - self.vm_size = vm_size + def __init__(self, **kwargs): + super(HardwareProfile, self).__init__(**kwargs) + self.vm_size = kwargs.get('vm_size', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/hardware_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/hardware_profile_py3.py new file mode 100644 index 000000000000..8cabe516cb6f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/hardware_profile_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class HardwareProfile(Model): + """Specifies the hardware settings for the virtual machine. + + :param vm_size: Specifies the size of the virtual machine. For more + information about virtual machine sizes, see [Sizes for virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    The available VM sizes depend on region and availability set. For + a list of available sizes use these APIs:

    [List all available + virtual machine sizes in an availability + set](virtualmachines-list-sizes-availability-set.md)

    [List all + available virtual machine sizes in a + region](virtualmachines-list-sizes-region.md)

    [List all available + virtual machine sizes for + resizing](virtualmachines-list-sizes-for-resizing.md). Possible values + include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', + 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', + 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', + 'Standard_A10', 'Standard_A11', 'Standard_D1', 'Standard_D2', + 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', + 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', + 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', + 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', + 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', 'Standard_DS3', + 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', + 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', 'Standard_DS3_v2', + 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2', + 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', + 'Standard_DS15_v2', 'Standard_G1', 'Standard_G2', 'Standard_G3', + 'Standard_G4', 'Standard_G5', 'Standard_GS1', 'Standard_GS2', + 'Standard_GS3', 'Standard_GS4', 'Standard_GS5' + :type vm_size: str or + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineSizeTypes + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + } + + def __init__(self, *, vm_size=None, **kwargs) -> None: + super(HardwareProfile, self).__init__(**kwargs) + self.vm_size = vm_size diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/image_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/image_reference.py index 3aa6e4826ee8..d83cc00f394f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/image_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/image_reference.py @@ -43,9 +43,9 @@ class ImageReference(Model): 'version': {'key': 'version', 'type': 'str'}, } - def __init__(self, publisher=None, offer=None, sku=None, version=None): - super(ImageReference, self).__init__() - self.publisher = publisher - self.offer = offer - self.sku = sku - self.version = version + def __init__(self, **kwargs): + super(ImageReference, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.offer = kwargs.get('offer', None) + self.sku = kwargs.get('sku', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/image_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/image_reference_py3.py new file mode 100644 index 000000000000..ec4e3f91dee4 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/image_reference_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class ImageReference(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. + + :param publisher: The image publisher. + :type publisher: str + :param offer: Specifies the offer of the platform image or marketplace + image used to create the virtual machine. + :type offer: str + :param sku: The image SKU. + :type sku: str + :param 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. + :type version: str + """ + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'offer': {'key': 'offer', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, publisher: str=None, offer: str=None, sku: str=None, version: str=None, **kwargs) -> None: + super(ImageReference, self).__init__(**kwargs) + self.publisher = publisher + self.offer = offer + self.sku = sku + self.version = version diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/inner_error.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/inner_error.py index de77683e2fc8..6324249d7c19 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/inner_error.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/inner_error.py @@ -26,7 +26,7 @@ class InnerError(Model): 'errordetail': {'key': 'errordetail', 'type': 'str'}, } - def __init__(self, exceptiontype=None, errordetail=None): - super(InnerError, self).__init__() - self.exceptiontype = exceptiontype - self.errordetail = errordetail + def __init__(self, **kwargs): + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = kwargs.get('exceptiontype', None) + self.errordetail = kwargs.get('errordetail', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/inner_error_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/inner_error_py3.py new file mode 100644 index 000000000000..ccec30d7b53f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/inner_error_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class InnerError(Model): + """Inner error details. + + :param exceptiontype: The exception type. + :type exceptiontype: str + :param errordetail: The internal error message or exception dump. + :type errordetail: str + """ + + _attribute_map = { + 'exceptiontype': {'key': 'exceptiontype', 'type': 'str'}, + 'errordetail': {'key': 'errordetail', 'type': 'str'}, + } + + def __init__(self, *, exceptiontype: str=None, errordetail: str=None, **kwargs) -> None: + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = exceptiontype + self.errordetail = errordetail diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/instance_view_status.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/instance_view_status.py index f95f31593506..55af5b89ce75 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/instance_view_status.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/instance_view_status.py @@ -38,10 +38,10 @@ class InstanceViewStatus(Model): 'time': {'key': 'time', 'type': 'iso-8601'}, } - def __init__(self, code=None, level=None, display_status=None, message=None, time=None): - super(InstanceViewStatus, self).__init__() - self.code = code - self.level = level - self.display_status = display_status - self.message = message - self.time = time + def __init__(self, **kwargs): + super(InstanceViewStatus, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.level = kwargs.get('level', None) + self.display_status = kwargs.get('display_status', None) + self.message = kwargs.get('message', None) + self.time = kwargs.get('time', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/instance_view_status_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/instance_view_status_py3.py new file mode 100644 index 000000000000..87a7679454a0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/instance_view_status_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class InstanceViewStatus(Model): + """Instance view status. + + :param code: The status code. + :type code: str + :param level: The level code. Possible values include: 'Info', 'Warning', + 'Error' + :type level: str or + ~azure.mgmt.compute.v2016_03_30.models.StatusLevelTypes + :param display_status: The short localizable label for the status. + :type display_status: str + :param message: The detailed status message, including for alerts and + error messages. + :type message: str + :param time: The time of the status. + :type time: datetime + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'StatusLevelTypes'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__(self, *, code: str=None, level=None, display_status: str=None, message: str=None, time=None, **kwargs) -> None: + super(InstanceViewStatus, self).__init__(**kwargs) + self.code = code + self.level = level + self.display_status = display_status + self.message = message + self.time = time diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/key_vault_key_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/key_vault_key_reference.py index 46d74426d42e..49da8ab13dab 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/key_vault_key_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/key_vault_key_reference.py @@ -15,9 +15,13 @@ class KeyVaultKeyReference(Model): """Describes a reference to Key Vault Key. - :param key_url: The URL referencing a key encryption key in Key Vault. + All required parameters must be populated in order to send to Azure. + + :param key_url: Required. The URL referencing a key encryption key in Key + Vault. :type key_url: str - :param source_vault: The relative URL of the Key Vault containing the key. + :param source_vault: Required. The relative URL of the Key Vault + containing the key. :type source_vault: ~azure.mgmt.compute.v2016_03_30.models.SubResource """ @@ -31,7 +35,7 @@ class KeyVaultKeyReference(Model): 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, } - def __init__(self, key_url, source_vault): - super(KeyVaultKeyReference, self).__init__() - self.key_url = key_url - self.source_vault = source_vault + def __init__(self, **kwargs): + super(KeyVaultKeyReference, self).__init__(**kwargs) + self.key_url = kwargs.get('key_url', None) + self.source_vault = kwargs.get('source_vault', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/key_vault_key_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/key_vault_key_reference_py3.py new file mode 100644 index 000000000000..7b4901a56e4c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/key_vault_key_reference_py3.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 msrest.serialization import Model + + +class KeyVaultKeyReference(Model): + """Describes a reference to Key Vault Key. + + All required parameters must be populated in order to send to Azure. + + :param key_url: Required. The URL referencing a key encryption key in Key + Vault. + :type key_url: str + :param source_vault: Required. The relative URL of the Key Vault + containing the key. + :type source_vault: ~azure.mgmt.compute.v2016_03_30.models.SubResource + """ + + _validation = { + 'key_url': {'required': True}, + 'source_vault': {'required': True}, + } + + _attribute_map = { + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, + } + + def __init__(self, *, key_url: str, source_vault, **kwargs) -> None: + super(KeyVaultKeyReference, self).__init__(**kwargs) + self.key_url = key_url + self.source_vault = source_vault diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/key_vault_secret_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/key_vault_secret_reference.py index bbd96b98c1df..41102a59518b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/key_vault_secret_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/key_vault_secret_reference.py @@ -15,10 +15,12 @@ class KeyVaultSecretReference(Model): """Describes a reference to Key Vault Secret. - :param secret_url: The URL referencing a secret in a Key Vault. + All required parameters must be populated in order to send to Azure. + + :param secret_url: Required. The URL referencing a secret in a Key Vault. :type secret_url: str - :param source_vault: The relative URL of the Key Vault containing the - secret. + :param source_vault: Required. The relative URL of the Key Vault + containing the secret. :type source_vault: ~azure.mgmt.compute.v2016_03_30.models.SubResource """ @@ -32,7 +34,7 @@ class KeyVaultSecretReference(Model): 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, } - def __init__(self, secret_url, source_vault): - super(KeyVaultSecretReference, self).__init__() - self.secret_url = secret_url - self.source_vault = source_vault + def __init__(self, **kwargs): + super(KeyVaultSecretReference, self).__init__(**kwargs) + self.secret_url = kwargs.get('secret_url', None) + self.source_vault = kwargs.get('source_vault', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/key_vault_secret_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/key_vault_secret_reference_py3.py new file mode 100644 index 000000000000..18d593c7d070 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/key_vault_secret_reference_py3.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 msrest.serialization import Model + + +class KeyVaultSecretReference(Model): + """Describes a reference to Key Vault Secret. + + All required parameters must be populated in order to send to Azure. + + :param secret_url: Required. The URL referencing a secret in a Key Vault. + :type secret_url: str + :param source_vault: Required. The relative URL of the Key Vault + containing the secret. + :type source_vault: ~azure.mgmt.compute.v2016_03_30.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, **kwargs) -> None: + super(KeyVaultSecretReference, self).__init__(**kwargs) + self.secret_url = secret_url + self.source_vault = source_vault diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/linux_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/linux_configuration.py index 164095d48d01..b4d5fc4466cb 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/linux_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/linux_configuration.py @@ -33,7 +33,7 @@ class LinuxConfiguration(Model): 'ssh': {'key': 'ssh', 'type': 'SshConfiguration'}, } - def __init__(self, disable_password_authentication=None, ssh=None): - super(LinuxConfiguration, self).__init__() - self.disable_password_authentication = disable_password_authentication - self.ssh = ssh + def __init__(self, **kwargs): + super(LinuxConfiguration, self).__init__(**kwargs) + self.disable_password_authentication = kwargs.get('disable_password_authentication', None) + self.ssh = kwargs.get('ssh', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/linux_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/linux_configuration_py3.py new file mode 100644 index 000000000000..06eca3be10eb --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/linux_configuration_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class LinuxConfiguration(Model): + """Specifies the Linux operating system settings on the virtual machine. +

    For a list of supported Linux distributions, see [Linux on + Azure-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) +

    For running non-endorsed distributions, see [Information for + Non-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + + :param disable_password_authentication: Specifies whether password + authentication should be disabled. + :type disable_password_authentication: bool + :param ssh: Specifies the ssh key configuration for a Linux OS. + :type ssh: ~azure.mgmt.compute.v2016_03_30.models.SshConfiguration + """ + + _attribute_map = { + 'disable_password_authentication': {'key': 'disablePasswordAuthentication', 'type': 'bool'}, + 'ssh': {'key': 'ssh', 'type': 'SshConfiguration'}, + } + + def __init__(self, *, disable_password_authentication: bool=None, ssh=None, **kwargs) -> None: + super(LinuxConfiguration, self).__init__(**kwargs) + self.disable_password_authentication = disable_password_authentication + self.ssh = ssh diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/network_interface_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/network_interface_reference.py index 80c743c0d8e3..b86e305e3f74 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/network_interface_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/network_interface_reference.py @@ -27,6 +27,6 @@ class NetworkInterfaceReference(SubResource): 'primary': {'key': 'properties.primary', 'type': 'bool'}, } - def __init__(self, id=None, primary=None): - super(NetworkInterfaceReference, self).__init__(id=id) - self.primary = primary + def __init__(self, **kwargs): + super(NetworkInterfaceReference, self).__init__(**kwargs) + self.primary = kwargs.get('primary', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/network_interface_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/network_interface_reference_py3.py new file mode 100644 index 000000000000..f42ead50fc36 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/network_interface_reference_py3.py @@ -0,0 +1,32 @@ +# 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 .sub_resource import SubResource + + +class NetworkInterfaceReference(SubResource): + """Describes a network interface reference. + + :param id: Resource Id + :type id: str + :param primary: Specifies the primary network interface in case the + virtual machine has more than 1 network interface. + :type primary: bool + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + } + + def __init__(self, *, id: str=None, primary: bool=None, **kwargs) -> None: + super(NetworkInterfaceReference, self).__init__(id=id, **kwargs) + self.primary = primary diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/network_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/network_profile.py index 0d975b416184..e4379407b005 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/network_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/network_profile.py @@ -25,6 +25,6 @@ class NetworkProfile(Model): 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceReference]'}, } - def __init__(self, network_interfaces=None): - super(NetworkProfile, self).__init__() - self.network_interfaces = network_interfaces + def __init__(self, **kwargs): + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/network_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/network_profile_py3.py new file mode 100644 index 000000000000..9ff2f4071b94 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/network_profile_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkProfile(Model): + """Specifies the network interfaces of the virtual machine. + + :param network_interfaces: Specifies the list of resource Ids for the + network interfaces associated with the virtual machine. + :type network_interfaces: + list[~azure.mgmt.compute.v2016_03_30.models.NetworkInterfaceReference] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceReference]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = network_interfaces diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/operation_status_response.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/operation_status_response.py index e95e0c121b6e..df6f59201253 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/operation_status_response.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/operation_status_response.py @@ -46,8 +46,8 @@ class OperationStatusResponse(Model): 'error': {'key': 'error', 'type': 'ApiError'}, } - def __init__(self): - super(OperationStatusResponse, self).__init__() + def __init__(self, **kwargs): + super(OperationStatusResponse, self).__init__(**kwargs) self.name = None self.status = None self.start_time = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/operation_status_response_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/operation_status_response_py3.py new file mode 100644 index 000000000000..3322243b174b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/operation_status_response_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class OperationStatusResponse(Model): + """Operation status response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation ID + :vartype name: str + :ivar status: Operation status + :vartype status: str + :ivar start_time: Start time of the operation + :vartype start_time: datetime + :ivar end_time: End time of the operation + :vartype end_time: datetime + :ivar error: Api error + :vartype error: ~azure.mgmt.compute.v2016_03_30.models.ApiError + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationStatusResponse, self).__init__(**kwargs) + self.name = None + self.status = None + self.start_time = None + self.end_time = None + self.error = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_disk.py index 37e285d35a6e..459ddcd37863 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_disk.py @@ -18,6 +18,8 @@ class OSDisk(Model): VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + All required parameters must be populated in order to send to Azure. + :param 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** @@ -28,9 +30,9 @@ class OSDisk(Model): Disk.

    Minimum api-version: 2015-06-15 :type encryption_settings: ~azure.mgmt.compute.v2016_03_30.models.DiskEncryptionSettings - :param name: The disk name. + :param name: Required. The disk name. :type name: str - :param vhd: The virtual hard disk. + :param vhd: Required. The virtual hard disk. :type vhd: ~azure.mgmt.compute.v2016_03_30.models.VirtualHardDisk :param image: The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If @@ -42,8 +44,8 @@ class OSDisk(Model):

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2016_03_30.models.CachingTypes - :param create_option: Specifies how the virtual machine should be - created.

    Possible values are:

    **Attach** \\u2013 This + :param create_option: Required. Specifies how the virtual machine should + be created.

    Possible values are:

    **Attach** \\u2013 This value is used when you are using a specialized disk to create the virtual machine.

    **FromImage** \\u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform @@ -75,13 +77,13 @@ class OSDisk(Model): 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, } - def __init__(self, name, vhd, create_option, os_type=None, encryption_settings=None, image=None, caching=None, disk_size_gb=None): - super(OSDisk, self).__init__() - self.os_type = os_type - self.encryption_settings = encryption_settings - self.name = name - self.vhd = vhd - self.image = image - self.caching = caching - self.create_option = create_option - self.disk_size_gb = disk_size_gb + def __init__(self, **kwargs): + super(OSDisk, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.encryption_settings = kwargs.get('encryption_settings', None) + self.name = kwargs.get('name', None) + self.vhd = kwargs.get('vhd', None) + self.image = kwargs.get('image', None) + self.caching = kwargs.get('caching', None) + self.create_option = kwargs.get('create_option', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_disk_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_disk_image.py index 32781b2a504e..339628798b5f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_disk_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_disk_image.py @@ -15,8 +15,10 @@ class OSDiskImage(Model): """Contains the os disk image information. - :param operating_system: The operating system of the osDiskImage. Possible - values include: 'Windows', 'Linux' + All required parameters must be populated in order to send to Azure. + + :param operating_system: Required. The operating system of the + osDiskImage. Possible values include: 'Windows', 'Linux' :type operating_system: str or ~azure.mgmt.compute.v2016_03_30.models.OperatingSystemTypes """ @@ -29,6 +31,6 @@ class OSDiskImage(Model): 'operating_system': {'key': 'operatingSystem', 'type': 'OperatingSystemTypes'}, } - def __init__(self, operating_system): - super(OSDiskImage, self).__init__() - self.operating_system = operating_system + def __init__(self, **kwargs): + super(OSDiskImage, self).__init__(**kwargs) + self.operating_system = kwargs.get('operating_system', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_disk_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_disk_image_py3.py new file mode 100644 index 000000000000..cab289838bad --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_disk_image_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class OSDiskImage(Model): + """Contains the os disk image information. + + All required parameters must be populated in order to send to Azure. + + :param operating_system: Required. The operating system of the + osDiskImage. Possible values include: 'Windows', 'Linux' + :type operating_system: str or + ~azure.mgmt.compute.v2016_03_30.models.OperatingSystemTypes + """ + + _validation = { + 'operating_system': {'required': True}, + } + + _attribute_map = { + 'operating_system': {'key': 'operatingSystem', 'type': 'OperatingSystemTypes'}, + } + + def __init__(self, *, operating_system, **kwargs) -> None: + super(OSDiskImage, self).__init__(**kwargs) + self.operating_system = operating_system diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_disk_py3.py new file mode 100644 index 000000000000..fb52bdcd3e5b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_disk_py3.py @@ -0,0 +1,89 @@ +# 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 msrest.serialization import Model + + +class OSDisk(Model): + """Specifies information about the operating system disk used by the virtual + machine.

    For more information about disks, see [About disks and + VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + + All required parameters must be populated in order to send to Azure. + + :param 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**. Possible values include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2016_03_30.models.OperatingSystemTypes + :param encryption_settings: Specifies the encryption settings for the OS + Disk.

    Minimum api-version: 2015-06-15 + :type encryption_settings: + ~azure.mgmt.compute.v2016_03_30.models.DiskEncryptionSettings + :param name: Required. The disk name. + :type name: str + :param vhd: Required. The virtual hard disk. + :type vhd: ~azure.mgmt.compute.v2016_03_30.models.VirtualHardDisk + :param image: The source user image virtual hard disk. The virtual hard + disk will be copied before being attached to the virtual machine. If + SourceImage is provided, the destination virtual hard drive must not + exist. + :type image: ~azure.mgmt.compute.v2016_03_30.models.VirtualHardDisk + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2016_03_30.models.CachingTypes + :param create_option: Required. Specifies how the virtual machine should + be created.

    Possible values are:

    **Attach** \\u2013 This + value is used when you are using a specialized disk to create the virtual + machine.

    **FromImage** \\u2013 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. Possible values include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2016_03_30.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in + gigabytes. This element can be used to overwrite the name of the disk in a + virtual machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + """ + + _validation = { + 'name': {'required': True}, + 'vhd': {'required': True}, + 'create_option': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': 'DiskEncryptionSettings'}, + 'name': {'key': 'name', 'type': 'str'}, + 'vhd': {'key': 'vhd', 'type': 'VirtualHardDisk'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + } + + def __init__(self, *, name: str, vhd, create_option, os_type=None, encryption_settings=None, image=None, caching=None, disk_size_gb: int=None, **kwargs) -> None: + super(OSDisk, self).__init__(**kwargs) + self.os_type = os_type + self.encryption_settings = encryption_settings + self.name = name + self.vhd = vhd + self.image = image + self.caching = caching + self.create_option = create_option + self.disk_size_gb = disk_size_gb diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_profile.py index 59bbafcb3c25..402a51fdb0ba 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_profile.py @@ -88,12 +88,12 @@ class OSProfile(Model): 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, } - def __init__(self, computer_name=None, admin_username=None, admin_password=None, custom_data=None, windows_configuration=None, linux_configuration=None, secrets=None): - super(OSProfile, self).__init__() - self.computer_name = computer_name - 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 + def __init__(self, **kwargs): + super(OSProfile, self).__init__(**kwargs) + self.computer_name = kwargs.get('computer_name', None) + self.admin_username = kwargs.get('admin_username', None) + self.admin_password = kwargs.get('admin_password', None) + self.custom_data = kwargs.get('custom_data', None) + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + self.secrets = kwargs.get('secrets', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_profile_py3.py new file mode 100644 index 000000000000..95126a01d37b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/os_profile_py3.py @@ -0,0 +1,99 @@ +# 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 msrest.serialization import Model + + +class OSProfile(Model): + """Specifies the operating system settings for the virtual machine. + + :param computer_name: Specifies the host OS name of the virtual machine. +

    **Max-length (Windows):** 15 characters

    **Max-length + (Linux):** 64 characters.

    For naming conventions and restrictions + see [Azure infrastructure services implementation + guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + :type computer_name: str + :param admin_username: Specifies the name of the administrator account. +

    **Windows-only restriction:** Cannot end in "."

    + **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".

    **Minimum-length (Linux):** 1 + character

    **Max-length (Linux):** 64 characters

    + **Max-length (Windows):** 20 characters

  • For root access to + the Linux VM, see [Using root privileges on Linux virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + For a list of built-in system users on Linux that should not be used in + this field, see [Selecting User Names for Linux on + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type admin_username: str + :param admin_password: Specifies the password of the administrator + account.

    **Minimum-length (Windows):** 8 characters

    + **Minimum-length (Linux):** 6 characters

    **Max-length + (Windows):** 123 characters

    **Max-length (Linux):** 72 characters +

    **Complexity requirements:** 3 out of 4 conditions below need to + be fulfilled
    Has lower characters
    Has upper characters
    Has a + digit
    Has a special character (Regex match [\\W_])

    + **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + "iloveyou!"

    For resetting the password, see [How to reset the + Remote Desktop service or its login password in a Windows + VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    For resetting root password, see [Manage users, SSH, and check or + repair disks on Azure Linux VMs using the VMAccess + Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + :type admin_password: str + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type custom_data: str + :param windows_configuration: Specifies Windows operating system settings + on the virtual machine. + :type windows_configuration: + ~azure.mgmt.compute.v2016_03_30.models.WindowsConfiguration + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) +

    For running non-endorsed distributions, see [Information for + Non-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + :type linux_configuration: + ~azure.mgmt.compute.v2016_03_30.models.LinuxConfiguration + :param secrets: Specifies set of certificates that should be installed + onto the virtual machine. + :type secrets: + list[~azure.mgmt.compute.v2016_03_30.models.VaultSecretGroup] + """ + + _attribute_map = { + 'computer_name': {'key': 'computerName', '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]'}, + } + + def __init__(self, *, computer_name: str=None, admin_username: str=None, admin_password: str=None, custom_data: str=None, windows_configuration=None, linux_configuration=None, secrets=None, **kwargs) -> None: + super(OSProfile, self).__init__(**kwargs) + self.computer_name = computer_name + 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 diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/plan.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/plan.py index 772160aef635..d42b6b32cfac 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/plan.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/plan.py @@ -38,9 +38,9 @@ class Plan(Model): 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, } - def __init__(self, name=None, publisher=None, product=None, promotion_code=None): - super(Plan, self).__init__() - self.name = name - self.publisher = publisher - self.product = product - self.promotion_code = promotion_code + def __init__(self, **kwargs): + super(Plan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/plan_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/plan_py3.py new file mode 100644 index 000000000000..9cca2c78a123 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/plan_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class Plan(Model): + """Specifies information about the marketplace image used to create the + virtual machine. This element is only used for marketplace images. Before + you can use a marketplace image from an API, you must enable the image for + programmatic use. In the Azure portal, find the marketplace image that you + want to use and then click **Want to deploy programmatically, Get Started + ->**. Enter any required information and then click **Save**. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: Specifies the product of the image from the marketplace. + This is the same value as Offer under the imageReference element. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, publisher: str=None, product: str=None, promotion_code: str=None, **kwargs) -> None: + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/purchase_plan.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/purchase_plan.py index aa29cb02ab78..2e1509addca6 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/purchase_plan.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/purchase_plan.py @@ -16,12 +16,15 @@ class PurchasePlan(Model): """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - :param publisher: The publisher ID. + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The publisher ID. :type publisher: str - :param name: The plan ID. + :param name: Required. The plan ID. :type name: str - :param product: Specifies the product of the image from the marketplace. - This is the same value as Offer under the imageReference element. + :param product: Required. Specifies the product of the image from the + marketplace. This is the same value as Offer under the imageReference + element. :type product: str """ @@ -37,8 +40,8 @@ class PurchasePlan(Model): 'product': {'key': 'product', 'type': 'str'}, } - def __init__(self, publisher, name, product): - super(PurchasePlan, self).__init__() - self.publisher = publisher - self.name = name - self.product = product + def __init__(self, **kwargs): + super(PurchasePlan, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.name = kwargs.get('name', None) + self.product = kwargs.get('product', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/purchase_plan_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/purchase_plan_py3.py new file mode 100644 index 000000000000..26f7996f1633 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/purchase_plan_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class PurchasePlan(Model): + """Used for establishing the purchase context of any 3rd Party artifact + through MarketPlace. + + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The publisher ID. + :type publisher: str + :param name: Required. The plan ID. + :type name: str + :param product: Required. Specifies the product of the image from the + marketplace. This is the same value as Offer under the imageReference + element. + :type product: str + """ + + _validation = { + 'publisher': {'required': True}, + 'name': {'required': True}, + 'product': {'required': True}, + } + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__(self, *, publisher: str, name: str, product: str, **kwargs) -> None: + super(PurchasePlan, self).__init__(**kwargs) + self.publisher = publisher + self.name = name + self.product = product diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/resource.py index 10269b591c68..5dd7d481c685 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/resource.py @@ -18,13 +18,15 @@ class Resource(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -45,10 +47,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/resource_py3.py new file mode 100644 index 000000000000..2f3702caf609 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/resource_py3.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/sku.py index 16755dc57b65..5c07709435e0 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/sku.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/sku.py @@ -31,8 +31,8 @@ class Sku(Model): 'capacity': {'key': 'capacity', 'type': 'long'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(Sku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/sku_py3.py new file mode 100644 index 000000000000..f6bc74afaadc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/sku_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class Sku(Model): + """Describes a virtual machine scale set sku. + + :param name: The sku name. + :type name: str + :param tier: Specifies the tier of virtual machines in a scale set.

    Possible Values:

    **Standard**

    **Basic** + :type tier: str + :param capacity: Specifies the number of virtual machines in the scale + set. + :type capacity: long + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'long'}, + } + + def __init__(self, *, name: str=None, tier: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/ssh_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/ssh_configuration.py index 9118faa234b5..395706d1acab 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/ssh_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/ssh_configuration.py @@ -25,6 +25,6 @@ class SshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[SshPublicKey]'}, } - def __init__(self, public_keys=None): - super(SshConfiguration, self).__init__() - self.public_keys = public_keys + def __init__(self, **kwargs): + super(SshConfiguration, self).__init__(**kwargs) + self.public_keys = kwargs.get('public_keys', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/ssh_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/ssh_configuration_py3.py new file mode 100644 index 000000000000..3baef3ba47d6 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/ssh_configuration_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SshConfiguration(Model): + """SSH configuration for Linux based VMs running on Azure. + + :param public_keys: The list of SSH public keys used to authenticate with + linux based VMs. + :type public_keys: + list[~azure.mgmt.compute.v2016_03_30.models.SshPublicKey] + """ + + _attribute_map = { + 'public_keys': {'key': 'publicKeys', 'type': '[SshPublicKey]'}, + } + + def __init__(self, *, public_keys=None, **kwargs) -> None: + super(SshConfiguration, self).__init__(**kwargs) + self.public_keys = public_keys diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/ssh_public_key.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/ssh_public_key.py index 2fe6756641cb..122e0d3b9fdd 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/ssh_public_key.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/ssh_public_key.py @@ -33,7 +33,7 @@ class SshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, path=None, key_data=None): - super(SshPublicKey, self).__init__() - self.path = path - self.key_data = key_data + def __init__(self, **kwargs): + super(SshPublicKey, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.key_data = kwargs.get('key_data', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/ssh_public_key_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/ssh_public_key_py3.py new file mode 100644 index 000000000000..b16ee085b36b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/ssh_public_key_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class SshPublicKey(Model): + """Contains information about SSH certificate public key and the path on the + Linux VM where the public key is placed. + + :param 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 + :type path: str + :param 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/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + :type key_data: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'key_data': {'key': 'keyData', 'type': 'str'}, + } + + def __init__(self, *, path: str=None, key_data: str=None, **kwargs) -> None: + super(SshPublicKey, self).__init__(**kwargs) + self.path = path + self.key_data = key_data diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/storage_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/storage_profile.py index 729b6117b260..615d641cfba0 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/storage_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/storage_profile.py @@ -40,8 +40,8 @@ class StorageProfile(Model): 'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'}, } - def __init__(self, image_reference=None, os_disk=None, data_disks=None): - super(StorageProfile, self).__init__() - self.image_reference = image_reference - self.os_disk = os_disk - self.data_disks = data_disks + def __init__(self, **kwargs): + super(StorageProfile, self).__init__(**kwargs) + self.image_reference = kwargs.get('image_reference', None) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/storage_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/storage_profile_py3.py new file mode 100644 index 000000000000..8269e4309aa0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/storage_profile_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class StorageProfile(Model): + """Specifies the storage settings for the virtual machine disks. + + :param 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. + :type image_reference: + ~azure.mgmt.compute.v2016_03_30.models.ImageReference + :param os_disk: Specifies information about the operating system disk used + by the virtual machine.

    For more information about disks, see + [About disks and VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type os_disk: ~azure.mgmt.compute.v2016_03_30.models.OSDisk + :param data_disks: Specifies the parameters that are used to add a data + disk to a virtual machine.

    For more information about disks, see + [About disks and VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type data_disks: list[~azure.mgmt.compute.v2016_03_30.models.DataDisk] + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'OSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'}, + } + + def __init__(self, *, image_reference=None, os_disk=None, data_disks=None, **kwargs) -> None: + super(StorageProfile, self).__init__(**kwargs) + self.image_reference = image_reference + self.os_disk = os_disk + self.data_disks = data_disks diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/sub_resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/sub_resource.py index b32875f54c8e..11e092cc6ff5 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/sub_resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/sub_resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/sub_resource_py3.py new file mode 100644 index 000000000000..29e5afee38f9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class SubResource(Model): + """SubResource. + + :param id: Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/upgrade_policy.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/upgrade_policy.py index c5fa94054994..63a0f512d34c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/upgrade_policy.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/upgrade_policy.py @@ -28,6 +28,6 @@ class UpgradePolicy(Model): 'mode': {'key': 'mode', 'type': 'UpgradeMode'}, } - def __init__(self, mode=None): - super(UpgradePolicy, self).__init__() - self.mode = mode + def __init__(self, **kwargs): + super(UpgradePolicy, self).__init__(**kwargs) + self.mode = kwargs.get('mode', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/upgrade_policy_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/upgrade_policy_py3.py new file mode 100644 index 000000000000..a373104ad975 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/upgrade_policy_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class UpgradePolicy(Model): + """Describes an upgrade policy - automatic or manual. + + :param mode: Specifies the mode of an upgrade to virtual machines in the + scale set.

    Possible values are:

    **Manual** - You + control the application of updates to virtual machines in the scale set. + You do this by using the manualUpgrade action.

    **Automatic** - + All virtual machines in the scale set are automatically updated at the + same time. Possible values include: 'Automatic', 'Manual' + :type mode: str or ~azure.mgmt.compute.v2016_03_30.models.UpgradeMode + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'UpgradeMode'}, + } + + def __init__(self, *, mode=None, **kwargs) -> None: + super(UpgradePolicy, self).__init__(**kwargs) + self.mode = mode diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/usage.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/usage.py index df47b2b4eee2..23badd7cd3dc 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/usage.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/usage.py @@ -18,14 +18,16 @@ class Usage(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar unit: An enum describing the unit of usage measurement. Default - value: "Count" . + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of usage measurement. + Default value: "Count" . :vartype unit: str - :param current_value: The current usage of the resource. + :param current_value: Required. The current usage of the resource. :type current_value: int - :param limit: The maximum permitted usage of the resource. + :param limit: Required. The maximum permitted usage of the resource. :type limit: long - :param name: The name of the type of usage. + :param name: Required. The name of the type of usage. :type name: ~azure.mgmt.compute.v2016_03_30.models.UsageName """ @@ -45,8 +47,8 @@ class Usage(Model): unit = "Count" - def __init__(self, current_value, limit, name): - super(Usage, self).__init__() - self.current_value = current_value - self.limit = limit - self.name = name + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/usage_name.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/usage_name.py index 799c1f896da3..e2560936493e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/usage_name.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/usage_name.py @@ -26,7 +26,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(UsageName, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/usage_name_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/usage_name_py3.py new file mode 100644 index 000000000000..ad0b77459f75 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class UsageName(Model): + """The Usage Names. + + :param value: The name of the resource. + :type value: str + :param localized_value: The localized name of the resource. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/usage_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/usage_py3.py new file mode 100644 index 000000000000..f72ece5f6adc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/usage_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class Usage(Model): + """Describes Compute Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of usage measurement. + Default value: "Count" . + :vartype unit: str + :param current_value: Required. The current usage of the resource. + :type current_value: int + :param limit: Required. The maximum permitted usage of the resource. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.compute.v2016_03_30.models.UsageName + """ + + _validation = { + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__(self, *, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/vault_certificate.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/vault_certificate.py index 8d4d05955de4..b173def6f820 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/vault_certificate.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/vault_certificate.py @@ -40,7 +40,7 @@ class VaultCertificate(Model): 'certificate_store': {'key': 'certificateStore', 'type': 'str'}, } - def __init__(self, certificate_url=None, certificate_store=None): - super(VaultCertificate, self).__init__() - self.certificate_url = certificate_url - self.certificate_store = certificate_store + def __init__(self, **kwargs): + super(VaultCertificate, self).__init__(**kwargs) + self.certificate_url = kwargs.get('certificate_url', None) + self.certificate_store = kwargs.get('certificate_store', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/vault_certificate_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/vault_certificate_py3.py new file mode 100644 index 000000000000..eda5ba1c3f1d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/vault_certificate_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VaultCertificate(Model): + """Describes a single certificate reference in a Key Vault, and where the + certificate should reside on the VM. + + :param 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](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + In this case, your certificate needs to be It is the Base64 encoding of + the following JSON Object which is encoded in UTF-8:

    {
    + "data":"",
    "dataType":"pfx",
    + "password":""
    } + :type certificate_url: str + :param 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 .crt + for the X509 certificate file and .prv for private + key. Both of these files are .pem formatted. + :type certificate_store: str + """ + + _attribute_map = { + 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, + 'certificate_store': {'key': 'certificateStore', 'type': 'str'}, + } + + def __init__(self, *, certificate_url: str=None, certificate_store: str=None, **kwargs) -> None: + super(VaultCertificate, self).__init__(**kwargs) + self.certificate_url = certificate_url + self.certificate_store = certificate_store diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/vault_secret_group.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/vault_secret_group.py index 5a20bd24b0f9..4ac926d6bfce 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/vault_secret_group.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/vault_secret_group.py @@ -29,7 +29,7 @@ class VaultSecretGroup(Model): 'vault_certificates': {'key': 'vaultCertificates', 'type': '[VaultCertificate]'}, } - def __init__(self, source_vault=None, vault_certificates=None): - super(VaultSecretGroup, self).__init__() - self.source_vault = source_vault - self.vault_certificates = vault_certificates + def __init__(self, **kwargs): + super(VaultSecretGroup, self).__init__(**kwargs) + self.source_vault = kwargs.get('source_vault', None) + self.vault_certificates = kwargs.get('vault_certificates', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/vault_secret_group_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/vault_secret_group_py3.py new file mode 100644 index 000000000000..2c5ed2bc445f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/vault_secret_group_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class VaultSecretGroup(Model): + """Describes a set of certificates which are all in the same Key Vault. + + :param source_vault: The relative URL of the Key Vault containing all of + the certificates in VaultCertificates. + :type source_vault: ~azure.mgmt.compute.v2016_03_30.models.SubResource + :param vault_certificates: The list of key vault references in SourceVault + which contain certificates. + :type vault_certificates: + list[~azure.mgmt.compute.v2016_03_30.models.VaultCertificate] + """ + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, + 'vault_certificates': {'key': 'vaultCertificates', 'type': '[VaultCertificate]'}, + } + + def __init__(self, *, source_vault=None, vault_certificates=None, **kwargs) -> None: + super(VaultSecretGroup, self).__init__(**kwargs) + self.source_vault = source_vault + self.vault_certificates = vault_certificates diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_hard_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_hard_disk.py index af1725d302af..5e3ad9dea7d4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_hard_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_hard_disk.py @@ -23,6 +23,6 @@ class VirtualHardDisk(Model): 'uri': {'key': 'uri', 'type': 'str'}, } - def __init__(self, uri=None): - super(VirtualHardDisk, self).__init__() - self.uri = uri + def __init__(self, **kwargs): + super(VirtualHardDisk, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_hard_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_hard_disk_py3.py new file mode 100644 index 000000000000..9c069b95f084 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_hard_disk_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class VirtualHardDisk(Model): + """Describes the uri of a disk. + + :param uri: Specifies the virtual hard disk's uri. + :type uri: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__(self, *, uri: str=None, **kwargs) -> None: + super(VirtualHardDisk, self).__init__(**kwargs) + self.uri = uri diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine.py index 219504cd411f..d29189e2bbdd 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine.py @@ -18,13 +18,15 @@ class VirtualMachine(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -127,18 +129,18 @@ class VirtualMachine(Resource): 'identity': {'key': 'identity', 'type': 'VirtualMachineIdentity'}, } - def __init__(self, location, tags=None, plan=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type=None, identity=None): - super(VirtualMachine, self).__init__(location=location, tags=tags) - self.plan = plan - self.hardware_profile = hardware_profile - self.storage_profile = storage_profile - self.os_profile = os_profile - self.network_profile = network_profile - self.diagnostics_profile = diagnostics_profile - self.availability_set = availability_set + def __init__(self, **kwargs): + super(VirtualMachine, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.os_profile = kwargs.get('os_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.availability_set = kwargs.get('availability_set', None) self.provisioning_state = None self.instance_view = None - self.license_type = license_type + self.license_type = kwargs.get('license_type', None) self.vm_id = None self.resources = None - self.identity = identity + self.identity = kwargs.get('identity', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_agent_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_agent_instance_view.py index 9b7a049d113d..f494261e2b6d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_agent_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_agent_instance_view.py @@ -32,8 +32,8 @@ class VirtualMachineAgentInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, vm_agent_version=None, extension_handlers=None, statuses=None): - super(VirtualMachineAgentInstanceView, self).__init__() - self.vm_agent_version = vm_agent_version - self.extension_handlers = extension_handlers - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineAgentInstanceView, self).__init__(**kwargs) + self.vm_agent_version = kwargs.get('vm_agent_version', None) + self.extension_handlers = kwargs.get('extension_handlers', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_agent_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_agent_instance_view_py3.py new file mode 100644 index 000000000000..fae6ce1c0a9f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_agent_instance_view_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineAgentInstanceView(Model): + """The instance view of the VM Agent running on the virtual machine. + + :param vm_agent_version: The VM Agent full version. + :type vm_agent_version: str + :param extension_handlers: The virtual machine extension handler instance + view. + :type extension_handlers: + list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtensionHandlerInstanceView] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2016_03_30.models.InstanceViewStatus] + """ + + _attribute_map = { + 'vm_agent_version': {'key': 'vmAgentVersion', 'type': 'str'}, + 'extension_handlers': {'key': 'extensionHandlers', 'type': '[VirtualMachineExtensionHandlerInstanceView]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, vm_agent_version: str=None, extension_handlers=None, statuses=None, **kwargs) -> None: + super(VirtualMachineAgentInstanceView, self).__init__(**kwargs) + self.vm_agent_version = vm_agent_version + self.extension_handlers = extension_handlers + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_capture_parameters.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_capture_parameters.py index b406f387ffed..4e6ffbea7a4f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_capture_parameters.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_capture_parameters.py @@ -15,12 +15,15 @@ class VirtualMachineCaptureParameters(Model): """Capture Virtual Machine parameters. - :param vhd_prefix: The captured virtual hard disk's name prefix. + All required parameters must be populated in order to send to Azure. + + :param vhd_prefix: Required. The captured virtual hard disk's name prefix. :type vhd_prefix: str - :param destination_container_name: The destination container name. + :param destination_container_name: Required. The destination container + name. :type destination_container_name: str - :param overwrite_vhds: Specifies whether to overwrite the destination - virtual hard disk, in case of conflict. + :param overwrite_vhds: Required. Specifies whether to overwrite the + destination virtual hard disk, in case of conflict. :type overwrite_vhds: bool """ @@ -36,8 +39,8 @@ class VirtualMachineCaptureParameters(Model): 'overwrite_vhds': {'key': 'overwriteVhds', 'type': 'bool'}, } - def __init__(self, vhd_prefix, destination_container_name, overwrite_vhds): - super(VirtualMachineCaptureParameters, self).__init__() - self.vhd_prefix = vhd_prefix - self.destination_container_name = destination_container_name - self.overwrite_vhds = overwrite_vhds + def __init__(self, **kwargs): + super(VirtualMachineCaptureParameters, self).__init__(**kwargs) + self.vhd_prefix = kwargs.get('vhd_prefix', None) + self.destination_container_name = kwargs.get('destination_container_name', None) + self.overwrite_vhds = kwargs.get('overwrite_vhds', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_capture_parameters_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_capture_parameters_py3.py new file mode 100644 index 000000000000..1866cdc23300 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_capture_parameters_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineCaptureParameters(Model): + """Capture Virtual Machine parameters. + + All required parameters must be populated in order to send to Azure. + + :param vhd_prefix: Required. The captured virtual hard disk's name prefix. + :type vhd_prefix: str + :param destination_container_name: Required. The destination container + name. + :type destination_container_name: str + :param overwrite_vhds: Required. Specifies whether to overwrite the + destination virtual hard disk, in case of conflict. + :type overwrite_vhds: bool + """ + + _validation = { + 'vhd_prefix': {'required': True}, + 'destination_container_name': {'required': True}, + 'overwrite_vhds': {'required': True}, + } + + _attribute_map = { + 'vhd_prefix': {'key': 'vhdPrefix', 'type': 'str'}, + 'destination_container_name': {'key': 'destinationContainerName', 'type': 'str'}, + 'overwrite_vhds': {'key': 'overwriteVhds', 'type': 'bool'}, + } + + def __init__(self, *, vhd_prefix: str, destination_container_name: str, overwrite_vhds: bool, **kwargs) -> None: + super(VirtualMachineCaptureParameters, self).__init__(**kwargs) + self.vhd_prefix = vhd_prefix + self.destination_container_name = destination_container_name + self.overwrite_vhds = overwrite_vhds diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_capture_result.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_capture_result.py index 95e26a427e83..2b0df7406a34 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_capture_result.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_capture_result.py @@ -26,6 +26,6 @@ class VirtualMachineCaptureResult(SubResource): 'output': {'key': 'properties.output', 'type': 'object'}, } - def __init__(self, id=None, output=None): - super(VirtualMachineCaptureResult, self).__init__(id=id) - self.output = output + def __init__(self, **kwargs): + super(VirtualMachineCaptureResult, self).__init__(**kwargs) + self.output = kwargs.get('output', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_capture_result_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_capture_result_py3.py new file mode 100644 index 000000000000..da449b8e9154 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_capture_result_py3.py @@ -0,0 +1,31 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineCaptureResult(SubResource): + """Resource Id. + + :param id: Resource Id + :type id: str + :param output: Operation output data (raw JSON) + :type output: object + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'output': {'key': 'properties.output', 'type': 'object'}, + } + + def __init__(self, *, id: str=None, output=None, **kwargs) -> None: + super(VirtualMachineCaptureResult, self).__init__(id=id, **kwargs) + self.output = output diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension.py index 4f5ab4e8bd1c..5bd629a0f880 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension.py @@ -18,13 +18,15 @@ class VirtualMachineExtension(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -82,14 +84,14 @@ class VirtualMachineExtension(Resource): 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineExtensionInstanceView'}, } - def __init__(self, location, tags=None, force_update_tag=None, publisher=None, virtual_machine_extension_type=None, type_handler_version=None, auto_upgrade_minor_version=None, settings=None, protected_settings=None, instance_view=None): - super(VirtualMachineExtension, self).__init__(location=location, tags=tags) - self.force_update_tag = force_update_tag - self.publisher = publisher - self.virtual_machine_extension_type = virtual_machine_extension_type - self.type_handler_version = type_handler_version - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings + def __init__(self, **kwargs): + super(VirtualMachineExtension, self).__init__(**kwargs) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.virtual_machine_extension_type = kwargs.get('virtual_machine_extension_type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) self.provisioning_state = None - self.instance_view = instance_view + self.instance_view = kwargs.get('instance_view', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_handler_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_handler_instance_view.py index c1ebc96715eb..796327c6e98c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_handler_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_handler_instance_view.py @@ -30,8 +30,8 @@ class VirtualMachineExtensionHandlerInstanceView(Model): 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, } - def __init__(self, type=None, type_handler_version=None, status=None): - super(VirtualMachineExtensionHandlerInstanceView, self).__init__() - self.type = type - self.type_handler_version = type_handler_version - self.status = status + def __init__(self, **kwargs): + super(VirtualMachineExtensionHandlerInstanceView, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.status = kwargs.get('status', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_handler_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_handler_instance_view_py3.py new file mode 100644 index 000000000000..0c9a6da30f09 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_handler_instance_view_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineExtensionHandlerInstanceView(Model): + """The instance view of a virtual machine extension handler. + + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param status: The extension handler status. + :type status: ~azure.mgmt.compute.v2016_03_30.models.InstanceViewStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, + } + + def __init__(self, *, type: str=None, type_handler_version: str=None, status=None, **kwargs) -> None: + super(VirtualMachineExtensionHandlerInstanceView, self).__init__(**kwargs) + self.type = type + self.type_handler_version = type_handler_version + self.status = status diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_image.py index 7614699a78da..7273e2b84754 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_image.py @@ -18,23 +18,26 @@ class VirtualMachineExtensionImage(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param operating_system: The operating system this extension supports. - :type operating_system: str - :param compute_role: The type of role (IaaS or PaaS) this extension + :param operating_system: Required. The operating system this extension supports. + :type operating_system: str + :param compute_role: Required. The type of role (IaaS or PaaS) this + extension supports. :type compute_role: str - :param handler_schema: The schema defined by publisher, where extension - consumers should provide settings in a matching schema. + :param handler_schema: Required. The schema defined by publisher, where + extension consumers should provide settings in a matching schema. :type handler_schema: str :param vm_scale_set_enabled: Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but @@ -69,10 +72,10 @@ class VirtualMachineExtensionImage(Resource): 'supports_multiple_extensions': {'key': 'properties.supportsMultipleExtensions', 'type': 'bool'}, } - def __init__(self, location, operating_system, compute_role, handler_schema, tags=None, vm_scale_set_enabled=None, supports_multiple_extensions=None): - super(VirtualMachineExtensionImage, self).__init__(location=location, tags=tags) - self.operating_system = operating_system - self.compute_role = compute_role - self.handler_schema = handler_schema - self.vm_scale_set_enabled = vm_scale_set_enabled - self.supports_multiple_extensions = supports_multiple_extensions + def __init__(self, **kwargs): + super(VirtualMachineExtensionImage, self).__init__(**kwargs) + self.operating_system = kwargs.get('operating_system', None) + self.compute_role = kwargs.get('compute_role', None) + self.handler_schema = kwargs.get('handler_schema', None) + self.vm_scale_set_enabled = kwargs.get('vm_scale_set_enabled', None) + self.supports_multiple_extensions = kwargs.get('supports_multiple_extensions', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_image_py3.py new file mode 100644 index 000000000000..217accab02f0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_image_py3.py @@ -0,0 +1,81 @@ +# 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 .resource import Resource + + +class VirtualMachineExtensionImage(Resource): + """Describes a Virtual Machine Extension Image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param operating_system: Required. The operating system this extension + supports. + :type operating_system: str + :param compute_role: Required. The type of role (IaaS or PaaS) this + extension supports. + :type compute_role: str + :param handler_schema: Required. The schema defined by publisher, where + extension consumers should provide settings in a matching schema. + :type handler_schema: str + :param vm_scale_set_enabled: Whether the extension can be used on xRP + VMScaleSets. By default existing extensions are usable on scalesets, but + there might be cases where a publisher wants to explicitly indicate the + extension is only enabled for CRP VMs but not VMSS. + :type vm_scale_set_enabled: bool + :param supports_multiple_extensions: Whether the handler can support + multiple extensions. + :type supports_multiple_extensions: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'operating_system': {'required': True}, + 'compute_role': {'required': True}, + 'handler_schema': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'operating_system': {'key': 'properties.operatingSystem', 'type': 'str'}, + 'compute_role': {'key': 'properties.computeRole', 'type': 'str'}, + 'handler_schema': {'key': 'properties.handlerSchema', 'type': 'str'}, + 'vm_scale_set_enabled': {'key': 'properties.vmScaleSetEnabled', 'type': 'bool'}, + 'supports_multiple_extensions': {'key': 'properties.supportsMultipleExtensions', 'type': 'bool'}, + } + + def __init__(self, *, location: str, operating_system: str, compute_role: str, handler_schema: str, tags=None, vm_scale_set_enabled: bool=None, supports_multiple_extensions: bool=None, **kwargs) -> None: + super(VirtualMachineExtensionImage, self).__init__(location=location, tags=tags, **kwargs) + self.operating_system = operating_system + self.compute_role = compute_role + self.handler_schema = handler_schema + self.vm_scale_set_enabled = vm_scale_set_enabled + self.supports_multiple_extensions = supports_multiple_extensions diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_instance_view.py index c16a59dce81c..20404ccc1f2e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_instance_view.py @@ -38,10 +38,10 @@ class VirtualMachineExtensionInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, name=None, type=None, type_handler_version=None, substatuses=None, statuses=None): - super(VirtualMachineExtensionInstanceView, self).__init__() - self.name = name - self.type = type - self.type_handler_version = type_handler_version - self.substatuses = substatuses - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineExtensionInstanceView, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.substatuses = kwargs.get('substatuses', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_instance_view_py3.py new file mode 100644 index 000000000000..6075f76cb1ca --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_instance_view_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineExtensionInstanceView(Model): + """The instance view of a virtual machine extension. + + :param name: The virtual machine extension name. + :type name: str + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param substatuses: The resource status information. + :type substatuses: + list[~azure.mgmt.compute.v2016_03_30.models.InstanceViewStatus] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2016_03_30.models.InstanceViewStatus] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'substatuses': {'key': 'substatuses', 'type': '[InstanceViewStatus]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, name: str=None, type: str=None, type_handler_version: str=None, substatuses=None, statuses=None, **kwargs) -> None: + super(VirtualMachineExtensionInstanceView, self).__init__(**kwargs) + self.name = name + self.type = type + self.type_handler_version = type_handler_version + self.substatuses = substatuses + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_py3.py new file mode 100644 index 000000000000..32c448ecd2c2 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_extension_py3.py @@ -0,0 +1,97 @@ +# 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 .resource import Resource + + +class VirtualMachineExtension(Resource): + """Describes a Virtual Machine Extension. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param force_update_tag: How the extension handler should be forced to + update even if the extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param virtual_machine_extension_type: Specifies the type of the + extension; an example is "CustomScriptExtension". + :type virtual_machine_extension_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either + protectedSettings or protectedSettingsFromKeyVault or no protected + settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :param instance_view: The virtual machine extension instance view. + :type instance_view: + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtensionInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'virtual_machine_extension_type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineExtensionInstanceView'}, + } + + def __init__(self, *, location: str, tags=None, force_update_tag: str=None, publisher: str=None, virtual_machine_extension_type: str=None, type_handler_version: str=None, auto_upgrade_minor_version: bool=None, settings=None, protected_settings=None, instance_view=None, **kwargs) -> None: + super(VirtualMachineExtension, self).__init__(location=location, tags=tags, **kwargs) + self.force_update_tag = force_update_tag + self.publisher = publisher + self.virtual_machine_extension_type = virtual_machine_extension_type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None + self.instance_view = instance_view diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_identity.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_identity.py index 4c0081f10876..ec2f505a0ee6 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_identity.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_identity.py @@ -40,8 +40,8 @@ class VirtualMachineIdentity(Model): 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, } - def __init__(self, type=None): - super(VirtualMachineIdentity, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = type + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_identity_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_identity_py3.py new file mode 100644 index 000000000000..9db47247e9e5 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_identity_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineIdentity(Model): + """Identity for the virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of virtual machine identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the virtual machine. + :vartype tenant_id: str + :param type: The type of identity used for the virtual machine. Currently, + the only supported type is 'SystemAssigned', which implicitly creates an + identity. Possible values include: 'SystemAssigned' + :type type: str or + ~azure.mgmt.compute.v2016_03_30.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(VirtualMachineIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_image.py index e7172b356d04..4ddf3a23c29c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_image.py @@ -15,11 +15,13 @@ class VirtualMachineImage(VirtualMachineImageResource): """Describes a Virtual Machine Image. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The name of the resource. + :param name: Required. The name of the resource. :type name: str - :param location: The supported Azure location of the resource. + :param location: Required. The supported Azure location of the resource. :type location: str :param tags: Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your @@ -50,8 +52,8 @@ class VirtualMachineImage(VirtualMachineImageResource): 'data_disk_images': {'key': 'properties.dataDiskImages', 'type': '[DataDiskImage]'}, } - def __init__(self, name, location, id=None, tags=None, plan=None, os_disk_image=None, data_disk_images=None): - super(VirtualMachineImage, self).__init__(id=id, name=name, location=location, tags=tags) - self.plan = plan - self.os_disk_image = os_disk_image - self.data_disk_images = data_disk_images + def __init__(self, **kwargs): + super(VirtualMachineImage, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.os_disk_image = kwargs.get('os_disk_image', None) + self.data_disk_images = kwargs.get('data_disk_images', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_image_py3.py new file mode 100644 index 000000000000..efc8c3d8394e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_image_py3.py @@ -0,0 +1,59 @@ +# 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 .virtual_machine_image_resource import VirtualMachineImageResource + + +class VirtualMachineImage(VirtualMachineImageResource): + """Describes a Virtual Machine Image. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The name of the resource. + :type name: str + :param location: Required. The supported Azure location of the resource. + :type location: str + :param tags: Specifies the tags that are assigned to the virtual machine. + For more information about using tags, see [Using tags to organize your + Azure + resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + :type tags: dict[str, str] + :param plan: + :type plan: ~azure.mgmt.compute.v2016_03_30.models.PurchasePlan + :param os_disk_image: + :type os_disk_image: ~azure.mgmt.compute.v2016_03_30.models.OSDiskImage + :param data_disk_images: + :type data_disk_images: + list[~azure.mgmt.compute.v2016_03_30.models.DataDiskImage] + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'properties.plan', 'type': 'PurchasePlan'}, + 'os_disk_image': {'key': 'properties.osDiskImage', 'type': 'OSDiskImage'}, + 'data_disk_images': {'key': 'properties.dataDiskImages', 'type': '[DataDiskImage]'}, + } + + def __init__(self, *, name: str, location: str, id: str=None, tags=None, plan=None, os_disk_image=None, data_disk_images=None, **kwargs) -> None: + super(VirtualMachineImage, self).__init__(id=id, name=name, location=location, tags=tags, **kwargs) + self.plan = plan + self.os_disk_image = os_disk_image + self.data_disk_images = data_disk_images diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_image_resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_image_resource.py index a7029041061d..8807cc8f391b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_image_resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_image_resource.py @@ -15,11 +15,13 @@ class VirtualMachineImageResource(SubResource): """Virtual machine image resource information. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The name of the resource. + :param name: Required. The name of the resource. :type name: str - :param location: The supported Azure location of the resource. + :param location: Required. The supported Azure location of the resource. :type location: str :param tags: Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your @@ -40,8 +42,8 @@ class VirtualMachineImageResource(SubResource): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, name, location, id=None, tags=None): - super(VirtualMachineImageResource, self).__init__(id=id) - self.name = name - self.location = location - self.tags = tags + def __init__(self, **kwargs): + super(VirtualMachineImageResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_image_resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_image_resource_py3.py new file mode 100644 index 000000000000..48a968bf2fbf --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_image_resource_py3.py @@ -0,0 +1,49 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineImageResource(SubResource): + """Virtual machine image resource information. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The name of the resource. + :type name: str + :param location: Required. The supported Azure location of the resource. + :type location: str + :param tags: Specifies the tags that are assigned to the virtual machine. + For more information about using tags, see [Using tags to organize your + Azure + resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + :type tags: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, name: str, location: str, id: str=None, tags=None, **kwargs) -> None: + super(VirtualMachineImageResource, self).__init__(id=id, **kwargs) + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_instance_view.py index 5f671e0c6042..966d3f09f313 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_instance_view.py @@ -54,13 +54,13 @@ class VirtualMachineInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, platform_update_domain=None, platform_fault_domain=None, rdp_thumb_print=None, vm_agent=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None): - super(VirtualMachineInstanceView, self).__init__() - self.platform_update_domain = platform_update_domain - self.platform_fault_domain = platform_fault_domain - self.rdp_thumb_print = rdp_thumb_print - self.vm_agent = vm_agent - self.disks = disks - self.extensions = extensions - self.boot_diagnostics = boot_diagnostics - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineInstanceView, self).__init__(**kwargs) + self.platform_update_domain = kwargs.get('platform_update_domain', None) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.rdp_thumb_print = kwargs.get('rdp_thumb_print', None) + self.vm_agent = kwargs.get('vm_agent', None) + self.disks = kwargs.get('disks', None) + self.extensions = kwargs.get('extensions', None) + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_instance_view_py3.py new file mode 100644 index 000000000000..ab733f0a765d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_instance_view_py3.py @@ -0,0 +1,66 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineInstanceView(Model): + """The instance view of a virtual machine. + + :param platform_update_domain: Specifies the update domain of the virtual + machine. + :type platform_update_domain: int + :param platform_fault_domain: Specifies the fault domain of the virtual + machine. + :type platform_fault_domain: int + :param rdp_thumb_print: The Remote desktop certificate thumbprint. + :type rdp_thumb_print: str + :param vm_agent: The VM Agent running on the virtual machine. + :type vm_agent: + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineAgentInstanceView + :param disks: The virtual machine disk information. + :type disks: list[~azure.mgmt.compute.v2016_03_30.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtensionInstanceView] + :param boot_diagnostics: Boot Diagnostics is a debugging feature which + allows you to view Console Output and Screenshot to diagnose VM status. +

    For Linux Virtual Machines, you can easily view the output of + your console log.

    For both Windows and Linux virtual machines, + Azure also enables you to see a screenshot of the VM from the hypervisor. + :type boot_diagnostics: + ~azure.mgmt.compute.v2016_03_30.models.BootDiagnosticsInstanceView + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2016_03_30.models.InstanceViewStatus] + """ + + _attribute_map = { + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'int'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, + 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, + 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, + 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnosticsInstanceView'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, platform_update_domain: int=None, platform_fault_domain: int=None, rdp_thumb_print: str=None, vm_agent=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None, **kwargs) -> None: + super(VirtualMachineInstanceView, self).__init__(**kwargs) + self.platform_update_domain = platform_update_domain + self.platform_fault_domain = platform_fault_domain + self.rdp_thumb_print = rdp_thumb_print + self.vm_agent = vm_agent + self.disks = disks + self.extensions = extensions + self.boot_diagnostics = boot_diagnostics + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_py3.py new file mode 100644 index 000000000000..4348f94e375d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_py3.py @@ -0,0 +1,146 @@ +# 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 .resource import Resource + + +class VirtualMachine(Resource): + """Describes a Virtual Machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2016_03_30.models.Plan + :param hardware_profile: Specifies the hardware settings for the virtual + machine. + :type hardware_profile: + ~azure.mgmt.compute.v2016_03_30.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2016_03_30.models.StorageProfile + :param os_profile: Specifies the operating system settings for the virtual + machine. + :type os_profile: ~azure.mgmt.compute.v2016_03_30.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual + machine. + :type network_profile: + ~azure.mgmt.compute.v2016_03_30.models.NetworkProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. +

    Minimum api-version: 2015-06-15. + :type diagnostics_profile: + ~azure.mgmt.compute.v2016_03_30.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set + that the virtual machine should be assigned to. Virtual machines specified + in the same availability set are allocated to different nodes to maximize + availability. For more information about availability sets, see [Manage + the availability of virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + :type availability_set: ~azure.mgmt.compute.v2016_03_30.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used + was licensed on-premises. This element is only used for images that + contain the Windows Server operating system.

    Possible values are: +

    Windows_Client

    Windows_Server

    If this element + is included in a request for an update, the value must match the initial + value. This value cannot be updated.

    For more information, see + [Azure Hybrid Use Benefit for Windows + Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Minimum api-version: 2015-06-15 + :type license_type: str + :ivar vm_id: Specifies the VM unique ID which is a 128-bits identifier + that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read + using platform BIOS commands. + :vartype vm_id: str + :ivar resources: The virtual machine child extension resources. + :vartype resources: + list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtension] + :param identity: The identity of the virtual machine, if configured. + :type identity: + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'vm_id': {'readonly': True}, + 'resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineIdentity'}, + } + + def __init__(self, *, location: str, tags=None, plan=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type: str=None, identity=None, **kwargs) -> None: + super(VirtualMachine, self).__init__(location=location, tags=tags, **kwargs) + self.plan = plan + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.os_profile = os_profile + self.network_profile = network_profile + self.diagnostics_profile = diagnostics_profile + self.availability_set = availability_set + self.provisioning_state = None + self.instance_view = None + self.license_type = license_type + self.vm_id = None + self.resources = None + self.identity = identity diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set.py index c507f89db3f1..3cffa82b94ac 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set.py @@ -18,13 +18,15 @@ class VirtualMachineScaleSet(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -69,11 +71,11 @@ class VirtualMachineScaleSet(Resource): 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, } - def __init__(self, location, tags=None, sku=None, upgrade_policy=None, virtual_machine_profile=None, over_provision=None, identity=None): - super(VirtualMachineScaleSet, self).__init__(location=location, tags=tags) - self.sku = sku - self.upgrade_policy = upgrade_policy - self.virtual_machine_profile = virtual_machine_profile + def __init__(self, **kwargs): + super(VirtualMachineScaleSet, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.upgrade_policy = kwargs.get('upgrade_policy', None) + self.virtual_machine_profile = kwargs.get('virtual_machine_profile', None) self.provisioning_state = None - self.over_provision = over_provision - self.identity = identity + self.over_provision = kwargs.get('over_provision', None) + self.identity = kwargs.get('identity', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_extension.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_extension.py index 2c7514755033..d6d8b5fbc51e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_extension.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_extension.py @@ -57,13 +57,13 @@ class VirtualMachineScaleSetExtension(SubResource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, name=None, publisher=None, type=None, type_handler_version=None, auto_upgrade_minor_version=None, settings=None, protected_settings=None): - super(VirtualMachineScaleSetExtension, self).__init__(id=id) - self.name = name - self.publisher = publisher - self.type = type - self.type_handler_version = type_handler_version - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings + def __init__(self, **kwargs): + super(VirtualMachineScaleSetExtension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_extension_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_extension_profile.py index c4ed4350040a..ca232d3aa7d0 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_extension_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_extension_profile.py @@ -25,6 +25,6 @@ class VirtualMachineScaleSetExtensionProfile(Model): 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetExtension]'}, } - def __init__(self, extensions=None): - super(VirtualMachineScaleSetExtensionProfile, self).__init__() - self.extensions = extensions + def __init__(self, **kwargs): + super(VirtualMachineScaleSetExtensionProfile, self).__init__(**kwargs) + self.extensions = kwargs.get('extensions', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_extension_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_extension_profile_py3.py new file mode 100644 index 000000000000..a2e63570c6a2 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_extension_profile_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetExtensionProfile(Model): + """Describes a virtual machine scale set extension profile. + + :param extensions: The virtual machine scale set child extension + resources. + :type extensions: + list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetExtension] + """ + + _attribute_map = { + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetExtension]'}, + } + + def __init__(self, *, extensions=None, **kwargs) -> None: + super(VirtualMachineScaleSetExtensionProfile, self).__init__(**kwargs) + self.extensions = extensions diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_extension_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_extension_py3.py new file mode 100644 index 000000000000..5523e0444c59 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_extension_py3.py @@ -0,0 +1,69 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineScaleSetExtension(SubResource): + """Describes a Virtual Machine Scale Set Extension. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource Id + :type id: str + :param name: The name of the extension. + :type name: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: The type of the extension handler. + :type type: str + :param type_handler_version: The type version of the extension handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Whether the extension handler should be + automatically upgraded across minor versions. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: Json formatted protected settings for the + extension. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name: str=None, publisher: str=None, type: str=None, type_handler_version: str=None, auto_upgrade_minor_version: bool=None, settings=None, protected_settings=None, **kwargs) -> None: + super(VirtualMachineScaleSetExtension, self).__init__(id=id, **kwargs) + self.name = name + self.publisher = publisher + self.type = type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_identity.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_identity.py index 66c70f6a6106..18c86a5f890d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_identity.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_identity.py @@ -42,8 +42,8 @@ class VirtualMachineScaleSetIdentity(Model): 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, } - def __init__(self, type=None): - super(VirtualMachineScaleSetIdentity, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = type + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_identity_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_identity_py3.py new file mode 100644 index 000000000000..fe82aa5fe3e1 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_identity_py3.py @@ -0,0 +1,49 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetIdentity(Model): + """Identity for the virtual machine scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of virtual machine scale set + identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the virtual machine scale + set. + :vartype tenant_id: str + :param type: The type of identity used for the virtual machine scale set. + Currently, the only supported type is 'SystemAssigned', which implicitly + creates an identity. Possible values include: 'SystemAssigned' + :type type: str or + ~azure.mgmt.compute.v2016_03_30.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(VirtualMachineScaleSetIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_instance_view.py index 82dbb90ac32f..b53997afdf79 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_instance_view.py @@ -41,8 +41,8 @@ class VirtualMachineScaleSetInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, statuses=None): - super(VirtualMachineScaleSetInstanceView, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetInstanceView, self).__init__(**kwargs) self.virtual_machine = None self.extensions = None - self.statuses = statuses + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_instance_view_py3.py new file mode 100644 index 000000000000..26ad90384c8d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_instance_view_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetInstanceView(Model): + """The instance view of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar virtual_machine: The instance view status summary for the virtual + machine scale set. + :vartype virtual_machine: + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetInstanceViewStatusesSummary + :ivar extensions: The extensions information. + :vartype extensions: + list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetVMExtensionsSummary] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2016_03_30.models.InstanceViewStatus] + """ + + _validation = { + 'virtual_machine': {'readonly': True}, + 'extensions': {'readonly': True}, + } + + _attribute_map = { + 'virtual_machine': {'key': 'virtualMachine', 'type': 'VirtualMachineScaleSetInstanceViewStatusesSummary'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetVMExtensionsSummary]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, statuses=None, **kwargs) -> None: + super(VirtualMachineScaleSetInstanceView, self).__init__(**kwargs) + self.virtual_machine = None + self.extensions = None + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_instance_view_statuses_summary.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_instance_view_statuses_summary.py index f7e4d9ba77ba..a02855aae1ce 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_instance_view_statuses_summary.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_instance_view_statuses_summary.py @@ -32,6 +32,6 @@ class VirtualMachineScaleSetInstanceViewStatusesSummary(Model): 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, } - def __init__(self): - super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__(**kwargs) self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_instance_view_statuses_summary_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_instance_view_statuses_summary_py3.py new file mode 100644 index 000000000000..0f6ca9b8d18b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_instance_view_statuses_summary_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetInstanceViewStatusesSummary(Model): + """Instance view statuses summary for virtual machines of a virtual machine + scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar statuses_summary: The extensions information. + :vartype statuses_summary: + list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineStatusCodeCount] + """ + + _validation = { + 'statuses_summary': {'readonly': True}, + } + + _attribute_map = { + 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__(**kwargs) + self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_ip_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_ip_configuration.py index c491877fb162..ec56a9fc5174 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_ip_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_ip_configuration.py @@ -15,11 +15,13 @@ class VirtualMachineScaleSetIPConfiguration(SubResource): """Describes a virtual machine scale set network profile's IP configuration. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The IP configuration name. + :param name: Required. The IP configuration name. :type name: str - :param subnet: The subnet. + :param subnet: Required. The subnet. :type subnet: ~azure.mgmt.compute.v2016_03_30.models.ApiEntityReference :param application_gateway_backend_address_pools: The application gateway backend address pools. @@ -49,10 +51,10 @@ class VirtualMachineScaleSetIPConfiguration(SubResource): 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, } - def __init__(self, name, subnet, id=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_pools=None): - super(VirtualMachineScaleSetIPConfiguration, self).__init__(id=id) - self.name = name - self.subnet = subnet - self.application_gateway_backend_address_pools = application_gateway_backend_address_pools - self.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools + def __init__(self, **kwargs): + super(VirtualMachineScaleSetIPConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.subnet = kwargs.get('subnet', None) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_pools = kwargs.get('load_balancer_inbound_nat_pools', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_ip_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_ip_configuration_py3.py new file mode 100644 index 000000000000..4e2c36c30e6c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_ip_configuration_py3.py @@ -0,0 +1,60 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineScaleSetIPConfiguration(SubResource): + """Describes a virtual machine scale set network profile's IP configuration. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The IP configuration name. + :type name: str + :param subnet: Required. The subnet. + :type subnet: ~azure.mgmt.compute.v2016_03_30.models.ApiEntityReference + :param application_gateway_backend_address_pools: The application gateway + backend address pools. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.compute.v2016_03_30.models.SubResource] + :param load_balancer_backend_address_pools: The load balancer backend + address pools. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.compute.v2016_03_30.models.SubResource] + :param load_balancer_inbound_nat_pools: The load balancer inbound nat + pools. + :type load_balancer_inbound_nat_pools: + list[~azure.mgmt.compute.v2016_03_30.models.SubResource] + """ + + _validation = { + 'name': {'required': True}, + 'subnet': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'ApiEntityReference'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, + } + + def __init__(self, *, name: str, subnet, id: str=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_pools=None, **kwargs) -> None: + super(VirtualMachineScaleSetIPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.subnet = subnet + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_network_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_network_configuration.py index 158db0734e45..b59219ffebb9 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_network_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_network_configuration.py @@ -16,13 +16,16 @@ class VirtualMachineScaleSetNetworkConfiguration(SubResource): """Describes a virtual machine scale set network profile's network configurations. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The network configuration name. + :param name: Required. The network configuration name. :type name: str :param primary: Whether this is a primary NIC on a virtual machine. :type primary: bool - :param ip_configurations: The virtual machine scale set IP Configuration. + :param ip_configurations: Required. The virtual machine scale set IP + Configuration. :type ip_configurations: list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetIPConfiguration] """ @@ -39,8 +42,8 @@ class VirtualMachineScaleSetNetworkConfiguration(SubResource): 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetIPConfiguration]'}, } - def __init__(self, name, ip_configurations, id=None, primary=None): - super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(id=id) - self.name = name - self.primary = primary - self.ip_configurations = ip_configurations + def __init__(self, **kwargs): + super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.primary = kwargs.get('primary', None) + self.ip_configurations = kwargs.get('ip_configurations', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_network_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_network_configuration_py3.py new file mode 100644 index 000000000000..1d82ed5e0c03 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_network_configuration_py3.py @@ -0,0 +1,49 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineScaleSetNetworkConfiguration(SubResource): + """Describes a virtual machine scale set network profile's network + configurations. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The network configuration name. + :type name: str + :param primary: Whether this is a primary NIC on a virtual machine. + :type primary: bool + :param ip_configurations: Required. The virtual machine scale set IP + Configuration. + :type ip_configurations: + list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetIPConfiguration] + """ + + _validation = { + 'name': {'required': True}, + 'ip_configurations': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetIPConfiguration]'}, + } + + def __init__(self, *, name: str, ip_configurations, id: str=None, primary: bool=None, **kwargs) -> None: + super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.primary = primary + self.ip_configurations = ip_configurations diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_network_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_network_profile.py index eb3c53fd9407..66972cf23634 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_network_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_network_profile.py @@ -25,6 +25,6 @@ class VirtualMachineScaleSetNetworkProfile(Model): 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetNetworkConfiguration]'}, } - def __init__(self, network_interface_configurations=None): - super(VirtualMachineScaleSetNetworkProfile, self).__init__() - self.network_interface_configurations = network_interface_configurations + def __init__(self, **kwargs): + super(VirtualMachineScaleSetNetworkProfile, self).__init__(**kwargs) + self.network_interface_configurations = kwargs.get('network_interface_configurations', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_network_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_network_profile_py3.py new file mode 100644 index 000000000000..f4803bf1c4b1 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_network_profile_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetNetworkProfile(Model): + """Describes a virtual machine scale set network profile. + + :param network_interface_configurations: The list of network + configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetNetworkConfiguration] + """ + + _attribute_map = { + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetNetworkConfiguration]'}, + } + + def __init__(self, *, network_interface_configurations=None, **kwargs) -> None: + super(VirtualMachineScaleSetNetworkProfile, self).__init__(**kwargs) + self.network_interface_configurations = network_interface_configurations diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_os_disk.py index 05462b041d1a..d46a87626736 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_os_disk.py @@ -15,20 +15,22 @@ class VirtualMachineScaleSetOSDisk(Model): """Describes a virtual machine scale set operating system disk. - :param name: The disk name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The disk name. :type name: str :param caching: Specifies the caching requirements.

    Possible values are:

    **None**

    **ReadOnly**

    **ReadWrite**

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2016_03_30.models.CachingTypes - :param create_option: Specifies how the virtual machines in the scale set - should be created.

    The only allowed value is: **FromImage** - \\u2013 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. Possible - values include: 'FromImage', 'Empty', 'Attach' + :param create_option: Required. Specifies how the virtual machines in the + scale set should be created.

    The only allowed value is: + **FromImage** \\u2013 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. + Possible values include: 'FromImage', 'Empty', 'Attach' :type create_option: str or ~azure.mgmt.compute.v2016_03_30.models.DiskCreateOptionTypes :param os_type: This property allows you to specify the type of the OS @@ -59,11 +61,11 @@ class VirtualMachineScaleSetOSDisk(Model): 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, } - def __init__(self, name, create_option, caching=None, os_type=None, image=None, vhd_containers=None): - super(VirtualMachineScaleSetOSDisk, self).__init__() - self.name = name - self.caching = caching - self.create_option = create_option - self.os_type = os_type - self.image = image - self.vhd_containers = vhd_containers + def __init__(self, **kwargs): + super(VirtualMachineScaleSetOSDisk, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.caching = kwargs.get('caching', None) + self.create_option = kwargs.get('create_option', None) + self.os_type = kwargs.get('os_type', None) + self.image = kwargs.get('image', None) + self.vhd_containers = kwargs.get('vhd_containers', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_os_disk_py3.py new file mode 100644 index 000000000000..b15221f79080 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_os_disk_py3.py @@ -0,0 +1,71 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetOSDisk(Model): + """Describes a virtual machine scale set operating system disk. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The disk name. + :type name: str + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2016_03_30.models.CachingTypes + :param create_option: Required. Specifies how the virtual machines in the + scale set should be created.

    The only allowed value is: + **FromImage** \\u2013 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. + Possible values include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2016_03_30.models.DiskCreateOptionTypes + :param 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**. Possible values include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2016_03_30.models.OperatingSystemTypes + :param image: The Source User Image VirtualHardDisk. This VirtualHardDisk + will be copied before using it to attach to the Virtual Machine. If + SourceImage is provided, the destination VirtualHardDisk should not exist. + :type image: ~azure.mgmt.compute.v2016_03_30.models.VirtualHardDisk + :param vhd_containers: The list of virtual hard disk container uris. + :type vhd_containers: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'create_option': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, + } + + def __init__(self, *, name: str, create_option, caching=None, os_type=None, image=None, vhd_containers=None, **kwargs) -> None: + super(VirtualMachineScaleSetOSDisk, self).__init__(**kwargs) + self.name = name + self.caching = caching + self.create_option = create_option + self.os_type = os_type + self.image = image + self.vhd_containers = vhd_containers diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_os_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_os_profile.py index 77a9022df536..efdda7ad7bb3 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_os_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_os_profile.py @@ -73,12 +73,12 @@ class VirtualMachineScaleSetOSProfile(Model): 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, } - def __init__(self, computer_name_prefix=None, admin_username=None, admin_password=None, custom_data=None, windows_configuration=None, linux_configuration=None, secrets=None): - super(VirtualMachineScaleSetOSProfile, self).__init__() - 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 + def __init__(self, **kwargs): + super(VirtualMachineScaleSetOSProfile, self).__init__(**kwargs) + self.computer_name_prefix = kwargs.get('computer_name_prefix', None) + self.admin_username = kwargs.get('admin_username', None) + self.admin_password = kwargs.get('admin_password', None) + self.custom_data = kwargs.get('custom_data', None) + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + self.secrets = kwargs.get('secrets', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_os_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_os_profile_py3.py new file mode 100644 index 000000000000..6ee3b78e7df4 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_os_profile_py3.py @@ -0,0 +1,84 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetOSProfile(Model): + """Describes a virtual machine scale set OS profile. + + :param 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. + :type computer_name_prefix: str + :param admin_username: Specifies the name of the administrator account. +

    **Windows-only restriction:** Cannot end in "."

    + **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".

    **Minimum-length (Linux):** 1 + character

    **Max-length (Linux):** 64 characters

    + **Max-length (Windows):** 20 characters

  • For root access to + the Linux VM, see [Using root privileges on Linux virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + For a list of built-in system users on Linux that should not be used in + this field, see [Selecting User Names for Linux on + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type admin_username: str + :param admin_password: Specifies the password of the administrator + account.

    **Minimum-length (Windows):** 8 characters

    + **Minimum-length (Linux):** 6 characters

    **Max-length + (Windows):** 123 characters

    **Max-length (Linux):** 72 characters +

    **Complexity requirements:** 3 out of 4 conditions below need to + be fulfilled
    Has lower characters
    Has upper characters
    Has a + digit
    Has a special character (Regex match [\\W_])

    + **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + "iloveyou!"

    For resetting the password, see [How to reset the + Remote Desktop service or its login password in a Windows + VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    For resetting root password, see [Manage users, SSH, and check or + repair disks on Azure Linux VMs using the VMAccess + Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + :type admin_password: str + :param custom_data: A base-64 encoded string of custom data. + :type custom_data: str + :param windows_configuration: The Windows Configuration of the OS profile. + :type windows_configuration: + ~azure.mgmt.compute.v2016_03_30.models.WindowsConfiguration + :param linux_configuration: The Linux Configuration of the OS profile. + :type linux_configuration: + ~azure.mgmt.compute.v2016_03_30.models.LinuxConfiguration + :param secrets: The List of certificates for addition to the VM. + :type secrets: + list[~azure.mgmt.compute.v2016_03_30.models.VaultSecretGroup] + """ + + _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]'}, + } + + def __init__(self, *, computer_name_prefix: str=None, admin_username: str=None, admin_password: str=None, custom_data: str=None, windows_configuration=None, linux_configuration=None, secrets=None, **kwargs) -> None: + super(VirtualMachineScaleSetOSProfile, self).__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 diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_py3.py new file mode 100644 index 000000000000..5ca8108adb6e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_py3.py @@ -0,0 +1,81 @@ +# 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 .resource import Resource + + +class VirtualMachineScaleSet(Resource): + """Describes a Virtual Machine Scale Set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The virtual machine scale set sku. + :type sku: ~azure.mgmt.compute.v2016_03_30.models.Sku + :param upgrade_policy: The upgrade policy. + :type upgrade_policy: ~azure.mgmt.compute.v2016_03_30.models.UpgradePolicy + :param virtual_machine_profile: The virtual machine profile. + :type virtual_machine_profile: + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetVMProfile + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :param over_provision: Specifies whether the Virtual Machine Scale Set + should be overprovisioned. + :type over_provision: bool + :param identity: The identity of the virtual machine scale set, if + configured. + :type identity: + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'upgrade_policy': {'key': 'properties.upgradePolicy', 'type': 'UpgradePolicy'}, + 'virtual_machine_profile': {'key': 'properties.virtualMachineProfile', 'type': 'VirtualMachineScaleSetVMProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'over_provision': {'key': 'properties.overProvision', 'type': 'bool'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, + } + + def __init__(self, *, location: str, tags=None, sku=None, upgrade_policy=None, virtual_machine_profile=None, over_provision: bool=None, identity=None, **kwargs) -> None: + super(VirtualMachineScaleSet, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.upgrade_policy = upgrade_policy + self.virtual_machine_profile = virtual_machine_profile + self.provisioning_state = None + self.over_provision = over_provision + self.identity = identity diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_sku.py index 3d9534f20bc4..7870d03c9144 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_sku.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_sku.py @@ -39,8 +39,8 @@ class VirtualMachineScaleSetSku(Model): 'capacity': {'key': 'capacity', 'type': 'VirtualMachineScaleSetSkuCapacity'}, } - def __init__(self): - super(VirtualMachineScaleSetSku, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetSku, self).__init__(**kwargs) self.resource_type = None self.sku = None self.capacity = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_sku_capacity.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_sku_capacity.py index a160a672047c..fd3c4449f76b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_sku_capacity.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_sku_capacity.py @@ -44,8 +44,8 @@ class VirtualMachineScaleSetSkuCapacity(Model): 'scale_type': {'key': 'scaleType', 'type': 'VirtualMachineScaleSetSkuScaleType'}, } - def __init__(self): - super(VirtualMachineScaleSetSkuCapacity, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetSkuCapacity, self).__init__(**kwargs) self.minimum = None self.maximum = None self.default_capacity = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_sku_capacity_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_sku_capacity_py3.py new file mode 100644 index 000000000000..f69668581e71 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_sku_capacity_py3.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetSkuCapacity(Model): + """Describes scaling information of a sku. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar minimum: The minimum capacity. + :vartype minimum: long + :ivar maximum: The maximum capacity that can be set. + :vartype maximum: long + :ivar default_capacity: The default capacity. + :vartype default_capacity: long + :ivar scale_type: The scale type applicable to the sku. Possible values + include: 'Automatic', 'None' + :vartype scale_type: str or + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetSkuScaleType + """ + + _validation = { + 'minimum': {'readonly': True}, + 'maximum': {'readonly': True}, + 'default_capacity': {'readonly': True}, + 'scale_type': {'readonly': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'long'}, + 'maximum': {'key': 'maximum', 'type': 'long'}, + 'default_capacity': {'key': 'defaultCapacity', 'type': 'long'}, + 'scale_type': {'key': 'scaleType', 'type': 'VirtualMachineScaleSetSkuScaleType'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetSkuCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default_capacity = None + self.scale_type = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_sku_py3.py new file mode 100644 index 000000000000..8bab11cf5910 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_sku_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetSku(Model): + """Describes an available virtual machine scale set sku. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_type: The type of resource the sku applies to. + :vartype resource_type: str + :ivar sku: The Sku. + :vartype sku: ~azure.mgmt.compute.v2016_03_30.models.Sku + :ivar capacity: Specifies the number of virtual machines in the scale set. + :vartype capacity: + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetSkuCapacity + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'sku': {'readonly': True}, + 'capacity': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'capacity': {'key': 'capacity', 'type': 'VirtualMachineScaleSetSkuCapacity'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetSku, self).__init__(**kwargs) + self.resource_type = None + self.sku = None + self.capacity = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_storage_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_storage_profile.py index 6d6ab265fb7d..ec2bc832d477 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_storage_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_storage_profile.py @@ -28,7 +28,7 @@ class VirtualMachineScaleSetStorageProfile(Model): 'os_disk': {'key': 'osDisk', 'type': 'VirtualMachineScaleSetOSDisk'}, } - def __init__(self, image_reference=None, os_disk=None): - super(VirtualMachineScaleSetStorageProfile, self).__init__() - self.image_reference = image_reference - self.os_disk = os_disk + def __init__(self, **kwargs): + super(VirtualMachineScaleSetStorageProfile, self).__init__(**kwargs) + self.image_reference = kwargs.get('image_reference', None) + self.os_disk = kwargs.get('os_disk', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_storage_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_storage_profile_py3.py new file mode 100644 index 000000000000..01272beb4a42 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_storage_profile_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetStorageProfile(Model): + """Describes a virtual machine scale set storage profile. + + :param image_reference: The image reference. + :type image_reference: + ~azure.mgmt.compute.v2016_03_30.models.ImageReference + :param os_disk: The OS disk. + :type os_disk: + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetOSDisk + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'VirtualMachineScaleSetOSDisk'}, + } + + def __init__(self, *, image_reference=None, os_disk=None, **kwargs) -> None: + super(VirtualMachineScaleSetStorageProfile, self).__init__(**kwargs) + self.image_reference = image_reference + self.os_disk = os_disk diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm.py index 119a9fcb0363..5aeb889909f7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm.py @@ -18,13 +18,15 @@ class VirtualMachineScaleSetVM(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -134,20 +136,20 @@ class VirtualMachineScaleSetVM(Resource): 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, } - def __init__(self, location, tags=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type=None, plan=None): - super(VirtualMachineScaleSetVM, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVM, self).__init__(**kwargs) self.instance_id = None self.sku = None self.latest_model_applied = None self.vm_id = None self.instance_view = None - self.hardware_profile = hardware_profile - self.storage_profile = storage_profile - self.os_profile = os_profile - self.network_profile = network_profile - self.diagnostics_profile = diagnostics_profile - self.availability_set = availability_set + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.os_profile = kwargs.get('os_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.availability_set = kwargs.get('availability_set', None) self.provisioning_state = None - self.license_type = license_type - self.plan = plan + self.license_type = kwargs.get('license_type', None) + self.plan = kwargs.get('plan', None) self.resources = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_extensions_summary.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_extensions_summary.py index 4e52ba4a86ef..a67869d9af84 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_extensions_summary.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_extensions_summary.py @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMExtensionsSummary(Model): 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, } - def __init__(self): - super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__(**kwargs) self.name = None self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_extensions_summary_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_extensions_summary_py3.py new file mode 100644 index 000000000000..fe4804644f68 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_extensions_summary_py3.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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMExtensionsSummary(Model): + """Extensions summary for virtual machines of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The extension name. + :vartype name: str + :ivar statuses_summary: The extensions information. + :vartype statuses_summary: + list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineStatusCodeCount] + """ + + _validation = { + 'name': {'readonly': True}, + 'statuses_summary': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__(**kwargs) + self.name = None + self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_ids.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_ids.py index 681ab449f3f2..772c66dad326 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_ids.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_ids.py @@ -25,6 +25,6 @@ class VirtualMachineScaleSetVMInstanceIDs(Model): 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, } - def __init__(self, instance_ids=None): - super(VirtualMachineScaleSetVMInstanceIDs, self).__init__() - self.instance_ids = instance_ids + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMInstanceIDs, self).__init__(**kwargs) + self.instance_ids = kwargs.get('instance_ids', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_ids_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_ids_py3.py new file mode 100644 index 000000000000..658a8ccb87d5 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_ids_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetVMInstanceIDs(Model): + """Specifies a list of virtual machine instance IDs from the VM scale set. + + :param instance_ids: The virtual machine scale set instance ids. Omitting + the virtual machine scale set instance ids will result in the operation + being performed on all virtual machines in the virtual machine scale set. + :type instance_ids: list[str] + """ + + _attribute_map = { + 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, + } + + def __init__(self, *, instance_ids=None, **kwargs) -> None: + super(VirtualMachineScaleSetVMInstanceIDs, self).__init__(**kwargs) + self.instance_ids = instance_ids diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_required_ids.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_required_ids.py index 2a35798001fa..ece250dd4fd4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_required_ids.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_required_ids.py @@ -15,7 +15,9 @@ class VirtualMachineScaleSetVMInstanceRequiredIDs(Model): """Specifies a list of virtual machine instance IDs from the VM scale set. - :param instance_ids: The virtual machine scale set instance ids. + All required parameters must be populated in order to send to Azure. + + :param instance_ids: Required. The virtual machine scale set instance ids. :type instance_ids: list[str] """ @@ -27,6 +29,6 @@ class VirtualMachineScaleSetVMInstanceRequiredIDs(Model): 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, } - def __init__(self, instance_ids): - super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__() - self.instance_ids = instance_ids + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__(**kwargs) + self.instance_ids = kwargs.get('instance_ids', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_required_ids_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_required_ids_py3.py new file mode 100644 index 000000000000..f32c6181467d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_required_ids_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMInstanceRequiredIDs(Model): + """Specifies a list of virtual machine instance IDs from the VM scale set. + + All required parameters must be populated in order to send to Azure. + + :param instance_ids: Required. The virtual machine scale set instance ids. + :type instance_ids: list[str] + """ + + _validation = { + 'instance_ids': {'required': True}, + } + + _attribute_map = { + 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, + } + + def __init__(self, *, instance_ids, **kwargs) -> None: + super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__(**kwargs) + self.instance_ids = instance_ids diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_view.py index 8859c80a8d64..a99cbc4d022d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_view.py @@ -52,13 +52,13 @@ class VirtualMachineScaleSetVMInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, platform_update_domain=None, platform_fault_domain=None, rdp_thumb_print=None, vm_agent=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None): - super(VirtualMachineScaleSetVMInstanceView, self).__init__() - self.platform_update_domain = platform_update_domain - self.platform_fault_domain = platform_fault_domain - self.rdp_thumb_print = rdp_thumb_print - self.vm_agent = vm_agent - self.disks = disks - self.extensions = extensions - self.boot_diagnostics = boot_diagnostics - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMInstanceView, self).__init__(**kwargs) + self.platform_update_domain = kwargs.get('platform_update_domain', None) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.rdp_thumb_print = kwargs.get('rdp_thumb_print', None) + self.vm_agent = kwargs.get('vm_agent', None) + self.disks = kwargs.get('disks', None) + self.extensions = kwargs.get('extensions', None) + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_view_py3.py new file mode 100644 index 000000000000..9cc3a0c3b2be --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_view_py3.py @@ -0,0 +1,64 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMInstanceView(Model): + """The instance view of a virtual machine scale set VM. + + :param platform_update_domain: The Update Domain count. + :type platform_update_domain: int + :param platform_fault_domain: The Fault Domain count. + :type platform_fault_domain: int + :param rdp_thumb_print: The Remote desktop certificate thumbprint. + :type rdp_thumb_print: str + :param vm_agent: The VM Agent running on the virtual machine. + :type vm_agent: + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineAgentInstanceView + :param disks: The disks information. + :type disks: list[~azure.mgmt.compute.v2016_03_30.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtensionInstanceView] + :param boot_diagnostics: Boot Diagnostics is a debugging feature which + allows you to view Console Output and Screenshot to diagnose VM status. +

    For Linux Virtual Machines, you can easily view the output of + your console log.

    For both Windows and Linux virtual machines, + Azure also enables you to see a screenshot of the VM from the hypervisor. + :type boot_diagnostics: + ~azure.mgmt.compute.v2016_03_30.models.BootDiagnosticsInstanceView + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2016_03_30.models.InstanceViewStatus] + """ + + _attribute_map = { + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'int'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, + 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, + 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, + 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnosticsInstanceView'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, platform_update_domain: int=None, platform_fault_domain: int=None, rdp_thumb_print: str=None, vm_agent=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None, **kwargs) -> None: + super(VirtualMachineScaleSetVMInstanceView, self).__init__(**kwargs) + self.platform_update_domain = platform_update_domain + self.platform_fault_domain = platform_fault_domain + self.rdp_thumb_print = rdp_thumb_print + self.vm_agent = vm_agent + self.disks = disks + self.extensions = extensions + self.boot_diagnostics = boot_diagnostics + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_profile.py index 302627aed764..a598ca7a29ac 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_profile.py @@ -36,9 +36,9 @@ class VirtualMachineScaleSetVMProfile(Model): 'extension_profile': {'key': 'extensionProfile', 'type': 'VirtualMachineScaleSetExtensionProfile'}, } - def __init__(self, os_profile=None, storage_profile=None, network_profile=None, extension_profile=None): - super(VirtualMachineScaleSetVMProfile, self).__init__() - self.os_profile = os_profile - self.storage_profile = storage_profile - self.network_profile = network_profile - self.extension_profile = extension_profile + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMProfile, self).__init__(**kwargs) + self.os_profile = kwargs.get('os_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.extension_profile = kwargs.get('extension_profile', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_profile_py3.py new file mode 100644 index 000000000000..485d1a7c83cb --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_profile_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetVMProfile(Model): + """Describes a virtual machine scale set virtual machine profile. + + :param os_profile: The virtual machine scale set OS profile. + :type os_profile: + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetOSProfile + :param storage_profile: The virtual machine scale set storage profile. + :type storage_profile: + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetStorageProfile + :param network_profile: The virtual machine scale set network profile. + :type network_profile: + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetNetworkProfile + :param extension_profile: The virtual machine scale set extension profile. + :type extension_profile: + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetExtensionProfile + """ + + _attribute_map = { + 'os_profile': {'key': 'osProfile', 'type': 'VirtualMachineScaleSetOSProfile'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'VirtualMachineScaleSetStorageProfile'}, + 'network_profile': {'key': 'networkProfile', 'type': 'VirtualMachineScaleSetNetworkProfile'}, + 'extension_profile': {'key': 'extensionProfile', 'type': 'VirtualMachineScaleSetExtensionProfile'}, + } + + def __init__(self, *, os_profile=None, storage_profile=None, network_profile=None, extension_profile=None, **kwargs) -> None: + super(VirtualMachineScaleSetVMProfile, self).__init__(**kwargs) + self.os_profile = os_profile + self.storage_profile = storage_profile + self.network_profile = network_profile + self.extension_profile = extension_profile diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_py3.py new file mode 100644 index 000000000000..b5d22478c827 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_vm_py3.py @@ -0,0 +1,155 @@ +# 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 .resource import Resource + + +class VirtualMachineScaleSetVM(Resource): + """Describes a virtual machine scale set virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar instance_id: The virtual machine instance ID. + :vartype instance_id: str + :ivar sku: The virtual machine SKU. + :vartype sku: ~azure.mgmt.compute.v2016_03_30.models.Sku + :ivar latest_model_applied: Specifies whether the latest model has been + applied to the virtual machine. + :vartype latest_model_applied: bool + :ivar vm_id: Azure VM unique ID. + :vartype vm_id: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineInstanceView + :param hardware_profile: Specifies the hardware settings for the virtual + machine. + :type hardware_profile: + ~azure.mgmt.compute.v2016_03_30.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2016_03_30.models.StorageProfile + :param os_profile: Specifies the operating system settings for the virtual + machine. + :type os_profile: ~azure.mgmt.compute.v2016_03_30.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual + machine. + :type network_profile: + ~azure.mgmt.compute.v2016_03_30.models.NetworkProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. +

    Minimum api-version: 2015-06-15. + :type diagnostics_profile: + ~azure.mgmt.compute.v2016_03_30.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set + that the virtual machine should be assigned to. Virtual machines specified + in the same availability set are allocated to different nodes to maximize + availability. For more information about availability sets, see [Manage + the availability of virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + :type availability_set: ~azure.mgmt.compute.v2016_03_30.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :param license_type: Specifies that the image or disk that is being used + was licensed on-premises. This element is only used for images that + contain the Windows Server operating system.

    Possible values are: +

    Windows_Client

    Windows_Server

    If this element + is included in a request for an update, the value must match the initial + value. This value cannot be updated.

    For more information, see + [Azure Hybrid Use Benefit for Windows + Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Minimum api-version: 2015-06-15 + :type license_type: str + :param plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2016_03_30.models.Plan + :ivar resources: The virtual machine child extension resources. + :vartype resources: + list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtension] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'instance_id': {'readonly': True}, + 'sku': {'readonly': True}, + 'latest_model_applied': {'readonly': True}, + 'vm_id': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'instance_id': {'key': 'instanceId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'latest_model_applied': {'key': 'properties.latestModelApplied', 'type': 'bool'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, + } + + def __init__(self, *, location: str, tags=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type: str=None, plan=None, **kwargs) -> None: + super(VirtualMachineScaleSetVM, self).__init__(location=location, tags=tags, **kwargs) + self.instance_id = None + self.sku = None + self.latest_model_applied = None + self.vm_id = None + self.instance_view = None + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.os_profile = os_profile + self.network_profile = network_profile + self.diagnostics_profile = diagnostics_profile + self.availability_set = availability_set + self.provisioning_state = None + self.license_type = license_type + self.plan = plan + self.resources = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_size.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_size.py index 3f4fa7f06b70..0fef3efd6c8e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_size.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_size.py @@ -43,11 +43,11 @@ class VirtualMachineSize(Model): 'max_data_disk_count': {'key': 'maxDataDiskCount', 'type': 'int'}, } - def __init__(self, name=None, number_of_cores=None, os_disk_size_in_mb=None, resource_disk_size_in_mb=None, memory_in_mb=None, max_data_disk_count=None): - super(VirtualMachineSize, self).__init__() - self.name = name - self.number_of_cores = number_of_cores - self.os_disk_size_in_mb = os_disk_size_in_mb - self.resource_disk_size_in_mb = resource_disk_size_in_mb - self.memory_in_mb = memory_in_mb - self.max_data_disk_count = max_data_disk_count + def __init__(self, **kwargs): + super(VirtualMachineSize, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.number_of_cores = kwargs.get('number_of_cores', None) + self.os_disk_size_in_mb = kwargs.get('os_disk_size_in_mb', None) + self.resource_disk_size_in_mb = kwargs.get('resource_disk_size_in_mb', None) + self.memory_in_mb = kwargs.get('memory_in_mb', None) + self.max_data_disk_count = kwargs.get('max_data_disk_count', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_size_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_size_py3.py new file mode 100644 index 000000000000..9f99ba20ce42 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_size_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineSize(Model): + """Describes the properties of a VM size. + + :param name: The name of the virtual machine size. + :type name: str + :param number_of_cores: The number of cores supported by the virtual + machine size. + :type number_of_cores: int + :param os_disk_size_in_mb: The OS disk size, in MB, allowed by the virtual + machine size. + :type os_disk_size_in_mb: int + :param resource_disk_size_in_mb: The resource disk size, in MB, allowed by + the virtual machine size. + :type resource_disk_size_in_mb: int + :param memory_in_mb: The amount of memory, in MB, supported by the virtual + machine size. + :type memory_in_mb: int + :param max_data_disk_count: The maximum number of data disks that can be + attached to the virtual machine size. + :type max_data_disk_count: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'number_of_cores': {'key': 'numberOfCores', 'type': 'int'}, + 'os_disk_size_in_mb': {'key': 'osDiskSizeInMB', 'type': 'int'}, + 'resource_disk_size_in_mb': {'key': 'resourceDiskSizeInMB', 'type': 'int'}, + 'memory_in_mb': {'key': 'memoryInMB', 'type': 'int'}, + 'max_data_disk_count': {'key': 'maxDataDiskCount', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, number_of_cores: int=None, os_disk_size_in_mb: int=None, resource_disk_size_in_mb: int=None, memory_in_mb: int=None, max_data_disk_count: int=None, **kwargs) -> None: + super(VirtualMachineSize, self).__init__(**kwargs) + self.name = name + self.number_of_cores = number_of_cores + self.os_disk_size_in_mb = os_disk_size_in_mb + self.resource_disk_size_in_mb = resource_disk_size_in_mb + self.memory_in_mb = memory_in_mb + self.max_data_disk_count = max_data_disk_count diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_status_code_count.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_status_code_count.py index 177515706064..7df7b702acd7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_status_code_count.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_status_code_count.py @@ -35,7 +35,7 @@ class VirtualMachineStatusCodeCount(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self): - super(VirtualMachineStatusCodeCount, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineStatusCodeCount, self).__init__(**kwargs) self.code = None self.count = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_status_code_count_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_status_code_count_py3.py new file mode 100644 index 000000000000..c38800073a95 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_status_code_count_py3.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 msrest.serialization import Model + + +class VirtualMachineStatusCodeCount(Model): + """The status code and count of the virtual machine scale set instance view + status summary. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The instance view status code. + :vartype code: str + :ivar count: The number of instances having a particular status code. + :vartype count: int + """ + + _validation = { + 'code': {'readonly': True}, + 'count': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineStatusCodeCount, self).__init__(**kwargs) + self.code = None + self.count = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/win_rm_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/win_rm_configuration.py index d96a229fe5fd..f781fc02fafc 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/win_rm_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/win_rm_configuration.py @@ -24,6 +24,6 @@ class WinRMConfiguration(Model): 'listeners': {'key': 'listeners', 'type': '[WinRMListener]'}, } - def __init__(self, listeners=None): - super(WinRMConfiguration, self).__init__() - self.listeners = listeners + def __init__(self, **kwargs): + super(WinRMConfiguration, self).__init__(**kwargs) + self.listeners = kwargs.get('listeners', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/win_rm_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/win_rm_configuration_py3.py new file mode 100644 index 000000000000..e49e4abff89a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/win_rm_configuration_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WinRMConfiguration(Model): + """Describes Windows Remote Management configuration of the VM. + + :param listeners: The list of Windows Remote Management listeners + :type listeners: + list[~azure.mgmt.compute.v2016_03_30.models.WinRMListener] + """ + + _attribute_map = { + 'listeners': {'key': 'listeners', 'type': '[WinRMListener]'}, + } + + def __init__(self, *, listeners=None, **kwargs) -> None: + super(WinRMConfiguration, self).__init__(**kwargs) + self.listeners = listeners diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/win_rm_listener.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/win_rm_listener.py index 7a8e9b72fe02..3d984a9f0677 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/win_rm_listener.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/win_rm_listener.py @@ -36,7 +36,7 @@ class WinRMListener(Model): 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, } - def __init__(self, protocol=None, certificate_url=None): - super(WinRMListener, self).__init__() - self.protocol = protocol - self.certificate_url = certificate_url + def __init__(self, **kwargs): + super(WinRMListener, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.certificate_url = kwargs.get('certificate_url', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/win_rm_listener_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/win_rm_listener_py3.py new file mode 100644 index 000000000000..01fde18332b1 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/win_rm_listener_py3.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 msrest.serialization import Model + + +class WinRMListener(Model): + """Describes Protocol and thumbprint of Windows Remote Management listener. + + :param protocol: Specifies the protocol of listener.

    Possible + values are:
    **http**

    **https**. Possible values include: + 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.compute.v2016_03_30.models.ProtocolTypes + :param 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](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + In this case, your certificate needs to be It is the Base64 encoding of + the following JSON Object which is encoded in UTF-8:

    {
    + "data":"",
    "dataType":"pfx",
    + "password":""
    } + :type certificate_url: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'ProtocolTypes'}, + 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, + } + + def __init__(self, *, protocol=None, certificate_url: str=None, **kwargs) -> None: + super(WinRMListener, self).__init__(**kwargs) + self.protocol = protocol + self.certificate_url = certificate_url diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/windows_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/windows_configuration.py index c3c6657075ba..c703e1650ee1 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/windows_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/windows_configuration.py @@ -45,10 +45,10 @@ class WindowsConfiguration(Model): 'win_rm': {'key': 'winRM', 'type': 'WinRMConfiguration'}, } - def __init__(self, provision_vm_agent=None, enable_automatic_updates=None, time_zone=None, additional_unattend_content=None, win_rm=None): - super(WindowsConfiguration, self).__init__() - 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.win_rm = win_rm + def __init__(self, **kwargs): + super(WindowsConfiguration, self).__init__(**kwargs) + self.provision_vm_agent = kwargs.get('provision_vm_agent', None) + self.enable_automatic_updates = kwargs.get('enable_automatic_updates', None) + self.time_zone = kwargs.get('time_zone', None) + self.additional_unattend_content = kwargs.get('additional_unattend_content', None) + self.win_rm = kwargs.get('win_rm', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/windows_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/windows_configuration_py3.py new file mode 100644 index 000000000000..045a6b233099 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/windows_configuration_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class WindowsConfiguration(Model): + """Specifies Windows operating system settings on the virtual machine. + + :param 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. + :type provision_vm_agent: bool + :param enable_automatic_updates: Indicates whether virtual machine is + enabled for automatic updates. + :type enable_automatic_updates: bool + :param time_zone: Specifies the time zone of the virtual machine. e.g. + "Pacific Standard Time" + :type time_zone: str + :param 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. + :type additional_unattend_content: + list[~azure.mgmt.compute.v2016_03_30.models.AdditionalUnattendContent] + :param win_rm: Specifies the Windows Remote Management listeners. This + enables remote Windows PowerShell. + :type win_rm: ~azure.mgmt.compute.v2016_03_30.models.WinRMConfiguration + """ + + _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]'}, + 'win_rm': {'key': 'winRM', 'type': 'WinRMConfiguration'}, + } + + def __init__(self, *, provision_vm_agent: bool=None, enable_automatic_updates: bool=None, time_zone: str=None, additional_unattend_content=None, win_rm=None, **kwargs) -> None: + super(WindowsConfiguration, self).__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.win_rm = win_rm diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/availability_sets_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/availability_sets_operations.py index 53b3836539b7..48582fd18dc4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/availability_sets_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/availability_sets_operations.py @@ -22,7 +22,7 @@ class AvailabilitySetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-03-30". """ @@ -60,7 +60,7 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("name", name, 'str'), @@ -105,6 +105,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} def delete( self, resource_group_name, availability_set_name, custom_headers=None, raw=False, **operation_config): @@ -125,7 +126,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -166,6 +167,7 @@ def delete( return client_raw_response return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} def get( self, resource_group_name, availability_set_name, custom_headers=None, raw=False, **operation_config): @@ -186,7 +188,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -227,6 +229,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -248,7 +251,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -294,6 +297,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets'} def list_available_sizes( self, resource_group_name, availability_set_name, custom_headers=None, raw=False, **operation_config): @@ -318,7 +322,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes' + url = self.list_available_sizes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -365,3 +369,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_available_sizes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/usage_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/usage_operations.py index 708545a1bec7..2ccadc8f4885 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/usage_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/usage_operations.py @@ -22,7 +22,7 @@ class UsageOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-03-30". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -105,3 +105,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_extension_images_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_extension_images_operations.py index 3f6b2009257c..6183efef9c2b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_extension_images_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_extension_images_operations.py @@ -22,7 +22,7 @@ class VirtualMachineExtensionImagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-03-30". """ @@ -61,7 +61,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}' + url = self.get.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -104,6 +104,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}'} def list_types( self, location, publisher_name, custom_headers=None, raw=False, **operation_config): @@ -125,7 +126,7 @@ def list_types( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types' + url = self.list_types.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -166,6 +167,7 @@ def list_types( return client_raw_response return deserialized + list_types.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types'} def list_versions( self, location, publisher_name, type, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): @@ -195,7 +197,7 @@ def list_versions( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions' + url = self.list_versions.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -243,3 +245,4 @@ def list_versions( return client_raw_response return deserialized + list_versions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_extensions_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_extensions_operations.py index fee2c197121a..85496d3604f2 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_extensions_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_extensions_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineExtensionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-03-30". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -93,7 +93,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -108,13 +108,16 @@ def create_or_update( :type extension_parameters: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtension :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineExtension or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachineExtension + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtension] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtension]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -126,30 +129,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineExtension', response) if raw: @@ -158,18 +139,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} def _delete_initial( self, resource_group_name, vm_name, vm_extension_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -213,7 +196,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_name, vm_extension_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, vm_extension_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -224,13 +207,16 @@ def delete( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -241,30 +227,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -273,12 +237,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} def get( self, resource_group_name, vm_name, vm_extension_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -304,7 +270,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -348,3 +314,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_images_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_images_operations.py index e20d5320791b..3f646c7ab15d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_images_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_images_operations.py @@ -22,7 +22,7 @@ class VirtualMachineImagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-03-30". """ @@ -62,7 +62,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}' + url = self.get.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -106,6 +106,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}'} def list( self, location, publisher_name, offer, skus, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): @@ -138,7 +139,7 @@ def list( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -187,6 +188,7 @@ def list( return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions'} def list_offers( self, location, publisher_name, custom_headers=None, raw=False, **operation_config): @@ -209,7 +211,7 @@ def list_offers( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers' + url = self.list_offers.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -250,6 +252,7 @@ def list_offers( return client_raw_response return deserialized + list_offers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers'} def list_publishers( self, location, custom_headers=None, raw=False, **operation_config): @@ -270,7 +273,7 @@ def list_publishers( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers' + url = self.list_publishers.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -310,6 +313,7 @@ def list_publishers( return client_raw_response return deserialized + list_publishers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers'} def list_skus( self, location, publisher_name, offer, custom_headers=None, raw=False, **operation_config): @@ -334,7 +338,7 @@ def list_skus( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus' + url = self.list_skus.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -376,3 +380,4 @@ def list_skus( return client_raw_response return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_scale_set_vms_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_scale_set_vms_operations.py index 8f44edc452b0..8891c9a33a47 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_scale_set_vms_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_scale_set_vms_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-03-30". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _reimage_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage' + url = self.reimage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -87,7 +87,7 @@ def _reimage_initial( return deserialized def reimage( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. @@ -98,13 +98,16 @@ def reimage( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._reimage_initial( @@ -115,30 +118,8 @@ def reimage( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -147,18 +128,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage'} def _deallocate_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate' + url = self.deallocate.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -202,7 +185,7 @@ def _deallocate_initial( return deserialized def deallocate( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is @@ -215,13 +198,16 @@ def deallocate( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._deallocate_initial( @@ -232,30 +218,8 @@ def deallocate( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -264,18 +228,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate'} def _delete_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -319,7 +285,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -329,13 +295,16 @@ def delete( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -346,30 +315,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -378,12 +325,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} def get( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): @@ -407,7 +356,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -449,6 +398,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} def get_instance_view( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): @@ -473,7 +423,7 @@ def get_instance_view( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView' + url = self.get_instance_view.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -515,6 +465,7 @@ def get_instance_view( return client_raw_response return deserialized + get_instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView'} def list( self, resource_group_name, virtual_machine_scale_set_name, filter=None, select=None, expand=None, custom_headers=None, raw=False, **operation_config): @@ -544,7 +495,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -597,12 +548,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines'} def _power_off_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff' + url = self.power_off.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -646,7 +598,7 @@ def _power_off_initial( return deserialized def power_off( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid @@ -659,13 +611,16 @@ def power_off( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._power_off_initial( @@ -676,30 +631,8 @@ def power_off( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -708,18 +641,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff'} def _restart_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart' + url = self.restart.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -763,7 +698,7 @@ def _restart_initial( return deserialized def restart( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -773,13 +708,16 @@ def restart( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._restart_initial( @@ -790,30 +728,8 @@ def restart( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -822,18 +738,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart'} def _start_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -877,7 +795,7 @@ def _start_initial( return deserialized def start( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -887,13 +805,16 @@ def start( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -904,30 +825,8 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -936,9 +835,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_scale_sets_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_scale_sets_operations.py index 4b3ed7d579f8..664138f0dde0 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_scale_sets_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_scale_sets_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineScaleSetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-03-30". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("name", name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -103,13 +103,16 @@ def create_or_update( :type parameters: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSet :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineScaleSet or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachineScaleSet + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSet] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSet]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -120,30 +123,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineScaleSet', response) if raw: @@ -152,18 +133,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def _delete_initial( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -206,7 +189,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -214,13 +197,16 @@ def delete( :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -230,30 +216,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -262,12 +226,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def get( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -288,7 +254,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -329,6 +295,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def _deallocate_initial( @@ -338,7 +305,7 @@ def _deallocate_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate' + url = self.deallocate.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -388,7 +355,7 @@ def _deallocate_initial( return deserialized def deallocate( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set @@ -404,13 +371,16 @@ def deallocate( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._deallocate_initial( @@ -421,30 +391,8 @@ def deallocate( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -453,12 +401,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate'} def _delete_instances_initial( @@ -466,7 +416,7 @@ def _delete_instances_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceRequiredIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete' + url = self.delete_instances.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -513,7 +463,7 @@ def _delete_instances_initial( return deserialized def delete_instances( - self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -523,13 +473,16 @@ def delete_instances( :param instance_ids: The virtual machine scale set instance ids. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_instances_initial( @@ -540,30 +493,8 @@ def delete_instances( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -572,12 +503,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_instances.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete'} def get_instance_view( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -600,7 +533,7 @@ def get_instance_view( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView' + url = self.get_instance_view.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -641,6 +574,7 @@ def get_instance_view( return client_raw_response return deserialized + get_instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -662,7 +596,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -708,6 +642,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -730,7 +665,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -775,6 +710,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets'} def list_skus( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -799,7 +735,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus' + url = self.list_skus.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -846,6 +782,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus'} def _power_off_initial( @@ -855,7 +792,7 @@ def _power_off_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff' + url = self.power_off.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -905,7 +842,7 @@ def _power_off_initial( return deserialized def power_off( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid @@ -921,13 +858,16 @@ def power_off( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._power_off_initial( @@ -938,30 +878,8 @@ def power_off( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -970,12 +888,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff'} def _restart_initial( @@ -985,7 +905,7 @@ def _restart_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart' + url = self.restart.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1035,7 +955,7 @@ def _restart_initial( return deserialized def restart( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1048,13 +968,16 @@ def restart( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._restart_initial( @@ -1065,30 +988,8 @@ def restart( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1097,12 +998,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart'} def _start_initial( @@ -1112,7 +1015,7 @@ def _start_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1162,7 +1065,7 @@ def _start_initial( return deserialized def start( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1175,13 +1078,16 @@ def start( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -1192,30 +1098,8 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1224,12 +1108,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start'} def _update_instances_initial( @@ -1237,7 +1123,7 @@ def _update_instances_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceRequiredIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade' + url = self.update_instances.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1284,7 +1170,7 @@ def _update_instances_initial( return deserialized def update_instances( - self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, polling=True, **operation_config): """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. @@ -1295,13 +1181,16 @@ def update_instances( :param instance_ids: The virtual machine scale set instance ids. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._update_instances_initial( @@ -1312,30 +1201,8 @@ def update_instances( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1344,18 +1211,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_instances.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade'} def _reimage_initial( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage' + url = self.reimage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1398,7 +1267,7 @@ def _reimage_initial( return deserialized def reimage( - self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, polling=True, **operation_config): """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. @@ -1407,13 +1276,16 @@ def reimage( :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._reimage_initial( @@ -1423,30 +1295,8 @@ def reimage( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1455,9 +1305,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_sizes_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_sizes_operations.py index 9abc7eda1ab6..4c049de4e3d3 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_sizes_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_sizes_operations.py @@ -22,7 +22,7 @@ class VirtualMachineSizesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-03-30". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -105,3 +105,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machines_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machines_operations.py index d8b82b95e92f..25e5499522c4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machines_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machines_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachinesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-03-30". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _capture_initial( self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture' + url = self.capture.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -90,7 +90,7 @@ def _capture_initial( return deserialized def capture( - self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -103,13 +103,17 @@ def capture( :type parameters: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineCaptureParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineCaptureResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualMachineCaptureResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineCaptureResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineCaptureResult]] :raises: :class:`CloudError` """ raw_result = self._capture_initial( @@ -120,30 +124,8 @@ def capture( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineCaptureResult', response) if raw: @@ -152,18 +134,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture'} def _create_or_update_initial( self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -212,7 +196,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -224,13 +208,16 @@ def create_or_update( :type parameters: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachine :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachine or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachine or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.VirtualMachine] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.VirtualMachine]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -241,30 +228,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachine', response) if raw: @@ -273,18 +238,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} def _delete_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -327,7 +294,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -335,13 +302,16 @@ def delete( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -351,30 +321,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -383,12 +331,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} def get( self, resource_group_name, vm_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -414,7 +364,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -457,12 +407,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} def _deallocate_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate' + url = self.deallocate.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -505,7 +456,7 @@ def _deallocate_initial( return deserialized def deallocate( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. @@ -515,13 +466,16 @@ def deallocate( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._deallocate_initial( @@ -531,30 +485,8 @@ def deallocate( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -563,12 +495,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate'} def generalize( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): @@ -589,7 +523,7 @@ def generalize( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize' + url = self.generalize.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -630,6 +564,7 @@ def generalize( return client_raw_response return deserialized + generalize.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -653,7 +588,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -699,6 +634,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -720,7 +656,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -765,6 +701,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines'} def list_available_sizes( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): @@ -789,7 +726,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes' + url = self.list_available_sizes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -836,12 +773,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_available_sizes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes'} def _power_off_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff' + url = self.power_off.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -884,7 +822,7 @@ def _power_off_initial( return deserialized def power_off( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. @@ -894,13 +832,16 @@ def power_off( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._power_off_initial( @@ -910,30 +851,8 @@ def power_off( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -942,18 +861,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff'} def _restart_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart' + url = self.restart.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -996,7 +917,7 @@ def _restart_initial( return deserialized def restart( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1004,13 +925,16 @@ def restart( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._restart_initial( @@ -1020,30 +944,8 @@ def restart( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1052,18 +954,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart'} def _start_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1106,7 +1010,7 @@ def _start_initial( return deserialized def start( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1114,13 +1018,16 @@ def start( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -1130,30 +1037,8 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1162,18 +1047,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start'} def _redeploy_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy' + url = self.redeploy.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1216,7 +1103,7 @@ def _redeploy_initial( return deserialized def redeploy( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to redeploy a virtual machine. :param resource_group_name: The name of the resource group. @@ -1224,13 +1111,16 @@ def redeploy( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._redeploy_initial( @@ -1240,30 +1130,8 @@ def redeploy( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1272,9 +1140,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + redeploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/__init__.py index 3439fa2555b9..2cc876579a96 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/__init__.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/__init__.py @@ -9,104 +9,204 @@ # regenerated. # -------------------------------------------------------------------------- -from .instance_view_status import InstanceViewStatus -from .sub_resource import SubResource -from .sku import Sku -from .availability_set import AvailabilitySet -from .virtual_machine_size import VirtualMachineSize -from .virtual_machine_extension_image import VirtualMachineExtensionImage -from .virtual_machine_image_resource import VirtualMachineImageResource -from .virtual_machine_extension_instance_view import VirtualMachineExtensionInstanceView -from .virtual_machine_extension import VirtualMachineExtension -from .purchase_plan import PurchasePlan -from .os_disk_image import OSDiskImage -from .data_disk_image import DataDiskImage -from .virtual_machine_image import VirtualMachineImage -from .usage_name import UsageName -from .usage import Usage -from .virtual_machine_capture_parameters import VirtualMachineCaptureParameters -from .virtual_machine_capture_result import VirtualMachineCaptureResult -from .plan import Plan -from .hardware_profile import HardwareProfile -from .image_reference import ImageReference -from .key_vault_secret_reference import KeyVaultSecretReference -from .key_vault_key_reference import KeyVaultKeyReference -from .disk_encryption_settings import DiskEncryptionSettings -from .virtual_hard_disk import VirtualHardDisk -from .managed_disk_parameters import ManagedDiskParameters -from .os_disk import OSDisk -from .data_disk import DataDisk -from .storage_profile import StorageProfile -from .additional_unattend_content import AdditionalUnattendContent -from .win_rm_listener import WinRMListener -from .win_rm_configuration import WinRMConfiguration -from .windows_configuration import WindowsConfiguration -from .ssh_public_key import SshPublicKey -from .ssh_configuration import SshConfiguration -from .linux_configuration import LinuxConfiguration -from .vault_certificate import VaultCertificate -from .vault_secret_group import VaultSecretGroup -from .os_profile import OSProfile -from .network_interface_reference import NetworkInterfaceReference -from .network_profile import NetworkProfile -from .boot_diagnostics import BootDiagnostics -from .diagnostics_profile import DiagnosticsProfile -from .virtual_machine_extension_handler_instance_view import VirtualMachineExtensionHandlerInstanceView -from .virtual_machine_agent_instance_view import VirtualMachineAgentInstanceView -from .disk_instance_view import DiskInstanceView -from .boot_diagnostics_instance_view import BootDiagnosticsInstanceView -from .virtual_machine_identity import VirtualMachineIdentity -from .virtual_machine_instance_view import VirtualMachineInstanceView -from .virtual_machine import VirtualMachine -from .upgrade_policy import UpgradePolicy -from .image_os_disk import ImageOSDisk -from .image_data_disk import ImageDataDisk -from .image_storage_profile import ImageStorageProfile -from .image import Image -from .virtual_machine_scale_set_identity import VirtualMachineScaleSetIdentity -from .virtual_machine_scale_set_os_profile import VirtualMachineScaleSetOSProfile -from .virtual_machine_scale_set_managed_disk_parameters import VirtualMachineScaleSetManagedDiskParameters -from .virtual_machine_scale_set_os_disk import VirtualMachineScaleSetOSDisk -from .virtual_machine_scale_set_data_disk import VirtualMachineScaleSetDataDisk -from .virtual_machine_scale_set_storage_profile import VirtualMachineScaleSetStorageProfile -from .api_entity_reference import ApiEntityReference -from .virtual_machine_scale_set_ip_configuration import VirtualMachineScaleSetIPConfiguration -from .virtual_machine_scale_set_network_configuration import VirtualMachineScaleSetNetworkConfiguration -from .virtual_machine_scale_set_network_profile import VirtualMachineScaleSetNetworkProfile -from .virtual_machine_scale_set_extension import VirtualMachineScaleSetExtension -from .virtual_machine_scale_set_extension_profile import VirtualMachineScaleSetExtensionProfile -from .virtual_machine_scale_set_vm_profile import VirtualMachineScaleSetVMProfile -from .virtual_machine_scale_set import VirtualMachineScaleSet -from .virtual_machine_scale_set_vm_instance_ids import VirtualMachineScaleSetVMInstanceIDs -from .virtual_machine_scale_set_vm_instance_required_ids import VirtualMachineScaleSetVMInstanceRequiredIDs -from .virtual_machine_status_code_count import VirtualMachineStatusCodeCount -from .virtual_machine_scale_set_instance_view_statuses_summary import VirtualMachineScaleSetInstanceViewStatusesSummary -from .virtual_machine_scale_set_vm_extensions_summary import VirtualMachineScaleSetVMExtensionsSummary -from .virtual_machine_scale_set_instance_view import VirtualMachineScaleSetInstanceView -from .virtual_machine_scale_set_sku_capacity import VirtualMachineScaleSetSkuCapacity -from .virtual_machine_scale_set_sku import VirtualMachineScaleSetSku -from .virtual_machine_scale_set_vm import VirtualMachineScaleSetVM -from .virtual_machine_scale_set_vm_instance_view import VirtualMachineScaleSetVMInstanceView -from .api_error_base import ApiErrorBase -from .inner_error import InnerError -from .api_error import ApiError -from .compute_long_running_operation_properties import ComputeLongRunningOperationProperties -from .resource import Resource -from .sub_resource_read_only import SubResourceReadOnly -from .operation_status_response import OperationStatusResponse -from .resource_update import ResourceUpdate -from .image_disk_reference import ImageDiskReference -from .creation_data import CreationData -from .source_vault import SourceVault -from .key_vault_and_secret_reference import KeyVaultAndSecretReference -from .key_vault_and_key_reference import KeyVaultAndKeyReference -from .encryption_settings import EncryptionSettings -from .disk import Disk -from .disk_update import DiskUpdate -from .grant_access_data import GrantAccessData -from .access_uri import AccessUri -from .snapshot import Snapshot -from .snapshot_update import SnapshotUpdate +try: + from .instance_view_status_py3 import InstanceViewStatus + from .sub_resource_py3 import SubResource + from .sku_py3 import Sku + from .availability_set_py3 import AvailabilitySet + from .virtual_machine_size_py3 import VirtualMachineSize + from .virtual_machine_extension_image_py3 import VirtualMachineExtensionImage + from .virtual_machine_image_resource_py3 import VirtualMachineImageResource + from .virtual_machine_extension_instance_view_py3 import VirtualMachineExtensionInstanceView + from .virtual_machine_extension_py3 import VirtualMachineExtension + from .purchase_plan_py3 import PurchasePlan + from .os_disk_image_py3 import OSDiskImage + from .data_disk_image_py3 import DataDiskImage + from .virtual_machine_image_py3 import VirtualMachineImage + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .virtual_machine_capture_parameters_py3 import VirtualMachineCaptureParameters + from .virtual_machine_capture_result_py3 import VirtualMachineCaptureResult + from .plan_py3 import Plan + from .hardware_profile_py3 import HardwareProfile + from .image_reference_py3 import ImageReference + from .key_vault_secret_reference_py3 import KeyVaultSecretReference + from .key_vault_key_reference_py3 import KeyVaultKeyReference + from .disk_encryption_settings_py3 import DiskEncryptionSettings + from .virtual_hard_disk_py3 import VirtualHardDisk + from .managed_disk_parameters_py3 import ManagedDiskParameters + from .os_disk_py3 import OSDisk + from .data_disk_py3 import DataDisk + from .storage_profile_py3 import StorageProfile + from .additional_unattend_content_py3 import AdditionalUnattendContent + from .win_rm_listener_py3 import WinRMListener + from .win_rm_configuration_py3 import WinRMConfiguration + from .windows_configuration_py3 import WindowsConfiguration + from .ssh_public_key_py3 import SshPublicKey + from .ssh_configuration_py3 import SshConfiguration + from .linux_configuration_py3 import LinuxConfiguration + from .vault_certificate_py3 import VaultCertificate + from .vault_secret_group_py3 import VaultSecretGroup + from .os_profile_py3 import OSProfile + from .network_interface_reference_py3 import NetworkInterfaceReference + from .network_profile_py3 import NetworkProfile + from .boot_diagnostics_py3 import BootDiagnostics + from .diagnostics_profile_py3 import DiagnosticsProfile + from .virtual_machine_extension_handler_instance_view_py3 import VirtualMachineExtensionHandlerInstanceView + from .virtual_machine_agent_instance_view_py3 import VirtualMachineAgentInstanceView + from .disk_instance_view_py3 import DiskInstanceView + from .boot_diagnostics_instance_view_py3 import BootDiagnosticsInstanceView + from .virtual_machine_identity_py3 import VirtualMachineIdentity + from .virtual_machine_instance_view_py3 import VirtualMachineInstanceView + from .virtual_machine_py3 import VirtualMachine + from .upgrade_policy_py3 import UpgradePolicy + from .image_os_disk_py3 import ImageOSDisk + from .image_data_disk_py3 import ImageDataDisk + from .image_storage_profile_py3 import ImageStorageProfile + from .image_py3 import Image + from .virtual_machine_scale_set_identity_py3 import VirtualMachineScaleSetIdentity + from .virtual_machine_scale_set_os_profile_py3 import VirtualMachineScaleSetOSProfile + from .virtual_machine_scale_set_managed_disk_parameters_py3 import VirtualMachineScaleSetManagedDiskParameters + from .virtual_machine_scale_set_os_disk_py3 import VirtualMachineScaleSetOSDisk + from .virtual_machine_scale_set_data_disk_py3 import VirtualMachineScaleSetDataDisk + from .virtual_machine_scale_set_storage_profile_py3 import VirtualMachineScaleSetStorageProfile + from .api_entity_reference_py3 import ApiEntityReference + from .virtual_machine_scale_set_ip_configuration_py3 import VirtualMachineScaleSetIPConfiguration + from .virtual_machine_scale_set_network_configuration_py3 import VirtualMachineScaleSetNetworkConfiguration + from .virtual_machine_scale_set_network_profile_py3 import VirtualMachineScaleSetNetworkProfile + from .virtual_machine_scale_set_extension_py3 import VirtualMachineScaleSetExtension + from .virtual_machine_scale_set_extension_profile_py3 import VirtualMachineScaleSetExtensionProfile + from .virtual_machine_scale_set_vm_profile_py3 import VirtualMachineScaleSetVMProfile + from .virtual_machine_scale_set_py3 import VirtualMachineScaleSet + from .virtual_machine_scale_set_vm_instance_ids_py3 import VirtualMachineScaleSetVMInstanceIDs + from .virtual_machine_scale_set_vm_instance_required_ids_py3 import VirtualMachineScaleSetVMInstanceRequiredIDs + from .virtual_machine_status_code_count_py3 import VirtualMachineStatusCodeCount + from .virtual_machine_scale_set_instance_view_statuses_summary_py3 import VirtualMachineScaleSetInstanceViewStatusesSummary + from .virtual_machine_scale_set_vm_extensions_summary_py3 import VirtualMachineScaleSetVMExtensionsSummary + from .virtual_machine_scale_set_instance_view_py3 import VirtualMachineScaleSetInstanceView + from .virtual_machine_scale_set_sku_capacity_py3 import VirtualMachineScaleSetSkuCapacity + from .virtual_machine_scale_set_sku_py3 import VirtualMachineScaleSetSku + from .virtual_machine_scale_set_vm_py3 import VirtualMachineScaleSetVM + from .virtual_machine_scale_set_vm_instance_view_py3 import VirtualMachineScaleSetVMInstanceView + from .api_error_base_py3 import ApiErrorBase + from .inner_error_py3 import InnerError + from .api_error_py3 import ApiError + from .compute_long_running_operation_properties_py3 import ComputeLongRunningOperationProperties + from .resource_py3 import Resource + from .sub_resource_read_only_py3 import SubResourceReadOnly + from .operation_status_response_py3 import OperationStatusResponse + from .resource_update_py3 import ResourceUpdate + from .image_disk_reference_py3 import ImageDiskReference + from .creation_data_py3 import CreationData + from .source_vault_py3 import SourceVault + from .key_vault_and_secret_reference_py3 import KeyVaultAndSecretReference + from .key_vault_and_key_reference_py3 import KeyVaultAndKeyReference + from .encryption_settings_py3 import EncryptionSettings + from .disk_py3 import Disk + from .disk_update_py3 import DiskUpdate + from .grant_access_data_py3 import GrantAccessData + from .access_uri_py3 import AccessUri + from .snapshot_py3 import Snapshot + from .snapshot_update_py3 import SnapshotUpdate +except (SyntaxError, ImportError): + from .instance_view_status import InstanceViewStatus + from .sub_resource import SubResource + from .sku import Sku + from .availability_set import AvailabilitySet + from .virtual_machine_size import VirtualMachineSize + from .virtual_machine_extension_image import VirtualMachineExtensionImage + from .virtual_machine_image_resource import VirtualMachineImageResource + from .virtual_machine_extension_instance_view import VirtualMachineExtensionInstanceView + from .virtual_machine_extension import VirtualMachineExtension + from .purchase_plan import PurchasePlan + from .os_disk_image import OSDiskImage + from .data_disk_image import DataDiskImage + from .virtual_machine_image import VirtualMachineImage + from .usage_name import UsageName + from .usage import Usage + from .virtual_machine_capture_parameters import VirtualMachineCaptureParameters + from .virtual_machine_capture_result import VirtualMachineCaptureResult + from .plan import Plan + from .hardware_profile import HardwareProfile + from .image_reference import ImageReference + from .key_vault_secret_reference import KeyVaultSecretReference + from .key_vault_key_reference import KeyVaultKeyReference + from .disk_encryption_settings import DiskEncryptionSettings + from .virtual_hard_disk import VirtualHardDisk + from .managed_disk_parameters import ManagedDiskParameters + from .os_disk import OSDisk + from .data_disk import DataDisk + from .storage_profile import StorageProfile + from .additional_unattend_content import AdditionalUnattendContent + from .win_rm_listener import WinRMListener + from .win_rm_configuration import WinRMConfiguration + from .windows_configuration import WindowsConfiguration + from .ssh_public_key import SshPublicKey + from .ssh_configuration import SshConfiguration + from .linux_configuration import LinuxConfiguration + from .vault_certificate import VaultCertificate + from .vault_secret_group import VaultSecretGroup + from .os_profile import OSProfile + from .network_interface_reference import NetworkInterfaceReference + from .network_profile import NetworkProfile + from .boot_diagnostics import BootDiagnostics + from .diagnostics_profile import DiagnosticsProfile + from .virtual_machine_extension_handler_instance_view import VirtualMachineExtensionHandlerInstanceView + from .virtual_machine_agent_instance_view import VirtualMachineAgentInstanceView + from .disk_instance_view import DiskInstanceView + from .boot_diagnostics_instance_view import BootDiagnosticsInstanceView + from .virtual_machine_identity import VirtualMachineIdentity + from .virtual_machine_instance_view import VirtualMachineInstanceView + from .virtual_machine import VirtualMachine + from .upgrade_policy import UpgradePolicy + from .image_os_disk import ImageOSDisk + from .image_data_disk import ImageDataDisk + from .image_storage_profile import ImageStorageProfile + from .image import Image + from .virtual_machine_scale_set_identity import VirtualMachineScaleSetIdentity + from .virtual_machine_scale_set_os_profile import VirtualMachineScaleSetOSProfile + from .virtual_machine_scale_set_managed_disk_parameters import VirtualMachineScaleSetManagedDiskParameters + from .virtual_machine_scale_set_os_disk import VirtualMachineScaleSetOSDisk + from .virtual_machine_scale_set_data_disk import VirtualMachineScaleSetDataDisk + from .virtual_machine_scale_set_storage_profile import VirtualMachineScaleSetStorageProfile + from .api_entity_reference import ApiEntityReference + from .virtual_machine_scale_set_ip_configuration import VirtualMachineScaleSetIPConfiguration + from .virtual_machine_scale_set_network_configuration import VirtualMachineScaleSetNetworkConfiguration + from .virtual_machine_scale_set_network_profile import VirtualMachineScaleSetNetworkProfile + from .virtual_machine_scale_set_extension import VirtualMachineScaleSetExtension + from .virtual_machine_scale_set_extension_profile import VirtualMachineScaleSetExtensionProfile + from .virtual_machine_scale_set_vm_profile import VirtualMachineScaleSetVMProfile + from .virtual_machine_scale_set import VirtualMachineScaleSet + from .virtual_machine_scale_set_vm_instance_ids import VirtualMachineScaleSetVMInstanceIDs + from .virtual_machine_scale_set_vm_instance_required_ids import VirtualMachineScaleSetVMInstanceRequiredIDs + from .virtual_machine_status_code_count import VirtualMachineStatusCodeCount + from .virtual_machine_scale_set_instance_view_statuses_summary import VirtualMachineScaleSetInstanceViewStatusesSummary + from .virtual_machine_scale_set_vm_extensions_summary import VirtualMachineScaleSetVMExtensionsSummary + from .virtual_machine_scale_set_instance_view import VirtualMachineScaleSetInstanceView + from .virtual_machine_scale_set_sku_capacity import VirtualMachineScaleSetSkuCapacity + from .virtual_machine_scale_set_sku import VirtualMachineScaleSetSku + from .virtual_machine_scale_set_vm import VirtualMachineScaleSetVM + from .virtual_machine_scale_set_vm_instance_view import VirtualMachineScaleSetVMInstanceView + from .api_error_base import ApiErrorBase + from .inner_error import InnerError + from .api_error import ApiError + from .compute_long_running_operation_properties import ComputeLongRunningOperationProperties + from .resource import Resource + from .sub_resource_read_only import SubResourceReadOnly + from .operation_status_response import OperationStatusResponse + from .resource_update import ResourceUpdate + from .image_disk_reference import ImageDiskReference + from .creation_data import CreationData + from .source_vault import SourceVault + from .key_vault_and_secret_reference import KeyVaultAndSecretReference + from .key_vault_and_key_reference import KeyVaultAndKeyReference + from .encryption_settings import EncryptionSettings + from .disk import Disk + from .disk_update import DiskUpdate + from .grant_access_data import GrantAccessData + from .access_uri import AccessUri + from .snapshot import Snapshot + from .snapshot_update import SnapshotUpdate from .availability_set_paged import AvailabilitySetPaged from .virtual_machine_size_paged import VirtualMachineSizePaged from .usage_paged import UsagePaged diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/access_uri.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/access_uri.py index 09f8982bc3a7..9ee6b01de1e1 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/access_uri.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/access_uri.py @@ -30,6 +30,6 @@ class AccessUri(Model): 'access_sas': {'key': 'properties.output.accessSAS', 'type': 'str'}, } - def __init__(self): - super(AccessUri, self).__init__() + def __init__(self, **kwargs): + super(AccessUri, self).__init__(**kwargs) self.access_sas = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/access_uri_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/access_uri_py3.py new file mode 100644 index 000000000000..bb9e56aa4221 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/access_uri_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class AccessUri(Model): + """A disk access SAS uri. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar access_sas: A SAS uri for accessing a disk. + :vartype access_sas: str + """ + + _validation = { + 'access_sas': {'readonly': True}, + } + + _attribute_map = { + 'access_sas': {'key': 'properties.output.accessSAS', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AccessUri, self).__init__(**kwargs) + self.access_sas = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/additional_unattend_content.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/additional_unattend_content.py index 6ef9838f40a9..01ffa6dc685d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/additional_unattend_content.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/additional_unattend_content.py @@ -45,9 +45,9 @@ class AdditionalUnattendContent(Model): 'content': {'key': 'content', 'type': 'str'}, } - def __init__(self, pass_name=None, component_name=None, setting_name=None, content=None): - super(AdditionalUnattendContent, self).__init__() - self.pass_name = pass_name - self.component_name = component_name - self.setting_name = setting_name - self.content = content + def __init__(self, **kwargs): + super(AdditionalUnattendContent, self).__init__(**kwargs) + self.pass_name = kwargs.get('pass_name', None) + self.component_name = kwargs.get('component_name', None) + self.setting_name = kwargs.get('setting_name', None) + self.content = kwargs.get('content', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/additional_unattend_content_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/additional_unattend_content_py3.py new file mode 100644 index 000000000000..8928cbeba053 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/additional_unattend_content_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class AdditionalUnattendContent(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. + + :param pass_name: The pass name. Currently, the only allowable value is + OobeSystem. Possible values include: 'OobeSystem' + :type pass_name: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.PassNames + :param component_name: The component name. Currently, the only allowable + value is Microsoft-Windows-Shell-Setup. Possible values include: + 'Microsoft-Windows-Shell-Setup' + :type component_name: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.ComponentNames + :param setting_name: Specifies the name of the setting to which the + content applies. Possible values are: FirstLogonCommands and AutoLogon. + Possible values include: 'AutoLogon', 'FirstLogonCommands' + :type setting_name: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.SettingNames + :param 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. + :type content: str + """ + + _attribute_map = { + 'pass_name': {'key': 'passName', 'type': 'PassNames'}, + 'component_name': {'key': 'componentName', 'type': 'ComponentNames'}, + 'setting_name': {'key': 'settingName', 'type': 'SettingNames'}, + 'content': {'key': 'content', 'type': 'str'}, + } + + def __init__(self, *, pass_name=None, component_name=None, setting_name=None, content: str=None, **kwargs) -> None: + super(AdditionalUnattendContent, self).__init__(**kwargs) + self.pass_name = pass_name + self.component_name = component_name + self.setting_name = setting_name + self.content = content diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_entity_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_entity_reference.py index 27696aacc3dc..d1bf572e916d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_entity_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_entity_reference.py @@ -24,6 +24,6 @@ class ApiEntityReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(ApiEntityReference, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(ApiEntityReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_entity_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_entity_reference_py3.py new file mode 100644 index 000000000000..da3e07082381 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_entity_reference_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApiEntityReference(Model): + """The API entity reference. + + :param id: The ARM resource id in the form of + /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(ApiEntityReference, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_error.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_error.py index 5bd7f3284ce2..8af390cf58fe 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_error.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_error.py @@ -37,10 +37,10 @@ class ApiError(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, details=None, innererror=None, code=None, target=None, message=None): - super(ApiError, self).__init__() - self.details = details - self.innererror = innererror - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ApiError, self).__init__(**kwargs) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_error_base.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_error_base.py index 2fb33a0ff411..655c08638905 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_error_base.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_error_base.py @@ -29,8 +29,8 @@ class ApiErrorBase(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, target=None, message=None): - super(ApiErrorBase, self).__init__() - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ApiErrorBase, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_error_base_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_error_base_py3.py new file mode 100644 index 000000000000..5ba95aa0283e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_error_base_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ApiErrorBase(Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ApiErrorBase, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_error_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_error_py3.py new file mode 100644 index 000000000000..2397cacf656a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_error_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class ApiError(Model): + """Api error. + + :param details: The Api error details + :type details: + list[~azure.mgmt.compute.v2016_04_30_preview.models.ApiErrorBase] + :param innererror: The Api inner error + :type innererror: + ~azure.mgmt.compute.v2016_04_30_preview.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, details=None, innererror=None, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ApiError, self).__init__(**kwargs) + self.details = details + self.innererror = innererror + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/availability_set.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/availability_set.py index aa7a95dbb340..1793a6943267 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/availability_set.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/availability_set.py @@ -28,13 +28,15 @@ class AvailabilitySet(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -77,11 +79,11 @@ class AvailabilitySet(Resource): 'sku': {'key': 'sku', 'type': 'Sku'}, } - def __init__(self, location, tags=None, platform_update_domain_count=None, platform_fault_domain_count=None, virtual_machines=None, managed=None, sku=None): - super(AvailabilitySet, self).__init__(location=location, tags=tags) - self.platform_update_domain_count = platform_update_domain_count - self.platform_fault_domain_count = platform_fault_domain_count - self.virtual_machines = virtual_machines + def __init__(self, **kwargs): + super(AvailabilitySet, self).__init__(**kwargs) + self.platform_update_domain_count = kwargs.get('platform_update_domain_count', None) + self.platform_fault_domain_count = kwargs.get('platform_fault_domain_count', None) + self.virtual_machines = kwargs.get('virtual_machines', None) self.statuses = None - self.managed = managed - self.sku = sku + self.managed = kwargs.get('managed', None) + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/availability_set_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/availability_set_py3.py new file mode 100644 index 000000000000..f9e977dbe70c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/availability_set_py3.py @@ -0,0 +1,89 @@ +# 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 .resource import Resource + + +class AvailabilitySet(Resource): + """Specifies information about the availability set that the virtual machine + should be assigned to. Virtual machines specified in the same availability + set are allocated to different nodes to maximize availability. For more + information about availability sets, see [Manage the availability of + virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param platform_update_domain_count: Update Domain count. + :type platform_update_domain_count: int + :param platform_fault_domain_count: Fault Domain count. + :type platform_fault_domain_count: int + :param virtual_machines: A list of references to all virtual machines in + the availability set. + :type virtual_machines: + list[~azure.mgmt.compute.v2016_04_30_preview.models.SubResource] + :ivar statuses: The resource status information. + :vartype statuses: + list[~azure.mgmt.compute.v2016_04_30_preview.models.InstanceViewStatus] + :param managed: If the availability set supports managed disks. + :type managed: bool + :param sku: Sku of the availability set + :type sku: ~azure.mgmt.compute.v2016_04_30_preview.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'statuses': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'platform_update_domain_count': {'key': 'properties.platformUpdateDomainCount', 'type': 'int'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResource]'}, + 'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'}, + 'managed': {'key': 'properties.managed', 'type': 'bool'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, location: str, tags=None, platform_update_domain_count: int=None, platform_fault_domain_count: int=None, virtual_machines=None, managed: bool=None, sku=None, **kwargs) -> None: + super(AvailabilitySet, self).__init__(location=location, tags=tags, **kwargs) + self.platform_update_domain_count = platform_update_domain_count + self.platform_fault_domain_count = platform_fault_domain_count + self.virtual_machines = virtual_machines + self.statuses = None + self.managed = managed + self.sku = sku diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/boot_diagnostics.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/boot_diagnostics.py index c94d188e3fba..ca3dbdd4f23c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/boot_diagnostics.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/boot_diagnostics.py @@ -32,7 +32,7 @@ class BootDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, enabled=None, storage_uri=None): - super(BootDiagnostics, self).__init__() - self.enabled = enabled - self.storage_uri = storage_uri + def __init__(self, **kwargs): + super(BootDiagnostics, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.storage_uri = kwargs.get('storage_uri', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/boot_diagnostics_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/boot_diagnostics_instance_view.py index 4ec7b385558d..6fe1f84a3910 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/boot_diagnostics_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/boot_diagnostics_instance_view.py @@ -26,7 +26,7 @@ class BootDiagnosticsInstanceView(Model): 'serial_console_log_blob_uri': {'key': 'serialConsoleLogBlobUri', 'type': 'str'}, } - def __init__(self, console_screenshot_blob_uri=None, serial_console_log_blob_uri=None): - super(BootDiagnosticsInstanceView, self).__init__() - self.console_screenshot_blob_uri = console_screenshot_blob_uri - self.serial_console_log_blob_uri = serial_console_log_blob_uri + def __init__(self, **kwargs): + super(BootDiagnosticsInstanceView, self).__init__(**kwargs) + self.console_screenshot_blob_uri = kwargs.get('console_screenshot_blob_uri', None) + self.serial_console_log_blob_uri = kwargs.get('serial_console_log_blob_uri', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/boot_diagnostics_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/boot_diagnostics_instance_view_py3.py new file mode 100644 index 000000000000..d85b51981ab9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/boot_diagnostics_instance_view_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class BootDiagnosticsInstanceView(Model): + """The instance view of a virtual machine boot diagnostics. + + :param console_screenshot_blob_uri: The console screenshot blob URI. + :type console_screenshot_blob_uri: str + :param serial_console_log_blob_uri: The Linux serial console log blob Uri. + :type serial_console_log_blob_uri: str + """ + + _attribute_map = { + 'console_screenshot_blob_uri': {'key': 'consoleScreenshotBlobUri', 'type': 'str'}, + 'serial_console_log_blob_uri': {'key': 'serialConsoleLogBlobUri', 'type': 'str'}, + } + + def __init__(self, *, console_screenshot_blob_uri: str=None, serial_console_log_blob_uri: str=None, **kwargs) -> None: + super(BootDiagnosticsInstanceView, self).__init__(**kwargs) + self.console_screenshot_blob_uri = console_screenshot_blob_uri + self.serial_console_log_blob_uri = serial_console_log_blob_uri diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/boot_diagnostics_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/boot_diagnostics_py3.py new file mode 100644 index 000000000000..b0a756ea4fa0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/boot_diagnostics_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class BootDiagnostics(Model): + """Boot Diagnostics is a debugging feature which allows you to view Console + Output and Screenshot to diagnose VM status.

    For Linux Virtual + Machines, you can easily view the output of your console log.

    For + both Windows and Linux virtual machines, Azure also enables you to see a + screenshot of the VM from the hypervisor. + + :param enabled: Whether boot diagnostics should be enabled on the Virtual + Machine. + :type enabled: bool + :param storage_uri: Uri of the storage account to use for placing the + console output and screenshot. + :type storage_uri: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, storage_uri: str=None, **kwargs) -> None: + super(BootDiagnostics, self).__init__(**kwargs) + self.enabled = enabled + self.storage_uri = storage_uri diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/compute_long_running_operation_properties.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/compute_long_running_operation_properties.py index f8ca23e0ccdf..66ff353eb206 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/compute_long_running_operation_properties.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/compute_long_running_operation_properties.py @@ -23,6 +23,6 @@ class ComputeLongRunningOperationProperties(Model): 'output': {'key': 'output', 'type': 'object'}, } - def __init__(self, output=None): - super(ComputeLongRunningOperationProperties, self).__init__() - self.output = output + def __init__(self, **kwargs): + super(ComputeLongRunningOperationProperties, self).__init__(**kwargs) + self.output = kwargs.get('output', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/compute_long_running_operation_properties_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/compute_long_running_operation_properties_py3.py new file mode 100644 index 000000000000..a4ffd6c8c32f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/compute_long_running_operation_properties_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class ComputeLongRunningOperationProperties(Model): + """Compute-specific operation properties, including output. + + :param output: Operation output data (raw JSON) + :type output: object + """ + + _attribute_map = { + 'output': {'key': 'output', 'type': 'object'}, + } + + def __init__(self, *, output=None, **kwargs) -> None: + super(ComputeLongRunningOperationProperties, self).__init__(**kwargs) + self.output = output diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/compute_management_client_enums.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/compute_management_client_enums.py index c488a02cc4e6..af9eb5a77018 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/compute_management_client_enums.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/compute_management_client_enums.py @@ -12,20 +12,20 @@ from enum import Enum -class StatusLevelTypes(Enum): +class StatusLevelTypes(str, Enum): info = "Info" warning = "Warning" error = "Error" -class OperatingSystemTypes(Enum): +class OperatingSystemTypes(str, Enum): windows = "Windows" linux = "Linux" -class VirtualMachineSizeTypes(Enum): +class VirtualMachineSizeTypes(str, Enum): basic_a0 = "Basic_A0" basic_a1 = "Basic_A1" @@ -92,72 +92,72 @@ class VirtualMachineSizeTypes(Enum): standard_gs5 = "Standard_GS5" -class CachingTypes(Enum): +class CachingTypes(str, Enum): none = "None" read_only = "ReadOnly" read_write = "ReadWrite" -class DiskCreateOptionTypes(Enum): +class DiskCreateOptionTypes(str, Enum): from_image = "FromImage" empty = "Empty" attach = "Attach" -class StorageAccountTypes(Enum): +class StorageAccountTypes(str, Enum): standard_lrs = "Standard_LRS" premium_lrs = "Premium_LRS" -class PassNames(Enum): +class PassNames(str, Enum): oobe_system = "OobeSystem" -class ComponentNames(Enum): +class ComponentNames(str, Enum): microsoft_windows_shell_setup = "Microsoft-Windows-Shell-Setup" -class SettingNames(Enum): +class SettingNames(str, Enum): auto_logon = "AutoLogon" first_logon_commands = "FirstLogonCommands" -class ProtocolTypes(Enum): +class ProtocolTypes(str, Enum): http = "Http" https = "Https" -class ResourceIdentityType(Enum): +class ResourceIdentityType(str, Enum): system_assigned = "SystemAssigned" -class UpgradeMode(Enum): +class UpgradeMode(str, Enum): automatic = "Automatic" manual = "Manual" -class OperatingSystemStateTypes(Enum): +class OperatingSystemStateTypes(str, Enum): generalized = "Generalized" specialized = "Specialized" -class VirtualMachineScaleSetSkuScaleType(Enum): +class VirtualMachineScaleSetSkuScaleType(str, Enum): automatic = "Automatic" none = "None" -class DiskCreateOption(Enum): +class DiskCreateOption(str, Enum): empty = "Empty" attach = "Attach" @@ -167,12 +167,12 @@ class DiskCreateOption(Enum): restore = "Restore" -class AccessLevel(Enum): +class AccessLevel(str, Enum): none = "None" read = "Read" -class InstanceViewTypes(Enum): +class InstanceViewTypes(str, Enum): instance_view = "instanceView" diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/creation_data.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/creation_data.py index 3ee2d7cc0d8a..1cd8716a89d5 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/creation_data.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/creation_data.py @@ -15,8 +15,10 @@ class CreationData(Model): """Data used when creating a disk. - :param create_option: This enumerates the possible sources of a disk's - creation. Possible values include: 'Empty', 'Attach', 'FromImage', + All required parameters must be populated in order to send to Azure. + + :param create_option: Required. This enumerates the possible sources of a + disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' :type create_option: str or ~azure.mgmt.compute.v2016_04_30_preview.models.DiskCreateOption @@ -50,10 +52,10 @@ class CreationData(Model): 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, } - def __init__(self, create_option, storage_account_id=None, image_reference=None, source_uri=None, source_resource_id=None): - super(CreationData, self).__init__() - self.create_option = create_option - self.storage_account_id = storage_account_id - self.image_reference = image_reference - self.source_uri = source_uri - self.source_resource_id = source_resource_id + def __init__(self, **kwargs): + super(CreationData, self).__init__(**kwargs) + self.create_option = kwargs.get('create_option', None) + self.storage_account_id = kwargs.get('storage_account_id', None) + self.image_reference = kwargs.get('image_reference', None) + self.source_uri = kwargs.get('source_uri', None) + self.source_resource_id = kwargs.get('source_resource_id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/creation_data_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/creation_data_py3.py new file mode 100644 index 000000000000..f0206b35dc92 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/creation_data_py3.py @@ -0,0 +1,61 @@ +# 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 msrest.serialization import Model + + +class CreationData(Model): + """Data used when creating a disk. + + All required parameters must be populated in order to send to Azure. + + :param create_option: Required. This enumerates the possible sources of a + disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', + 'Import', 'Copy', 'Restore' + :type create_option: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.DiskCreateOption + :param storage_account_id: If createOption is Import, the Azure Resource + Manager identifier of the storage account containing the blob to import as + a disk. Required only if the blob is in a different subscription + :type storage_account_id: str + :param image_reference: Disk source information. + :type image_reference: + ~azure.mgmt.compute.v2016_04_30_preview.models.ImageDiskReference + :param source_uri: If createOption is Import, this is a SAS URI to a blob + to be imported into a managed disk. If createOption is Copy, this is a + relative Uri containing the id of the source snapshot to be copied into a + managed disk. + :type source_uri: str + :param source_resource_id: If createOption is Copy, this is the ARM id of + the source snapshot or disk. If createOption is Restore, this is the + ARM-like id of the source disk restore point. + :type source_resource_id: str + """ + + _validation = { + 'create_option': {'required': True}, + } + + _attribute_map = { + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOption'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'image_reference': {'key': 'imageReference', 'type': 'ImageDiskReference'}, + 'source_uri': {'key': 'sourceUri', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + } + + def __init__(self, *, create_option, storage_account_id: str=None, image_reference=None, source_uri: str=None, source_resource_id: str=None, **kwargs) -> None: + super(CreationData, self).__init__(**kwargs) + self.create_option = create_option + self.storage_account_id = storage_account_id + self.image_reference = image_reference + self.source_uri = source_uri + self.source_resource_id = source_resource_id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/data_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/data_disk.py index 0cc1b1dd92b0..1db128727007 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/data_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/data_disk.py @@ -15,9 +15,11 @@ class DataDisk(Model): """Describes a data disk. - :param 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. + All required parameters must be populated in order to send to Azure. + + :param lun: Required. 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. :type lun: int :param name: The disk name. :type name: str @@ -35,8 +37,8 @@ class DataDisk(Model): storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2016_04_30_preview.models.CachingTypes - :param create_option: Specifies how the virtual machine should be - created.

    Possible values are:

    **Attach** \\u2013 This + :param create_option: Required. Specifies how the virtual machine should + be created.

    Possible values are:

    **Attach** \\u2013 This value is used when you are using a specialized disk to create the virtual machine.

    **FromImage** \\u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform @@ -70,13 +72,13 @@ class DataDisk(Model): 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, } - def __init__(self, lun, create_option, name=None, vhd=None, image=None, caching=None, disk_size_gb=None, managed_disk=None): - super(DataDisk, self).__init__() - self.lun = lun - self.name = name - self.vhd = vhd - self.image = image - self.caching = caching - self.create_option = create_option - self.disk_size_gb = disk_size_gb - self.managed_disk = managed_disk + def __init__(self, **kwargs): + super(DataDisk, self).__init__(**kwargs) + self.lun = kwargs.get('lun', None) + self.name = kwargs.get('name', None) + self.vhd = kwargs.get('vhd', None) + self.image = kwargs.get('image', None) + self.caching = kwargs.get('caching', None) + self.create_option = kwargs.get('create_option', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.managed_disk = kwargs.get('managed_disk', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/data_disk_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/data_disk_image.py index 60a4befc525f..b5dbfcefb472 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/data_disk_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/data_disk_image.py @@ -32,6 +32,6 @@ class DataDiskImage(Model): 'lun': {'key': 'lun', 'type': 'int'}, } - def __init__(self): - super(DataDiskImage, self).__init__() + def __init__(self, **kwargs): + super(DataDiskImage, self).__init__(**kwargs) self.lun = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/data_disk_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/data_disk_image_py3.py new file mode 100644 index 000000000000..8431a3988502 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/data_disk_image_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class DataDiskImage(Model): + """Contains the data disk images information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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. + :vartype lun: int + """ + + _validation = { + 'lun': {'readonly': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(DataDiskImage, self).__init__(**kwargs) + self.lun = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/data_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/data_disk_py3.py new file mode 100644 index 000000000000..adcc250ba2e2 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/data_disk_py3.py @@ -0,0 +1,84 @@ +# 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 msrest.serialization import Model + + +class DataDisk(Model): + """Describes a data disk. + + All required parameters must be populated in order to send to Azure. + + :param lun: Required. 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. + :type lun: int + :param name: The disk name. + :type name: str + :param vhd: The virtual hard disk. + :type vhd: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualHardDisk + :param image: The source user image virtual hard disk. The virtual hard + disk will be copied before being attached to the virtual machine. If + SourceImage is provided, the destination virtual hard drive must not + exist. + :type image: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualHardDisk + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.CachingTypes + :param create_option: Required. Specifies how the virtual machine should + be created.

    Possible values are:

    **Attach** \\u2013 This + value is used when you are using a specialized disk to create the virtual + machine.

    **FromImage** \\u2013 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. Possible values include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in + gigabytes. This element can be used to overwrite the name of the disk in a + virtual machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2016_04_30_preview.models.ManagedDiskParameters + """ + + _validation = { + 'lun': {'required': True}, + 'create_option': {'required': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'vhd': {'key': 'vhd', 'type': 'VirtualHardDisk'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, + } + + def __init__(self, *, lun: int, create_option, name: str=None, vhd=None, image=None, caching=None, disk_size_gb: int=None, managed_disk=None, **kwargs) -> None: + super(DataDisk, self).__init__(**kwargs) + self.lun = lun + self.name = name + self.vhd = vhd + self.image = image + self.caching = caching + self.create_option = create_option + self.disk_size_gb = disk_size_gb + self.managed_disk = managed_disk diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/diagnostics_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/diagnostics_profile.py index f25430c35478..7e52b45ee5c8 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/diagnostics_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/diagnostics_profile.py @@ -29,6 +29,6 @@ class DiagnosticsProfile(Model): 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnostics'}, } - def __init__(self, boot_diagnostics=None): - super(DiagnosticsProfile, self).__init__() - self.boot_diagnostics = boot_diagnostics + def __init__(self, **kwargs): + super(DiagnosticsProfile, self).__init__(**kwargs) + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/diagnostics_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/diagnostics_profile_py3.py new file mode 100644 index 000000000000..f30752cea400 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/diagnostics_profile_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class DiagnosticsProfile(Model): + """Specifies the boot diagnostic settings state.

    Minimum api-version: + 2015-06-15. + + :param boot_diagnostics: Boot Diagnostics is a debugging feature which + allows you to view Console Output and Screenshot to diagnose VM status. +

    For Linux Virtual Machines, you can easily view the output of + your console log.

    For both Windows and Linux virtual machines, + Azure also enables you to see a screenshot of the VM from the hypervisor. + :type boot_diagnostics: + ~azure.mgmt.compute.v2016_04_30_preview.models.BootDiagnostics + """ + + _attribute_map = { + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnostics'}, + } + + def __init__(self, *, boot_diagnostics=None, **kwargs) -> None: + super(DiagnosticsProfile, self).__init__(**kwargs) + self.boot_diagnostics = boot_diagnostics diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk.py index 00f0a664e465..03748ff9aef8 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk.py @@ -18,13 +18,15 @@ class Disk(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -38,8 +40,8 @@ class Disk(Resource): 'Windows', 'Linux' :type os_type: str or ~azure.mgmt.compute.v2016_04_30_preview.models.OperatingSystemTypes - :param creation_data: Disk source information. CreationData information - cannot be changed after the disk has been created. + :param creation_data: Required. Disk source information. CreationData + information cannot be changed after the disk has been created. :type creation_data: ~azure.mgmt.compute.v2016_04_30_preview.models.CreationData :param disk_size_gb: If creationData.createOption is Empty, this field is @@ -85,13 +87,13 @@ class Disk(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, location, creation_data, tags=None, account_type=None, os_type=None, disk_size_gb=None, encryption_settings=None): - super(Disk, self).__init__(location=location, tags=tags) - self.account_type = account_type + def __init__(self, **kwargs): + super(Disk, self).__init__(**kwargs) + self.account_type = kwargs.get('account_type', None) self.time_created = None - self.os_type = os_type - self.creation_data = creation_data - self.disk_size_gb = disk_size_gb - self.encryption_settings = encryption_settings + self.os_type = kwargs.get('os_type', None) + self.creation_data = kwargs.get('creation_data', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings = kwargs.get('encryption_settings', None) self.owner_id = None self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_encryption_settings.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_encryption_settings.py index a7b3e3f238a3..65fd8f27b79d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_encryption_settings.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_encryption_settings.py @@ -34,8 +34,8 @@ class DiskEncryptionSettings(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, disk_encryption_key=None, key_encryption_key=None, enabled=None): - super(DiskEncryptionSettings, self).__init__() - self.disk_encryption_key = disk_encryption_key - self.key_encryption_key = key_encryption_key - self.enabled = enabled + def __init__(self, **kwargs): + super(DiskEncryptionSettings, self).__init__(**kwargs) + self.disk_encryption_key = kwargs.get('disk_encryption_key', None) + self.key_encryption_key = kwargs.get('key_encryption_key', None) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_encryption_settings_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_encryption_settings_py3.py new file mode 100644 index 000000000000..5660286740dc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_encryption_settings_py3.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 msrest.serialization import Model + + +class DiskEncryptionSettings(Model): + """Describes a Encryption Settings for a Disk. + + :param disk_encryption_key: Specifies the location of the disk encryption + key, which is a Key Vault Secret. + :type disk_encryption_key: + ~azure.mgmt.compute.v2016_04_30_preview.models.KeyVaultSecretReference + :param key_encryption_key: Specifies the location of the key encryption + key in Key Vault. + :type key_encryption_key: + ~azure.mgmt.compute.v2016_04_30_preview.models.KeyVaultKeyReference + :param enabled: Specifies whether disk encryption should be enabled on the + virtual machine. + :type enabled: bool + """ + + _attribute_map = { + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultKeyReference'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, disk_encryption_key=None, key_encryption_key=None, enabled: bool=None, **kwargs) -> None: + super(DiskEncryptionSettings, self).__init__(**kwargs) + self.disk_encryption_key = disk_encryption_key + self.key_encryption_key = key_encryption_key + self.enabled = enabled diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_instance_view.py index 9ac7cab9e323..d74755f0ec76 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_instance_view.py @@ -27,7 +27,7 @@ class DiskInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, name=None, statuses=None): - super(DiskInstanceView, self).__init__() - self.name = name - self.statuses = statuses + def __init__(self, **kwargs): + super(DiskInstanceView, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_instance_view_py3.py new file mode 100644 index 000000000000..1ce314459fad --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_instance_view_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class DiskInstanceView(Model): + """The instance view of the disk. + + :param name: The disk name. + :type name: str + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2016_04_30_preview.models.InstanceViewStatus] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, name: str=None, statuses=None, **kwargs) -> None: + super(DiskInstanceView, self).__init__(**kwargs) + self.name = name + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_py3.py new file mode 100644 index 000000000000..cf3b3dab5351 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_py3.py @@ -0,0 +1,99 @@ +# 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 .resource import Resource + + +class Disk(Resource): + """Disk 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 Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param account_type: the storage account type of the disk. Possible values + include: 'Standard_LRS', 'Premium_LRS' + :type account_type: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.StorageAccountTypes + :ivar time_created: The time when the disk was created. + :vartype time_created: datetime + :param os_type: The Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.OperatingSystemTypes + :param creation_data: Required. Disk source information. CreationData + information cannot be changed after the disk has been created. + :type creation_data: + ~azure.mgmt.compute.v2016_04_30_preview.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2016_04_30_preview.models.EncryptionSettings + :ivar owner_id: A relative URI containing the VM id that has the disk + attached. + :vartype owner_id: str + :ivar provisioning_state: The disk provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'time_created': {'readonly': True}, + 'creation_data': {'required': True}, + 'owner_id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'account_type': {'key': 'properties.accountType', 'type': 'StorageAccountTypes'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + 'owner_id': {'key': 'properties.ownerId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, creation_data, tags=None, account_type=None, os_type=None, disk_size_gb: int=None, encryption_settings=None, **kwargs) -> None: + super(Disk, self).__init__(location=location, tags=tags, **kwargs) + self.account_type = account_type + self.time_created = None + self.os_type = os_type + self.creation_data = creation_data + self.disk_size_gb = disk_size_gb + self.encryption_settings = encryption_settings + self.owner_id = None + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_update.py index e770e8e622a6..412257542cfc 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_update.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_update.py @@ -49,10 +49,10 @@ class DiskUpdate(ResourceUpdate): 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, } - def __init__(self, tags=None, account_type=None, os_type=None, creation_data=None, disk_size_gb=None, encryption_settings=None): - super(DiskUpdate, self).__init__(tags=tags) - self.account_type = account_type - self.os_type = os_type - self.creation_data = creation_data - self.disk_size_gb = disk_size_gb - self.encryption_settings = encryption_settings + def __init__(self, **kwargs): + super(DiskUpdate, self).__init__(**kwargs) + self.account_type = kwargs.get('account_type', None) + self.os_type = kwargs.get('os_type', None) + self.creation_data = kwargs.get('creation_data', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings = kwargs.get('encryption_settings', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_update_py3.py new file mode 100644 index 000000000000..545c2a218368 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/disk_update_py3.py @@ -0,0 +1,58 @@ +# 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 .resource_update import ResourceUpdate + + +class DiskUpdate(ResourceUpdate): + """Disk update resource. + + :param tags: Resource tags + :type tags: dict[str, str] + :param account_type: the storage account type of the disk. Possible values + include: 'Standard_LRS', 'Premium_LRS' + :type account_type: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.StorageAccountTypes + :param os_type: the Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.OperatingSystemTypes + :param creation_data: disk source information. CreationData information + cannot be changed after the disk has been created. + :type creation_data: + ~azure.mgmt.compute.v2016_04_30_preview.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2016_04_30_preview.models.EncryptionSettings + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'account_type': {'key': 'properties.accountType', 'type': 'StorageAccountTypes'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + } + + def __init__(self, *, tags=None, account_type=None, os_type=None, creation_data=None, disk_size_gb: int=None, encryption_settings=None, **kwargs) -> None: + super(DiskUpdate, self).__init__(tags=tags, **kwargs) + self.account_type = account_type + self.os_type = os_type + self.creation_data = creation_data + self.disk_size_gb = disk_size_gb + self.encryption_settings = encryption_settings diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/encryption_settings.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/encryption_settings.py index 1e479330b6ed..3d7c6049d35e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/encryption_settings.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/encryption_settings.py @@ -37,8 +37,8 @@ class EncryptionSettings(Model): 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultAndKeyReference'}, } - def __init__(self, enabled=None, disk_encryption_key=None, key_encryption_key=None): - super(EncryptionSettings, self).__init__() - self.enabled = enabled - self.disk_encryption_key = disk_encryption_key - self.key_encryption_key = key_encryption_key + def __init__(self, **kwargs): + super(EncryptionSettings, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.disk_encryption_key = kwargs.get('disk_encryption_key', None) + self.key_encryption_key = kwargs.get('key_encryption_key', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/encryption_settings_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/encryption_settings_py3.py new file mode 100644 index 000000000000..2cd6b654abdb --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/encryption_settings_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EncryptionSettings(Model): + """Encryption settings for disk or snapshot. + + :param enabled: Set this flag to true and provide DiskEncryptionKey and + optional KeyEncryptionKey to enable encryption. Set this flag to false and + remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If + EncryptionSettings is null in the request object, the existing settings + remain unchanged. + :type enabled: bool + :param disk_encryption_key: Key Vault Secret Url and vault id of the disk + encryption key + :type disk_encryption_key: + ~azure.mgmt.compute.v2016_04_30_preview.models.KeyVaultAndSecretReference + :param key_encryption_key: Key Vault Key Url and vault id of the key + encryption key + :type key_encryption_key: + ~azure.mgmt.compute.v2016_04_30_preview.models.KeyVaultAndKeyReference + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultAndSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultAndKeyReference'}, + } + + def __init__(self, *, enabled: bool=None, disk_encryption_key=None, key_encryption_key=None, **kwargs) -> None: + super(EncryptionSettings, self).__init__(**kwargs) + self.enabled = enabled + self.disk_encryption_key = disk_encryption_key + self.key_encryption_key = key_encryption_key diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/grant_access_data.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/grant_access_data.py index 23829c0a3342..a0de15034343 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/grant_access_data.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/grant_access_data.py @@ -15,11 +15,13 @@ class GrantAccessData(Model): """Data used for requesting a SAS. - :param access: Possible values include: 'None', 'Read' + All required parameters must be populated in order to send to Azure. + + :param access: Required. Possible values include: 'None', 'Read' :type access: str or ~azure.mgmt.compute.v2016_04_30_preview.models.AccessLevel - :param duration_in_seconds: Time duration in seconds until the SAS access - expires. + :param duration_in_seconds: Required. Time duration in seconds until the + SAS access expires. :type duration_in_seconds: int """ @@ -33,7 +35,7 @@ class GrantAccessData(Model): 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'int'}, } - def __init__(self, access, duration_in_seconds): - super(GrantAccessData, self).__init__() - self.access = access - self.duration_in_seconds = duration_in_seconds + def __init__(self, **kwargs): + super(GrantAccessData, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.duration_in_seconds = kwargs.get('duration_in_seconds', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/grant_access_data_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/grant_access_data_py3.py new file mode 100644 index 000000000000..65416406cdcd --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/grant_access_data_py3.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 msrest.serialization import Model + + +class GrantAccessData(Model): + """Data used for requesting a SAS. + + All required parameters must be populated in order to send to Azure. + + :param access: Required. Possible values include: 'None', 'Read' + :type access: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.AccessLevel + :param duration_in_seconds: Required. Time duration in seconds until the + SAS access expires. + :type duration_in_seconds: int + """ + + _validation = { + 'access': {'required': True}, + 'duration_in_seconds': {'required': True}, + } + + _attribute_map = { + 'access': {'key': 'access', 'type': 'AccessLevel'}, + 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'int'}, + } + + def __init__(self, *, access, duration_in_seconds: int, **kwargs) -> None: + super(GrantAccessData, self).__init__(**kwargs) + self.access = access + self.duration_in_seconds = duration_in_seconds diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/hardware_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/hardware_profile.py index 5e69c7f08003..e9c70839ab5b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/hardware_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/hardware_profile.py @@ -50,6 +50,6 @@ class HardwareProfile(Model): 'vm_size': {'key': 'vmSize', 'type': 'str'}, } - def __init__(self, vm_size=None): - super(HardwareProfile, self).__init__() - self.vm_size = vm_size + def __init__(self, **kwargs): + super(HardwareProfile, self).__init__(**kwargs) + self.vm_size = kwargs.get('vm_size', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/hardware_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/hardware_profile_py3.py new file mode 100644 index 000000000000..97df538e0894 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/hardware_profile_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class HardwareProfile(Model): + """Specifies the hardware settings for the virtual machine. + + :param vm_size: Specifies the size of the virtual machine. For more + information about virtual machine sizes, see [Sizes for virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    The available VM sizes depend on region and availability set. For + a list of available sizes use these APIs:

    [List all available + virtual machine sizes in an availability + set](virtualmachines-list-sizes-availability-set.md)

    [List all + available virtual machine sizes in a + region](virtualmachines-list-sizes-region.md)

    [List all available + virtual machine sizes for + resizing](virtualmachines-list-sizes-for-resizing.md). Possible values + include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', + 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', + 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', + 'Standard_A10', 'Standard_A11', 'Standard_D1', 'Standard_D2', + 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', + 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', + 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', + 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', + 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', 'Standard_DS3', + 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', + 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', 'Standard_DS3_v2', + 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2', + 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', + 'Standard_DS15_v2', 'Standard_G1', 'Standard_G2', 'Standard_G3', + 'Standard_G4', 'Standard_G5', 'Standard_GS1', 'Standard_GS2', + 'Standard_GS3', 'Standard_GS4', 'Standard_GS5' + :type vm_size: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineSizeTypes + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + } + + def __init__(self, *, vm_size=None, **kwargs) -> None: + super(HardwareProfile, self).__init__(**kwargs) + self.vm_size = vm_size diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image.py index 54858e351db6..260c7c468d86 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image.py @@ -20,13 +20,15 @@ class Image(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -61,8 +63,8 @@ class Image(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, location, tags=None, source_virtual_machine=None, storage_profile=None): - super(Image, self).__init__(location=location, tags=tags) - self.source_virtual_machine = source_virtual_machine - self.storage_profile = storage_profile + def __init__(self, **kwargs): + super(Image, self).__init__(**kwargs) + self.source_virtual_machine = kwargs.get('source_virtual_machine', None) + self.storage_profile = kwargs.get('storage_profile', None) self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_data_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_data_disk.py index b10d73ae0af0..d696f2804c4b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_data_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_data_disk.py @@ -15,9 +15,11 @@ class ImageDataDisk(Model): """Describes a data disk. - :param 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. + All required parameters must be populated in order to send to Azure. + + :param lun: Required. 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. :type lun: int :param snapshot: The snapshot. :type snapshot: ~azure.mgmt.compute.v2016_04_30_preview.models.SubResource @@ -51,11 +53,11 @@ class ImageDataDisk(Model): 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, } - def __init__(self, lun, snapshot=None, managed_disk=None, blob_uri=None, caching=None, disk_size_gb=None): - super(ImageDataDisk, self).__init__() - self.lun = lun - self.snapshot = snapshot - self.managed_disk = managed_disk - self.blob_uri = blob_uri - self.caching = caching - self.disk_size_gb = disk_size_gb + def __init__(self, **kwargs): + super(ImageDataDisk, self).__init__(**kwargs) + self.lun = kwargs.get('lun', None) + self.snapshot = kwargs.get('snapshot', None) + self.managed_disk = kwargs.get('managed_disk', None) + self.blob_uri = kwargs.get('blob_uri', None) + self.caching = kwargs.get('caching', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_data_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_data_disk_py3.py new file mode 100644 index 000000000000..02a40d76f288 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_data_disk_py3.py @@ -0,0 +1,63 @@ +# 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 msrest.serialization import Model + + +class ImageDataDisk(Model): + """Describes a data disk. + + All required parameters must be populated in order to send to Azure. + + :param lun: Required. 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. + :type lun: int + :param snapshot: The snapshot. + :type snapshot: ~azure.mgmt.compute.v2016_04_30_preview.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: + ~azure.mgmt.compute.v2016_04_30_preview.models.SubResource + :param blob_uri: The Virtual Hard Disk. + :type blob_uri: str + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.CachingTypes + :param disk_size_gb: Specifies the size of empty data disks in gigabytes. + This element can be used to overwrite the name of the disk in a virtual + machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + """ + + _validation = { + 'lun': {'required': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + 'snapshot': {'key': 'snapshot', 'type': 'SubResource'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'SubResource'}, + 'blob_uri': {'key': 'blobUri', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + } + + def __init__(self, *, lun: int, snapshot=None, managed_disk=None, blob_uri: str=None, caching=None, disk_size_gb: int=None, **kwargs) -> None: + super(ImageDataDisk, self).__init__(**kwargs) + self.lun = lun + self.snapshot = snapshot + self.managed_disk = managed_disk + self.blob_uri = blob_uri + self.caching = caching + self.disk_size_gb = disk_size_gb diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_disk_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_disk_reference.py index e3f08988c180..247d532379fc 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_disk_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_disk_reference.py @@ -15,8 +15,10 @@ class ImageDiskReference(Model): """The source image used for creating the disk. - :param id: A relative uri containing either a Platform Imgage Repository - or user image reference. + All required parameters must be populated in order to send to Azure. + + :param id: Required. A relative uri containing either a Platform Imgage + Repository or user image reference. :type id: str :param lun: If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS @@ -33,7 +35,7 @@ class ImageDiskReference(Model): 'lun': {'key': 'lun', 'type': 'int'}, } - def __init__(self, id, lun=None): - super(ImageDiskReference, self).__init__() - self.id = id - self.lun = lun + def __init__(self, **kwargs): + super(ImageDiskReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.lun = kwargs.get('lun', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_disk_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_disk_reference_py3.py new file mode 100644 index 000000000000..191563557acb --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_disk_reference_py3.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 msrest.serialization import Model + + +class ImageDiskReference(Model): + """The source image used for creating the disk. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. A relative uri containing either a Platform Imgage + Repository or user image reference. + :type id: str + :param lun: If the disk is created from an image's data disk, this is an + index that indicates which of the data disks in the image to use. For OS + disks, this field is null. + :type lun: int + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__(self, *, id: str, lun: int=None, **kwargs) -> None: + super(ImageDiskReference, self).__init__(**kwargs) + self.id = id + self.lun = lun diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_os_disk.py index 3995693859b1..98eea6ff040f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_os_disk.py @@ -15,14 +15,16 @@ class ImageOSDisk(Model): """Describes an Operating System disk. - :param os_type: This property allows you to specify the type of the OS - that is included in the disk if creating a VM from a custom image. + All required parameters must be populated in order to send to Azure. + + :param os_type: Required. This property allows you to specify the type of + the OS that is included in the disk if creating a VM from a custom image.

    Possible values are:

    **Windows**

    **Linux**. Possible values include: 'Windows', 'Linux' :type os_type: str or ~azure.mgmt.compute.v2016_04_30_preview.models.OperatingSystemTypes - :param os_state: The OS State. Possible values include: 'Generalized', - 'Specialized' + :param os_state: Required. The OS State. Possible values include: + 'Generalized', 'Specialized' :type os_state: str or ~azure.mgmt.compute.v2016_04_30_preview.models.OperatingSystemStateTypes :param snapshot: The snapshot. @@ -59,12 +61,12 @@ class ImageOSDisk(Model): 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, } - def __init__(self, os_type, os_state, snapshot=None, managed_disk=None, blob_uri=None, caching=None, disk_size_gb=None): - super(ImageOSDisk, self).__init__() - self.os_type = os_type - self.os_state = os_state - self.snapshot = snapshot - self.managed_disk = managed_disk - self.blob_uri = blob_uri - self.caching = caching - self.disk_size_gb = disk_size_gb + def __init__(self, **kwargs): + super(ImageOSDisk, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.os_state = kwargs.get('os_state', None) + self.snapshot = kwargs.get('snapshot', None) + self.managed_disk = kwargs.get('managed_disk', None) + self.blob_uri = kwargs.get('blob_uri', None) + self.caching = kwargs.get('caching', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_os_disk_py3.py new file mode 100644 index 000000000000..1080364a701b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_os_disk_py3.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class ImageOSDisk(Model): + """Describes an Operating System disk. + + All required parameters must be populated in order to send to Azure. + + :param os_type: Required. This property allows you to specify the type of + the OS that is included in the disk if creating a VM from a custom image. +

    Possible values are:

    **Windows**

    **Linux**. + Possible values include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.OperatingSystemTypes + :param os_state: Required. The OS State. Possible values include: + 'Generalized', 'Specialized' + :type os_state: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.OperatingSystemStateTypes + :param snapshot: The snapshot. + :type snapshot: ~azure.mgmt.compute.v2016_04_30_preview.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: + ~azure.mgmt.compute.v2016_04_30_preview.models.SubResource + :param blob_uri: The Virtual Hard Disk. + :type blob_uri: str + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.CachingTypes + :param disk_size_gb: Specifies the size of empty data disks in gigabytes. + This element can be used to overwrite the name of the disk in a virtual + machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + """ + + _validation = { + 'os_type': {'required': True}, + 'os_state': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'os_state': {'key': 'osState', 'type': 'OperatingSystemStateTypes'}, + 'snapshot': {'key': 'snapshot', 'type': 'SubResource'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'SubResource'}, + 'blob_uri': {'key': 'blobUri', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + } + + def __init__(self, *, os_type, os_state, snapshot=None, managed_disk=None, blob_uri: str=None, caching=None, disk_size_gb: int=None, **kwargs) -> None: + super(ImageOSDisk, self).__init__(**kwargs) + self.os_type = os_type + self.os_state = os_state + self.snapshot = snapshot + self.managed_disk = managed_disk + self.blob_uri = blob_uri + self.caching = caching + self.disk_size_gb = disk_size_gb diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_py3.py new file mode 100644 index 000000000000..d035e3eb9106 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_py3.py @@ -0,0 +1,70 @@ +# 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 .resource import Resource + + +class Image(Resource): + """The source user image virtual hard disk. The virtual hard disk will be + copied before being attached to the virtual machine. If SourceImage is + provided, the destination virtual hard drive must not exist. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param source_virtual_machine: The source virtual machine from which Image + is created. + :type source_virtual_machine: + ~azure.mgmt.compute.v2016_04_30_preview.models.SubResource + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2016_04_30_preview.models.ImageStorageProfile + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source_virtual_machine': {'key': 'properties.sourceVirtualMachine', 'type': 'SubResource'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'ImageStorageProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, source_virtual_machine=None, storage_profile=None, **kwargs) -> None: + super(Image, self).__init__(location=location, tags=tags, **kwargs) + self.source_virtual_machine = source_virtual_machine + self.storage_profile = storage_profile + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_reference.py index 9ec2177fa5ad..b8f929f4ad70 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_reference.py @@ -46,9 +46,9 @@ class ImageReference(SubResource): 'version': {'key': 'version', 'type': 'str'}, } - def __init__(self, id=None, publisher=None, offer=None, sku=None, version=None): - super(ImageReference, self).__init__(id=id) - self.publisher = publisher - self.offer = offer - self.sku = sku - self.version = version + def __init__(self, **kwargs): + super(ImageReference, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.offer = kwargs.get('offer', None) + self.sku = kwargs.get('sku', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_reference_py3.py new file mode 100644 index 000000000000..f44047d4c087 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_reference_py3.py @@ -0,0 +1,54 @@ +# 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 .sub_resource import SubResource + + +class ImageReference(SubResource): + """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. + + :param id: Resource Id + :type id: str + :param publisher: The image publisher. + :type publisher: str + :param offer: Specifies the offer of the platform image or marketplace + image used to create the virtual machine. + :type offer: str + :param sku: The image SKU. + :type sku: str + :param 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. + :type version: str + """ + + _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'}, + } + + def __init__(self, *, id: str=None, publisher: str=None, offer: str=None, sku: str=None, version: str=None, **kwargs) -> None: + super(ImageReference, self).__init__(id=id, **kwargs) + self.publisher = publisher + self.offer = offer + self.sku = sku + self.version = version diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_storage_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_storage_profile.py index 3645216ebfba..46d13c36255e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_storage_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_storage_profile.py @@ -15,9 +15,11 @@ class ImageStorageProfile(Model): """Describes a storage profile. - :param os_disk: Specifies information about the operating system disk used - by the virtual machine.

    For more information about disks, see - [About disks and VHDs for Azure virtual + All required parameters must be populated in order to send to Azure. + + :param os_disk: Required. Specifies information about the operating system + disk used by the virtual machine.

    For more information about + disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). :type os_disk: ~azure.mgmt.compute.v2016_04_30_preview.models.ImageOSDisk :param data_disks: Specifies the parameters that are used to add a data @@ -37,7 +39,7 @@ class ImageStorageProfile(Model): 'data_disks': {'key': 'dataDisks', 'type': '[ImageDataDisk]'}, } - def __init__(self, os_disk, data_disks=None): - super(ImageStorageProfile, self).__init__() - self.os_disk = os_disk - self.data_disks = data_disks + def __init__(self, **kwargs): + super(ImageStorageProfile, self).__init__(**kwargs) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_storage_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_storage_profile_py3.py new file mode 100644 index 000000000000..7280e0fe8431 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_storage_profile_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class ImageStorageProfile(Model): + """Describes a storage profile. + + All required parameters must be populated in order to send to Azure. + + :param os_disk: Required. Specifies information about the operating system + disk used by the virtual machine.

    For more information about + disks, see [About disks and VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type os_disk: ~azure.mgmt.compute.v2016_04_30_preview.models.ImageOSDisk + :param data_disks: Specifies the parameters that are used to add a data + disk to a virtual machine.

    For more information about disks, see + [About disks and VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type data_disks: + list[~azure.mgmt.compute.v2016_04_30_preview.models.ImageDataDisk] + """ + + _validation = { + 'os_disk': {'required': True}, + } + + _attribute_map = { + 'os_disk': {'key': 'osDisk', 'type': 'ImageOSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[ImageDataDisk]'}, + } + + def __init__(self, *, os_disk, data_disks=None, **kwargs) -> None: + super(ImageStorageProfile, self).__init__(**kwargs) + self.os_disk = os_disk + self.data_disks = data_disks diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/inner_error.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/inner_error.py index de77683e2fc8..6324249d7c19 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/inner_error.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/inner_error.py @@ -26,7 +26,7 @@ class InnerError(Model): 'errordetail': {'key': 'errordetail', 'type': 'str'}, } - def __init__(self, exceptiontype=None, errordetail=None): - super(InnerError, self).__init__() - self.exceptiontype = exceptiontype - self.errordetail = errordetail + def __init__(self, **kwargs): + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = kwargs.get('exceptiontype', None) + self.errordetail = kwargs.get('errordetail', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/inner_error_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/inner_error_py3.py new file mode 100644 index 000000000000..ccec30d7b53f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/inner_error_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class InnerError(Model): + """Inner error details. + + :param exceptiontype: The exception type. + :type exceptiontype: str + :param errordetail: The internal error message or exception dump. + :type errordetail: str + """ + + _attribute_map = { + 'exceptiontype': {'key': 'exceptiontype', 'type': 'str'}, + 'errordetail': {'key': 'errordetail', 'type': 'str'}, + } + + def __init__(self, *, exceptiontype: str=None, errordetail: str=None, **kwargs) -> None: + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = exceptiontype + self.errordetail = errordetail diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/instance_view_status.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/instance_view_status.py index 9433ecb6d55a..6741b46ec8c2 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/instance_view_status.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/instance_view_status.py @@ -38,10 +38,10 @@ class InstanceViewStatus(Model): 'time': {'key': 'time', 'type': 'iso-8601'}, } - def __init__(self, code=None, level=None, display_status=None, message=None, time=None): - super(InstanceViewStatus, self).__init__() - self.code = code - self.level = level - self.display_status = display_status - self.message = message - self.time = time + def __init__(self, **kwargs): + super(InstanceViewStatus, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.level = kwargs.get('level', None) + self.display_status = kwargs.get('display_status', None) + self.message = kwargs.get('message', None) + self.time = kwargs.get('time', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/instance_view_status_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/instance_view_status_py3.py new file mode 100644 index 000000000000..44b6ee6e6ad4 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/instance_view_status_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class InstanceViewStatus(Model): + """Instance view status. + + :param code: The status code. + :type code: str + :param level: The level code. Possible values include: 'Info', 'Warning', + 'Error' + :type level: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.StatusLevelTypes + :param display_status: The short localizable label for the status. + :type display_status: str + :param message: The detailed status message, including for alerts and + error messages. + :type message: str + :param time: The time of the status. + :type time: datetime + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'StatusLevelTypes'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__(self, *, code: str=None, level=None, display_status: str=None, message: str=None, time=None, **kwargs) -> None: + super(InstanceViewStatus, self).__init__(**kwargs) + self.code = code + self.level = level + self.display_status = display_status + self.message = message + self.time = time diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_and_key_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_and_key_reference.py index fe085cebcdb2..29021b7bf88d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_and_key_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_and_key_reference.py @@ -16,11 +16,13 @@ class KeyVaultAndKeyReference(Model): """Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the encryptionKey. - :param source_vault: Resource id of the KeyVault containing the key or - secret + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the + key or secret :type source_vault: ~azure.mgmt.compute.v2016_04_30_preview.models.SourceVault - :param key_url: Url pointing to a key or secret in KeyVault + :param key_url: Required. Url pointing to a key or secret in KeyVault :type key_url: str """ @@ -34,7 +36,7 @@ class KeyVaultAndKeyReference(Model): 'key_url': {'key': 'keyUrl', 'type': 'str'}, } - def __init__(self, source_vault, key_url): - super(KeyVaultAndKeyReference, self).__init__() - self.source_vault = source_vault - self.key_url = key_url + def __init__(self, **kwargs): + super(KeyVaultAndKeyReference, self).__init__(**kwargs) + self.source_vault = kwargs.get('source_vault', None) + self.key_url = kwargs.get('key_url', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_and_key_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_and_key_reference_py3.py new file mode 100644 index 000000000000..480a05b257a8 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_and_key_reference_py3.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 msrest.serialization import Model + + +class KeyVaultAndKeyReference(Model): + """Key Vault Key Url and vault id of KeK, KeK is optional and when provided is + used to unwrap the encryptionKey. + + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the + key or secret + :type source_vault: + ~azure.mgmt.compute.v2016_04_30_preview.models.SourceVault + :param key_url: Required. Url pointing to a key or secret in KeyVault + :type key_url: str + """ + + _validation = { + 'source_vault': {'required': True}, + 'key_url': {'required': True}, + } + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + } + + def __init__(self, *, source_vault, key_url: str, **kwargs) -> None: + super(KeyVaultAndKeyReference, self).__init__(**kwargs) + self.source_vault = source_vault + self.key_url = key_url diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_and_secret_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_and_secret_reference.py index 476b88ec10e6..d1da7fb2acc6 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_and_secret_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_and_secret_reference.py @@ -15,11 +15,13 @@ class KeyVaultAndSecretReference(Model): """Key Vault Secret Url and vault id of the encryption key . - :param source_vault: Resource id of the KeyVault containing the key or - secret + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the + key or secret :type source_vault: ~azure.mgmt.compute.v2016_04_30_preview.models.SourceVault - :param secret_url: Url pointing to a key or secret in KeyVault + :param secret_url: Required. Url pointing to a key or secret in KeyVault :type secret_url: str """ @@ -33,7 +35,7 @@ class KeyVaultAndSecretReference(Model): 'secret_url': {'key': 'secretUrl', 'type': 'str'}, } - def __init__(self, source_vault, secret_url): - super(KeyVaultAndSecretReference, self).__init__() - self.source_vault = source_vault - self.secret_url = secret_url + def __init__(self, **kwargs): + super(KeyVaultAndSecretReference, self).__init__(**kwargs) + self.source_vault = kwargs.get('source_vault', None) + self.secret_url = kwargs.get('secret_url', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_and_secret_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_and_secret_reference_py3.py new file mode 100644 index 000000000000..82c41657a74a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_and_secret_reference_py3.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 msrest.serialization import Model + + +class KeyVaultAndSecretReference(Model): + """Key Vault Secret Url and vault id of the encryption key . + + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the + key or secret + :type source_vault: + ~azure.mgmt.compute.v2016_04_30_preview.models.SourceVault + :param secret_url: Required. Url pointing to a key or secret in KeyVault + :type secret_url: str + """ + + _validation = { + 'source_vault': {'required': True}, + 'secret_url': {'required': True}, + } + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'secret_url': {'key': 'secretUrl', 'type': 'str'}, + } + + def __init__(self, *, source_vault, secret_url: str, **kwargs) -> None: + super(KeyVaultAndSecretReference, self).__init__(**kwargs) + self.source_vault = source_vault + self.secret_url = secret_url diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_key_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_key_reference.py index 5254881f968e..02437d2c77de 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_key_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_key_reference.py @@ -15,9 +15,13 @@ class KeyVaultKeyReference(Model): """Describes a reference to Key Vault Key. - :param key_url: The URL referencing a key encryption key in Key Vault. + All required parameters must be populated in order to send to Azure. + + :param key_url: Required. The URL referencing a key encryption key in Key + Vault. :type key_url: str - :param source_vault: The relative URL of the Key Vault containing the key. + :param source_vault: Required. The relative URL of the Key Vault + containing the key. :type source_vault: ~azure.mgmt.compute.v2016_04_30_preview.models.SubResource """ @@ -32,7 +36,7 @@ class KeyVaultKeyReference(Model): 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, } - def __init__(self, key_url, source_vault): - super(KeyVaultKeyReference, self).__init__() - self.key_url = key_url - self.source_vault = source_vault + def __init__(self, **kwargs): + super(KeyVaultKeyReference, self).__init__(**kwargs) + self.key_url = kwargs.get('key_url', None) + self.source_vault = kwargs.get('source_vault', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_key_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_key_reference_py3.py new file mode 100644 index 000000000000..fc711b0c6cad --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_key_reference_py3.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 msrest.serialization import Model + + +class KeyVaultKeyReference(Model): + """Describes a reference to Key Vault Key. + + All required parameters must be populated in order to send to Azure. + + :param key_url: Required. The URL referencing a key encryption key in Key + Vault. + :type key_url: str + :param source_vault: Required. The relative URL of the Key Vault + containing the key. + :type source_vault: + ~azure.mgmt.compute.v2016_04_30_preview.models.SubResource + """ + + _validation = { + 'key_url': {'required': True}, + 'source_vault': {'required': True}, + } + + _attribute_map = { + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, + } + + def __init__(self, *, key_url: str, source_vault, **kwargs) -> None: + super(KeyVaultKeyReference, self).__init__(**kwargs) + self.key_url = key_url + self.source_vault = source_vault diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_secret_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_secret_reference.py index 1372517bbd88..e478be625fe6 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_secret_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_secret_reference.py @@ -15,10 +15,12 @@ class KeyVaultSecretReference(Model): """Describes a reference to Key Vault Secret. - :param secret_url: The URL referencing a secret in a Key Vault. + All required parameters must be populated in order to send to Azure. + + :param secret_url: Required. The URL referencing a secret in a Key Vault. :type secret_url: str - :param source_vault: The relative URL of the Key Vault containing the - secret. + :param source_vault: Required. The relative URL of the Key Vault + containing the secret. :type source_vault: ~azure.mgmt.compute.v2016_04_30_preview.models.SubResource """ @@ -33,7 +35,7 @@ class KeyVaultSecretReference(Model): 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, } - def __init__(self, secret_url, source_vault): - super(KeyVaultSecretReference, self).__init__() - self.secret_url = secret_url - self.source_vault = source_vault + def __init__(self, **kwargs): + super(KeyVaultSecretReference, self).__init__(**kwargs) + self.secret_url = kwargs.get('secret_url', None) + self.source_vault = kwargs.get('source_vault', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_secret_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_secret_reference_py3.py new file mode 100644 index 000000000000..cc17d1b9032c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/key_vault_secret_reference_py3.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 msrest.serialization import Model + + +class KeyVaultSecretReference(Model): + """Describes a reference to Key Vault Secret. + + All required parameters must be populated in order to send to Azure. + + :param secret_url: Required. The URL referencing a secret in a Key Vault. + :type secret_url: str + :param source_vault: Required. The relative URL of the Key Vault + containing the secret. + :type source_vault: + ~azure.mgmt.compute.v2016_04_30_preview.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, **kwargs) -> None: + super(KeyVaultSecretReference, self).__init__(**kwargs) + self.secret_url = secret_url + self.source_vault = source_vault diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/linux_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/linux_configuration.py index fd6d7fde8c23..e8689ca503e9 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/linux_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/linux_configuration.py @@ -33,7 +33,7 @@ class LinuxConfiguration(Model): 'ssh': {'key': 'ssh', 'type': 'SshConfiguration'}, } - def __init__(self, disable_password_authentication=None, ssh=None): - super(LinuxConfiguration, self).__init__() - self.disable_password_authentication = disable_password_authentication - self.ssh = ssh + def __init__(self, **kwargs): + super(LinuxConfiguration, self).__init__(**kwargs) + self.disable_password_authentication = kwargs.get('disable_password_authentication', None) + self.ssh = kwargs.get('ssh', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/linux_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/linux_configuration_py3.py new file mode 100644 index 000000000000..b0a3f0ee7a9a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/linux_configuration_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class LinuxConfiguration(Model): + """Specifies the Linux operating system settings on the virtual machine. +

    For a list of supported Linux distributions, see [Linux on + Azure-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) +

    For running non-endorsed distributions, see [Information for + Non-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + + :param disable_password_authentication: Specifies whether password + authentication should be disabled. + :type disable_password_authentication: bool + :param ssh: Specifies the ssh key configuration for a Linux OS. + :type ssh: ~azure.mgmt.compute.v2016_04_30_preview.models.SshConfiguration + """ + + _attribute_map = { + 'disable_password_authentication': {'key': 'disablePasswordAuthentication', 'type': 'bool'}, + 'ssh': {'key': 'ssh', 'type': 'SshConfiguration'}, + } + + def __init__(self, *, disable_password_authentication: bool=None, ssh=None, **kwargs) -> None: + super(LinuxConfiguration, self).__init__(**kwargs) + self.disable_password_authentication = disable_password_authentication + self.ssh = ssh diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/managed_disk_parameters.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/managed_disk_parameters.py index 345999773408..aac844a7ebb5 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/managed_disk_parameters.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/managed_disk_parameters.py @@ -29,6 +29,6 @@ class ManagedDiskParameters(SubResource): 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, } - def __init__(self, id=None, storage_account_type=None): - super(ManagedDiskParameters, self).__init__(id=id) - self.storage_account_type = storage_account_type + def __init__(self, **kwargs): + super(ManagedDiskParameters, self).__init__(**kwargs) + self.storage_account_type = kwargs.get('storage_account_type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/managed_disk_parameters_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/managed_disk_parameters_py3.py new file mode 100644 index 000000000000..ffce009881d2 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/managed_disk_parameters_py3.py @@ -0,0 +1,34 @@ +# 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 .sub_resource import SubResource + + +class ManagedDiskParameters(SubResource): + """The parameters of a managed disk. + + :param id: Resource Id + :type id: str + :param storage_account_type: Specifies the storage account type for the + managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible + values include: 'Standard_LRS', 'Premium_LRS' + :type storage_account_type: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.StorageAccountTypes + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, + } + + def __init__(self, *, id: str=None, storage_account_type=None, **kwargs) -> None: + super(ManagedDiskParameters, self).__init__(id=id, **kwargs) + self.storage_account_type = storage_account_type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/network_interface_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/network_interface_reference.py index 80c743c0d8e3..b86e305e3f74 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/network_interface_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/network_interface_reference.py @@ -27,6 +27,6 @@ class NetworkInterfaceReference(SubResource): 'primary': {'key': 'properties.primary', 'type': 'bool'}, } - def __init__(self, id=None, primary=None): - super(NetworkInterfaceReference, self).__init__(id=id) - self.primary = primary + def __init__(self, **kwargs): + super(NetworkInterfaceReference, self).__init__(**kwargs) + self.primary = kwargs.get('primary', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/network_interface_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/network_interface_reference_py3.py new file mode 100644 index 000000000000..f42ead50fc36 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/network_interface_reference_py3.py @@ -0,0 +1,32 @@ +# 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 .sub_resource import SubResource + + +class NetworkInterfaceReference(SubResource): + """Describes a network interface reference. + + :param id: Resource Id + :type id: str + :param primary: Specifies the primary network interface in case the + virtual machine has more than 1 network interface. + :type primary: bool + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + } + + def __init__(self, *, id: str=None, primary: bool=None, **kwargs) -> None: + super(NetworkInterfaceReference, self).__init__(id=id, **kwargs) + self.primary = primary diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/network_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/network_profile.py index 3a81557e34a6..467d6e5884cd 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/network_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/network_profile.py @@ -25,6 +25,6 @@ class NetworkProfile(Model): 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceReference]'}, } - def __init__(self, network_interfaces=None): - super(NetworkProfile, self).__init__() - self.network_interfaces = network_interfaces + def __init__(self, **kwargs): + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/network_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/network_profile_py3.py new file mode 100644 index 000000000000..cd9b6daa285b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/network_profile_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkProfile(Model): + """Specifies the network interfaces of the virtual machine. + + :param network_interfaces: Specifies the list of resource Ids for the + network interfaces associated with the virtual machine. + :type network_interfaces: + list[~azure.mgmt.compute.v2016_04_30_preview.models.NetworkInterfaceReference] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceReference]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = network_interfaces diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/operation_status_response.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/operation_status_response.py index 2f629aba0ef7..2cc7cf8104aa 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/operation_status_response.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/operation_status_response.py @@ -46,8 +46,8 @@ class OperationStatusResponse(Model): 'error': {'key': 'error', 'type': 'ApiError'}, } - def __init__(self): - super(OperationStatusResponse, self).__init__() + def __init__(self, **kwargs): + super(OperationStatusResponse, self).__init__(**kwargs) self.name = None self.status = None self.start_time = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/operation_status_response_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/operation_status_response_py3.py new file mode 100644 index 000000000000..f7713f697f70 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/operation_status_response_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class OperationStatusResponse(Model): + """Operation status response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation ID + :vartype name: str + :ivar status: Operation status + :vartype status: str + :ivar start_time: Start time of the operation + :vartype start_time: datetime + :ivar end_time: End time of the operation + :vartype end_time: datetime + :ivar error: Api error + :vartype error: ~azure.mgmt.compute.v2016_04_30_preview.models.ApiError + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationStatusResponse, self).__init__(**kwargs) + self.name = None + self.status = None + self.start_time = None + self.end_time = None + self.error = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_disk.py index 14406d9e623c..cd7d915b62f1 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_disk.py @@ -18,6 +18,8 @@ class OSDisk(Model): VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + All required parameters must be populated in order to send to Azure. + :param 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** @@ -44,8 +46,8 @@ class OSDisk(Model): storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2016_04_30_preview.models.CachingTypes - :param create_option: Specifies how the virtual machine should be - created.

    Possible values are:

    **Attach** \\u2013 This + :param create_option: Required. Specifies how the virtual machine should + be created.

    Possible values are:

    **Attach** \\u2013 This value is used when you are using a specialized disk to create the virtual machine.

    **FromImage** \\u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform @@ -79,14 +81,14 @@ class OSDisk(Model): 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, } - def __init__(self, create_option, os_type=None, encryption_settings=None, name=None, vhd=None, image=None, caching=None, disk_size_gb=None, managed_disk=None): - super(OSDisk, self).__init__() - self.os_type = os_type - self.encryption_settings = encryption_settings - self.name = name - self.vhd = vhd - self.image = image - self.caching = caching - self.create_option = create_option - self.disk_size_gb = disk_size_gb - self.managed_disk = managed_disk + def __init__(self, **kwargs): + super(OSDisk, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.encryption_settings = kwargs.get('encryption_settings', None) + self.name = kwargs.get('name', None) + self.vhd = kwargs.get('vhd', None) + self.image = kwargs.get('image', None) + self.caching = kwargs.get('caching', None) + self.create_option = kwargs.get('create_option', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.managed_disk = kwargs.get('managed_disk', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_disk_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_disk_image.py index 8498442accc8..71608314bd25 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_disk_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_disk_image.py @@ -15,8 +15,10 @@ class OSDiskImage(Model): """Contains the os disk image information. - :param operating_system: The operating system of the osDiskImage. Possible - values include: 'Windows', 'Linux' + All required parameters must be populated in order to send to Azure. + + :param operating_system: Required. The operating system of the + osDiskImage. Possible values include: 'Windows', 'Linux' :type operating_system: str or ~azure.mgmt.compute.v2016_04_30_preview.models.OperatingSystemTypes """ @@ -29,6 +31,6 @@ class OSDiskImage(Model): 'operating_system': {'key': 'operatingSystem', 'type': 'OperatingSystemTypes'}, } - def __init__(self, operating_system): - super(OSDiskImage, self).__init__() - self.operating_system = operating_system + def __init__(self, **kwargs): + super(OSDiskImage, self).__init__(**kwargs) + self.operating_system = kwargs.get('operating_system', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_disk_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_disk_image_py3.py new file mode 100644 index 000000000000..2fffe8d56908 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_disk_image_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class OSDiskImage(Model): + """Contains the os disk image information. + + All required parameters must be populated in order to send to Azure. + + :param operating_system: Required. The operating system of the + osDiskImage. Possible values include: 'Windows', 'Linux' + :type operating_system: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.OperatingSystemTypes + """ + + _validation = { + 'operating_system': {'required': True}, + } + + _attribute_map = { + 'operating_system': {'key': 'operatingSystem', 'type': 'OperatingSystemTypes'}, + } + + def __init__(self, *, operating_system, **kwargs) -> None: + super(OSDiskImage, self).__init__(**kwargs) + self.operating_system = operating_system diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_disk_py3.py new file mode 100644 index 000000000000..e8101921250d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_disk_py3.py @@ -0,0 +1,94 @@ +# 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 msrest.serialization import Model + + +class OSDisk(Model): + """Specifies information about the operating system disk used by the virtual + machine.

    For more information about disks, see [About disks and + VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + + All required parameters must be populated in order to send to Azure. + + :param 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**. Possible values include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.OperatingSystemTypes + :param encryption_settings: Specifies the encryption settings for the OS + Disk.

    Minimum api-version: 2015-06-15 + :type encryption_settings: + ~azure.mgmt.compute.v2016_04_30_preview.models.DiskEncryptionSettings + :param name: The disk name. + :type name: str + :param vhd: The virtual hard disk. + :type vhd: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualHardDisk + :param image: The source user image virtual hard disk. The virtual hard + disk will be copied before being attached to the virtual machine. If + SourceImage is provided, the destination virtual hard drive must not + exist. + :type image: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualHardDisk + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.CachingTypes + :param create_option: Required. Specifies how the virtual machine should + be created.

    Possible values are:

    **Attach** \\u2013 This + value is used when you are using a specialized disk to create the virtual + machine.

    **FromImage** \\u2013 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. Possible values include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in + gigabytes. This element can be used to overwrite the name of the disk in a + virtual machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2016_04_30_preview.models.ManagedDiskParameters + """ + + _validation = { + 'create_option': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': 'DiskEncryptionSettings'}, + 'name': {'key': 'name', 'type': 'str'}, + 'vhd': {'key': 'vhd', 'type': 'VirtualHardDisk'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, + } + + def __init__(self, *, create_option, os_type=None, encryption_settings=None, name: str=None, vhd=None, image=None, caching=None, disk_size_gb: int=None, managed_disk=None, **kwargs) -> None: + super(OSDisk, self).__init__(**kwargs) + self.os_type = os_type + self.encryption_settings = encryption_settings + self.name = name + self.vhd = vhd + self.image = image + self.caching = caching + self.create_option = create_option + self.disk_size_gb = disk_size_gb + self.managed_disk = managed_disk diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_profile.py index 4899a5ed4288..e9628746f12a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_profile.py @@ -88,12 +88,12 @@ class OSProfile(Model): 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, } - def __init__(self, computer_name=None, admin_username=None, admin_password=None, custom_data=None, windows_configuration=None, linux_configuration=None, secrets=None): - super(OSProfile, self).__init__() - self.computer_name = computer_name - 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 + def __init__(self, **kwargs): + super(OSProfile, self).__init__(**kwargs) + self.computer_name = kwargs.get('computer_name', None) + self.admin_username = kwargs.get('admin_username', None) + self.admin_password = kwargs.get('admin_password', None) + self.custom_data = kwargs.get('custom_data', None) + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + self.secrets = kwargs.get('secrets', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_profile_py3.py new file mode 100644 index 000000000000..ed0589fc2776 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/os_profile_py3.py @@ -0,0 +1,99 @@ +# 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 msrest.serialization import Model + + +class OSProfile(Model): + """Specifies the operating system settings for the virtual machine. + + :param computer_name: Specifies the host OS name of the virtual machine. +

    **Max-length (Windows):** 15 characters

    **Max-length + (Linux):** 64 characters.

    For naming conventions and restrictions + see [Azure infrastructure services implementation + guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + :type computer_name: str + :param admin_username: Specifies the name of the administrator account. +

    **Windows-only restriction:** Cannot end in "."

    + **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".

    **Minimum-length (Linux):** 1 + character

    **Max-length (Linux):** 64 characters

    + **Max-length (Windows):** 20 characters

  • For root access to + the Linux VM, see [Using root privileges on Linux virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + For a list of built-in system users on Linux that should not be used in + this field, see [Selecting User Names for Linux on + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type admin_username: str + :param admin_password: Specifies the password of the administrator + account.

    **Minimum-length (Windows):** 8 characters

    + **Minimum-length (Linux):** 6 characters

    **Max-length + (Windows):** 123 characters

    **Max-length (Linux):** 72 characters +

    **Complexity requirements:** 3 out of 4 conditions below need to + be fulfilled
    Has lower characters
    Has upper characters
    Has a + digit
    Has a special character (Regex match [\\W_])

    + **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + "iloveyou!"

    For resetting the password, see [How to reset the + Remote Desktop service or its login password in a Windows + VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    For resetting root password, see [Manage users, SSH, and check or + repair disks on Azure Linux VMs using the VMAccess + Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + :type admin_password: str + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type custom_data: str + :param windows_configuration: Specifies Windows operating system settings + on the virtual machine. + :type windows_configuration: + ~azure.mgmt.compute.v2016_04_30_preview.models.WindowsConfiguration + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) +

    For running non-endorsed distributions, see [Information for + Non-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + :type linux_configuration: + ~azure.mgmt.compute.v2016_04_30_preview.models.LinuxConfiguration + :param secrets: Specifies set of certificates that should be installed + onto the virtual machine. + :type secrets: + list[~azure.mgmt.compute.v2016_04_30_preview.models.VaultSecretGroup] + """ + + _attribute_map = { + 'computer_name': {'key': 'computerName', '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]'}, + } + + def __init__(self, *, computer_name: str=None, admin_username: str=None, admin_password: str=None, custom_data: str=None, windows_configuration=None, linux_configuration=None, secrets=None, **kwargs) -> None: + super(OSProfile, self).__init__(**kwargs) + self.computer_name = computer_name + 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 diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/plan.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/plan.py index 772160aef635..d42b6b32cfac 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/plan.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/plan.py @@ -38,9 +38,9 @@ class Plan(Model): 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, } - def __init__(self, name=None, publisher=None, product=None, promotion_code=None): - super(Plan, self).__init__() - self.name = name - self.publisher = publisher - self.product = product - self.promotion_code = promotion_code + def __init__(self, **kwargs): + super(Plan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/plan_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/plan_py3.py new file mode 100644 index 000000000000..9cca2c78a123 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/plan_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class Plan(Model): + """Specifies information about the marketplace image used to create the + virtual machine. This element is only used for marketplace images. Before + you can use a marketplace image from an API, you must enable the image for + programmatic use. In the Azure portal, find the marketplace image that you + want to use and then click **Want to deploy programmatically, Get Started + ->**. Enter any required information and then click **Save**. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: Specifies the product of the image from the marketplace. + This is the same value as Offer under the imageReference element. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, publisher: str=None, product: str=None, promotion_code: str=None, **kwargs) -> None: + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/purchase_plan.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/purchase_plan.py index aa29cb02ab78..2e1509addca6 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/purchase_plan.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/purchase_plan.py @@ -16,12 +16,15 @@ class PurchasePlan(Model): """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - :param publisher: The publisher ID. + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The publisher ID. :type publisher: str - :param name: The plan ID. + :param name: Required. The plan ID. :type name: str - :param product: Specifies the product of the image from the marketplace. - This is the same value as Offer under the imageReference element. + :param product: Required. Specifies the product of the image from the + marketplace. This is the same value as Offer under the imageReference + element. :type product: str """ @@ -37,8 +40,8 @@ class PurchasePlan(Model): 'product': {'key': 'product', 'type': 'str'}, } - def __init__(self, publisher, name, product): - super(PurchasePlan, self).__init__() - self.publisher = publisher - self.name = name - self.product = product + def __init__(self, **kwargs): + super(PurchasePlan, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.name = kwargs.get('name', None) + self.product = kwargs.get('product', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/purchase_plan_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/purchase_plan_py3.py new file mode 100644 index 000000000000..26f7996f1633 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/purchase_plan_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class PurchasePlan(Model): + """Used for establishing the purchase context of any 3rd Party artifact + through MarketPlace. + + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The publisher ID. + :type publisher: str + :param name: Required. The plan ID. + :type name: str + :param product: Required. Specifies the product of the image from the + marketplace. This is the same value as Offer under the imageReference + element. + :type product: str + """ + + _validation = { + 'publisher': {'required': True}, + 'name': {'required': True}, + 'product': {'required': True}, + } + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__(self, *, publisher: str, name: str, product: str, **kwargs) -> None: + super(PurchasePlan, self).__init__(**kwargs) + self.publisher = publisher + self.name = name + self.product = product diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/resource.py index 10269b591c68..5dd7d481c685 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/resource.py @@ -18,13 +18,15 @@ class Resource(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -45,10 +47,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/resource_py3.py new file mode 100644 index 000000000000..2f3702caf609 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/resource_py3.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/resource_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/resource_update.py index daa416f69c6d..182590bbdd32 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/resource_update.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/resource_update.py @@ -23,6 +23,6 @@ class ResourceUpdate(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, tags=None): - super(ResourceUpdate, self).__init__() - self.tags = tags + def __init__(self, **kwargs): + super(ResourceUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/resource_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/resource_update_py3.py new file mode 100644 index 000000000000..12e233958bf3 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/resource_update_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class ResourceUpdate(Model): + """The Resource model definition. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ResourceUpdate, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sku.py index 16755dc57b65..5c07709435e0 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sku.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sku.py @@ -31,8 +31,8 @@ class Sku(Model): 'capacity': {'key': 'capacity', 'type': 'long'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(Sku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sku_py3.py new file mode 100644 index 000000000000..f6bc74afaadc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sku_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class Sku(Model): + """Describes a virtual machine scale set sku. + + :param name: The sku name. + :type name: str + :param tier: Specifies the tier of virtual machines in a scale set.

    Possible Values:

    **Standard**

    **Basic** + :type tier: str + :param capacity: Specifies the number of virtual machines in the scale + set. + :type capacity: long + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'long'}, + } + + def __init__(self, *, name: str=None, tier: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/snapshot.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/snapshot.py index fa34f3334d38..df7821821099 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/snapshot.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/snapshot.py @@ -18,13 +18,15 @@ class Snapshot(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -38,8 +40,8 @@ class Snapshot(Resource): 'Windows', 'Linux' :type os_type: str or ~azure.mgmt.compute.v2016_04_30_preview.models.OperatingSystemTypes - :param creation_data: Disk source information. CreationData information - cannot be changed after the disk has been created. + :param creation_data: Required. Disk source information. CreationData + information cannot be changed after the disk has been created. :type creation_data: ~azure.mgmt.compute.v2016_04_30_preview.models.CreationData :param disk_size_gb: If creationData.createOption is Empty, this field is @@ -85,13 +87,13 @@ class Snapshot(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, location, creation_data, tags=None, account_type=None, os_type=None, disk_size_gb=None, encryption_settings=None): - super(Snapshot, self).__init__(location=location, tags=tags) - self.account_type = account_type + def __init__(self, **kwargs): + super(Snapshot, self).__init__(**kwargs) + self.account_type = kwargs.get('account_type', None) self.time_created = None - self.os_type = os_type - self.creation_data = creation_data - self.disk_size_gb = disk_size_gb - self.encryption_settings = encryption_settings + self.os_type = kwargs.get('os_type', None) + self.creation_data = kwargs.get('creation_data', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings = kwargs.get('encryption_settings', None) self.owner_id = None self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/snapshot_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/snapshot_py3.py new file mode 100644 index 000000000000..325b6544e35e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/snapshot_py3.py @@ -0,0 +1,99 @@ +# 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 .resource import Resource + + +class Snapshot(Resource): + """Snapshot 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 Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param account_type: the storage account type of the disk. Possible values + include: 'Standard_LRS', 'Premium_LRS' + :type account_type: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.StorageAccountTypes + :ivar time_created: The time when the disk was created. + :vartype time_created: datetime + :param os_type: The Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.OperatingSystemTypes + :param creation_data: Required. Disk source information. CreationData + information cannot be changed after the disk has been created. + :type creation_data: + ~azure.mgmt.compute.v2016_04_30_preview.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2016_04_30_preview.models.EncryptionSettings + :ivar owner_id: A relative URI containing the VM id that has the disk + attached. + :vartype owner_id: str + :ivar provisioning_state: The disk provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'time_created': {'readonly': True}, + 'creation_data': {'required': True}, + 'owner_id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'account_type': {'key': 'properties.accountType', 'type': 'StorageAccountTypes'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + 'owner_id': {'key': 'properties.ownerId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, creation_data, tags=None, account_type=None, os_type=None, disk_size_gb: int=None, encryption_settings=None, **kwargs) -> None: + super(Snapshot, self).__init__(location=location, tags=tags, **kwargs) + self.account_type = account_type + self.time_created = None + self.os_type = os_type + self.creation_data = creation_data + self.disk_size_gb = disk_size_gb + self.encryption_settings = encryption_settings + self.owner_id = None + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/snapshot_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/snapshot_update.py index 18ba23de1637..2cfe88c7a138 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/snapshot_update.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/snapshot_update.py @@ -49,10 +49,10 @@ class SnapshotUpdate(ResourceUpdate): 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, } - def __init__(self, tags=None, account_type=None, os_type=None, creation_data=None, disk_size_gb=None, encryption_settings=None): - super(SnapshotUpdate, self).__init__(tags=tags) - self.account_type = account_type - self.os_type = os_type - self.creation_data = creation_data - self.disk_size_gb = disk_size_gb - self.encryption_settings = encryption_settings + def __init__(self, **kwargs): + super(SnapshotUpdate, self).__init__(**kwargs) + self.account_type = kwargs.get('account_type', None) + self.os_type = kwargs.get('os_type', None) + self.creation_data = kwargs.get('creation_data', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings = kwargs.get('encryption_settings', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/snapshot_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/snapshot_update_py3.py new file mode 100644 index 000000000000..22c491d39f6a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/snapshot_update_py3.py @@ -0,0 +1,58 @@ +# 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 .resource_update import ResourceUpdate + + +class SnapshotUpdate(ResourceUpdate): + """Snapshot update resource. + + :param tags: Resource tags + :type tags: dict[str, str] + :param account_type: the storage account type of the disk. Possible values + include: 'Standard_LRS', 'Premium_LRS' + :type account_type: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.StorageAccountTypes + :param os_type: the Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.OperatingSystemTypes + :param creation_data: disk source information. CreationData information + cannot be changed after the disk has been created. + :type creation_data: + ~azure.mgmt.compute.v2016_04_30_preview.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2016_04_30_preview.models.EncryptionSettings + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'account_type': {'key': 'properties.accountType', 'type': 'StorageAccountTypes'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + } + + def __init__(self, *, tags=None, account_type=None, os_type=None, creation_data=None, disk_size_gb: int=None, encryption_settings=None, **kwargs) -> None: + super(SnapshotUpdate, self).__init__(tags=tags, **kwargs) + self.account_type = account_type + self.os_type = os_type + self.creation_data = creation_data + self.disk_size_gb = disk_size_gb + self.encryption_settings = encryption_settings diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/source_vault.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/source_vault.py index 5f242d159d4c..9b16302ebbfb 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/source_vault.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/source_vault.py @@ -24,6 +24,6 @@ class SourceVault(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SourceVault, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SourceVault, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/source_vault_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/source_vault_py3.py new file mode 100644 index 000000000000..13eea5461390 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/source_vault_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SourceVault(Model): + """The vault id is an Azure Resource Manager Resoure id in the form + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}. + + :param id: Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SourceVault, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/ssh_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/ssh_configuration.py index e3e048c3ec41..4a11025a5587 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/ssh_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/ssh_configuration.py @@ -25,6 +25,6 @@ class SshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[SshPublicKey]'}, } - def __init__(self, public_keys=None): - super(SshConfiguration, self).__init__() - self.public_keys = public_keys + def __init__(self, **kwargs): + super(SshConfiguration, self).__init__(**kwargs) + self.public_keys = kwargs.get('public_keys', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/ssh_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/ssh_configuration_py3.py new file mode 100644 index 000000000000..a1a49cff031b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/ssh_configuration_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SshConfiguration(Model): + """SSH configuration for Linux based VMs running on Azure. + + :param public_keys: The list of SSH public keys used to authenticate with + linux based VMs. + :type public_keys: + list[~azure.mgmt.compute.v2016_04_30_preview.models.SshPublicKey] + """ + + _attribute_map = { + 'public_keys': {'key': 'publicKeys', 'type': '[SshPublicKey]'}, + } + + def __init__(self, *, public_keys=None, **kwargs) -> None: + super(SshConfiguration, self).__init__(**kwargs) + self.public_keys = public_keys diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/ssh_public_key.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/ssh_public_key.py index 2fe6756641cb..122e0d3b9fdd 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/ssh_public_key.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/ssh_public_key.py @@ -33,7 +33,7 @@ class SshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, path=None, key_data=None): - super(SshPublicKey, self).__init__() - self.path = path - self.key_data = key_data + def __init__(self, **kwargs): + super(SshPublicKey, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.key_data = kwargs.get('key_data', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/ssh_public_key_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/ssh_public_key_py3.py new file mode 100644 index 000000000000..b16ee085b36b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/ssh_public_key_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class SshPublicKey(Model): + """Contains information about SSH certificate public key and the path on the + Linux VM where the public key is placed. + + :param 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 + :type path: str + :param 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/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + :type key_data: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'key_data': {'key': 'keyData', 'type': 'str'}, + } + + def __init__(self, *, path: str=None, key_data: str=None, **kwargs) -> None: + super(SshPublicKey, self).__init__(**kwargs) + self.path = path + self.key_data = key_data diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/storage_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/storage_profile.py index cc20b2b9650f..0664920689d6 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/storage_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/storage_profile.py @@ -41,8 +41,8 @@ class StorageProfile(Model): 'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'}, } - def __init__(self, image_reference=None, os_disk=None, data_disks=None): - super(StorageProfile, self).__init__() - self.image_reference = image_reference - self.os_disk = os_disk - self.data_disks = data_disks + def __init__(self, **kwargs): + super(StorageProfile, self).__init__(**kwargs) + self.image_reference = kwargs.get('image_reference', None) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/storage_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/storage_profile_py3.py new file mode 100644 index 000000000000..ba1f2d046eb0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/storage_profile_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class StorageProfile(Model): + """Specifies the storage settings for the virtual machine disks. + + :param 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. + :type image_reference: + ~azure.mgmt.compute.v2016_04_30_preview.models.ImageReference + :param os_disk: Specifies information about the operating system disk used + by the virtual machine.

    For more information about disks, see + [About disks and VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type os_disk: ~azure.mgmt.compute.v2016_04_30_preview.models.OSDisk + :param data_disks: Specifies the parameters that are used to add a data + disk to a virtual machine.

    For more information about disks, see + [About disks and VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type data_disks: + list[~azure.mgmt.compute.v2016_04_30_preview.models.DataDisk] + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'OSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'}, + } + + def __init__(self, *, image_reference=None, os_disk=None, data_disks=None, **kwargs) -> None: + super(StorageProfile, self).__init__(**kwargs) + self.image_reference = image_reference + self.os_disk = os_disk + self.data_disks = data_disks diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sub_resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sub_resource.py index b32875f54c8e..11e092cc6ff5 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sub_resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sub_resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sub_resource_py3.py new file mode 100644 index 000000000000..29e5afee38f9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class SubResource(Model): + """SubResource. + + :param id: Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sub_resource_read_only.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sub_resource_read_only.py index 308c52a8420b..4a0ec466c0d4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sub_resource_read_only.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sub_resource_read_only.py @@ -30,6 +30,6 @@ class SubResourceReadOnly(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self): - super(SubResourceReadOnly, self).__init__() + def __init__(self, **kwargs): + super(SubResourceReadOnly, self).__init__(**kwargs) self.id = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sub_resource_read_only_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sub_resource_read_only_py3.py new file mode 100644 index 000000000000..cb918e9a2ac6 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/sub_resource_read_only_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class SubResourceReadOnly(Model): + """SubResourceReadOnly. + + 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) -> None: + super(SubResourceReadOnly, self).__init__(**kwargs) + self.id = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/upgrade_policy.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/upgrade_policy.py index af47573311d1..13b677d84ff4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/upgrade_policy.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/upgrade_policy.py @@ -29,6 +29,6 @@ class UpgradePolicy(Model): 'mode': {'key': 'mode', 'type': 'UpgradeMode'}, } - def __init__(self, mode=None): - super(UpgradePolicy, self).__init__() - self.mode = mode + def __init__(self, **kwargs): + super(UpgradePolicy, self).__init__(**kwargs) + self.mode = kwargs.get('mode', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/upgrade_policy_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/upgrade_policy_py3.py new file mode 100644 index 000000000000..2c344e88f74d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/upgrade_policy_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class UpgradePolicy(Model): + """Describes an upgrade policy - automatic or manual. + + :param mode: Specifies the mode of an upgrade to virtual machines in the + scale set.

    Possible values are:

    **Manual** - You + control the application of updates to virtual machines in the scale set. + You do this by using the manualUpgrade action.

    **Automatic** - + All virtual machines in the scale set are automatically updated at the + same time. Possible values include: 'Automatic', 'Manual' + :type mode: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.UpgradeMode + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'UpgradeMode'}, + } + + def __init__(self, *, mode=None, **kwargs) -> None: + super(UpgradePolicy, self).__init__(**kwargs) + self.mode = mode diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/usage.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/usage.py index 91331bc73635..019b6efc0669 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/usage.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/usage.py @@ -18,14 +18,16 @@ class Usage(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar unit: An enum describing the unit of usage measurement. Default - value: "Count" . + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of usage measurement. + Default value: "Count" . :vartype unit: str - :param current_value: The current usage of the resource. + :param current_value: Required. The current usage of the resource. :type current_value: int - :param limit: The maximum permitted usage of the resource. + :param limit: Required. The maximum permitted usage of the resource. :type limit: long - :param name: The name of the type of usage. + :param name: Required. The name of the type of usage. :type name: ~azure.mgmt.compute.v2016_04_30_preview.models.UsageName """ @@ -45,8 +47,8 @@ class Usage(Model): unit = "Count" - def __init__(self, current_value, limit, name): - super(Usage, self).__init__() - self.current_value = current_value - self.limit = limit - self.name = name + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/usage_name.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/usage_name.py index 799c1f896da3..e2560936493e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/usage_name.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/usage_name.py @@ -26,7 +26,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(UsageName, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/usage_name_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/usage_name_py3.py new file mode 100644 index 000000000000..ad0b77459f75 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class UsageName(Model): + """The Usage Names. + + :param value: The name of the resource. + :type value: str + :param localized_value: The localized name of the resource. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/usage_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/usage_py3.py new file mode 100644 index 000000000000..b33df6c9101d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/usage_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class Usage(Model): + """Describes Compute Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of usage measurement. + Default value: "Count" . + :vartype unit: str + :param current_value: Required. The current usage of the resource. + :type current_value: int + :param limit: Required. The maximum permitted usage of the resource. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.compute.v2016_04_30_preview.models.UsageName + """ + + _validation = { + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__(self, *, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/vault_certificate.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/vault_certificate.py index 8d4d05955de4..b173def6f820 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/vault_certificate.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/vault_certificate.py @@ -40,7 +40,7 @@ class VaultCertificate(Model): 'certificate_store': {'key': 'certificateStore', 'type': 'str'}, } - def __init__(self, certificate_url=None, certificate_store=None): - super(VaultCertificate, self).__init__() - self.certificate_url = certificate_url - self.certificate_store = certificate_store + def __init__(self, **kwargs): + super(VaultCertificate, self).__init__(**kwargs) + self.certificate_url = kwargs.get('certificate_url', None) + self.certificate_store = kwargs.get('certificate_store', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/vault_certificate_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/vault_certificate_py3.py new file mode 100644 index 000000000000..eda5ba1c3f1d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/vault_certificate_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VaultCertificate(Model): + """Describes a single certificate reference in a Key Vault, and where the + certificate should reside on the VM. + + :param 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](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + In this case, your certificate needs to be It is the Base64 encoding of + the following JSON Object which is encoded in UTF-8:

    {
    + "data":"",
    "dataType":"pfx",
    + "password":""
    } + :type certificate_url: str + :param 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 .crt + for the X509 certificate file and .prv for private + key. Both of these files are .pem formatted. + :type certificate_store: str + """ + + _attribute_map = { + 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, + 'certificate_store': {'key': 'certificateStore', 'type': 'str'}, + } + + def __init__(self, *, certificate_url: str=None, certificate_store: str=None, **kwargs) -> None: + super(VaultCertificate, self).__init__(**kwargs) + self.certificate_url = certificate_url + self.certificate_store = certificate_store diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/vault_secret_group.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/vault_secret_group.py index 36ba25a6fde9..9d73e6eb8016 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/vault_secret_group.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/vault_secret_group.py @@ -30,7 +30,7 @@ class VaultSecretGroup(Model): 'vault_certificates': {'key': 'vaultCertificates', 'type': '[VaultCertificate]'}, } - def __init__(self, source_vault=None, vault_certificates=None): - super(VaultSecretGroup, self).__init__() - self.source_vault = source_vault - self.vault_certificates = vault_certificates + def __init__(self, **kwargs): + super(VaultSecretGroup, self).__init__(**kwargs) + self.source_vault = kwargs.get('source_vault', None) + self.vault_certificates = kwargs.get('vault_certificates', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/vault_secret_group_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/vault_secret_group_py3.py new file mode 100644 index 000000000000..955f9a828118 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/vault_secret_group_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class VaultSecretGroup(Model): + """Describes a set of certificates which are all in the same Key Vault. + + :param source_vault: The relative URL of the Key Vault containing all of + the certificates in VaultCertificates. + :type source_vault: + ~azure.mgmt.compute.v2016_04_30_preview.models.SubResource + :param vault_certificates: The list of key vault references in SourceVault + which contain certificates. + :type vault_certificates: + list[~azure.mgmt.compute.v2016_04_30_preview.models.VaultCertificate] + """ + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, + 'vault_certificates': {'key': 'vaultCertificates', 'type': '[VaultCertificate]'}, + } + + def __init__(self, *, source_vault=None, vault_certificates=None, **kwargs) -> None: + super(VaultSecretGroup, self).__init__(**kwargs) + self.source_vault = source_vault + self.vault_certificates = vault_certificates diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_hard_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_hard_disk.py index af1725d302af..5e3ad9dea7d4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_hard_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_hard_disk.py @@ -23,6 +23,6 @@ class VirtualHardDisk(Model): 'uri': {'key': 'uri', 'type': 'str'}, } - def __init__(self, uri=None): - super(VirtualHardDisk, self).__init__() - self.uri = uri + def __init__(self, **kwargs): + super(VirtualHardDisk, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_hard_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_hard_disk_py3.py new file mode 100644 index 000000000000..9c069b95f084 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_hard_disk_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class VirtualHardDisk(Model): + """Describes the uri of a disk. + + :param uri: Specifies the virtual hard disk's uri. + :type uri: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__(self, *, uri: str=None, **kwargs) -> None: + super(VirtualHardDisk, self).__init__(**kwargs) + self.uri = uri diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine.py index a361c2bd9cd7..ea4dfa0d70c2 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine.py @@ -18,13 +18,15 @@ class VirtualMachine(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -128,18 +130,18 @@ class VirtualMachine(Resource): 'identity': {'key': 'identity', 'type': 'VirtualMachineIdentity'}, } - def __init__(self, location, tags=None, plan=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type=None, identity=None): - super(VirtualMachine, self).__init__(location=location, tags=tags) - self.plan = plan - self.hardware_profile = hardware_profile - self.storage_profile = storage_profile - self.os_profile = os_profile - self.network_profile = network_profile - self.diagnostics_profile = diagnostics_profile - self.availability_set = availability_set + def __init__(self, **kwargs): + super(VirtualMachine, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.os_profile = kwargs.get('os_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.availability_set = kwargs.get('availability_set', None) self.provisioning_state = None self.instance_view = None - self.license_type = license_type + self.license_type = kwargs.get('license_type', None) self.vm_id = None self.resources = None - self.identity = identity + self.identity = kwargs.get('identity', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_agent_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_agent_instance_view.py index 9584fa6e35cb..f6d0fc9a94ea 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_agent_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_agent_instance_view.py @@ -32,8 +32,8 @@ class VirtualMachineAgentInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, vm_agent_version=None, extension_handlers=None, statuses=None): - super(VirtualMachineAgentInstanceView, self).__init__() - self.vm_agent_version = vm_agent_version - self.extension_handlers = extension_handlers - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineAgentInstanceView, self).__init__(**kwargs) + self.vm_agent_version = kwargs.get('vm_agent_version', None) + self.extension_handlers = kwargs.get('extension_handlers', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_agent_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_agent_instance_view_py3.py new file mode 100644 index 000000000000..9b301b73086b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_agent_instance_view_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineAgentInstanceView(Model): + """The instance view of the VM Agent running on the virtual machine. + + :param vm_agent_version: The VM Agent full version. + :type vm_agent_version: str + :param extension_handlers: The virtual machine extension handler instance + view. + :type extension_handlers: + list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtensionHandlerInstanceView] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2016_04_30_preview.models.InstanceViewStatus] + """ + + _attribute_map = { + 'vm_agent_version': {'key': 'vmAgentVersion', 'type': 'str'}, + 'extension_handlers': {'key': 'extensionHandlers', 'type': '[VirtualMachineExtensionHandlerInstanceView]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, vm_agent_version: str=None, extension_handlers=None, statuses=None, **kwargs) -> None: + super(VirtualMachineAgentInstanceView, self).__init__(**kwargs) + self.vm_agent_version = vm_agent_version + self.extension_handlers = extension_handlers + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_capture_parameters.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_capture_parameters.py index b406f387ffed..4e6ffbea7a4f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_capture_parameters.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_capture_parameters.py @@ -15,12 +15,15 @@ class VirtualMachineCaptureParameters(Model): """Capture Virtual Machine parameters. - :param vhd_prefix: The captured virtual hard disk's name prefix. + All required parameters must be populated in order to send to Azure. + + :param vhd_prefix: Required. The captured virtual hard disk's name prefix. :type vhd_prefix: str - :param destination_container_name: The destination container name. + :param destination_container_name: Required. The destination container + name. :type destination_container_name: str - :param overwrite_vhds: Specifies whether to overwrite the destination - virtual hard disk, in case of conflict. + :param overwrite_vhds: Required. Specifies whether to overwrite the + destination virtual hard disk, in case of conflict. :type overwrite_vhds: bool """ @@ -36,8 +39,8 @@ class VirtualMachineCaptureParameters(Model): 'overwrite_vhds': {'key': 'overwriteVhds', 'type': 'bool'}, } - def __init__(self, vhd_prefix, destination_container_name, overwrite_vhds): - super(VirtualMachineCaptureParameters, self).__init__() - self.vhd_prefix = vhd_prefix - self.destination_container_name = destination_container_name - self.overwrite_vhds = overwrite_vhds + def __init__(self, **kwargs): + super(VirtualMachineCaptureParameters, self).__init__(**kwargs) + self.vhd_prefix = kwargs.get('vhd_prefix', None) + self.destination_container_name = kwargs.get('destination_container_name', None) + self.overwrite_vhds = kwargs.get('overwrite_vhds', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_capture_parameters_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_capture_parameters_py3.py new file mode 100644 index 000000000000..1866cdc23300 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_capture_parameters_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineCaptureParameters(Model): + """Capture Virtual Machine parameters. + + All required parameters must be populated in order to send to Azure. + + :param vhd_prefix: Required. The captured virtual hard disk's name prefix. + :type vhd_prefix: str + :param destination_container_name: Required. The destination container + name. + :type destination_container_name: str + :param overwrite_vhds: Required. Specifies whether to overwrite the + destination virtual hard disk, in case of conflict. + :type overwrite_vhds: bool + """ + + _validation = { + 'vhd_prefix': {'required': True}, + 'destination_container_name': {'required': True}, + 'overwrite_vhds': {'required': True}, + } + + _attribute_map = { + 'vhd_prefix': {'key': 'vhdPrefix', 'type': 'str'}, + 'destination_container_name': {'key': 'destinationContainerName', 'type': 'str'}, + 'overwrite_vhds': {'key': 'overwriteVhds', 'type': 'bool'}, + } + + def __init__(self, *, vhd_prefix: str, destination_container_name: str, overwrite_vhds: bool, **kwargs) -> None: + super(VirtualMachineCaptureParameters, self).__init__(**kwargs) + self.vhd_prefix = vhd_prefix + self.destination_container_name = destination_container_name + self.overwrite_vhds = overwrite_vhds diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_capture_result.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_capture_result.py index 95e26a427e83..2b0df7406a34 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_capture_result.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_capture_result.py @@ -26,6 +26,6 @@ class VirtualMachineCaptureResult(SubResource): 'output': {'key': 'properties.output', 'type': 'object'}, } - def __init__(self, id=None, output=None): - super(VirtualMachineCaptureResult, self).__init__(id=id) - self.output = output + def __init__(self, **kwargs): + super(VirtualMachineCaptureResult, self).__init__(**kwargs) + self.output = kwargs.get('output', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_capture_result_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_capture_result_py3.py new file mode 100644 index 000000000000..da449b8e9154 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_capture_result_py3.py @@ -0,0 +1,31 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineCaptureResult(SubResource): + """Resource Id. + + :param id: Resource Id + :type id: str + :param output: Operation output data (raw JSON) + :type output: object + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'output': {'key': 'properties.output', 'type': 'object'}, + } + + def __init__(self, *, id: str=None, output=None, **kwargs) -> None: + super(VirtualMachineCaptureResult, self).__init__(id=id, **kwargs) + self.output = output diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension.py index db57cede0e42..fb00bd780b7a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension.py @@ -18,13 +18,15 @@ class VirtualMachineExtension(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -82,14 +84,14 @@ class VirtualMachineExtension(Resource): 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineExtensionInstanceView'}, } - def __init__(self, location, tags=None, force_update_tag=None, publisher=None, virtual_machine_extension_type=None, type_handler_version=None, auto_upgrade_minor_version=None, settings=None, protected_settings=None, instance_view=None): - super(VirtualMachineExtension, self).__init__(location=location, tags=tags) - self.force_update_tag = force_update_tag - self.publisher = publisher - self.virtual_machine_extension_type = virtual_machine_extension_type - self.type_handler_version = type_handler_version - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings + def __init__(self, **kwargs): + super(VirtualMachineExtension, self).__init__(**kwargs) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.virtual_machine_extension_type = kwargs.get('virtual_machine_extension_type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) self.provisioning_state = None - self.instance_view = instance_view + self.instance_view = kwargs.get('instance_view', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_handler_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_handler_instance_view.py index f26b64f29d7e..411bcf8c9fe4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_handler_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_handler_instance_view.py @@ -31,8 +31,8 @@ class VirtualMachineExtensionHandlerInstanceView(Model): 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, } - def __init__(self, type=None, type_handler_version=None, status=None): - super(VirtualMachineExtensionHandlerInstanceView, self).__init__() - self.type = type - self.type_handler_version = type_handler_version - self.status = status + def __init__(self, **kwargs): + super(VirtualMachineExtensionHandlerInstanceView, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.status = kwargs.get('status', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_handler_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_handler_instance_view_py3.py new file mode 100644 index 000000000000..6b66bc5fa5c1 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_handler_instance_view_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineExtensionHandlerInstanceView(Model): + """The instance view of a virtual machine extension handler. + + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param status: The extension handler status. + :type status: + ~azure.mgmt.compute.v2016_04_30_preview.models.InstanceViewStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, + } + + def __init__(self, *, type: str=None, type_handler_version: str=None, status=None, **kwargs) -> None: + super(VirtualMachineExtensionHandlerInstanceView, self).__init__(**kwargs) + self.type = type + self.type_handler_version = type_handler_version + self.status = status diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_image.py index 7614699a78da..7273e2b84754 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_image.py @@ -18,23 +18,26 @@ class VirtualMachineExtensionImage(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param operating_system: The operating system this extension supports. - :type operating_system: str - :param compute_role: The type of role (IaaS or PaaS) this extension + :param operating_system: Required. The operating system this extension supports. + :type operating_system: str + :param compute_role: Required. The type of role (IaaS or PaaS) this + extension supports. :type compute_role: str - :param handler_schema: The schema defined by publisher, where extension - consumers should provide settings in a matching schema. + :param handler_schema: Required. The schema defined by publisher, where + extension consumers should provide settings in a matching schema. :type handler_schema: str :param vm_scale_set_enabled: Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but @@ -69,10 +72,10 @@ class VirtualMachineExtensionImage(Resource): 'supports_multiple_extensions': {'key': 'properties.supportsMultipleExtensions', 'type': 'bool'}, } - def __init__(self, location, operating_system, compute_role, handler_schema, tags=None, vm_scale_set_enabled=None, supports_multiple_extensions=None): - super(VirtualMachineExtensionImage, self).__init__(location=location, tags=tags) - self.operating_system = operating_system - self.compute_role = compute_role - self.handler_schema = handler_schema - self.vm_scale_set_enabled = vm_scale_set_enabled - self.supports_multiple_extensions = supports_multiple_extensions + def __init__(self, **kwargs): + super(VirtualMachineExtensionImage, self).__init__(**kwargs) + self.operating_system = kwargs.get('operating_system', None) + self.compute_role = kwargs.get('compute_role', None) + self.handler_schema = kwargs.get('handler_schema', None) + self.vm_scale_set_enabled = kwargs.get('vm_scale_set_enabled', None) + self.supports_multiple_extensions = kwargs.get('supports_multiple_extensions', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_image_py3.py new file mode 100644 index 000000000000..217accab02f0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_image_py3.py @@ -0,0 +1,81 @@ +# 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 .resource import Resource + + +class VirtualMachineExtensionImage(Resource): + """Describes a Virtual Machine Extension Image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param operating_system: Required. The operating system this extension + supports. + :type operating_system: str + :param compute_role: Required. The type of role (IaaS or PaaS) this + extension supports. + :type compute_role: str + :param handler_schema: Required. The schema defined by publisher, where + extension consumers should provide settings in a matching schema. + :type handler_schema: str + :param vm_scale_set_enabled: Whether the extension can be used on xRP + VMScaleSets. By default existing extensions are usable on scalesets, but + there might be cases where a publisher wants to explicitly indicate the + extension is only enabled for CRP VMs but not VMSS. + :type vm_scale_set_enabled: bool + :param supports_multiple_extensions: Whether the handler can support + multiple extensions. + :type supports_multiple_extensions: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'operating_system': {'required': True}, + 'compute_role': {'required': True}, + 'handler_schema': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'operating_system': {'key': 'properties.operatingSystem', 'type': 'str'}, + 'compute_role': {'key': 'properties.computeRole', 'type': 'str'}, + 'handler_schema': {'key': 'properties.handlerSchema', 'type': 'str'}, + 'vm_scale_set_enabled': {'key': 'properties.vmScaleSetEnabled', 'type': 'bool'}, + 'supports_multiple_extensions': {'key': 'properties.supportsMultipleExtensions', 'type': 'bool'}, + } + + def __init__(self, *, location: str, operating_system: str, compute_role: str, handler_schema: str, tags=None, vm_scale_set_enabled: bool=None, supports_multiple_extensions: bool=None, **kwargs) -> None: + super(VirtualMachineExtensionImage, self).__init__(location=location, tags=tags, **kwargs) + self.operating_system = operating_system + self.compute_role = compute_role + self.handler_schema = handler_schema + self.vm_scale_set_enabled = vm_scale_set_enabled + self.supports_multiple_extensions = supports_multiple_extensions diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_instance_view.py index 4ef45c135f01..7dd1fb0572e8 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_instance_view.py @@ -38,10 +38,10 @@ class VirtualMachineExtensionInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, name=None, type=None, type_handler_version=None, substatuses=None, statuses=None): - super(VirtualMachineExtensionInstanceView, self).__init__() - self.name = name - self.type = type - self.type_handler_version = type_handler_version - self.substatuses = substatuses - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineExtensionInstanceView, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.substatuses = kwargs.get('substatuses', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_instance_view_py3.py new file mode 100644 index 000000000000..4ac3c8b0af49 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_instance_view_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineExtensionInstanceView(Model): + """The instance view of a virtual machine extension. + + :param name: The virtual machine extension name. + :type name: str + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param substatuses: The resource status information. + :type substatuses: + list[~azure.mgmt.compute.v2016_04_30_preview.models.InstanceViewStatus] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2016_04_30_preview.models.InstanceViewStatus] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'substatuses': {'key': 'substatuses', 'type': '[InstanceViewStatus]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, name: str=None, type: str=None, type_handler_version: str=None, substatuses=None, statuses=None, **kwargs) -> None: + super(VirtualMachineExtensionInstanceView, self).__init__(**kwargs) + self.name = name + self.type = type + self.type_handler_version = type_handler_version + self.substatuses = substatuses + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_py3.py new file mode 100644 index 000000000000..342cb444d9ce --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_extension_py3.py @@ -0,0 +1,97 @@ +# 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 .resource import Resource + + +class VirtualMachineExtension(Resource): + """Describes a Virtual Machine Extension. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param force_update_tag: How the extension handler should be forced to + update even if the extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param virtual_machine_extension_type: Specifies the type of the + extension; an example is "CustomScriptExtension". + :type virtual_machine_extension_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either + protectedSettings or protectedSettingsFromKeyVault or no protected + settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :param instance_view: The virtual machine extension instance view. + :type instance_view: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtensionInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'virtual_machine_extension_type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineExtensionInstanceView'}, + } + + def __init__(self, *, location: str, tags=None, force_update_tag: str=None, publisher: str=None, virtual_machine_extension_type: str=None, type_handler_version: str=None, auto_upgrade_minor_version: bool=None, settings=None, protected_settings=None, instance_view=None, **kwargs) -> None: + super(VirtualMachineExtension, self).__init__(location=location, tags=tags, **kwargs) + self.force_update_tag = force_update_tag + self.publisher = publisher + self.virtual_machine_extension_type = virtual_machine_extension_type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None + self.instance_view = instance_view diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_identity.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_identity.py index 913554c1a461..84be2bbe01e2 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_identity.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_identity.py @@ -40,8 +40,8 @@ class VirtualMachineIdentity(Model): 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, } - def __init__(self, type=None): - super(VirtualMachineIdentity, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = type + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_identity_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_identity_py3.py new file mode 100644 index 000000000000..bfd1ec6626bc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_identity_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineIdentity(Model): + """Identity for the virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of virtual machine identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the virtual machine. + :vartype tenant_id: str + :param type: The type of identity used for the virtual machine. Currently, + the only supported type is 'SystemAssigned', which implicitly creates an + identity. Possible values include: 'SystemAssigned' + :type type: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(VirtualMachineIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_image.py index a7bff780485a..32853c04e51c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_image.py @@ -15,11 +15,13 @@ class VirtualMachineImage(VirtualMachineImageResource): """Describes a Virtual Machine Image. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The name of the resource. + :param name: Required. The name of the resource. :type name: str - :param location: The supported Azure location of the resource. + :param location: Required. The supported Azure location of the resource. :type location: str :param tags: Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your @@ -51,8 +53,8 @@ class VirtualMachineImage(VirtualMachineImageResource): 'data_disk_images': {'key': 'properties.dataDiskImages', 'type': '[DataDiskImage]'}, } - def __init__(self, name, location, id=None, tags=None, plan=None, os_disk_image=None, data_disk_images=None): - super(VirtualMachineImage, self).__init__(id=id, name=name, location=location, tags=tags) - self.plan = plan - self.os_disk_image = os_disk_image - self.data_disk_images = data_disk_images + def __init__(self, **kwargs): + super(VirtualMachineImage, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.os_disk_image = kwargs.get('os_disk_image', None) + self.data_disk_images = kwargs.get('data_disk_images', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_image_py3.py new file mode 100644 index 000000000000..04d6563b63b3 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_image_py3.py @@ -0,0 +1,60 @@ +# 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 .virtual_machine_image_resource import VirtualMachineImageResource + + +class VirtualMachineImage(VirtualMachineImageResource): + """Describes a Virtual Machine Image. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The name of the resource. + :type name: str + :param location: Required. The supported Azure location of the resource. + :type location: str + :param tags: Specifies the tags that are assigned to the virtual machine. + For more information about using tags, see [Using tags to organize your + Azure + resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + :type tags: dict[str, str] + :param plan: + :type plan: ~azure.mgmt.compute.v2016_04_30_preview.models.PurchasePlan + :param os_disk_image: + :type os_disk_image: + ~azure.mgmt.compute.v2016_04_30_preview.models.OSDiskImage + :param data_disk_images: + :type data_disk_images: + list[~azure.mgmt.compute.v2016_04_30_preview.models.DataDiskImage] + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'properties.plan', 'type': 'PurchasePlan'}, + 'os_disk_image': {'key': 'properties.osDiskImage', 'type': 'OSDiskImage'}, + 'data_disk_images': {'key': 'properties.dataDiskImages', 'type': '[DataDiskImage]'}, + } + + def __init__(self, *, name: str, location: str, id: str=None, tags=None, plan=None, os_disk_image=None, data_disk_images=None, **kwargs) -> None: + super(VirtualMachineImage, self).__init__(id=id, name=name, location=location, tags=tags, **kwargs) + self.plan = plan + self.os_disk_image = os_disk_image + self.data_disk_images = data_disk_images diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_image_resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_image_resource.py index a7029041061d..8807cc8f391b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_image_resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_image_resource.py @@ -15,11 +15,13 @@ class VirtualMachineImageResource(SubResource): """Virtual machine image resource information. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The name of the resource. + :param name: Required. The name of the resource. :type name: str - :param location: The supported Azure location of the resource. + :param location: Required. The supported Azure location of the resource. :type location: str :param tags: Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your @@ -40,8 +42,8 @@ class VirtualMachineImageResource(SubResource): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, name, location, id=None, tags=None): - super(VirtualMachineImageResource, self).__init__(id=id) - self.name = name - self.location = location - self.tags = tags + def __init__(self, **kwargs): + super(VirtualMachineImageResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_image_resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_image_resource_py3.py new file mode 100644 index 000000000000..48a968bf2fbf --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_image_resource_py3.py @@ -0,0 +1,49 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineImageResource(SubResource): + """Virtual machine image resource information. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The name of the resource. + :type name: str + :param location: Required. The supported Azure location of the resource. + :type location: str + :param tags: Specifies the tags that are assigned to the virtual machine. + For more information about using tags, see [Using tags to organize your + Azure + resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + :type tags: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, name: str, location: str, id: str=None, tags=None, **kwargs) -> None: + super(VirtualMachineImageResource, self).__init__(id=id, **kwargs) + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_instance_view.py index dbc075baaeba..c1e4c785527b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_instance_view.py @@ -55,13 +55,13 @@ class VirtualMachineInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, platform_update_domain=None, platform_fault_domain=None, rdp_thumb_print=None, vm_agent=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None): - super(VirtualMachineInstanceView, self).__init__() - self.platform_update_domain = platform_update_domain - self.platform_fault_domain = platform_fault_domain - self.rdp_thumb_print = rdp_thumb_print - self.vm_agent = vm_agent - self.disks = disks - self.extensions = extensions - self.boot_diagnostics = boot_diagnostics - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineInstanceView, self).__init__(**kwargs) + self.platform_update_domain = kwargs.get('platform_update_domain', None) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.rdp_thumb_print = kwargs.get('rdp_thumb_print', None) + self.vm_agent = kwargs.get('vm_agent', None) + self.disks = kwargs.get('disks', None) + self.extensions = kwargs.get('extensions', None) + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_instance_view_py3.py new file mode 100644 index 000000000000..323a0e109a7a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_instance_view_py3.py @@ -0,0 +1,67 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineInstanceView(Model): + """The instance view of a virtual machine. + + :param platform_update_domain: Specifies the update domain of the virtual + machine. + :type platform_update_domain: int + :param platform_fault_domain: Specifies the fault domain of the virtual + machine. + :type platform_fault_domain: int + :param rdp_thumb_print: The Remote desktop certificate thumbprint. + :type rdp_thumb_print: str + :param vm_agent: The VM Agent running on the virtual machine. + :type vm_agent: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineAgentInstanceView + :param disks: The virtual machine disk information. + :type disks: + list[~azure.mgmt.compute.v2016_04_30_preview.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtensionInstanceView] + :param boot_diagnostics: Boot Diagnostics is a debugging feature which + allows you to view Console Output and Screenshot to diagnose VM status. +

    For Linux Virtual Machines, you can easily view the output of + your console log.

    For both Windows and Linux virtual machines, + Azure also enables you to see a screenshot of the VM from the hypervisor. + :type boot_diagnostics: + ~azure.mgmt.compute.v2016_04_30_preview.models.BootDiagnosticsInstanceView + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2016_04_30_preview.models.InstanceViewStatus] + """ + + _attribute_map = { + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'int'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, + 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, + 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, + 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnosticsInstanceView'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, platform_update_domain: int=None, platform_fault_domain: int=None, rdp_thumb_print: str=None, vm_agent=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None, **kwargs) -> None: + super(VirtualMachineInstanceView, self).__init__(**kwargs) + self.platform_update_domain = platform_update_domain + self.platform_fault_domain = platform_fault_domain + self.rdp_thumb_print = rdp_thumb_print + self.vm_agent = vm_agent + self.disks = disks + self.extensions = extensions + self.boot_diagnostics = boot_diagnostics + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_py3.py new file mode 100644 index 000000000000..c34a5e057c9a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_py3.py @@ -0,0 +1,147 @@ +# 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 .resource import Resource + + +class VirtualMachine(Resource): + """Describes a Virtual Machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2016_04_30_preview.models.Plan + :param hardware_profile: Specifies the hardware settings for the virtual + machine. + :type hardware_profile: + ~azure.mgmt.compute.v2016_04_30_preview.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2016_04_30_preview.models.StorageProfile + :param os_profile: Specifies the operating system settings for the virtual + machine. + :type os_profile: ~azure.mgmt.compute.v2016_04_30_preview.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual + machine. + :type network_profile: + ~azure.mgmt.compute.v2016_04_30_preview.models.NetworkProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. +

    Minimum api-version: 2015-06-15. + :type diagnostics_profile: + ~azure.mgmt.compute.v2016_04_30_preview.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set + that the virtual machine should be assigned to. Virtual machines specified + in the same availability set are allocated to different nodes to maximize + availability. For more information about availability sets, see [Manage + the availability of virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + :type availability_set: + ~azure.mgmt.compute.v2016_04_30_preview.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used + was licensed on-premises. This element is only used for images that + contain the Windows Server operating system.

    Possible values are: +

    Windows_Client

    Windows_Server

    If this element + is included in a request for an update, the value must match the initial + value. This value cannot be updated.

    For more information, see + [Azure Hybrid Use Benefit for Windows + Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Minimum api-version: 2015-06-15 + :type license_type: str + :ivar vm_id: Specifies the VM unique ID which is a 128-bits identifier + that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read + using platform BIOS commands. + :vartype vm_id: str + :ivar resources: The virtual machine child extension resources. + :vartype resources: + list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtension] + :param identity: The identity of the virtual machine, if configured. + :type identity: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'vm_id': {'readonly': True}, + 'resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineIdentity'}, + } + + def __init__(self, *, location: str, tags=None, plan=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type: str=None, identity=None, **kwargs) -> None: + super(VirtualMachine, self).__init__(location=location, tags=tags, **kwargs) + self.plan = plan + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.os_profile = os_profile + self.network_profile = network_profile + self.diagnostics_profile = diagnostics_profile + self.availability_set = availability_set + self.provisioning_state = None + self.instance_view = None + self.license_type = license_type + self.vm_id = None + self.resources = None + self.identity = identity diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set.py index 00ec7e9ea9dd..30ccec128f7a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set.py @@ -18,13 +18,15 @@ class VirtualMachineScaleSet(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -83,13 +85,13 @@ class VirtualMachineScaleSet(Resource): 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, } - def __init__(self, location, tags=None, sku=None, plan=None, upgrade_policy=None, virtual_machine_profile=None, over_provision=None, single_placement_group=None, identity=None): - super(VirtualMachineScaleSet, self).__init__(location=location, tags=tags) - self.sku = sku - self.plan = plan - self.upgrade_policy = upgrade_policy - self.virtual_machine_profile = virtual_machine_profile + def __init__(self, **kwargs): + super(VirtualMachineScaleSet, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.plan = kwargs.get('plan', None) + self.upgrade_policy = kwargs.get('upgrade_policy', None) + self.virtual_machine_profile = kwargs.get('virtual_machine_profile', None) self.provisioning_state = None - self.over_provision = over_provision - self.single_placement_group = single_placement_group - self.identity = identity + self.over_provision = kwargs.get('over_provision', None) + self.single_placement_group = kwargs.get('single_placement_group', None) + self.identity = kwargs.get('identity', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_data_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_data_disk.py index f827f03a7af1..52812568311f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_data_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_data_disk.py @@ -15,11 +15,13 @@ class VirtualMachineScaleSetDataDisk(Model): """Describes a virtual machine scale set data disk. + All required parameters must be populated in order to send to Azure. + :param name: The disk name. :type name: str - :param 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. + :param lun: Required. 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. :type lun: int :param caching: Specifies the caching requirements.

    Possible values are:

    **None**

    **ReadOnly**

    **ReadWrite** @@ -27,8 +29,8 @@ class VirtualMachineScaleSetDataDisk(Model): storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2016_04_30_preview.models.CachingTypes - :param create_option: The create option. Possible values include: - 'FromImage', 'Empty', 'Attach' + :param create_option: Required. The create option. Possible values + include: 'FromImage', 'Empty', 'Attach' :type create_option: str or ~azure.mgmt.compute.v2016_04_30_preview.models.DiskCreateOptionTypes :param disk_size_gb: Specifies the size of an empty data disk in @@ -54,11 +56,11 @@ class VirtualMachineScaleSetDataDisk(Model): 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, } - def __init__(self, lun, create_option, name=None, caching=None, disk_size_gb=None, managed_disk=None): - super(VirtualMachineScaleSetDataDisk, self).__init__() - self.name = name - self.lun = lun - self.caching = caching - self.create_option = create_option - self.disk_size_gb = disk_size_gb - self.managed_disk = managed_disk + def __init__(self, **kwargs): + super(VirtualMachineScaleSetDataDisk, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.lun = kwargs.get('lun', None) + self.caching = kwargs.get('caching', None) + self.create_option = kwargs.get('create_option', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.managed_disk = kwargs.get('managed_disk', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_data_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_data_disk_py3.py new file mode 100644 index 000000000000..d591a546afa4 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_data_disk_py3.py @@ -0,0 +1,66 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetDataDisk(Model): + """Describes a virtual machine scale set data disk. + + All required parameters must be populated in order to send to Azure. + + :param name: The disk name. + :type name: str + :param lun: Required. 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. + :type lun: int + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.CachingTypes + :param create_option: Required. The create option. Possible values + include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in + gigabytes. This element can be used to overwrite the name of the disk in a + virtual machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetManagedDiskParameters + """ + + _validation = { + 'lun': {'required': True}, + 'create_option': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, + } + + def __init__(self, *, lun: int, create_option, name: str=None, caching=None, disk_size_gb: int=None, managed_disk=None, **kwargs) -> None: + super(VirtualMachineScaleSetDataDisk, self).__init__(**kwargs) + self.name = name + self.lun = lun + self.caching = caching + self.create_option = create_option + self.disk_size_gb = disk_size_gb + self.managed_disk = managed_disk diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_extension.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_extension.py index 5097197e4f72..29bc30c1f021 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_extension.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_extension.py @@ -62,13 +62,13 @@ class VirtualMachineScaleSetExtension(SubResourceReadOnly): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, name=None, publisher=None, type=None, type_handler_version=None, auto_upgrade_minor_version=None, settings=None, protected_settings=None): - super(VirtualMachineScaleSetExtension, self).__init__() - self.name = name - self.publisher = publisher - self.type = type - self.type_handler_version = type_handler_version - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings + def __init__(self, **kwargs): + super(VirtualMachineScaleSetExtension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_extension_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_extension_profile.py index 89e35f636351..6dcf2ea9bc9c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_extension_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_extension_profile.py @@ -25,6 +25,6 @@ class VirtualMachineScaleSetExtensionProfile(Model): 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetExtension]'}, } - def __init__(self, extensions=None): - super(VirtualMachineScaleSetExtensionProfile, self).__init__() - self.extensions = extensions + def __init__(self, **kwargs): + super(VirtualMachineScaleSetExtensionProfile, self).__init__(**kwargs) + self.extensions = kwargs.get('extensions', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_extension_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_extension_profile_py3.py new file mode 100644 index 000000000000..7136c80608a0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_extension_profile_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetExtensionProfile(Model): + """Describes a virtual machine scale set extension profile. + + :param extensions: The virtual machine scale set child extension + resources. + :type extensions: + list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetExtension] + """ + + _attribute_map = { + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetExtension]'}, + } + + def __init__(self, *, extensions=None, **kwargs) -> None: + super(VirtualMachineScaleSetExtensionProfile, self).__init__(**kwargs) + self.extensions = extensions diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_extension_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_extension_py3.py new file mode 100644 index 000000000000..456edba974fe --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_extension_py3.py @@ -0,0 +1,74 @@ +# 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 .sub_resource_read_only import SubResourceReadOnly + + +class VirtualMachineScaleSetExtension(SubResourceReadOnly): + """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 + :param name: The name of the extension. + :type name: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either + protectedSettings or protectedSettingsFromKeyVault or no protected + settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, publisher: str=None, type: str=None, type_handler_version: str=None, auto_upgrade_minor_version: bool=None, settings=None, protected_settings=None, **kwargs) -> None: + super(VirtualMachineScaleSetExtension, self).__init__(, **kwargs) + self.name = name + self.publisher = publisher + self.type = type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_identity.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_identity.py index 8c8f38096f02..a7b9883fa459 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_identity.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_identity.py @@ -42,8 +42,8 @@ class VirtualMachineScaleSetIdentity(Model): 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, } - def __init__(self, type=None): - super(VirtualMachineScaleSetIdentity, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = type + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_identity_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_identity_py3.py new file mode 100644 index 000000000000..55fb61687b44 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_identity_py3.py @@ -0,0 +1,49 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetIdentity(Model): + """Identity for the virtual machine scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of virtual machine scale set + identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the virtual machine scale + set. + :vartype tenant_id: str + :param type: The type of identity used for the virtual machine scale set. + Currently, the only supported type is 'SystemAssigned', which implicitly + creates an identity. Possible values include: 'SystemAssigned' + :type type: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(VirtualMachineScaleSetIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view.py index d8327a266dbf..fc73a188243f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view.py @@ -41,8 +41,8 @@ class VirtualMachineScaleSetInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, statuses=None): - super(VirtualMachineScaleSetInstanceView, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetInstanceView, self).__init__(**kwargs) self.virtual_machine = None self.extensions = None - self.statuses = statuses + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view_py3.py new file mode 100644 index 000000000000..6f7a4431de39 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetInstanceView(Model): + """The instance view of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar virtual_machine: The instance view status summary for the virtual + machine scale set. + :vartype virtual_machine: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetInstanceViewStatusesSummary + :ivar extensions: The extensions information. + :vartype extensions: + list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetVMExtensionsSummary] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2016_04_30_preview.models.InstanceViewStatus] + """ + + _validation = { + 'virtual_machine': {'readonly': True}, + 'extensions': {'readonly': True}, + } + + _attribute_map = { + 'virtual_machine': {'key': 'virtualMachine', 'type': 'VirtualMachineScaleSetInstanceViewStatusesSummary'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetVMExtensionsSummary]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, statuses=None, **kwargs) -> None: + super(VirtualMachineScaleSetInstanceView, self).__init__(**kwargs) + self.virtual_machine = None + self.extensions = None + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view_statuses_summary.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view_statuses_summary.py index f734dca4d057..aaf29fceeb65 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view_statuses_summary.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view_statuses_summary.py @@ -32,6 +32,6 @@ class VirtualMachineScaleSetInstanceViewStatusesSummary(Model): 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, } - def __init__(self): - super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__(**kwargs) self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view_statuses_summary_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view_statuses_summary_py3.py new file mode 100644 index 000000000000..bd92330e549b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view_statuses_summary_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetInstanceViewStatusesSummary(Model): + """Instance view statuses summary for virtual machines of a virtual machine + scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar statuses_summary: The extensions information. + :vartype statuses_summary: + list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineStatusCodeCount] + """ + + _validation = { + 'statuses_summary': {'readonly': True}, + } + + _attribute_map = { + 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__(**kwargs) + self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_ip_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_ip_configuration.py index 11a14397fe70..98b86fbcfc7c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_ip_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_ip_configuration.py @@ -15,11 +15,13 @@ class VirtualMachineScaleSetIPConfiguration(SubResource): """Describes a virtual machine scale set network profile's IP configuration. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The IP configuration name. + :param name: Required. The IP configuration name. :type name: str - :param subnet: The subnet. + :param subnet: Required. The subnet. :type subnet: ~azure.mgmt.compute.v2016_04_30_preview.models.ApiEntityReference :param application_gateway_backend_address_pools: The application gateway @@ -50,10 +52,10 @@ class VirtualMachineScaleSetIPConfiguration(SubResource): 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, } - def __init__(self, name, subnet, id=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_pools=None): - super(VirtualMachineScaleSetIPConfiguration, self).__init__(id=id) - self.name = name - self.subnet = subnet - self.application_gateway_backend_address_pools = application_gateway_backend_address_pools - self.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools + def __init__(self, **kwargs): + super(VirtualMachineScaleSetIPConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.subnet = kwargs.get('subnet', None) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_pools = kwargs.get('load_balancer_inbound_nat_pools', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_ip_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_ip_configuration_py3.py new file mode 100644 index 000000000000..e3c09703cdf1 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_ip_configuration_py3.py @@ -0,0 +1,61 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineScaleSetIPConfiguration(SubResource): + """Describes a virtual machine scale set network profile's IP configuration. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The IP configuration name. + :type name: str + :param subnet: Required. The subnet. + :type subnet: + ~azure.mgmt.compute.v2016_04_30_preview.models.ApiEntityReference + :param application_gateway_backend_address_pools: The application gateway + backend address pools. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.compute.v2016_04_30_preview.models.SubResource] + :param load_balancer_backend_address_pools: The load balancer backend + address pools. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.compute.v2016_04_30_preview.models.SubResource] + :param load_balancer_inbound_nat_pools: The load balancer inbound nat + pools. + :type load_balancer_inbound_nat_pools: + list[~azure.mgmt.compute.v2016_04_30_preview.models.SubResource] + """ + + _validation = { + 'name': {'required': True}, + 'subnet': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'ApiEntityReference'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, + } + + def __init__(self, *, name: str, subnet, id: str=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_pools=None, **kwargs) -> None: + super(VirtualMachineScaleSetIPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.subnet = subnet + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_managed_disk_parameters.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_managed_disk_parameters.py index 04165586b8ee..d620b4bada5e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_managed_disk_parameters.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_managed_disk_parameters.py @@ -26,6 +26,6 @@ class VirtualMachineScaleSetManagedDiskParameters(Model): 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, } - def __init__(self, storage_account_type=None): - super(VirtualMachineScaleSetManagedDiskParameters, self).__init__() - self.storage_account_type = storage_account_type + def __init__(self, **kwargs): + super(VirtualMachineScaleSetManagedDiskParameters, self).__init__(**kwargs) + self.storage_account_type = kwargs.get('storage_account_type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_managed_disk_parameters_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_managed_disk_parameters_py3.py new file mode 100644 index 000000000000..0d248895d204 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_managed_disk_parameters_py3.py @@ -0,0 +1,31 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetManagedDiskParameters(Model): + """Describes the parameters of a ScaleSet managed disk. + + :param storage_account_type: Specifies the storage account type for the + managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible + values include: 'Standard_LRS', 'Premium_LRS' + :type storage_account_type: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.StorageAccountTypes + """ + + _attribute_map = { + 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, + } + + def __init__(self, *, storage_account_type=None, **kwargs) -> None: + super(VirtualMachineScaleSetManagedDiskParameters, self).__init__(**kwargs) + self.storage_account_type = storage_account_type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_network_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_network_configuration.py index 0a8ef8ef3399..7ada583e7a1f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_network_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_network_configuration.py @@ -16,13 +16,16 @@ class VirtualMachineScaleSetNetworkConfiguration(SubResource): """Describes a virtual machine scale set network profile's network configurations. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The network configuration name. + :param name: Required. The network configuration name. :type name: str :param primary: Whether this is a primary NIC on a virtual machine. :type primary: bool - :param ip_configurations: The virtual machine scale set IP Configuration. + :param ip_configurations: Required. The virtual machine scale set IP + Configuration. :type ip_configurations: list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetIPConfiguration] """ @@ -39,8 +42,8 @@ class VirtualMachineScaleSetNetworkConfiguration(SubResource): 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetIPConfiguration]'}, } - def __init__(self, name, ip_configurations, id=None, primary=None): - super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(id=id) - self.name = name - self.primary = primary - self.ip_configurations = ip_configurations + def __init__(self, **kwargs): + super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.primary = kwargs.get('primary', None) + self.ip_configurations = kwargs.get('ip_configurations', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_network_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_network_configuration_py3.py new file mode 100644 index 000000000000..10a0d88b296e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_network_configuration_py3.py @@ -0,0 +1,49 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineScaleSetNetworkConfiguration(SubResource): + """Describes a virtual machine scale set network profile's network + configurations. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The network configuration name. + :type name: str + :param primary: Whether this is a primary NIC on a virtual machine. + :type primary: bool + :param ip_configurations: Required. The virtual machine scale set IP + Configuration. + :type ip_configurations: + list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetIPConfiguration] + """ + + _validation = { + 'name': {'required': True}, + 'ip_configurations': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetIPConfiguration]'}, + } + + def __init__(self, *, name: str, ip_configurations, id: str=None, primary: bool=None, **kwargs) -> None: + super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.primary = primary + self.ip_configurations = ip_configurations diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_network_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_network_profile.py index 72de79a9a0ae..db88739b701e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_network_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_network_profile.py @@ -25,6 +25,6 @@ class VirtualMachineScaleSetNetworkProfile(Model): 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetNetworkConfiguration]'}, } - def __init__(self, network_interface_configurations=None): - super(VirtualMachineScaleSetNetworkProfile, self).__init__() - self.network_interface_configurations = network_interface_configurations + def __init__(self, **kwargs): + super(VirtualMachineScaleSetNetworkProfile, self).__init__(**kwargs) + self.network_interface_configurations = kwargs.get('network_interface_configurations', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_network_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_network_profile_py3.py new file mode 100644 index 000000000000..ddf18bc1ce31 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_network_profile_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetNetworkProfile(Model): + """Describes a virtual machine scale set network profile. + + :param network_interface_configurations: The list of network + configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetNetworkConfiguration] + """ + + _attribute_map = { + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetNetworkConfiguration]'}, + } + + def __init__(self, *, network_interface_configurations=None, **kwargs) -> None: + super(VirtualMachineScaleSetNetworkProfile, self).__init__(**kwargs) + self.network_interface_configurations = network_interface_configurations diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_disk.py index 6ad683c1d03e..f7f1d53b2524 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_disk.py @@ -15,6 +15,8 @@ class VirtualMachineScaleSetOSDisk(Model): """Describes a virtual machine scale set operating system disk. + All required parameters must be populated in order to send to Azure. + :param name: The disk name. :type name: str :param caching: Specifies the caching requirements.

    Possible @@ -23,13 +25,13 @@ class VirtualMachineScaleSetOSDisk(Model): storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2016_04_30_preview.models.CachingTypes - :param create_option: Specifies how the virtual machines in the scale set - should be created.

    The only allowed value is: **FromImage** - \\u2013 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. Possible - values include: 'FromImage', 'Empty', 'Attach' + :param create_option: Required. Specifies how the virtual machines in the + scale set should be created.

    The only allowed value is: + **FromImage** \\u2013 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. + Possible values include: 'FromImage', 'Empty', 'Attach' :type create_option: str or ~azure.mgmt.compute.v2016_04_30_preview.models.DiskCreateOptionTypes :param os_type: This property allows you to specify the type of the OS @@ -64,12 +66,12 @@ class VirtualMachineScaleSetOSDisk(Model): 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, } - def __init__(self, create_option, name=None, caching=None, os_type=None, image=None, vhd_containers=None, managed_disk=None): - super(VirtualMachineScaleSetOSDisk, self).__init__() - self.name = name - self.caching = caching - self.create_option = create_option - self.os_type = os_type - self.image = image - self.vhd_containers = vhd_containers - self.managed_disk = managed_disk + def __init__(self, **kwargs): + super(VirtualMachineScaleSetOSDisk, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.caching = kwargs.get('caching', None) + self.create_option = kwargs.get('create_option', None) + self.os_type = kwargs.get('os_type', None) + self.image = kwargs.get('image', None) + self.vhd_containers = kwargs.get('vhd_containers', None) + self.managed_disk = kwargs.get('managed_disk', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_disk_py3.py new file mode 100644 index 000000000000..48478d7fc9c9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_disk_py3.py @@ -0,0 +1,77 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetOSDisk(Model): + """Describes a virtual machine scale set operating system disk. + + All required parameters must be populated in order to send to Azure. + + :param name: The disk name. + :type name: str + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.CachingTypes + :param create_option: Required. Specifies how the virtual machines in the + scale set should be created.

    The only allowed value is: + **FromImage** \\u2013 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. + Possible values include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.DiskCreateOptionTypes + :param 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**. Possible values include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.OperatingSystemTypes + :param image: The Source User Image VirtualHardDisk. This VirtualHardDisk + will be copied before using it to attach to the Virtual Machine. If + SourceImage is provided, the destination VirtualHardDisk should not exist. + :type image: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualHardDisk + :param vhd_containers: The list of virtual hard disk container uris. + :type vhd_containers: list[str] + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetManagedDiskParameters + """ + + _validation = { + 'create_option': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, + } + + def __init__(self, *, create_option, name: str=None, caching=None, os_type=None, image=None, vhd_containers=None, managed_disk=None, **kwargs) -> None: + super(VirtualMachineScaleSetOSDisk, self).__init__(**kwargs) + self.name = name + self.caching = caching + self.create_option = create_option + self.os_type = os_type + self.image = image + self.vhd_containers = vhd_containers + self.managed_disk = managed_disk diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_profile.py index 794d373d4b03..2008a2f9bd71 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_profile.py @@ -73,12 +73,12 @@ class VirtualMachineScaleSetOSProfile(Model): 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, } - def __init__(self, computer_name_prefix=None, admin_username=None, admin_password=None, custom_data=None, windows_configuration=None, linux_configuration=None, secrets=None): - super(VirtualMachineScaleSetOSProfile, self).__init__() - 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 + def __init__(self, **kwargs): + super(VirtualMachineScaleSetOSProfile, self).__init__(**kwargs) + self.computer_name_prefix = kwargs.get('computer_name_prefix', None) + self.admin_username = kwargs.get('admin_username', None) + self.admin_password = kwargs.get('admin_password', None) + self.custom_data = kwargs.get('custom_data', None) + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + self.secrets = kwargs.get('secrets', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_profile_py3.py new file mode 100644 index 000000000000..43dbcf5050f4 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_os_profile_py3.py @@ -0,0 +1,84 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetOSProfile(Model): + """Describes a virtual machine scale set OS profile. + + :param 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. + :type computer_name_prefix: str + :param admin_username: Specifies the name of the administrator account. +

    **Windows-only restriction:** Cannot end in "."

    + **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".

    **Minimum-length (Linux):** 1 + character

    **Max-length (Linux):** 64 characters

    + **Max-length (Windows):** 20 characters

  • For root access to + the Linux VM, see [Using root privileges on Linux virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + For a list of built-in system users on Linux that should not be used in + this field, see [Selecting User Names for Linux on + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type admin_username: str + :param admin_password: Specifies the password of the administrator + account.

    **Minimum-length (Windows):** 8 characters

    + **Minimum-length (Linux):** 6 characters

    **Max-length + (Windows):** 123 characters

    **Max-length (Linux):** 72 characters +

    **Complexity requirements:** 3 out of 4 conditions below need to + be fulfilled
    Has lower characters
    Has upper characters
    Has a + digit
    Has a special character (Regex match [\\W_])

    + **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + "iloveyou!"

    For resetting the password, see [How to reset the + Remote Desktop service or its login password in a Windows + VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    For resetting root password, see [Manage users, SSH, and check or + repair disks on Azure Linux VMs using the VMAccess + Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + :type admin_password: str + :param custom_data: A base-64 encoded string of custom data. + :type custom_data: str + :param windows_configuration: The Windows Configuration of the OS profile. + :type windows_configuration: + ~azure.mgmt.compute.v2016_04_30_preview.models.WindowsConfiguration + :param linux_configuration: The Linux Configuration of the OS profile. + :type linux_configuration: + ~azure.mgmt.compute.v2016_04_30_preview.models.LinuxConfiguration + :param secrets: The List of certificates for addition to the VM. + :type secrets: + list[~azure.mgmt.compute.v2016_04_30_preview.models.VaultSecretGroup] + """ + + _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]'}, + } + + def __init__(self, *, computer_name_prefix: str=None, admin_username: str=None, admin_password: str=None, custom_data: str=None, windows_configuration=None, linux_configuration=None, secrets=None, **kwargs) -> None: + super(VirtualMachineScaleSetOSProfile, self).__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 diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_py3.py new file mode 100644 index 000000000000..f6125f581a42 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_py3.py @@ -0,0 +1,97 @@ +# 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 .resource import Resource + + +class VirtualMachineScaleSet(Resource): + """Describes a Virtual Machine Scale Set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The virtual machine scale set sku. + :type sku: ~azure.mgmt.compute.v2016_04_30_preview.models.Sku + :param plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2016_04_30_preview.models.Plan + :param upgrade_policy: The upgrade policy. + :type upgrade_policy: + ~azure.mgmt.compute.v2016_04_30_preview.models.UpgradePolicy + :param virtual_machine_profile: The virtual machine profile. + :type virtual_machine_profile: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetVMProfile + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :param over_provision: Specifies whether the Virtual Machine Scale Set + should be overprovisioned. + :type over_provision: bool + :param single_placement_group: When true this limits the scale set to a + single placement group, of max size 100 virtual machines. + :type single_placement_group: bool + :param identity: The identity of the virtual machine scale set, if + configured. + :type identity: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'upgrade_policy': {'key': 'properties.upgradePolicy', 'type': 'UpgradePolicy'}, + 'virtual_machine_profile': {'key': 'properties.virtualMachineProfile', 'type': 'VirtualMachineScaleSetVMProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'over_provision': {'key': 'properties.overProvision', 'type': 'bool'}, + 'single_placement_group': {'key': 'properties.singlePlacementGroup', 'type': 'bool'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, + } + + def __init__(self, *, location: str, tags=None, sku=None, plan=None, upgrade_policy=None, virtual_machine_profile=None, over_provision: bool=None, single_placement_group: bool=None, identity=None, **kwargs) -> None: + super(VirtualMachineScaleSet, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.plan = plan + self.upgrade_policy = upgrade_policy + self.virtual_machine_profile = virtual_machine_profile + self.provisioning_state = None + self.over_provision = over_provision + self.single_placement_group = single_placement_group + self.identity = identity diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_sku.py index 92a5f37dbb52..55dc4909fc9f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_sku.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_sku.py @@ -39,8 +39,8 @@ class VirtualMachineScaleSetSku(Model): 'capacity': {'key': 'capacity', 'type': 'VirtualMachineScaleSetSkuCapacity'}, } - def __init__(self): - super(VirtualMachineScaleSetSku, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetSku, self).__init__(**kwargs) self.resource_type = None self.sku = None self.capacity = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_sku_capacity.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_sku_capacity.py index 59c2c5add9a2..32f1d5fcd5a9 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_sku_capacity.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_sku_capacity.py @@ -44,8 +44,8 @@ class VirtualMachineScaleSetSkuCapacity(Model): 'scale_type': {'key': 'scaleType', 'type': 'VirtualMachineScaleSetSkuScaleType'}, } - def __init__(self): - super(VirtualMachineScaleSetSkuCapacity, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetSkuCapacity, self).__init__(**kwargs) self.minimum = None self.maximum = None self.default_capacity = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_sku_capacity_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_sku_capacity_py3.py new file mode 100644 index 000000000000..30476ad800b0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_sku_capacity_py3.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetSkuCapacity(Model): + """Describes scaling information of a sku. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar minimum: The minimum capacity. + :vartype minimum: long + :ivar maximum: The maximum capacity that can be set. + :vartype maximum: long + :ivar default_capacity: The default capacity. + :vartype default_capacity: long + :ivar scale_type: The scale type applicable to the sku. Possible values + include: 'Automatic', 'None' + :vartype scale_type: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetSkuScaleType + """ + + _validation = { + 'minimum': {'readonly': True}, + 'maximum': {'readonly': True}, + 'default_capacity': {'readonly': True}, + 'scale_type': {'readonly': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'long'}, + 'maximum': {'key': 'maximum', 'type': 'long'}, + 'default_capacity': {'key': 'defaultCapacity', 'type': 'long'}, + 'scale_type': {'key': 'scaleType', 'type': 'VirtualMachineScaleSetSkuScaleType'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetSkuCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default_capacity = None + self.scale_type = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_sku_py3.py new file mode 100644 index 000000000000..8811dfc92e85 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_sku_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetSku(Model): + """Describes an available virtual machine scale set sku. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_type: The type of resource the sku applies to. + :vartype resource_type: str + :ivar sku: The Sku. + :vartype sku: ~azure.mgmt.compute.v2016_04_30_preview.models.Sku + :ivar capacity: Specifies the number of virtual machines in the scale set. + :vartype capacity: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetSkuCapacity + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'sku': {'readonly': True}, + 'capacity': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'capacity': {'key': 'capacity', 'type': 'VirtualMachineScaleSetSkuCapacity'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetSku, self).__init__(**kwargs) + self.resource_type = None + self.sku = None + self.capacity = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_storage_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_storage_profile.py index 14000de695dc..4cd0466e4685 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_storage_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_storage_profile.py @@ -32,8 +32,8 @@ class VirtualMachineScaleSetStorageProfile(Model): 'data_disks': {'key': 'dataDisks', 'type': '[VirtualMachineScaleSetDataDisk]'}, } - def __init__(self, image_reference=None, os_disk=None, data_disks=None): - super(VirtualMachineScaleSetStorageProfile, self).__init__() - self.image_reference = image_reference - self.os_disk = os_disk - self.data_disks = data_disks + def __init__(self, **kwargs): + super(VirtualMachineScaleSetStorageProfile, self).__init__(**kwargs) + self.image_reference = kwargs.get('image_reference', None) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_storage_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_storage_profile_py3.py new file mode 100644 index 000000000000..c57a42c0aca6 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_storage_profile_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetStorageProfile(Model): + """Describes a virtual machine scale set storage profile. + + :param image_reference: The image reference. + :type image_reference: + ~azure.mgmt.compute.v2016_04_30_preview.models.ImageReference + :param os_disk: The OS disk. + :type os_disk: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetOSDisk + :param data_disks: The data disks. + :type data_disks: + list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetDataDisk] + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'VirtualMachineScaleSetOSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[VirtualMachineScaleSetDataDisk]'}, + } + + def __init__(self, *, image_reference=None, os_disk=None, data_disks=None, **kwargs) -> None: + super(VirtualMachineScaleSetStorageProfile, self).__init__(**kwargs) + self.image_reference = image_reference + self.os_disk = os_disk + self.data_disks = data_disks diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm.py index 2e832a307682..b50a65c4da56 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm.py @@ -18,13 +18,15 @@ class VirtualMachineScaleSetVM(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -135,20 +137,20 @@ class VirtualMachineScaleSetVM(Resource): 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, } - def __init__(self, location, tags=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type=None, plan=None): - super(VirtualMachineScaleSetVM, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVM, self).__init__(**kwargs) self.instance_id = None self.sku = None self.latest_model_applied = None self.vm_id = None self.instance_view = None - self.hardware_profile = hardware_profile - self.storage_profile = storage_profile - self.os_profile = os_profile - self.network_profile = network_profile - self.diagnostics_profile = diagnostics_profile - self.availability_set = availability_set + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.os_profile = kwargs.get('os_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.availability_set = kwargs.get('availability_set', None) self.provisioning_state = None - self.license_type = license_type - self.plan = plan + self.license_type = kwargs.get('license_type', None) + self.plan = kwargs.get('plan', None) self.resources = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_extensions_summary.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_extensions_summary.py index 8c049d09944f..9f487b98ca78 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_extensions_summary.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_extensions_summary.py @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMExtensionsSummary(Model): 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, } - def __init__(self): - super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__(**kwargs) self.name = None self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_extensions_summary_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_extensions_summary_py3.py new file mode 100644 index 000000000000..ad719a30e3c7 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_extensions_summary_py3.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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMExtensionsSummary(Model): + """Extensions summary for virtual machines of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The extension name. + :vartype name: str + :ivar statuses_summary: The extensions information. + :vartype statuses_summary: + list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineStatusCodeCount] + """ + + _validation = { + 'name': {'readonly': True}, + 'statuses_summary': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__(**kwargs) + self.name = None + self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_ids.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_ids.py index 681ab449f3f2..772c66dad326 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_ids.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_ids.py @@ -25,6 +25,6 @@ class VirtualMachineScaleSetVMInstanceIDs(Model): 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, } - def __init__(self, instance_ids=None): - super(VirtualMachineScaleSetVMInstanceIDs, self).__init__() - self.instance_ids = instance_ids + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMInstanceIDs, self).__init__(**kwargs) + self.instance_ids = kwargs.get('instance_ids', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_ids_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_ids_py3.py new file mode 100644 index 000000000000..658a8ccb87d5 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_ids_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetVMInstanceIDs(Model): + """Specifies a list of virtual machine instance IDs from the VM scale set. + + :param instance_ids: The virtual machine scale set instance ids. Omitting + the virtual machine scale set instance ids will result in the operation + being performed on all virtual machines in the virtual machine scale set. + :type instance_ids: list[str] + """ + + _attribute_map = { + 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, + } + + def __init__(self, *, instance_ids=None, **kwargs) -> None: + super(VirtualMachineScaleSetVMInstanceIDs, self).__init__(**kwargs) + self.instance_ids = instance_ids diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_required_ids.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_required_ids.py index 2a35798001fa..ece250dd4fd4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_required_ids.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_required_ids.py @@ -15,7 +15,9 @@ class VirtualMachineScaleSetVMInstanceRequiredIDs(Model): """Specifies a list of virtual machine instance IDs from the VM scale set. - :param instance_ids: The virtual machine scale set instance ids. + All required parameters must be populated in order to send to Azure. + + :param instance_ids: Required. The virtual machine scale set instance ids. :type instance_ids: list[str] """ @@ -27,6 +29,6 @@ class VirtualMachineScaleSetVMInstanceRequiredIDs(Model): 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, } - def __init__(self, instance_ids): - super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__() - self.instance_ids = instance_ids + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__(**kwargs) + self.instance_ids = kwargs.get('instance_ids', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_required_ids_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_required_ids_py3.py new file mode 100644 index 000000000000..f32c6181467d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_required_ids_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMInstanceRequiredIDs(Model): + """Specifies a list of virtual machine instance IDs from the VM scale set. + + All required parameters must be populated in order to send to Azure. + + :param instance_ids: Required. The virtual machine scale set instance ids. + :type instance_ids: list[str] + """ + + _validation = { + 'instance_ids': {'required': True}, + } + + _attribute_map = { + 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, + } + + def __init__(self, *, instance_ids, **kwargs) -> None: + super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__(**kwargs) + self.instance_ids = instance_ids diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_view.py index 8692481ee81c..641b2b535d0c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_view.py @@ -57,14 +57,14 @@ class VirtualMachineScaleSetVMInstanceView(Model): 'placement_group_id': {'key': 'placementGroupId', 'type': 'str'}, } - def __init__(self, platform_update_domain=None, platform_fault_domain=None, rdp_thumb_print=None, vm_agent=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None, placement_group_id=None): - super(VirtualMachineScaleSetVMInstanceView, self).__init__() - self.platform_update_domain = platform_update_domain - self.platform_fault_domain = platform_fault_domain - self.rdp_thumb_print = rdp_thumb_print - self.vm_agent = vm_agent - self.disks = disks - self.extensions = extensions - self.boot_diagnostics = boot_diagnostics - self.statuses = statuses - self.placement_group_id = placement_group_id + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMInstanceView, self).__init__(**kwargs) + self.platform_update_domain = kwargs.get('platform_update_domain', None) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.rdp_thumb_print = kwargs.get('rdp_thumb_print', None) + self.vm_agent = kwargs.get('vm_agent', None) + self.disks = kwargs.get('disks', None) + self.extensions = kwargs.get('extensions', None) + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) + self.statuses = kwargs.get('statuses', None) + self.placement_group_id = kwargs.get('placement_group_id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_view_py3.py new file mode 100644 index 000000000000..d16428111fc0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_instance_view_py3.py @@ -0,0 +1,70 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMInstanceView(Model): + """The instance view of a virtual machine scale set VM. + + :param platform_update_domain: The Update Domain count. + :type platform_update_domain: int + :param platform_fault_domain: The Fault Domain count. + :type platform_fault_domain: int + :param rdp_thumb_print: The Remote desktop certificate thumbprint. + :type rdp_thumb_print: str + :param vm_agent: The VM Agent running on the virtual machine. + :type vm_agent: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineAgentInstanceView + :param disks: The disks information. + :type disks: + list[~azure.mgmt.compute.v2016_04_30_preview.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtensionInstanceView] + :param boot_diagnostics: Boot Diagnostics is a debugging feature which + allows you to view Console Output and Screenshot to diagnose VM status. +

    For Linux Virtual Machines, you can easily view the output of + your console log.

    For both Windows and Linux virtual machines, + Azure also enables you to see a screenshot of the VM from the hypervisor. + :type boot_diagnostics: + ~azure.mgmt.compute.v2016_04_30_preview.models.BootDiagnosticsInstanceView + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2016_04_30_preview.models.InstanceViewStatus] + :param placement_group_id: The placement group in which the VM is running. + If the VM is deallocated it will not have a placementGroupId. + :type placement_group_id: str + """ + + _attribute_map = { + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'int'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, + 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, + 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, + 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnosticsInstanceView'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + 'placement_group_id': {'key': 'placementGroupId', 'type': 'str'}, + } + + def __init__(self, *, platform_update_domain: int=None, platform_fault_domain: int=None, rdp_thumb_print: str=None, vm_agent=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None, placement_group_id: str=None, **kwargs) -> None: + super(VirtualMachineScaleSetVMInstanceView, self).__init__(**kwargs) + self.platform_update_domain = platform_update_domain + self.platform_fault_domain = platform_fault_domain + self.rdp_thumb_print = rdp_thumb_print + self.vm_agent = vm_agent + self.disks = disks + self.extensions = extensions + self.boot_diagnostics = boot_diagnostics + self.statuses = statuses + self.placement_group_id = placement_group_id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_profile.py index a106cd87f3b4..433e67fd340a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_profile.py @@ -36,9 +36,9 @@ class VirtualMachineScaleSetVMProfile(Model): 'extension_profile': {'key': 'extensionProfile', 'type': 'VirtualMachineScaleSetExtensionProfile'}, } - def __init__(self, os_profile=None, storage_profile=None, network_profile=None, extension_profile=None): - super(VirtualMachineScaleSetVMProfile, self).__init__() - self.os_profile = os_profile - self.storage_profile = storage_profile - self.network_profile = network_profile - self.extension_profile = extension_profile + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMProfile, self).__init__(**kwargs) + self.os_profile = kwargs.get('os_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.extension_profile = kwargs.get('extension_profile', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_profile_py3.py new file mode 100644 index 000000000000..4ad7899f9632 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_profile_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetVMProfile(Model): + """Describes a virtual machine scale set virtual machine profile. + + :param os_profile: The virtual machine scale set OS profile. + :type os_profile: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetOSProfile + :param storage_profile: The virtual machine scale set storage profile. + :type storage_profile: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetStorageProfile + :param network_profile: The virtual machine scale set network profile. + :type network_profile: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetNetworkProfile + :param extension_profile: The virtual machine scale set extension profile. + :type extension_profile: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetExtensionProfile + """ + + _attribute_map = { + 'os_profile': {'key': 'osProfile', 'type': 'VirtualMachineScaleSetOSProfile'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'VirtualMachineScaleSetStorageProfile'}, + 'network_profile': {'key': 'networkProfile', 'type': 'VirtualMachineScaleSetNetworkProfile'}, + 'extension_profile': {'key': 'extensionProfile', 'type': 'VirtualMachineScaleSetExtensionProfile'}, + } + + def __init__(self, *, os_profile=None, storage_profile=None, network_profile=None, extension_profile=None, **kwargs) -> None: + super(VirtualMachineScaleSetVMProfile, self).__init__(**kwargs) + self.os_profile = os_profile + self.storage_profile = storage_profile + self.network_profile = network_profile + self.extension_profile = extension_profile diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_py3.py new file mode 100644 index 000000000000..79793f66dac7 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_vm_py3.py @@ -0,0 +1,156 @@ +# 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 .resource import Resource + + +class VirtualMachineScaleSetVM(Resource): + """Describes a virtual machine scale set virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar instance_id: The virtual machine instance ID. + :vartype instance_id: str + :ivar sku: The virtual machine SKU. + :vartype sku: ~azure.mgmt.compute.v2016_04_30_preview.models.Sku + :ivar latest_model_applied: Specifies whether the latest model has been + applied to the virtual machine. + :vartype latest_model_applied: bool + :ivar vm_id: Azure VM unique ID. + :vartype vm_id: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineInstanceView + :param hardware_profile: Specifies the hardware settings for the virtual + machine. + :type hardware_profile: + ~azure.mgmt.compute.v2016_04_30_preview.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2016_04_30_preview.models.StorageProfile + :param os_profile: Specifies the operating system settings for the virtual + machine. + :type os_profile: ~azure.mgmt.compute.v2016_04_30_preview.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual + machine. + :type network_profile: + ~azure.mgmt.compute.v2016_04_30_preview.models.NetworkProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. +

    Minimum api-version: 2015-06-15. + :type diagnostics_profile: + ~azure.mgmt.compute.v2016_04_30_preview.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set + that the virtual machine should be assigned to. Virtual machines specified + in the same availability set are allocated to different nodes to maximize + availability. For more information about availability sets, see [Manage + the availability of virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + :type availability_set: + ~azure.mgmt.compute.v2016_04_30_preview.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :param license_type: Specifies that the image or disk that is being used + was licensed on-premises. This element is only used for images that + contain the Windows Server operating system.

    Possible values are: +

    Windows_Client

    Windows_Server

    If this element + is included in a request for an update, the value must match the initial + value. This value cannot be updated.

    For more information, see + [Azure Hybrid Use Benefit for Windows + Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Minimum api-version: 2015-06-15 + :type license_type: str + :param plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2016_04_30_preview.models.Plan + :ivar resources: The virtual machine child extension resources. + :vartype resources: + list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtension] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'instance_id': {'readonly': True}, + 'sku': {'readonly': True}, + 'latest_model_applied': {'readonly': True}, + 'vm_id': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'instance_id': {'key': 'instanceId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'latest_model_applied': {'key': 'properties.latestModelApplied', 'type': 'bool'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, + } + + def __init__(self, *, location: str, tags=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type: str=None, plan=None, **kwargs) -> None: + super(VirtualMachineScaleSetVM, self).__init__(location=location, tags=tags, **kwargs) + self.instance_id = None + self.sku = None + self.latest_model_applied = None + self.vm_id = None + self.instance_view = None + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.os_profile = os_profile + self.network_profile = network_profile + self.diagnostics_profile = diagnostics_profile + self.availability_set = availability_set + self.provisioning_state = None + self.license_type = license_type + self.plan = plan + self.resources = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_size.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_size.py index 3f4fa7f06b70..0fef3efd6c8e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_size.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_size.py @@ -43,11 +43,11 @@ class VirtualMachineSize(Model): 'max_data_disk_count': {'key': 'maxDataDiskCount', 'type': 'int'}, } - def __init__(self, name=None, number_of_cores=None, os_disk_size_in_mb=None, resource_disk_size_in_mb=None, memory_in_mb=None, max_data_disk_count=None): - super(VirtualMachineSize, self).__init__() - self.name = name - self.number_of_cores = number_of_cores - self.os_disk_size_in_mb = os_disk_size_in_mb - self.resource_disk_size_in_mb = resource_disk_size_in_mb - self.memory_in_mb = memory_in_mb - self.max_data_disk_count = max_data_disk_count + def __init__(self, **kwargs): + super(VirtualMachineSize, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.number_of_cores = kwargs.get('number_of_cores', None) + self.os_disk_size_in_mb = kwargs.get('os_disk_size_in_mb', None) + self.resource_disk_size_in_mb = kwargs.get('resource_disk_size_in_mb', None) + self.memory_in_mb = kwargs.get('memory_in_mb', None) + self.max_data_disk_count = kwargs.get('max_data_disk_count', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_size_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_size_py3.py new file mode 100644 index 000000000000..9f99ba20ce42 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_size_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineSize(Model): + """Describes the properties of a VM size. + + :param name: The name of the virtual machine size. + :type name: str + :param number_of_cores: The number of cores supported by the virtual + machine size. + :type number_of_cores: int + :param os_disk_size_in_mb: The OS disk size, in MB, allowed by the virtual + machine size. + :type os_disk_size_in_mb: int + :param resource_disk_size_in_mb: The resource disk size, in MB, allowed by + the virtual machine size. + :type resource_disk_size_in_mb: int + :param memory_in_mb: The amount of memory, in MB, supported by the virtual + machine size. + :type memory_in_mb: int + :param max_data_disk_count: The maximum number of data disks that can be + attached to the virtual machine size. + :type max_data_disk_count: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'number_of_cores': {'key': 'numberOfCores', 'type': 'int'}, + 'os_disk_size_in_mb': {'key': 'osDiskSizeInMB', 'type': 'int'}, + 'resource_disk_size_in_mb': {'key': 'resourceDiskSizeInMB', 'type': 'int'}, + 'memory_in_mb': {'key': 'memoryInMB', 'type': 'int'}, + 'max_data_disk_count': {'key': 'maxDataDiskCount', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, number_of_cores: int=None, os_disk_size_in_mb: int=None, resource_disk_size_in_mb: int=None, memory_in_mb: int=None, max_data_disk_count: int=None, **kwargs) -> None: + super(VirtualMachineSize, self).__init__(**kwargs) + self.name = name + self.number_of_cores = number_of_cores + self.os_disk_size_in_mb = os_disk_size_in_mb + self.resource_disk_size_in_mb = resource_disk_size_in_mb + self.memory_in_mb = memory_in_mb + self.max_data_disk_count = max_data_disk_count diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_status_code_count.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_status_code_count.py index 177515706064..7df7b702acd7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_status_code_count.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_status_code_count.py @@ -35,7 +35,7 @@ class VirtualMachineStatusCodeCount(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self): - super(VirtualMachineStatusCodeCount, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineStatusCodeCount, self).__init__(**kwargs) self.code = None self.count = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_status_code_count_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_status_code_count_py3.py new file mode 100644 index 000000000000..c38800073a95 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_status_code_count_py3.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 msrest.serialization import Model + + +class VirtualMachineStatusCodeCount(Model): + """The status code and count of the virtual machine scale set instance view + status summary. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The instance view status code. + :vartype code: str + :ivar count: The number of instances having a particular status code. + :vartype count: int + """ + + _validation = { + 'code': {'readonly': True}, + 'count': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineStatusCodeCount, self).__init__(**kwargs) + self.code = None + self.count = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/win_rm_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/win_rm_configuration.py index 46700643d104..41635875026d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/win_rm_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/win_rm_configuration.py @@ -24,6 +24,6 @@ class WinRMConfiguration(Model): 'listeners': {'key': 'listeners', 'type': '[WinRMListener]'}, } - def __init__(self, listeners=None): - super(WinRMConfiguration, self).__init__() - self.listeners = listeners + def __init__(self, **kwargs): + super(WinRMConfiguration, self).__init__(**kwargs) + self.listeners = kwargs.get('listeners', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/win_rm_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/win_rm_configuration_py3.py new file mode 100644 index 000000000000..ac5143326bd3 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/win_rm_configuration_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WinRMConfiguration(Model): + """Describes Windows Remote Management configuration of the VM. + + :param listeners: The list of Windows Remote Management listeners + :type listeners: + list[~azure.mgmt.compute.v2016_04_30_preview.models.WinRMListener] + """ + + _attribute_map = { + 'listeners': {'key': 'listeners', 'type': '[WinRMListener]'}, + } + + def __init__(self, *, listeners=None, **kwargs) -> None: + super(WinRMConfiguration, self).__init__(**kwargs) + self.listeners = listeners diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/win_rm_listener.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/win_rm_listener.py index 8cedce9683bb..705c7526004b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/win_rm_listener.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/win_rm_listener.py @@ -36,7 +36,7 @@ class WinRMListener(Model): 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, } - def __init__(self, protocol=None, certificate_url=None): - super(WinRMListener, self).__init__() - self.protocol = protocol - self.certificate_url = certificate_url + def __init__(self, **kwargs): + super(WinRMListener, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.certificate_url = kwargs.get('certificate_url', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/win_rm_listener_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/win_rm_listener_py3.py new file mode 100644 index 000000000000..ab6093907ea0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/win_rm_listener_py3.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 msrest.serialization import Model + + +class WinRMListener(Model): + """Describes Protocol and thumbprint of Windows Remote Management listener. + + :param protocol: Specifies the protocol of listener.

    Possible + values are:
    **http**

    **https**. Possible values include: + 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.compute.v2016_04_30_preview.models.ProtocolTypes + :param 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](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + In this case, your certificate needs to be It is the Base64 encoding of + the following JSON Object which is encoded in UTF-8:

    {
    + "data":"",
    "dataType":"pfx",
    + "password":""
    } + :type certificate_url: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'ProtocolTypes'}, + 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, + } + + def __init__(self, *, protocol=None, certificate_url: str=None, **kwargs) -> None: + super(WinRMListener, self).__init__(**kwargs) + self.protocol = protocol + self.certificate_url = certificate_url diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/windows_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/windows_configuration.py index f4d4afd09ade..cd649be575cb 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/windows_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/windows_configuration.py @@ -46,10 +46,10 @@ class WindowsConfiguration(Model): 'win_rm': {'key': 'winRM', 'type': 'WinRMConfiguration'}, } - def __init__(self, provision_vm_agent=None, enable_automatic_updates=None, time_zone=None, additional_unattend_content=None, win_rm=None): - super(WindowsConfiguration, self).__init__() - 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.win_rm = win_rm + def __init__(self, **kwargs): + super(WindowsConfiguration, self).__init__(**kwargs) + self.provision_vm_agent = kwargs.get('provision_vm_agent', None) + self.enable_automatic_updates = kwargs.get('enable_automatic_updates', None) + self.time_zone = kwargs.get('time_zone', None) + self.additional_unattend_content = kwargs.get('additional_unattend_content', None) + self.win_rm = kwargs.get('win_rm', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/windows_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/windows_configuration_py3.py new file mode 100644 index 000000000000..768c300efc00 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/windows_configuration_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class WindowsConfiguration(Model): + """Specifies Windows operating system settings on the virtual machine. + + :param 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. + :type provision_vm_agent: bool + :param enable_automatic_updates: Indicates whether virtual machine is + enabled for automatic updates. + :type enable_automatic_updates: bool + :param time_zone: Specifies the time zone of the virtual machine. e.g. + "Pacific Standard Time" + :type time_zone: str + :param 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. + :type additional_unattend_content: + list[~azure.mgmt.compute.v2016_04_30_preview.models.AdditionalUnattendContent] + :param win_rm: Specifies the Windows Remote Management listeners. This + enables remote Windows PowerShell. + :type win_rm: + ~azure.mgmt.compute.v2016_04_30_preview.models.WinRMConfiguration + """ + + _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]'}, + 'win_rm': {'key': 'winRM', 'type': 'WinRMConfiguration'}, + } + + def __init__(self, *, provision_vm_agent: bool=None, enable_automatic_updates: bool=None, time_zone: str=None, additional_unattend_content=None, win_rm=None, **kwargs) -> None: + super(WindowsConfiguration, self).__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.win_rm = win_rm diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/availability_sets_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/availability_sets_operations.py index b0ae5654d5cc..dda88859b1f5 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/availability_sets_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/availability_sets_operations.py @@ -22,7 +22,7 @@ class AvailabilitySetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-04-30-preview". """ @@ -60,7 +60,7 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("name", name, 'str'), @@ -105,6 +105,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} def delete( self, resource_group_name, availability_set_name, custom_headers=None, raw=False, **operation_config): @@ -126,7 +127,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -167,6 +168,7 @@ def delete( return client_raw_response return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} def get( self, resource_group_name, availability_set_name, custom_headers=None, raw=False, **operation_config): @@ -187,7 +189,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -228,6 +230,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -249,7 +252,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -295,6 +298,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets'} def list_available_sizes( self, resource_group_name, availability_set_name, custom_headers=None, raw=False, **operation_config): @@ -319,7 +323,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes' + url = self.list_available_sizes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -366,3 +370,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_available_sizes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/disks_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/disks_operations.py index 2293337205e8..1bb9532e2524 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/disks_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/disks_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class DisksOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-04-30-preview". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -106,13 +106,16 @@ def create_or_update( operation. :type disk: ~azure.mgmt.compute.v2016_04_30_preview.models.Disk :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Disk or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Disk or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.Disk] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.Disk]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('Disk', response) if raw: @@ -155,18 +136,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} def _update_initial( self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}' + url = self.update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -215,7 +198,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, polling=True, **operation_config): """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -229,13 +212,16 @@ def update( operation. :type disk: ~azure.mgmt.compute.v2016_04_30_preview.models.DiskUpdate :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Disk or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Disk or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.Disk] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.Disk]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -246,30 +232,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('Disk', response) if raw: @@ -278,12 +242,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} def get( self, resource_group_name, disk_name, custom_headers=None, raw=False, **operation_config): @@ -307,7 +273,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}' + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -348,12 +314,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} def _delete_initial( self, resource_group_name, disk_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}' + url = self.delete.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -396,7 +363,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, disk_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, disk_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a disk. :param resource_group_name: The name of the resource group. @@ -407,13 +374,16 @@ def delete( length is 80 characters. :type disk_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -423,30 +393,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -455,12 +403,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -482,7 +432,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') @@ -528,6 +478,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -547,7 +498,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -592,6 +543,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks'} def _grant_access_initial( @@ -599,7 +551,7 @@ def _grant_access_initial( grant_access_data = models.GrantAccessData(access=access, duration_in_seconds=duration_in_seconds) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess' + url = self.grant_access.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -646,7 +598,7 @@ def _grant_access_initial( return deserialized def grant_access( - self, resource_group_name, disk_name, access, duration_in_seconds, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, disk_name, access, duration_in_seconds, custom_headers=None, raw=False, polling=True, **operation_config): """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -663,13 +615,16 @@ def grant_access( access expires. :type duration_in_seconds: int :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns AccessUri or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AccessUri or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.AccessUri] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.AccessUri]] :raises: :class:`CloudError` """ raw_result = self._grant_access_initial( @@ -681,30 +636,8 @@ def grant_access( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('AccessUri', response) if raw: @@ -713,18 +646,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + grant_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess'} def _revoke_access_initial( self, resource_group_name, disk_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess' + url = self.revoke_access.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -767,7 +702,7 @@ def _revoke_access_initial( return deserialized def revoke_access( - self, resource_group_name, disk_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, disk_name, custom_headers=None, raw=False, polling=True, **operation_config): """Revokes access to a disk. :param resource_group_name: The name of the resource group. @@ -778,13 +713,16 @@ def revoke_access( length is 80 characters. :type disk_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._revoke_access_initial( @@ -794,30 +732,8 @@ def revoke_access( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -826,9 +742,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + revoke_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/images_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/images_operations.py index e4e05fe80c5f..a9f7099d9cff 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/images_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/images_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ImagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-04-30-preview". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, image_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'imageName': self._serialize.url("image_name", image_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, image_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, image_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update an image. :param resource_group_name: The name of the resource group. @@ -102,13 +102,16 @@ def create_or_update( :param parameters: Parameters supplied to the Create Image operation. :type parameters: ~azure.mgmt.compute.v2016_04_30_preview.models.Image :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Image or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Image or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.Image] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.Image]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -119,30 +122,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('Image', response) if raw: @@ -151,18 +132,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} def _delete_initial( self, resource_group_name, image_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'imageName': self._serialize.url("image_name", image_name, 'str'), @@ -205,7 +188,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, image_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, image_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -213,13 +196,16 @@ def delete( :param image_name: The name of the image. :type image_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -229,30 +215,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -261,12 +225,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} def get( self, resource_group_name, image_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -289,7 +255,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'imageName': self._serialize.url("image_name", image_name, 'str'), @@ -332,6 +298,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -353,7 +320,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -399,6 +366,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -420,7 +388,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -465,3 +433,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/snapshots_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/snapshots_operations.py index e8076e010c25..4d0356d0abed 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/snapshots_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/snapshots_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SnapshotsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-04-30-preview". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -105,13 +105,16 @@ def create_or_update( :type snapshot: ~azure.mgmt.compute.v2016_04_30_preview.models.Snapshot :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Snapshot or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Snapshot or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.Snapshot] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.Snapshot]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -122,30 +125,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('Snapshot', response) if raw: @@ -154,18 +135,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} def _update_initial( self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}' + url = self.update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -214,7 +197,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, polling=True, **operation_config): """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -227,13 +210,16 @@ def update( :type snapshot: ~azure.mgmt.compute.v2016_04_30_preview.models.SnapshotUpdate :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Snapshot or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Snapshot or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.Snapshot] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.Snapshot]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -244,30 +230,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('Snapshot', response) if raw: @@ -276,12 +240,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} def get( self, resource_group_name, snapshot_name, custom_headers=None, raw=False, **operation_config): @@ -303,7 +269,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}' + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -344,12 +310,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} def _delete_initial( self, resource_group_name, snapshot_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}' + url = self.delete.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -392,7 +359,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, snapshot_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, snapshot_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a snapshot. :param resource_group_name: The name of the resource group. @@ -401,13 +368,16 @@ def delete( subscription and resource group. :type snapshot_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -417,30 +387,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -449,12 +397,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -476,7 +426,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') @@ -522,6 +472,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -541,7 +492,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -586,6 +537,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots'} def _grant_access_initial( @@ -593,7 +545,7 @@ def _grant_access_initial( grant_access_data = models.GrantAccessData(access=access, duration_in_seconds=duration_in_seconds) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess' + url = self.grant_access.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -640,7 +592,7 @@ def _grant_access_initial( return deserialized def grant_access( - self, resource_group_name, snapshot_name, access, duration_in_seconds, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, snapshot_name, access, duration_in_seconds, custom_headers=None, raw=False, polling=True, **operation_config): """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -655,13 +607,16 @@ def grant_access( access expires. :type duration_in_seconds: int :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns AccessUri or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AccessUri or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.AccessUri] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.AccessUri]] :raises: :class:`CloudError` """ raw_result = self._grant_access_initial( @@ -673,30 +628,8 @@ def grant_access( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('AccessUri', response) if raw: @@ -705,18 +638,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + grant_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess'} def _revoke_access_initial( self, resource_group_name, snapshot_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess' + url = self.revoke_access.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -759,7 +694,7 @@ def _revoke_access_initial( return deserialized def revoke_access( - self, resource_group_name, snapshot_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, snapshot_name, custom_headers=None, raw=False, polling=True, **operation_config): """Revokes access to a snapshot. :param resource_group_name: The name of the resource group. @@ -768,13 +703,16 @@ def revoke_access( subscription and resource group. :type snapshot_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._revoke_access_initial( @@ -784,30 +722,8 @@ def revoke_access( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -816,9 +732,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + revoke_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/usage_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/usage_operations.py index fa3ecd5b5c33..51996f303a0d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/usage_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/usage_operations.py @@ -22,7 +22,7 @@ class UsageOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-04-30-preview". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -105,3 +105,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_extension_images_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_extension_images_operations.py index 3743f0cfd57c..34b10c839d82 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_extension_images_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_extension_images_operations.py @@ -22,7 +22,7 @@ class VirtualMachineExtensionImagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-04-30-preview". """ @@ -61,7 +61,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}' + url = self.get.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -104,6 +104,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}'} def list_types( self, location, publisher_name, custom_headers=None, raw=False, **operation_config): @@ -125,7 +126,7 @@ def list_types( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types' + url = self.list_types.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -166,6 +167,7 @@ def list_types( return client_raw_response return deserialized + list_types.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types'} def list_versions( self, location, publisher_name, type, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): @@ -195,7 +197,7 @@ def list_versions( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions' + url = self.list_versions.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -243,3 +245,4 @@ def list_versions( return client_raw_response return deserialized + list_versions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_extensions_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_extensions_operations.py index df11f6894744..69098285f870 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_extensions_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_extensions_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineExtensionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-04-30-preview". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -93,7 +93,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -108,13 +108,16 @@ def create_or_update( :type extension_parameters: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtension :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineExtension or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachineExtension + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtension] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtension]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -126,30 +129,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineExtension', response) if raw: @@ -158,18 +139,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} def _delete_initial( self, resource_group_name, vm_name, vm_extension_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -213,7 +196,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_name, vm_extension_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, vm_extension_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -224,13 +207,16 @@ def delete( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -241,30 +227,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -273,12 +237,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} def get( self, resource_group_name, vm_name, vm_extension_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -305,7 +271,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -349,3 +315,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_images_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_images_operations.py index d66f76944d10..e1e3fc9b16b7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_images_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_images_operations.py @@ -22,7 +22,7 @@ class VirtualMachineImagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-04-30-preview". """ @@ -63,7 +63,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}' + url = self.get.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -107,6 +107,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}'} def list( self, location, publisher_name, offer, skus, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): @@ -139,7 +140,7 @@ def list( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -188,6 +189,7 @@ def list( return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions'} def list_offers( self, location, publisher_name, custom_headers=None, raw=False, **operation_config): @@ -210,7 +212,7 @@ def list_offers( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers' + url = self.list_offers.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -251,6 +253,7 @@ def list_offers( return client_raw_response return deserialized + list_offers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers'} def list_publishers( self, location, custom_headers=None, raw=False, **operation_config): @@ -271,7 +274,7 @@ def list_publishers( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers' + url = self.list_publishers.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -311,6 +314,7 @@ def list_publishers( return client_raw_response return deserialized + list_publishers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers'} def list_skus( self, location, publisher_name, offer, custom_headers=None, raw=False, **operation_config): @@ -335,7 +339,7 @@ def list_skus( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus' + url = self.list_skus.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -377,3 +381,4 @@ def list_skus( return client_raw_response return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_scale_set_vms_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_scale_set_vms_operations.py index 9cae0b8f485f..61b70093702b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_scale_set_vms_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_scale_set_vms_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-04-30-preview". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _reimage_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage' + url = self.reimage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -87,7 +87,7 @@ def _reimage_initial( return deserialized def reimage( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. @@ -98,13 +98,16 @@ def reimage( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._reimage_initial( @@ -115,30 +118,8 @@ def reimage( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -147,18 +128,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage'} def _reimage_all_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall' + url = self.reimage_all.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -202,7 +185,7 @@ def _reimage_all_initial( return deserialized def reimage_all( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. @@ -214,13 +197,16 @@ def reimage_all( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._reimage_all_initial( @@ -231,30 +217,8 @@ def reimage_all( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -263,18 +227,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reimage_all.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall'} def _deallocate_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate' + url = self.deallocate.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -318,7 +284,7 @@ def _deallocate_initial( return deserialized def deallocate( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is @@ -331,13 +297,16 @@ def deallocate( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._deallocate_initial( @@ -348,30 +317,8 @@ def deallocate( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -380,18 +327,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate'} def _delete_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -435,7 +384,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -445,13 +394,16 @@ def delete( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -462,30 +414,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -494,12 +424,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} def get( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): @@ -523,7 +455,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -565,6 +497,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} def get_instance_view( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): @@ -589,7 +522,7 @@ def get_instance_view( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView' + url = self.get_instance_view.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -631,6 +564,7 @@ def get_instance_view( return client_raw_response return deserialized + get_instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView'} def list( self, resource_group_name, virtual_machine_scale_set_name, filter=None, select=None, expand=None, custom_headers=None, raw=False, **operation_config): @@ -660,7 +594,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -713,12 +647,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines'} def _power_off_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff' + url = self.power_off.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -762,7 +697,7 @@ def _power_off_initial( return deserialized def power_off( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid @@ -775,13 +710,16 @@ def power_off( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._power_off_initial( @@ -792,30 +730,8 @@ def power_off( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -824,18 +740,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff'} def _restart_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart' + url = self.restart.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -879,7 +797,7 @@ def _restart_initial( return deserialized def restart( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -889,13 +807,16 @@ def restart( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._restart_initial( @@ -906,30 +827,8 @@ def restart( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -938,18 +837,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart'} def _start_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -993,7 +894,7 @@ def _start_initial( return deserialized def start( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1003,13 +904,16 @@ def start( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -1020,30 +924,8 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1052,9 +934,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_scale_sets_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_scale_sets_operations.py index b92b4cd1fa54..32b27d043583 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_scale_sets_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_scale_sets_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineScaleSetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-04-30-preview". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("name", name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -103,13 +103,16 @@ def create_or_update( :type parameters: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSet :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineScaleSet or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachineScaleSet + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSet] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSet]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -120,30 +123,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineScaleSet', response) if raw: @@ -152,18 +133,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def _delete_initial( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -206,7 +189,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -214,13 +197,16 @@ def delete( :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -230,30 +216,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -262,12 +226,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def get( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -289,7 +255,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -330,6 +296,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def _deallocate_initial( @@ -339,7 +306,7 @@ def _deallocate_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate' + url = self.deallocate.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -389,7 +356,7 @@ def _deallocate_initial( return deserialized def deallocate( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set @@ -405,13 +372,16 @@ def deallocate( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._deallocate_initial( @@ -422,30 +392,8 @@ def deallocate( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -454,12 +402,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate'} def _delete_instances_initial( @@ -467,7 +417,7 @@ def _delete_instances_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceRequiredIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete' + url = self.delete_instances.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -514,7 +464,7 @@ def _delete_instances_initial( return deserialized def delete_instances( - self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -524,13 +474,16 @@ def delete_instances( :param instance_ids: The virtual machine scale set instance ids. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_instances_initial( @@ -541,30 +494,8 @@ def delete_instances( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -573,12 +504,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_instances.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete'} def get_instance_view( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -601,7 +534,7 @@ def get_instance_view( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView' + url = self.get_instance_view.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -642,6 +575,7 @@ def get_instance_view( return client_raw_response return deserialized + get_instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -663,7 +597,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -709,6 +643,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -731,7 +666,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -776,6 +711,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets'} def list_skus( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -800,7 +736,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus' + url = self.list_skus.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -847,6 +783,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus'} def _power_off_initial( @@ -856,7 +793,7 @@ def _power_off_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff' + url = self.power_off.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -906,7 +843,7 @@ def _power_off_initial( return deserialized def power_off( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid @@ -922,13 +859,16 @@ def power_off( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._power_off_initial( @@ -939,30 +879,8 @@ def power_off( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -971,12 +889,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff'} def _restart_initial( @@ -986,7 +906,7 @@ def _restart_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart' + url = self.restart.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1036,7 +956,7 @@ def _restart_initial( return deserialized def restart( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1049,13 +969,16 @@ def restart( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._restart_initial( @@ -1066,30 +989,8 @@ def restart( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1098,12 +999,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart'} def _start_initial( @@ -1113,7 +1016,7 @@ def _start_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1163,7 +1066,7 @@ def _start_initial( return deserialized def start( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1176,13 +1079,16 @@ def start( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -1193,30 +1099,8 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1225,12 +1109,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start'} def _update_instances_initial( @@ -1238,7 +1124,7 @@ def _update_instances_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceRequiredIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade' + url = self.update_instances.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1285,7 +1171,7 @@ def _update_instances_initial( return deserialized def update_instances( - self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, polling=True, **operation_config): """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. @@ -1296,13 +1182,16 @@ def update_instances( :param instance_ids: The virtual machine scale set instance ids. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._update_instances_initial( @@ -1313,30 +1202,8 @@ def update_instances( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1345,18 +1212,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_instances.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade'} def _reimage_initial( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage' + url = self.reimage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1399,7 +1268,7 @@ def _reimage_initial( return deserialized def reimage( - self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, polling=True, **operation_config): """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. @@ -1408,13 +1277,16 @@ def reimage( :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._reimage_initial( @@ -1424,30 +1296,8 @@ def reimage( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1456,18 +1306,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage'} def _reimage_all_initial( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall' + url = self.reimage_all.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1510,7 +1362,7 @@ def _reimage_all_initial( return deserialized def reimage_all( - self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, polling=True, **operation_config): """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. @@ -1519,13 +1371,16 @@ def reimage_all( :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._reimage_all_initial( @@ -1535,30 +1390,8 @@ def reimage_all( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1567,9 +1400,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reimage_all.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_sizes_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_sizes_operations.py index bf83804181da..5c7173bc8dfa 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_sizes_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machine_sizes_operations.py @@ -22,7 +22,7 @@ class VirtualMachineSizesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-04-30-preview". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -105,3 +105,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machines_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machines_operations.py index c32e69402db2..6abfbaf986c2 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machines_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/virtual_machines_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachinesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-04-30-preview". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _capture_initial( self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture' + url = self.capture.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -90,7 +90,7 @@ def _capture_initial( return deserialized def capture( - self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -103,13 +103,17 @@ def capture( :type parameters: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineCaptureParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineCaptureResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualMachineCaptureResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineCaptureResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineCaptureResult]] :raises: :class:`CloudError` """ raw_result = self._capture_initial( @@ -120,30 +124,8 @@ def capture( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineCaptureResult', response) if raw: @@ -152,18 +134,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture'} def _create_or_update_initial( self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -212,7 +196,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -224,13 +208,16 @@ def create_or_update( :type parameters: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachine :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachine or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachine or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachine] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachine]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -241,30 +228,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachine', response) if raw: @@ -273,18 +238,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} def _delete_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -327,7 +294,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -335,13 +302,16 @@ def delete( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -351,30 +321,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -383,12 +331,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} def get( self, resource_group_name, vm_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -414,7 +364,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -457,12 +407,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} def _convert_to_managed_disks_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks' + url = self.convert_to_managed_disks.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -505,7 +456,7 @@ def _convert_to_managed_disks_initial( return deserialized def convert_to_managed_disks( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. @@ -515,13 +466,16 @@ def convert_to_managed_disks( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._convert_to_managed_disks_initial( @@ -531,30 +485,8 @@ def convert_to_managed_disks( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -563,18 +495,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + convert_to_managed_disks.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks'} def _deallocate_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate' + url = self.deallocate.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -617,7 +551,7 @@ def _deallocate_initial( return deserialized def deallocate( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. @@ -627,13 +561,16 @@ def deallocate( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._deallocate_initial( @@ -643,30 +580,8 @@ def deallocate( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -675,12 +590,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate'} def generalize( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): @@ -702,7 +619,7 @@ def generalize( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize' + url = self.generalize.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -743,6 +660,7 @@ def generalize( return client_raw_response return deserialized + generalize.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -766,7 +684,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -812,6 +730,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -833,7 +752,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -878,6 +797,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines'} def list_available_sizes( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): @@ -902,7 +822,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes' + url = self.list_available_sizes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -949,12 +869,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_available_sizes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes'} def _power_off_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff' + url = self.power_off.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -997,7 +918,7 @@ def _power_off_initial( return deserialized def power_off( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. @@ -1007,13 +928,16 @@ def power_off( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._power_off_initial( @@ -1023,30 +947,8 @@ def power_off( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1055,18 +957,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff'} def _restart_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart' + url = self.restart.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1109,7 +1013,7 @@ def _restart_initial( return deserialized def restart( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1117,13 +1021,16 @@ def restart( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._restart_initial( @@ -1133,30 +1040,8 @@ def restart( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1165,18 +1050,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart'} def _start_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1219,7 +1106,7 @@ def _start_initial( return deserialized def start( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1227,13 +1114,16 @@ def start( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -1243,30 +1133,8 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1275,18 +1143,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start'} def _redeploy_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy' + url = self.redeploy.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1329,7 +1199,7 @@ def _redeploy_initial( return deserialized def redeploy( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to redeploy a virtual machine. :param resource_group_name: The name of the resource group. @@ -1337,13 +1207,16 @@ def redeploy( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._redeploy_initial( @@ -1353,30 +1226,8 @@ def redeploy( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1385,9 +1236,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + redeploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/__init__.py index 966e2439cd7e..0fd5d783f72f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/__init__.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/__init__.py @@ -9,135 +9,266 @@ # regenerated. # -------------------------------------------------------------------------- -from .instance_view_status import InstanceViewStatus -from .sub_resource import SubResource -from .sku import Sku -from .availability_set import AvailabilitySet -from .virtual_machine_size import VirtualMachineSize -from .virtual_machine_extension_image import VirtualMachineExtensionImage -from .virtual_machine_image_resource import VirtualMachineImageResource -from .virtual_machine_extension_instance_view import VirtualMachineExtensionInstanceView -from .virtual_machine_extension import VirtualMachineExtension -from .purchase_plan import PurchasePlan -from .os_disk_image import OSDiskImage -from .data_disk_image import DataDiskImage -from .virtual_machine_image import VirtualMachineImage -from .usage_name import UsageName -from .usage import Usage -from .virtual_machine_capture_parameters import VirtualMachineCaptureParameters -from .virtual_machine_capture_result import VirtualMachineCaptureResult -from .plan import Plan -from .hardware_profile import HardwareProfile -from .image_reference import ImageReference -from .key_vault_secret_reference import KeyVaultSecretReference -from .key_vault_key_reference import KeyVaultKeyReference -from .disk_encryption_settings import DiskEncryptionSettings -from .virtual_hard_disk import VirtualHardDisk -from .managed_disk_parameters import ManagedDiskParameters -from .os_disk import OSDisk -from .data_disk import DataDisk -from .storage_profile import StorageProfile -from .additional_unattend_content import AdditionalUnattendContent -from .win_rm_listener import WinRMListener -from .win_rm_configuration import WinRMConfiguration -from .windows_configuration import WindowsConfiguration -from .ssh_public_key import SshPublicKey -from .ssh_configuration import SshConfiguration -from .linux_configuration import LinuxConfiguration -from .vault_certificate import VaultCertificate -from .vault_secret_group import VaultSecretGroup -from .os_profile import OSProfile -from .network_interface_reference import NetworkInterfaceReference -from .network_profile import NetworkProfile -from .boot_diagnostics import BootDiagnostics -from .diagnostics_profile import DiagnosticsProfile -from .virtual_machine_extension_handler_instance_view import VirtualMachineExtensionHandlerInstanceView -from .virtual_machine_agent_instance_view import VirtualMachineAgentInstanceView -from .disk_instance_view import DiskInstanceView -from .boot_diagnostics_instance_view import BootDiagnosticsInstanceView -from .virtual_machine_identity import VirtualMachineIdentity -from .maintenance_redeploy_status import MaintenanceRedeployStatus -from .virtual_machine_instance_view import VirtualMachineInstanceView -from .virtual_machine import VirtualMachine -from .rolling_upgrade_policy import RollingUpgradePolicy -from .upgrade_policy import UpgradePolicy -from .image_os_disk import ImageOSDisk -from .image_data_disk import ImageDataDisk -from .image_storage_profile import ImageStorageProfile -from .image import Image -from .virtual_machine_scale_set_identity import VirtualMachineScaleSetIdentity -from .resource_sku_capacity import ResourceSkuCapacity -from .resource_sku_costs import ResourceSkuCosts -from .resource_sku_capabilities import ResourceSkuCapabilities -from .resource_sku_restrictions import ResourceSkuRestrictions -from .resource_sku import ResourceSku -from .virtual_machine_scale_set_os_profile import VirtualMachineScaleSetOSProfile -from .virtual_machine_scale_set_update_os_profile import VirtualMachineScaleSetUpdateOSProfile -from .virtual_machine_scale_set_managed_disk_parameters import VirtualMachineScaleSetManagedDiskParameters -from .virtual_machine_scale_set_os_disk import VirtualMachineScaleSetOSDisk -from .virtual_machine_scale_set_update_os_disk import VirtualMachineScaleSetUpdateOSDisk -from .virtual_machine_scale_set_data_disk import VirtualMachineScaleSetDataDisk -from .virtual_machine_scale_set_storage_profile import VirtualMachineScaleSetStorageProfile -from .virtual_machine_scale_set_update_storage_profile import VirtualMachineScaleSetUpdateStorageProfile -from .api_entity_reference import ApiEntityReference -from .virtual_machine_scale_set_public_ip_address_configuration_dns_settings import VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings -from .virtual_machine_scale_set_public_ip_address_configuration import VirtualMachineScaleSetPublicIPAddressConfiguration -from .virtual_machine_scale_set_update_public_ip_address_configuration import VirtualMachineScaleSetUpdatePublicIPAddressConfiguration -from .virtual_machine_scale_set_ip_configuration import VirtualMachineScaleSetIPConfiguration -from .virtual_machine_scale_set_update_ip_configuration import VirtualMachineScaleSetUpdateIPConfiguration -from .virtual_machine_scale_set_network_configuration_dns_settings import VirtualMachineScaleSetNetworkConfigurationDnsSettings -from .virtual_machine_scale_set_network_configuration import VirtualMachineScaleSetNetworkConfiguration -from .virtual_machine_scale_set_update_network_configuration import VirtualMachineScaleSetUpdateNetworkConfiguration -from .virtual_machine_scale_set_network_profile import VirtualMachineScaleSetNetworkProfile -from .virtual_machine_scale_set_update_network_profile import VirtualMachineScaleSetUpdateNetworkProfile -from .virtual_machine_scale_set_extension import VirtualMachineScaleSetExtension -from .virtual_machine_scale_set_extension_profile import VirtualMachineScaleSetExtensionProfile -from .virtual_machine_scale_set_vm_profile import VirtualMachineScaleSetVMProfile -from .virtual_machine_scale_set_update_vm_profile import VirtualMachineScaleSetUpdateVMProfile -from .virtual_machine_scale_set import VirtualMachineScaleSet -from .virtual_machine_scale_set_update import VirtualMachineScaleSetUpdate -from .virtual_machine_scale_set_vm_instance_ids import VirtualMachineScaleSetVMInstanceIDs -from .virtual_machine_scale_set_vm_instance_required_ids import VirtualMachineScaleSetVMInstanceRequiredIDs -from .virtual_machine_status_code_count import VirtualMachineStatusCodeCount -from .virtual_machine_scale_set_instance_view_statuses_summary import VirtualMachineScaleSetInstanceViewStatusesSummary -from .virtual_machine_scale_set_vm_extensions_summary import VirtualMachineScaleSetVMExtensionsSummary -from .virtual_machine_scale_set_instance_view import VirtualMachineScaleSetInstanceView -from .virtual_machine_scale_set_sku_capacity import VirtualMachineScaleSetSkuCapacity -from .virtual_machine_scale_set_sku import VirtualMachineScaleSetSku -from .virtual_machine_scale_set_vm import VirtualMachineScaleSetVM -from .virtual_machine_health_status import VirtualMachineHealthStatus -from .virtual_machine_scale_set_vm_instance_view import VirtualMachineScaleSetVMInstanceView -from .rolling_upgrade_running_status import RollingUpgradeRunningStatus -from .rolling_upgrade_progress_info import RollingUpgradeProgressInfo -from .api_error_base import ApiErrorBase -from .inner_error import InnerError -from .api_error import ApiError -from .rolling_upgrade_status_info import RollingUpgradeStatusInfo -from .compute_long_running_operation_properties import ComputeLongRunningOperationProperties -from .resource import Resource -from .update_resource import UpdateResource -from .sub_resource_read_only import SubResourceReadOnly -from .operation_status_response import OperationStatusResponse -from .disk_sku import DiskSku -from .resource_update import ResourceUpdate -from .image_disk_reference import ImageDiskReference -from .creation_data import CreationData -from .source_vault import SourceVault -from .key_vault_and_secret_reference import KeyVaultAndSecretReference -from .key_vault_and_key_reference import KeyVaultAndKeyReference -from .encryption_settings import EncryptionSettings -from .disk import Disk -from .disk_update import DiskUpdate -from .grant_access_data import GrantAccessData -from .access_uri import AccessUri -from .snapshot import Snapshot -from .snapshot_update import SnapshotUpdate -from .run_command_input_parameter import RunCommandInputParameter -from .run_command_input import RunCommandInput -from .run_command_parameter_definition import RunCommandParameterDefinition -from .run_command_document_base import RunCommandDocumentBase -from .run_command_document import RunCommandDocument -from .run_command_result import RunCommandResult +try: + from .instance_view_status_py3 import InstanceViewStatus + from .sub_resource_py3 import SubResource + from .sku_py3 import Sku + from .availability_set_py3 import AvailabilitySet + from .virtual_machine_size_py3 import VirtualMachineSize + from .virtual_machine_extension_image_py3 import VirtualMachineExtensionImage + from .virtual_machine_image_resource_py3 import VirtualMachineImageResource + from .virtual_machine_extension_instance_view_py3 import VirtualMachineExtensionInstanceView + from .virtual_machine_extension_py3 import VirtualMachineExtension + from .purchase_plan_py3 import PurchasePlan + from .os_disk_image_py3 import OSDiskImage + from .data_disk_image_py3 import DataDiskImage + from .virtual_machine_image_py3 import VirtualMachineImage + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .virtual_machine_capture_parameters_py3 import VirtualMachineCaptureParameters + from .virtual_machine_capture_result_py3 import VirtualMachineCaptureResult + from .plan_py3 import Plan + from .hardware_profile_py3 import HardwareProfile + from .image_reference_py3 import ImageReference + from .key_vault_secret_reference_py3 import KeyVaultSecretReference + from .key_vault_key_reference_py3 import KeyVaultKeyReference + from .disk_encryption_settings_py3 import DiskEncryptionSettings + from .virtual_hard_disk_py3 import VirtualHardDisk + from .managed_disk_parameters_py3 import ManagedDiskParameters + from .os_disk_py3 import OSDisk + from .data_disk_py3 import DataDisk + from .storage_profile_py3 import StorageProfile + from .additional_unattend_content_py3 import AdditionalUnattendContent + from .win_rm_listener_py3 import WinRMListener + from .win_rm_configuration_py3 import WinRMConfiguration + from .windows_configuration_py3 import WindowsConfiguration + from .ssh_public_key_py3 import SshPublicKey + from .ssh_configuration_py3 import SshConfiguration + from .linux_configuration_py3 import LinuxConfiguration + from .vault_certificate_py3 import VaultCertificate + from .vault_secret_group_py3 import VaultSecretGroup + from .os_profile_py3 import OSProfile + from .network_interface_reference_py3 import NetworkInterfaceReference + from .network_profile_py3 import NetworkProfile + from .boot_diagnostics_py3 import BootDiagnostics + from .diagnostics_profile_py3 import DiagnosticsProfile + from .virtual_machine_extension_handler_instance_view_py3 import VirtualMachineExtensionHandlerInstanceView + from .virtual_machine_agent_instance_view_py3 import VirtualMachineAgentInstanceView + from .disk_instance_view_py3 import DiskInstanceView + from .boot_diagnostics_instance_view_py3 import BootDiagnosticsInstanceView + from .virtual_machine_identity_py3 import VirtualMachineIdentity + from .maintenance_redeploy_status_py3 import MaintenanceRedeployStatus + from .virtual_machine_instance_view_py3 import VirtualMachineInstanceView + from .virtual_machine_py3 import VirtualMachine + from .rolling_upgrade_policy_py3 import RollingUpgradePolicy + from .upgrade_policy_py3 import UpgradePolicy + from .image_os_disk_py3 import ImageOSDisk + from .image_data_disk_py3 import ImageDataDisk + from .image_storage_profile_py3 import ImageStorageProfile + from .image_py3 import Image + from .virtual_machine_scale_set_identity_py3 import VirtualMachineScaleSetIdentity + from .resource_sku_capacity_py3 import ResourceSkuCapacity + from .resource_sku_costs_py3 import ResourceSkuCosts + from .resource_sku_capabilities_py3 import ResourceSkuCapabilities + from .resource_sku_restrictions_py3 import ResourceSkuRestrictions + from .resource_sku_py3 import ResourceSku + from .virtual_machine_scale_set_os_profile_py3 import VirtualMachineScaleSetOSProfile + from .virtual_machine_scale_set_update_os_profile_py3 import VirtualMachineScaleSetUpdateOSProfile + from .virtual_machine_scale_set_managed_disk_parameters_py3 import VirtualMachineScaleSetManagedDiskParameters + from .virtual_machine_scale_set_os_disk_py3 import VirtualMachineScaleSetOSDisk + from .virtual_machine_scale_set_update_os_disk_py3 import VirtualMachineScaleSetUpdateOSDisk + from .virtual_machine_scale_set_data_disk_py3 import VirtualMachineScaleSetDataDisk + from .virtual_machine_scale_set_storage_profile_py3 import VirtualMachineScaleSetStorageProfile + from .virtual_machine_scale_set_update_storage_profile_py3 import VirtualMachineScaleSetUpdateStorageProfile + from .api_entity_reference_py3 import ApiEntityReference + from .virtual_machine_scale_set_public_ip_address_configuration_dns_settings_py3 import VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + from .virtual_machine_scale_set_public_ip_address_configuration_py3 import VirtualMachineScaleSetPublicIPAddressConfiguration + from .virtual_machine_scale_set_update_public_ip_address_configuration_py3 import VirtualMachineScaleSetUpdatePublicIPAddressConfiguration + from .virtual_machine_scale_set_ip_configuration_py3 import VirtualMachineScaleSetIPConfiguration + from .virtual_machine_scale_set_update_ip_configuration_py3 import VirtualMachineScaleSetUpdateIPConfiguration + from .virtual_machine_scale_set_network_configuration_dns_settings_py3 import VirtualMachineScaleSetNetworkConfigurationDnsSettings + from .virtual_machine_scale_set_network_configuration_py3 import VirtualMachineScaleSetNetworkConfiguration + from .virtual_machine_scale_set_update_network_configuration_py3 import VirtualMachineScaleSetUpdateNetworkConfiguration + from .virtual_machine_scale_set_network_profile_py3 import VirtualMachineScaleSetNetworkProfile + from .virtual_machine_scale_set_update_network_profile_py3 import VirtualMachineScaleSetUpdateNetworkProfile + from .virtual_machine_scale_set_extension_py3 import VirtualMachineScaleSetExtension + from .virtual_machine_scale_set_extension_profile_py3 import VirtualMachineScaleSetExtensionProfile + from .virtual_machine_scale_set_vm_profile_py3 import VirtualMachineScaleSetVMProfile + from .virtual_machine_scale_set_update_vm_profile_py3 import VirtualMachineScaleSetUpdateVMProfile + from .virtual_machine_scale_set_py3 import VirtualMachineScaleSet + from .virtual_machine_scale_set_update_py3 import VirtualMachineScaleSetUpdate + from .virtual_machine_scale_set_vm_instance_ids_py3 import VirtualMachineScaleSetVMInstanceIDs + from .virtual_machine_scale_set_vm_instance_required_ids_py3 import VirtualMachineScaleSetVMInstanceRequiredIDs + from .virtual_machine_status_code_count_py3 import VirtualMachineStatusCodeCount + from .virtual_machine_scale_set_instance_view_statuses_summary_py3 import VirtualMachineScaleSetInstanceViewStatusesSummary + from .virtual_machine_scale_set_vm_extensions_summary_py3 import VirtualMachineScaleSetVMExtensionsSummary + from .virtual_machine_scale_set_instance_view_py3 import VirtualMachineScaleSetInstanceView + from .virtual_machine_scale_set_sku_capacity_py3 import VirtualMachineScaleSetSkuCapacity + from .virtual_machine_scale_set_sku_py3 import VirtualMachineScaleSetSku + from .virtual_machine_scale_set_vm_py3 import VirtualMachineScaleSetVM + from .virtual_machine_health_status_py3 import VirtualMachineHealthStatus + from .virtual_machine_scale_set_vm_instance_view_py3 import VirtualMachineScaleSetVMInstanceView + from .rolling_upgrade_running_status_py3 import RollingUpgradeRunningStatus + from .rolling_upgrade_progress_info_py3 import RollingUpgradeProgressInfo + from .api_error_base_py3 import ApiErrorBase + from .inner_error_py3 import InnerError + from .api_error_py3 import ApiError + from .rolling_upgrade_status_info_py3 import RollingUpgradeStatusInfo + from .compute_long_running_operation_properties_py3 import ComputeLongRunningOperationProperties + from .resource_py3 import Resource + from .update_resource_py3 import UpdateResource + from .sub_resource_read_only_py3 import SubResourceReadOnly + from .operation_status_response_py3 import OperationStatusResponse + from .disk_sku_py3 import DiskSku + from .resource_update_py3 import ResourceUpdate + from .image_disk_reference_py3 import ImageDiskReference + from .creation_data_py3 import CreationData + from .source_vault_py3 import SourceVault + from .key_vault_and_secret_reference_py3 import KeyVaultAndSecretReference + from .key_vault_and_key_reference_py3 import KeyVaultAndKeyReference + from .encryption_settings_py3 import EncryptionSettings + from .disk_py3 import Disk + from .disk_update_py3 import DiskUpdate + from .grant_access_data_py3 import GrantAccessData + from .access_uri_py3 import AccessUri + from .snapshot_py3 import Snapshot + from .snapshot_update_py3 import SnapshotUpdate + from .run_command_input_parameter_py3 import RunCommandInputParameter + from .run_command_input_py3 import RunCommandInput + from .run_command_parameter_definition_py3 import RunCommandParameterDefinition + from .run_command_document_base_py3 import RunCommandDocumentBase + from .run_command_document_py3 import RunCommandDocument + from .run_command_result_py3 import RunCommandResult +except (SyntaxError, ImportError): + from .instance_view_status import InstanceViewStatus + from .sub_resource import SubResource + from .sku import Sku + from .availability_set import AvailabilitySet + from .virtual_machine_size import VirtualMachineSize + from .virtual_machine_extension_image import VirtualMachineExtensionImage + from .virtual_machine_image_resource import VirtualMachineImageResource + from .virtual_machine_extension_instance_view import VirtualMachineExtensionInstanceView + from .virtual_machine_extension import VirtualMachineExtension + from .purchase_plan import PurchasePlan + from .os_disk_image import OSDiskImage + from .data_disk_image import DataDiskImage + from .virtual_machine_image import VirtualMachineImage + from .usage_name import UsageName + from .usage import Usage + from .virtual_machine_capture_parameters import VirtualMachineCaptureParameters + from .virtual_machine_capture_result import VirtualMachineCaptureResult + from .plan import Plan + from .hardware_profile import HardwareProfile + from .image_reference import ImageReference + from .key_vault_secret_reference import KeyVaultSecretReference + from .key_vault_key_reference import KeyVaultKeyReference + from .disk_encryption_settings import DiskEncryptionSettings + from .virtual_hard_disk import VirtualHardDisk + from .managed_disk_parameters import ManagedDiskParameters + from .os_disk import OSDisk + from .data_disk import DataDisk + from .storage_profile import StorageProfile + from .additional_unattend_content import AdditionalUnattendContent + from .win_rm_listener import WinRMListener + from .win_rm_configuration import WinRMConfiguration + from .windows_configuration import WindowsConfiguration + from .ssh_public_key import SshPublicKey + from .ssh_configuration import SshConfiguration + from .linux_configuration import LinuxConfiguration + from .vault_certificate import VaultCertificate + from .vault_secret_group import VaultSecretGroup + from .os_profile import OSProfile + from .network_interface_reference import NetworkInterfaceReference + from .network_profile import NetworkProfile + from .boot_diagnostics import BootDiagnostics + from .diagnostics_profile import DiagnosticsProfile + from .virtual_machine_extension_handler_instance_view import VirtualMachineExtensionHandlerInstanceView + from .virtual_machine_agent_instance_view import VirtualMachineAgentInstanceView + from .disk_instance_view import DiskInstanceView + from .boot_diagnostics_instance_view import BootDiagnosticsInstanceView + from .virtual_machine_identity import VirtualMachineIdentity + from .maintenance_redeploy_status import MaintenanceRedeployStatus + from .virtual_machine_instance_view import VirtualMachineInstanceView + from .virtual_machine import VirtualMachine + from .rolling_upgrade_policy import RollingUpgradePolicy + from .upgrade_policy import UpgradePolicy + from .image_os_disk import ImageOSDisk + from .image_data_disk import ImageDataDisk + from .image_storage_profile import ImageStorageProfile + from .image import Image + from .virtual_machine_scale_set_identity import VirtualMachineScaleSetIdentity + from .resource_sku_capacity import ResourceSkuCapacity + from .resource_sku_costs import ResourceSkuCosts + from .resource_sku_capabilities import ResourceSkuCapabilities + from .resource_sku_restrictions import ResourceSkuRestrictions + from .resource_sku import ResourceSku + from .virtual_machine_scale_set_os_profile import VirtualMachineScaleSetOSProfile + from .virtual_machine_scale_set_update_os_profile import VirtualMachineScaleSetUpdateOSProfile + from .virtual_machine_scale_set_managed_disk_parameters import VirtualMachineScaleSetManagedDiskParameters + from .virtual_machine_scale_set_os_disk import VirtualMachineScaleSetOSDisk + from .virtual_machine_scale_set_update_os_disk import VirtualMachineScaleSetUpdateOSDisk + from .virtual_machine_scale_set_data_disk import VirtualMachineScaleSetDataDisk + from .virtual_machine_scale_set_storage_profile import VirtualMachineScaleSetStorageProfile + from .virtual_machine_scale_set_update_storage_profile import VirtualMachineScaleSetUpdateStorageProfile + from .api_entity_reference import ApiEntityReference + from .virtual_machine_scale_set_public_ip_address_configuration_dns_settings import VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + from .virtual_machine_scale_set_public_ip_address_configuration import VirtualMachineScaleSetPublicIPAddressConfiguration + from .virtual_machine_scale_set_update_public_ip_address_configuration import VirtualMachineScaleSetUpdatePublicIPAddressConfiguration + from .virtual_machine_scale_set_ip_configuration import VirtualMachineScaleSetIPConfiguration + from .virtual_machine_scale_set_update_ip_configuration import VirtualMachineScaleSetUpdateIPConfiguration + from .virtual_machine_scale_set_network_configuration_dns_settings import VirtualMachineScaleSetNetworkConfigurationDnsSettings + from .virtual_machine_scale_set_network_configuration import VirtualMachineScaleSetNetworkConfiguration + from .virtual_machine_scale_set_update_network_configuration import VirtualMachineScaleSetUpdateNetworkConfiguration + from .virtual_machine_scale_set_network_profile import VirtualMachineScaleSetNetworkProfile + from .virtual_machine_scale_set_update_network_profile import VirtualMachineScaleSetUpdateNetworkProfile + from .virtual_machine_scale_set_extension import VirtualMachineScaleSetExtension + from .virtual_machine_scale_set_extension_profile import VirtualMachineScaleSetExtensionProfile + from .virtual_machine_scale_set_vm_profile import VirtualMachineScaleSetVMProfile + from .virtual_machine_scale_set_update_vm_profile import VirtualMachineScaleSetUpdateVMProfile + from .virtual_machine_scale_set import VirtualMachineScaleSet + from .virtual_machine_scale_set_update import VirtualMachineScaleSetUpdate + from .virtual_machine_scale_set_vm_instance_ids import VirtualMachineScaleSetVMInstanceIDs + from .virtual_machine_scale_set_vm_instance_required_ids import VirtualMachineScaleSetVMInstanceRequiredIDs + from .virtual_machine_status_code_count import VirtualMachineStatusCodeCount + from .virtual_machine_scale_set_instance_view_statuses_summary import VirtualMachineScaleSetInstanceViewStatusesSummary + from .virtual_machine_scale_set_vm_extensions_summary import VirtualMachineScaleSetVMExtensionsSummary + from .virtual_machine_scale_set_instance_view import VirtualMachineScaleSetInstanceView + from .virtual_machine_scale_set_sku_capacity import VirtualMachineScaleSetSkuCapacity + from .virtual_machine_scale_set_sku import VirtualMachineScaleSetSku + from .virtual_machine_scale_set_vm import VirtualMachineScaleSetVM + from .virtual_machine_health_status import VirtualMachineHealthStatus + from .virtual_machine_scale_set_vm_instance_view import VirtualMachineScaleSetVMInstanceView + from .rolling_upgrade_running_status import RollingUpgradeRunningStatus + from .rolling_upgrade_progress_info import RollingUpgradeProgressInfo + from .api_error_base import ApiErrorBase + from .inner_error import InnerError + from .api_error import ApiError + from .rolling_upgrade_status_info import RollingUpgradeStatusInfo + from .compute_long_running_operation_properties import ComputeLongRunningOperationProperties + from .resource import Resource + from .update_resource import UpdateResource + from .sub_resource_read_only import SubResourceReadOnly + from .operation_status_response import OperationStatusResponse + from .disk_sku import DiskSku + from .resource_update import ResourceUpdate + from .image_disk_reference import ImageDiskReference + from .creation_data import CreationData + from .source_vault import SourceVault + from .key_vault_and_secret_reference import KeyVaultAndSecretReference + from .key_vault_and_key_reference import KeyVaultAndKeyReference + from .encryption_settings import EncryptionSettings + from .disk import Disk + from .disk_update import DiskUpdate + from .grant_access_data import GrantAccessData + from .access_uri import AccessUri + from .snapshot import Snapshot + from .snapshot_update import SnapshotUpdate + from .run_command_input_parameter import RunCommandInputParameter + from .run_command_input import RunCommandInput + from .run_command_parameter_definition import RunCommandParameterDefinition + from .run_command_document_base import RunCommandDocumentBase + from .run_command_document import RunCommandDocument + from .run_command_result import RunCommandResult from .availability_set_paged import AvailabilitySetPaged from .virtual_machine_size_paged import VirtualMachineSizePaged from .usage_paged import UsagePaged diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/access_uri.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/access_uri.py index 09f8982bc3a7..9ee6b01de1e1 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/access_uri.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/access_uri.py @@ -30,6 +30,6 @@ class AccessUri(Model): 'access_sas': {'key': 'properties.output.accessSAS', 'type': 'str'}, } - def __init__(self): - super(AccessUri, self).__init__() + def __init__(self, **kwargs): + super(AccessUri, self).__init__(**kwargs) self.access_sas = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/access_uri_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/access_uri_py3.py new file mode 100644 index 000000000000..bb9e56aa4221 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/access_uri_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class AccessUri(Model): + """A disk access SAS uri. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar access_sas: A SAS uri for accessing a disk. + :vartype access_sas: str + """ + + _validation = { + 'access_sas': {'readonly': True}, + } + + _attribute_map = { + 'access_sas': {'key': 'properties.output.accessSAS', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AccessUri, self).__init__(**kwargs) + self.access_sas = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/additional_unattend_content.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/additional_unattend_content.py index 315b6b3e6065..2b3534860c21 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/additional_unattend_content.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/additional_unattend_content.py @@ -44,9 +44,9 @@ class AdditionalUnattendContent(Model): 'content': {'key': 'content', 'type': 'str'}, } - def __init__(self, pass_name=None, component_name=None, setting_name=None, content=None): - super(AdditionalUnattendContent, self).__init__() - self.pass_name = pass_name - self.component_name = component_name - self.setting_name = setting_name - self.content = content + def __init__(self, **kwargs): + super(AdditionalUnattendContent, self).__init__(**kwargs) + self.pass_name = kwargs.get('pass_name', None) + self.component_name = kwargs.get('component_name', None) + self.setting_name = kwargs.get('setting_name', None) + self.content = kwargs.get('content', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/additional_unattend_content_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/additional_unattend_content_py3.py new file mode 100644 index 000000000000..535b90b099a8 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/additional_unattend_content_py3.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class AdditionalUnattendContent(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. + + :param pass_name: The pass name. Currently, the only allowable value is + OobeSystem. Possible values include: 'OobeSystem' + :type pass_name: str or ~azure.mgmt.compute.v2017_03_30.models.PassNames + :param component_name: The component name. Currently, the only allowable + value is Microsoft-Windows-Shell-Setup. Possible values include: + 'Microsoft-Windows-Shell-Setup' + :type component_name: str or + ~azure.mgmt.compute.v2017_03_30.models.ComponentNames + :param setting_name: Specifies the name of the setting to which the + content applies. Possible values are: FirstLogonCommands and AutoLogon. + Possible values include: 'AutoLogon', 'FirstLogonCommands' + :type setting_name: str or + ~azure.mgmt.compute.v2017_03_30.models.SettingNames + :param 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. + :type content: str + """ + + _attribute_map = { + 'pass_name': {'key': 'passName', 'type': 'PassNames'}, + 'component_name': {'key': 'componentName', 'type': 'ComponentNames'}, + 'setting_name': {'key': 'settingName', 'type': 'SettingNames'}, + 'content': {'key': 'content', 'type': 'str'}, + } + + def __init__(self, *, pass_name=None, component_name=None, setting_name=None, content: str=None, **kwargs) -> None: + super(AdditionalUnattendContent, self).__init__(**kwargs) + self.pass_name = pass_name + self.component_name = component_name + self.setting_name = setting_name + self.content = content diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_entity_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_entity_reference.py index 27696aacc3dc..d1bf572e916d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_entity_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_entity_reference.py @@ -24,6 +24,6 @@ class ApiEntityReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(ApiEntityReference, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(ApiEntityReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_entity_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_entity_reference_py3.py new file mode 100644 index 000000000000..da3e07082381 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_entity_reference_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApiEntityReference(Model): + """The API entity reference. + + :param id: The ARM resource id in the form of + /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(ApiEntityReference, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_error.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_error.py index bde43bd842fc..c20d52eb593f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_error.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_error.py @@ -35,10 +35,10 @@ class ApiError(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, details=None, innererror=None, code=None, target=None, message=None): - super(ApiError, self).__init__() - self.details = details - self.innererror = innererror - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ApiError, self).__init__(**kwargs) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_error_base.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_error_base.py index 2fb33a0ff411..655c08638905 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_error_base.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_error_base.py @@ -29,8 +29,8 @@ class ApiErrorBase(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, target=None, message=None): - super(ApiErrorBase, self).__init__() - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ApiErrorBase, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_error_base_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_error_base_py3.py new file mode 100644 index 000000000000..5ba95aa0283e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_error_base_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ApiErrorBase(Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ApiErrorBase, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_error_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_error_py3.py new file mode 100644 index 000000000000..22fb43607568 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/api_error_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApiError(Model): + """Api error. + + :param details: The Api error details + :type details: list[~azure.mgmt.compute.v2017_03_30.models.ApiErrorBase] + :param innererror: The Api inner error + :type innererror: ~azure.mgmt.compute.v2017_03_30.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, details=None, innererror=None, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ApiError, self).__init__(**kwargs) + self.details = details + self.innererror = innererror + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/availability_set.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/availability_set.py index e0b783ab4446..ccb42b1f6601 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/availability_set.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/availability_set.py @@ -28,13 +28,15 @@ class AvailabilitySet(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -74,10 +76,10 @@ class AvailabilitySet(Resource): 'sku': {'key': 'sku', 'type': 'Sku'}, } - def __init__(self, location, tags=None, platform_update_domain_count=None, platform_fault_domain_count=None, virtual_machines=None, sku=None): - super(AvailabilitySet, self).__init__(location=location, tags=tags) - self.platform_update_domain_count = platform_update_domain_count - self.platform_fault_domain_count = platform_fault_domain_count - self.virtual_machines = virtual_machines + def __init__(self, **kwargs): + super(AvailabilitySet, self).__init__(**kwargs) + self.platform_update_domain_count = kwargs.get('platform_update_domain_count', None) + self.platform_fault_domain_count = kwargs.get('platform_fault_domain_count', None) + self.virtual_machines = kwargs.get('virtual_machines', None) self.statuses = None - self.sku = sku + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/availability_set_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/availability_set_py3.py new file mode 100644 index 000000000000..a096e28adcdc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/availability_set_py3.py @@ -0,0 +1,85 @@ +# 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 .resource import Resource + + +class AvailabilitySet(Resource): + """Specifies information about the availability set that the virtual machine + should be assigned to. Virtual machines specified in the same availability + set are allocated to different nodes to maximize availability. For more + information about availability sets, see [Manage the availability of + virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param platform_update_domain_count: Update Domain count. + :type platform_update_domain_count: int + :param platform_fault_domain_count: Fault Domain count. + :type platform_fault_domain_count: int + :param virtual_machines: A list of references to all virtual machines in + the availability set. + :type virtual_machines: + list[~azure.mgmt.compute.v2017_03_30.models.SubResource] + :ivar statuses: The resource status information. + :vartype statuses: + list[~azure.mgmt.compute.v2017_03_30.models.InstanceViewStatus] + :param sku: Sku of the availability set + :type sku: ~azure.mgmt.compute.v2017_03_30.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'statuses': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'platform_update_domain_count': {'key': 'properties.platformUpdateDomainCount', 'type': 'int'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResource]'}, + 'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, location: str, tags=None, platform_update_domain_count: int=None, platform_fault_domain_count: int=None, virtual_machines=None, sku=None, **kwargs) -> None: + super(AvailabilitySet, self).__init__(location=location, tags=tags, **kwargs) + self.platform_update_domain_count = platform_update_domain_count + self.platform_fault_domain_count = platform_fault_domain_count + self.virtual_machines = virtual_machines + self.statuses = None + self.sku = sku diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/boot_diagnostics.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/boot_diagnostics.py index c94d188e3fba..ca3dbdd4f23c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/boot_diagnostics.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/boot_diagnostics.py @@ -32,7 +32,7 @@ class BootDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, enabled=None, storage_uri=None): - super(BootDiagnostics, self).__init__() - self.enabled = enabled - self.storage_uri = storage_uri + def __init__(self, **kwargs): + super(BootDiagnostics, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.storage_uri = kwargs.get('storage_uri', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/boot_diagnostics_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/boot_diagnostics_instance_view.py index 4ec7b385558d..6fe1f84a3910 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/boot_diagnostics_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/boot_diagnostics_instance_view.py @@ -26,7 +26,7 @@ class BootDiagnosticsInstanceView(Model): 'serial_console_log_blob_uri': {'key': 'serialConsoleLogBlobUri', 'type': 'str'}, } - def __init__(self, console_screenshot_blob_uri=None, serial_console_log_blob_uri=None): - super(BootDiagnosticsInstanceView, self).__init__() - self.console_screenshot_blob_uri = console_screenshot_blob_uri - self.serial_console_log_blob_uri = serial_console_log_blob_uri + def __init__(self, **kwargs): + super(BootDiagnosticsInstanceView, self).__init__(**kwargs) + self.console_screenshot_blob_uri = kwargs.get('console_screenshot_blob_uri', None) + self.serial_console_log_blob_uri = kwargs.get('serial_console_log_blob_uri', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/boot_diagnostics_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/boot_diagnostics_instance_view_py3.py new file mode 100644 index 000000000000..d85b51981ab9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/boot_diagnostics_instance_view_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class BootDiagnosticsInstanceView(Model): + """The instance view of a virtual machine boot diagnostics. + + :param console_screenshot_blob_uri: The console screenshot blob URI. + :type console_screenshot_blob_uri: str + :param serial_console_log_blob_uri: The Linux serial console log blob Uri. + :type serial_console_log_blob_uri: str + """ + + _attribute_map = { + 'console_screenshot_blob_uri': {'key': 'consoleScreenshotBlobUri', 'type': 'str'}, + 'serial_console_log_blob_uri': {'key': 'serialConsoleLogBlobUri', 'type': 'str'}, + } + + def __init__(self, *, console_screenshot_blob_uri: str=None, serial_console_log_blob_uri: str=None, **kwargs) -> None: + super(BootDiagnosticsInstanceView, self).__init__(**kwargs) + self.console_screenshot_blob_uri = console_screenshot_blob_uri + self.serial_console_log_blob_uri = serial_console_log_blob_uri diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/boot_diagnostics_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/boot_diagnostics_py3.py new file mode 100644 index 000000000000..b0a756ea4fa0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/boot_diagnostics_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class BootDiagnostics(Model): + """Boot Diagnostics is a debugging feature which allows you to view Console + Output and Screenshot to diagnose VM status.

    For Linux Virtual + Machines, you can easily view the output of your console log.

    For + both Windows and Linux virtual machines, Azure also enables you to see a + screenshot of the VM from the hypervisor. + + :param enabled: Whether boot diagnostics should be enabled on the Virtual + Machine. + :type enabled: bool + :param storage_uri: Uri of the storage account to use for placing the + console output and screenshot. + :type storage_uri: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, storage_uri: str=None, **kwargs) -> None: + super(BootDiagnostics, self).__init__(**kwargs) + self.enabled = enabled + self.storage_uri = storage_uri diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/compute_long_running_operation_properties.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/compute_long_running_operation_properties.py index f8ca23e0ccdf..66ff353eb206 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/compute_long_running_operation_properties.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/compute_long_running_operation_properties.py @@ -23,6 +23,6 @@ class ComputeLongRunningOperationProperties(Model): 'output': {'key': 'output', 'type': 'object'}, } - def __init__(self, output=None): - super(ComputeLongRunningOperationProperties, self).__init__() - self.output = output + def __init__(self, **kwargs): + super(ComputeLongRunningOperationProperties, self).__init__(**kwargs) + self.output = kwargs.get('output', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/compute_long_running_operation_properties_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/compute_long_running_operation_properties_py3.py new file mode 100644 index 000000000000..a4ffd6c8c32f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/compute_long_running_operation_properties_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class ComputeLongRunningOperationProperties(Model): + """Compute-specific operation properties, including output. + + :param output: Operation output data (raw JSON) + :type output: object + """ + + _attribute_map = { + 'output': {'key': 'output', 'type': 'object'}, + } + + def __init__(self, *, output=None, **kwargs) -> None: + super(ComputeLongRunningOperationProperties, self).__init__(**kwargs) + self.output = output diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/compute_management_client_enums.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/compute_management_client_enums.py index 9cc93642bb85..4e6dbe530093 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/compute_management_client_enums.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/compute_management_client_enums.py @@ -12,20 +12,20 @@ from enum import Enum -class StatusLevelTypes(Enum): +class StatusLevelTypes(str, Enum): info = "Info" warning = "Warning" error = "Error" -class OperatingSystemTypes(Enum): +class OperatingSystemTypes(str, Enum): windows = "Windows" linux = "Linux" -class VirtualMachineSizeTypes(Enum): +class VirtualMachineSizeTypes(str, Enum): basic_a0 = "Basic_A0" basic_a1 = "Basic_A1" @@ -126,54 +126,54 @@ class VirtualMachineSizeTypes(Enum): standard_nv24 = "Standard_NV24" -class CachingTypes(Enum): +class CachingTypes(str, Enum): none = "None" read_only = "ReadOnly" read_write = "ReadWrite" -class DiskCreateOptionTypes(Enum): +class DiskCreateOptionTypes(str, Enum): from_image = "FromImage" empty = "Empty" attach = "Attach" -class StorageAccountTypes(Enum): +class StorageAccountTypes(str, Enum): standard_lrs = "Standard_LRS" premium_lrs = "Premium_LRS" -class PassNames(Enum): +class PassNames(str, Enum): oobe_system = "OobeSystem" -class ComponentNames(Enum): +class ComponentNames(str, Enum): microsoft_windows_shell_setup = "Microsoft-Windows-Shell-Setup" -class SettingNames(Enum): +class SettingNames(str, Enum): auto_logon = "AutoLogon" first_logon_commands = "FirstLogonCommands" -class ProtocolTypes(Enum): +class ProtocolTypes(str, Enum): http = "Http" https = "Https" -class ResourceIdentityType(Enum): +class ResourceIdentityType(str, Enum): system_assigned = "SystemAssigned" -class MaintenanceOperationResultCodeTypes(Enum): +class MaintenanceOperationResultCodeTypes(str, Enum): none = "None" retry_later = "RetryLater" @@ -181,50 +181,50 @@ class MaintenanceOperationResultCodeTypes(Enum): maintenance_completed = "MaintenanceCompleted" -class UpgradeMode(Enum): +class UpgradeMode(str, Enum): automatic = "Automatic" manual = "Manual" rolling = "Rolling" -class OperatingSystemStateTypes(Enum): +class OperatingSystemStateTypes(str, Enum): generalized = "Generalized" specialized = "Specialized" -class ResourceSkuCapacityScaleType(Enum): +class ResourceSkuCapacityScaleType(str, Enum): automatic = "Automatic" manual = "Manual" none = "None" -class ResourceSkuRestrictionsType(Enum): +class ResourceSkuRestrictionsType(str, Enum): location = "Location" -class ResourceSkuRestrictionsReasonCode(Enum): +class ResourceSkuRestrictionsReasonCode(str, Enum): quota_id = "QuotaId" not_available_for_subscription = "NotAvailableForSubscription" -class IPVersion(Enum): +class IPVersion(str, Enum): ipv4 = "IPv4" ipv6 = "IPv6" -class VirtualMachineScaleSetSkuScaleType(Enum): +class VirtualMachineScaleSetSkuScaleType(str, Enum): automatic = "Automatic" none = "None" -class RollingUpgradeStatusCode(Enum): +class RollingUpgradeStatusCode(str, Enum): rolling_forward = "RollingForward" cancelled = "Cancelled" @@ -232,13 +232,13 @@ class RollingUpgradeStatusCode(Enum): faulted = "Faulted" -class RollingUpgradeActionType(Enum): +class RollingUpgradeActionType(str, Enum): start = "Start" cancel = "Cancel" -class DiskCreateOption(Enum): +class DiskCreateOption(str, Enum): empty = "Empty" attach = "Attach" @@ -247,12 +247,12 @@ class DiskCreateOption(Enum): copy = "Copy" -class AccessLevel(Enum): +class AccessLevel(str, Enum): none = "None" read = "Read" -class InstanceViewTypes(Enum): +class InstanceViewTypes(str, Enum): instance_view = "instanceView" diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/creation_data.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/creation_data.py index 0892d7c17fdd..6a9ecbbaa1fe 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/creation_data.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/creation_data.py @@ -15,8 +15,10 @@ class CreationData(Model): """Data used when creating a disk. - :param create_option: This enumerates the possible sources of a disk's - creation. Possible values include: 'Empty', 'Attach', 'FromImage', + All required parameters must be populated in order to send to Azure. + + :param create_option: Required. This enumerates the possible sources of a + disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy' :type create_option: str or ~azure.mgmt.compute.v2017_03_30.models.DiskCreateOption @@ -47,10 +49,10 @@ class CreationData(Model): 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, } - def __init__(self, create_option, storage_account_id=None, image_reference=None, source_uri=None, source_resource_id=None): - super(CreationData, self).__init__() - self.create_option = create_option - self.storage_account_id = storage_account_id - self.image_reference = image_reference - self.source_uri = source_uri - self.source_resource_id = source_resource_id + def __init__(self, **kwargs): + super(CreationData, self).__init__(**kwargs) + self.create_option = kwargs.get('create_option', None) + self.storage_account_id = kwargs.get('storage_account_id', None) + self.image_reference = kwargs.get('image_reference', None) + self.source_uri = kwargs.get('source_uri', None) + self.source_resource_id = kwargs.get('source_resource_id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/creation_data_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/creation_data_py3.py new file mode 100644 index 000000000000..f548e7d19e89 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/creation_data_py3.py @@ -0,0 +1,58 @@ +# 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 msrest.serialization import Model + + +class CreationData(Model): + """Data used when creating a disk. + + All required parameters must be populated in order to send to Azure. + + :param create_option: Required. This enumerates the possible sources of a + disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', + 'Import', 'Copy' + :type create_option: str or + ~azure.mgmt.compute.v2017_03_30.models.DiskCreateOption + :param storage_account_id: If createOption is Import, the Azure Resource + Manager identifier of the storage account containing the blob to import as + a disk. Required only if the blob is in a different subscription + :type storage_account_id: str + :param image_reference: Disk source information. + :type image_reference: + ~azure.mgmt.compute.v2017_03_30.models.ImageDiskReference + :param source_uri: If createOption is Import, this is the URI of a blob to + be imported into a managed disk. + :type source_uri: str + :param source_resource_id: If createOption is Copy, this is the ARM id of + the source snapshot or disk. + :type source_resource_id: str + """ + + _validation = { + 'create_option': {'required': True}, + } + + _attribute_map = { + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOption'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'image_reference': {'key': 'imageReference', 'type': 'ImageDiskReference'}, + 'source_uri': {'key': 'sourceUri', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + } + + def __init__(self, *, create_option, storage_account_id: str=None, image_reference=None, source_uri: str=None, source_resource_id: str=None, **kwargs) -> None: + super(CreationData, self).__init__(**kwargs) + self.create_option = create_option + self.storage_account_id = storage_account_id + self.image_reference = image_reference + self.source_uri = source_uri + self.source_resource_id = source_resource_id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/data_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/data_disk.py index 832a9a20bcc4..5a0bf58d6c10 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/data_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/data_disk.py @@ -15,9 +15,11 @@ class DataDisk(Model): """Describes a data disk. - :param 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. + All required parameters must be populated in order to send to Azure. + + :param lun: Required. 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. :type lun: int :param name: The disk name. :type name: str @@ -33,8 +35,8 @@ class DataDisk(Model):

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2017_03_30.models.CachingTypes - :param create_option: Specifies how the virtual machine should be - created.

    Possible values are:

    **Attach** \\u2013 This + :param create_option: Required. Specifies how the virtual machine should + be created.

    Possible values are:

    **Attach** \\u2013 This value is used when you are using a specialized disk to create the virtual machine.

    **FromImage** \\u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform @@ -68,13 +70,13 @@ class DataDisk(Model): 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, } - def __init__(self, lun, create_option, name=None, vhd=None, image=None, caching=None, disk_size_gb=None, managed_disk=None): - super(DataDisk, self).__init__() - self.lun = lun - self.name = name - self.vhd = vhd - self.image = image - self.caching = caching - self.create_option = create_option - self.disk_size_gb = disk_size_gb - self.managed_disk = managed_disk + def __init__(self, **kwargs): + super(DataDisk, self).__init__(**kwargs) + self.lun = kwargs.get('lun', None) + self.name = kwargs.get('name', None) + self.vhd = kwargs.get('vhd', None) + self.image = kwargs.get('image', None) + self.caching = kwargs.get('caching', None) + self.create_option = kwargs.get('create_option', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.managed_disk = kwargs.get('managed_disk', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/data_disk_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/data_disk_image.py index 60a4befc525f..b5dbfcefb472 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/data_disk_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/data_disk_image.py @@ -32,6 +32,6 @@ class DataDiskImage(Model): 'lun': {'key': 'lun', 'type': 'int'}, } - def __init__(self): - super(DataDiskImage, self).__init__() + def __init__(self, **kwargs): + super(DataDiskImage, self).__init__(**kwargs) self.lun = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/data_disk_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/data_disk_image_py3.py new file mode 100644 index 000000000000..8431a3988502 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/data_disk_image_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class DataDiskImage(Model): + """Contains the data disk images information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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. + :vartype lun: int + """ + + _validation = { + 'lun': {'readonly': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(DataDiskImage, self).__init__(**kwargs) + self.lun = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/data_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/data_disk_py3.py new file mode 100644 index 000000000000..ce4a52a28af6 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/data_disk_py3.py @@ -0,0 +1,82 @@ +# 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 msrest.serialization import Model + + +class DataDisk(Model): + """Describes a data disk. + + All required parameters must be populated in order to send to Azure. + + :param lun: Required. 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. + :type lun: int + :param name: The disk name. + :type name: str + :param vhd: The virtual hard disk. + :type vhd: ~azure.mgmt.compute.v2017_03_30.models.VirtualHardDisk + :param image: The source user image virtual hard disk. The virtual hard + disk will be copied before being attached to the virtual machine. If + SourceImage is provided, the destination virtual hard drive must not + exist. + :type image: ~azure.mgmt.compute.v2017_03_30.models.VirtualHardDisk + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2017_03_30.models.CachingTypes + :param create_option: Required. Specifies how the virtual machine should + be created.

    Possible values are:

    **Attach** \\u2013 This + value is used when you are using a specialized disk to create the virtual + machine.

    **FromImage** \\u2013 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. Possible values include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2017_03_30.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in + gigabytes. This element can be used to overwrite the name of the disk in a + virtual machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2017_03_30.models.ManagedDiskParameters + """ + + _validation = { + 'lun': {'required': True}, + 'create_option': {'required': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'vhd': {'key': 'vhd', 'type': 'VirtualHardDisk'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, + } + + def __init__(self, *, lun: int, create_option, name: str=None, vhd=None, image=None, caching=None, disk_size_gb: int=None, managed_disk=None, **kwargs) -> None: + super(DataDisk, self).__init__(**kwargs) + self.lun = lun + self.name = name + self.vhd = vhd + self.image = image + self.caching = caching + self.create_option = create_option + self.disk_size_gb = disk_size_gb + self.managed_disk = managed_disk diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/diagnostics_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/diagnostics_profile.py index 0687c9f83aa8..36c128097209 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/diagnostics_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/diagnostics_profile.py @@ -29,6 +29,6 @@ class DiagnosticsProfile(Model): 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnostics'}, } - def __init__(self, boot_diagnostics=None): - super(DiagnosticsProfile, self).__init__() - self.boot_diagnostics = boot_diagnostics + def __init__(self, **kwargs): + super(DiagnosticsProfile, self).__init__(**kwargs) + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/diagnostics_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/diagnostics_profile_py3.py new file mode 100644 index 000000000000..30ba1b1a6c70 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/diagnostics_profile_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class DiagnosticsProfile(Model): + """Specifies the boot diagnostic settings state.

    Minimum api-version: + 2015-06-15. + + :param boot_diagnostics: Boot Diagnostics is a debugging feature which + allows you to view Console Output and Screenshot to diagnose VM status. +

    For Linux Virtual Machines, you can easily view the output of + your console log.

    For both Windows and Linux virtual machines, + Azure also enables you to see a screenshot of the VM from the hypervisor. + :type boot_diagnostics: + ~azure.mgmt.compute.v2017_03_30.models.BootDiagnostics + """ + + _attribute_map = { + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnostics'}, + } + + def __init__(self, *, boot_diagnostics=None, **kwargs) -> None: + super(DiagnosticsProfile, self).__init__(**kwargs) + self.boot_diagnostics = boot_diagnostics diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk.py index 7e5d3529f5f5..555d543482ea 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk.py @@ -18,13 +18,15 @@ class Disk(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -41,8 +43,8 @@ class Disk(Resource): 'Windows', 'Linux' :type os_type: str or ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemTypes - :param creation_data: Disk source information. CreationData information - cannot be changed after the disk has been created. + :param creation_data: Required. Disk source information. CreationData + information cannot be changed after the disk has been created. :type creation_data: ~azure.mgmt.compute.v2017_03_30.models.CreationData :param disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is @@ -85,14 +87,14 @@ class Disk(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, location, creation_data, tags=None, sku=None, zones=None, os_type=None, disk_size_gb=None, encryption_settings=None): - super(Disk, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(Disk, self).__init__(**kwargs) self.managed_by = None - self.sku = sku - self.zones = zones + self.sku = kwargs.get('sku', None) + self.zones = kwargs.get('zones', None) self.time_created = None - self.os_type = os_type - self.creation_data = creation_data - self.disk_size_gb = disk_size_gb - self.encryption_settings = encryption_settings + self.os_type = kwargs.get('os_type', None) + self.creation_data = kwargs.get('creation_data', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings = kwargs.get('encryption_settings', None) self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_encryption_settings.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_encryption_settings.py index 7c5e1b8a467c..7f98ef395200 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_encryption_settings.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_encryption_settings.py @@ -34,8 +34,8 @@ class DiskEncryptionSettings(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, disk_encryption_key=None, key_encryption_key=None, enabled=None): - super(DiskEncryptionSettings, self).__init__() - self.disk_encryption_key = disk_encryption_key - self.key_encryption_key = key_encryption_key - self.enabled = enabled + def __init__(self, **kwargs): + super(DiskEncryptionSettings, self).__init__(**kwargs) + self.disk_encryption_key = kwargs.get('disk_encryption_key', None) + self.key_encryption_key = kwargs.get('key_encryption_key', None) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_encryption_settings_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_encryption_settings_py3.py new file mode 100644 index 000000000000..8108da077a2a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_encryption_settings_py3.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 msrest.serialization import Model + + +class DiskEncryptionSettings(Model): + """Describes a Encryption Settings for a Disk. + + :param disk_encryption_key: Specifies the location of the disk encryption + key, which is a Key Vault Secret. + :type disk_encryption_key: + ~azure.mgmt.compute.v2017_03_30.models.KeyVaultSecretReference + :param key_encryption_key: Specifies the location of the key encryption + key in Key Vault. + :type key_encryption_key: + ~azure.mgmt.compute.v2017_03_30.models.KeyVaultKeyReference + :param enabled: Specifies whether disk encryption should be enabled on the + virtual machine. + :type enabled: bool + """ + + _attribute_map = { + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultKeyReference'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, disk_encryption_key=None, key_encryption_key=None, enabled: bool=None, **kwargs) -> None: + super(DiskEncryptionSettings, self).__init__(**kwargs) + self.disk_encryption_key = disk_encryption_key + self.key_encryption_key = key_encryption_key + self.enabled = enabled diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_instance_view.py index 81f3506d1efb..e250408baa20 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_instance_view.py @@ -32,8 +32,8 @@ class DiskInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, name=None, encryption_settings=None, statuses=None): - super(DiskInstanceView, self).__init__() - self.name = name - self.encryption_settings = encryption_settings - self.statuses = statuses + def __init__(self, **kwargs): + super(DiskInstanceView, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.encryption_settings = kwargs.get('encryption_settings', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_instance_view_py3.py new file mode 100644 index 000000000000..f8d374a055f3 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_instance_view_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class DiskInstanceView(Model): + """The instance view of the disk. + + :param name: The disk name. + :type name: str + :param encryption_settings: Specifies the encryption settings for the OS + Disk.

    Minimum api-version: 2015-06-15 + :type encryption_settings: + list[~azure.mgmt.compute.v2017_03_30.models.DiskEncryptionSettings] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2017_03_30.models.InstanceViewStatus] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': '[DiskEncryptionSettings]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, name: str=None, encryption_settings=None, statuses=None, **kwargs) -> None: + super(DiskInstanceView, self).__init__(**kwargs) + self.name = name + self.encryption_settings = encryption_settings + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_py3.py new file mode 100644 index 000000000000..979613707c9f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_py3.py @@ -0,0 +1,100 @@ +# 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 .resource import Resource + + +class Disk(Resource): + """Disk 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 Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar managed_by: A relative URI containing the ID of the VM that has the + disk attached. + :vartype managed_by: str + :param sku: + :type sku: ~azure.mgmt.compute.v2017_03_30.models.DiskSku + :param zones: The Logical zone list for Disk. + :type zones: list[str] + :ivar time_created: The time when the disk was created. + :vartype time_created: datetime + :param os_type: The Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemTypes + :param creation_data: Required. Disk source information. CreationData + information cannot be changed after the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2017_03_30.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2017_03_30.models.EncryptionSettings + :ivar provisioning_state: The disk provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'managed_by': {'readonly': True}, + 'time_created': {'readonly': True}, + 'creation_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, creation_data, tags=None, sku=None, zones=None, os_type=None, disk_size_gb: int=None, encryption_settings=None, **kwargs) -> None: + super(Disk, self).__init__(location=location, tags=tags, **kwargs) + self.managed_by = None + self.sku = sku + self.zones = zones + self.time_created = None + self.os_type = os_type + self.creation_data = creation_data + self.disk_size_gb = disk_size_gb + self.encryption_settings = encryption_settings + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_sku.py index 2abf11d8c488..64f47a7b75e3 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_sku.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_sku.py @@ -35,7 +35,7 @@ class DiskSku(Model): 'tier': {'key': 'tier', 'type': 'str'}, } - def __init__(self, name=None): - super(DiskSku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(DiskSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) self.tier = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_sku_py3.py new file mode 100644 index 000000000000..dae5211ac38c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_sku_py3.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 msrest.serialization import Model + + +class DiskSku(Model): + """The disks and snapshots sku name. Can be Standard_LRS or Premium_LRS. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The sku name. Possible values include: 'Standard_LRS', + 'Premium_LRS' + :type name: str or + ~azure.mgmt.compute.v2017_03_30.models.StorageAccountTypes + :ivar tier: The sku tier. Default value: "Standard" . + :vartype tier: str + """ + + _validation = { + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'StorageAccountTypes'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(DiskSku, self).__init__(**kwargs) + self.name = name + self.tier = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_update.py index 16c96d399464..1c62861a71cf 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_update.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_update.py @@ -42,8 +42,8 @@ class DiskUpdate(ResourceUpdate): 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, } - def __init__(self, tags=None, sku=None, os_type=None, disk_size_gb=None, encryption_settings=None): - super(DiskUpdate, self).__init__(tags=tags, sku=sku) - self.os_type = os_type - self.disk_size_gb = disk_size_gb - self.encryption_settings = encryption_settings + def __init__(self, **kwargs): + super(DiskUpdate, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings = kwargs.get('encryption_settings', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_update_py3.py new file mode 100644 index 000000000000..ce585313920e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/disk_update_py3.py @@ -0,0 +1,49 @@ +# 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 .resource_update import ResourceUpdate + + +class DiskUpdate(ResourceUpdate): + """Disk update resource. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: + :type sku: ~azure.mgmt.compute.v2017_03_30.models.DiskSku + :param os_type: the Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemTypes + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2017_03_30.models.EncryptionSettings + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + } + + def __init__(self, *, tags=None, sku=None, os_type=None, disk_size_gb: int=None, encryption_settings=None, **kwargs) -> None: + super(DiskUpdate, self).__init__(tags=tags, sku=sku, **kwargs) + self.os_type = os_type + self.disk_size_gb = disk_size_gb + self.encryption_settings = encryption_settings diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/encryption_settings.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/encryption_settings.py index 1d61393fc54d..a0ac101e9c77 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/encryption_settings.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/encryption_settings.py @@ -37,8 +37,8 @@ class EncryptionSettings(Model): 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultAndKeyReference'}, } - def __init__(self, enabled=None, disk_encryption_key=None, key_encryption_key=None): - super(EncryptionSettings, self).__init__() - self.enabled = enabled - self.disk_encryption_key = disk_encryption_key - self.key_encryption_key = key_encryption_key + def __init__(self, **kwargs): + super(EncryptionSettings, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.disk_encryption_key = kwargs.get('disk_encryption_key', None) + self.key_encryption_key = kwargs.get('key_encryption_key', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/encryption_settings_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/encryption_settings_py3.py new file mode 100644 index 000000000000..6e0af2329bb4 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/encryption_settings_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EncryptionSettings(Model): + """Encryption settings for disk or snapshot. + + :param enabled: Set this flag to true and provide DiskEncryptionKey and + optional KeyEncryptionKey to enable encryption. Set this flag to false and + remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If + EncryptionSettings is null in the request object, the existing settings + remain unchanged. + :type enabled: bool + :param disk_encryption_key: Key Vault Secret Url and vault id of the disk + encryption key + :type disk_encryption_key: + ~azure.mgmt.compute.v2017_03_30.models.KeyVaultAndSecretReference + :param key_encryption_key: Key Vault Key Url and vault id of the key + encryption key + :type key_encryption_key: + ~azure.mgmt.compute.v2017_03_30.models.KeyVaultAndKeyReference + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultAndSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultAndKeyReference'}, + } + + def __init__(self, *, enabled: bool=None, disk_encryption_key=None, key_encryption_key=None, **kwargs) -> None: + super(EncryptionSettings, self).__init__(**kwargs) + self.enabled = enabled + self.disk_encryption_key = disk_encryption_key + self.key_encryption_key = key_encryption_key diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/grant_access_data.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/grant_access_data.py index d79c66dd63b6..df3466f4f99d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/grant_access_data.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/grant_access_data.py @@ -15,10 +15,12 @@ class GrantAccessData(Model): """Data used for requesting a SAS. - :param access: Possible values include: 'None', 'Read' + All required parameters must be populated in order to send to Azure. + + :param access: Required. Possible values include: 'None', 'Read' :type access: str or ~azure.mgmt.compute.v2017_03_30.models.AccessLevel - :param duration_in_seconds: Time duration in seconds until the SAS access - expires. + :param duration_in_seconds: Required. Time duration in seconds until the + SAS access expires. :type duration_in_seconds: int """ @@ -32,7 +34,7 @@ class GrantAccessData(Model): 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'int'}, } - def __init__(self, access, duration_in_seconds): - super(GrantAccessData, self).__init__() - self.access = access - self.duration_in_seconds = duration_in_seconds + def __init__(self, **kwargs): + super(GrantAccessData, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.duration_in_seconds = kwargs.get('duration_in_seconds', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/grant_access_data_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/grant_access_data_py3.py new file mode 100644 index 000000000000..828e923ac006 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/grant_access_data_py3.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 msrest.serialization import Model + + +class GrantAccessData(Model): + """Data used for requesting a SAS. + + All required parameters must be populated in order to send to Azure. + + :param access: Required. Possible values include: 'None', 'Read' + :type access: str or ~azure.mgmt.compute.v2017_03_30.models.AccessLevel + :param duration_in_seconds: Required. Time duration in seconds until the + SAS access expires. + :type duration_in_seconds: int + """ + + _validation = { + 'access': {'required': True}, + 'duration_in_seconds': {'required': True}, + } + + _attribute_map = { + 'access': {'key': 'access', 'type': 'AccessLevel'}, + 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'int'}, + } + + def __init__(self, *, access, duration_in_seconds: int, **kwargs) -> None: + super(GrantAccessData, self).__init__(**kwargs) + self.access = access + self.duration_in_seconds = duration_in_seconds diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/hardware_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/hardware_profile.py index 4f225f6209c7..573e0f20f88c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/hardware_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/hardware_profile.py @@ -58,6 +58,6 @@ class HardwareProfile(Model): 'vm_size': {'key': 'vmSize', 'type': 'str'}, } - def __init__(self, vm_size=None): - super(HardwareProfile, self).__init__() - self.vm_size = vm_size + def __init__(self, **kwargs): + super(HardwareProfile, self).__init__(**kwargs) + self.vm_size = kwargs.get('vm_size', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/hardware_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/hardware_profile_py3.py new file mode 100644 index 000000000000..ee352a2a83ab --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/hardware_profile_py3.py @@ -0,0 +1,63 @@ +# 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 msrest.serialization import Model + + +class HardwareProfile(Model): + """Specifies the hardware settings for the virtual machine. + + :param vm_size: Specifies the size of the virtual machine. For more + information about virtual machine sizes, see [Sizes for virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    The available VM sizes depend on region and availability set. For + a list of available sizes use these APIs:

    [List all available + virtual machine sizes in an availability + set](virtualmachines-list-sizes-availability-set.md)

    [List all + available virtual machine sizes in a + region](virtualmachines-list-sizes-region.md)

    [List all available + virtual machine sizes for + resizing](virtualmachines-list-sizes-for-resizing.md). Possible values + include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', + 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', + 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', + 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', + 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', + 'Standard_A8m_v2', 'Standard_D1', 'Standard_D2', 'Standard_D3', + 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', + 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', + 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', + 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', + 'Standard_DS2', 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', + 'Standard_DS12', 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', + 'Standard_DS2_v2', 'Standard_DS3_v2', 'Standard_DS4_v2', + 'Standard_DS5_v2', 'Standard_DS11_v2', 'Standard_DS12_v2', + 'Standard_DS13_v2', 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_F1', + 'Standard_F2', 'Standard_F4', 'Standard_F8', 'Standard_F16', + 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', 'Standard_F8s', + 'Standard_F16s', 'Standard_G1', 'Standard_G2', 'Standard_G3', + 'Standard_G4', 'Standard_G5', 'Standard_GS1', 'Standard_GS2', + 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_H8', + 'Standard_H16', 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', + 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', + 'Standard_L32s', 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', + 'Standard_NC24r', 'Standard_NV6', 'Standard_NV12', 'Standard_NV24' + :type vm_size: str or + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineSizeTypes + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + } + + def __init__(self, *, vm_size=None, **kwargs) -> None: + super(HardwareProfile, self).__init__(**kwargs) + self.vm_size = vm_size diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image.py index 442e6056b6e8..e045bc3eaade 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image.py @@ -20,13 +20,15 @@ class Image(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -61,8 +63,8 @@ class Image(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, location, tags=None, source_virtual_machine=None, storage_profile=None): - super(Image, self).__init__(location=location, tags=tags) - self.source_virtual_machine = source_virtual_machine - self.storage_profile = storage_profile + def __init__(self, **kwargs): + super(Image, self).__init__(**kwargs) + self.source_virtual_machine = kwargs.get('source_virtual_machine', None) + self.storage_profile = kwargs.get('storage_profile', None) self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_data_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_data_disk.py index 124157a65cfd..c30b35473476 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_data_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_data_disk.py @@ -15,9 +15,11 @@ class ImageDataDisk(Model): """Describes a data disk. - :param 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. + All required parameters must be populated in order to send to Azure. + + :param lun: Required. 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. :type lun: int :param snapshot: The snapshot. :type snapshot: ~azure.mgmt.compute.v2017_03_30.models.SubResource @@ -55,12 +57,12 @@ class ImageDataDisk(Model): 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, } - def __init__(self, lun, snapshot=None, managed_disk=None, blob_uri=None, caching=None, disk_size_gb=None, storage_account_type=None): - super(ImageDataDisk, self).__init__() - self.lun = lun - self.snapshot = snapshot - self.managed_disk = managed_disk - self.blob_uri = blob_uri - self.caching = caching - self.disk_size_gb = disk_size_gb - self.storage_account_type = storage_account_type + def __init__(self, **kwargs): + super(ImageDataDisk, self).__init__(**kwargs) + self.lun = kwargs.get('lun', None) + self.snapshot = kwargs.get('snapshot', None) + self.managed_disk = kwargs.get('managed_disk', None) + self.blob_uri = kwargs.get('blob_uri', None) + self.caching = kwargs.get('caching', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.storage_account_type = kwargs.get('storage_account_type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_data_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_data_disk_py3.py new file mode 100644 index 000000000000..a553931a9d2a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_data_disk_py3.py @@ -0,0 +1,68 @@ +# 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 msrest.serialization import Model + + +class ImageDataDisk(Model): + """Describes a data disk. + + All required parameters must be populated in order to send to Azure. + + :param lun: Required. 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. + :type lun: int + :param snapshot: The snapshot. + :type snapshot: ~azure.mgmt.compute.v2017_03_30.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: ~azure.mgmt.compute.v2017_03_30.models.SubResource + :param blob_uri: The Virtual Hard Disk. + :type blob_uri: str + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2017_03_30.models.CachingTypes + :param disk_size_gb: Specifies the size of empty data disks in gigabytes. + This element can be used to overwrite the name of the disk in a virtual + machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + :param storage_account_type: Specifies the storage account type for the + managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible + values include: 'Standard_LRS', 'Premium_LRS' + :type storage_account_type: str or + ~azure.mgmt.compute.v2017_03_30.models.StorageAccountTypes + """ + + _validation = { + 'lun': {'required': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + 'snapshot': {'key': 'snapshot', 'type': 'SubResource'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'SubResource'}, + 'blob_uri': {'key': 'blobUri', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, + } + + def __init__(self, *, lun: int, snapshot=None, managed_disk=None, blob_uri: str=None, caching=None, disk_size_gb: int=None, storage_account_type=None, **kwargs) -> None: + super(ImageDataDisk, self).__init__(**kwargs) + self.lun = lun + self.snapshot = snapshot + self.managed_disk = managed_disk + self.blob_uri = blob_uri + self.caching = caching + self.disk_size_gb = disk_size_gb + self.storage_account_type = storage_account_type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_disk_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_disk_reference.py index e3f08988c180..247d532379fc 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_disk_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_disk_reference.py @@ -15,8 +15,10 @@ class ImageDiskReference(Model): """The source image used for creating the disk. - :param id: A relative uri containing either a Platform Imgage Repository - or user image reference. + All required parameters must be populated in order to send to Azure. + + :param id: Required. A relative uri containing either a Platform Imgage + Repository or user image reference. :type id: str :param lun: If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS @@ -33,7 +35,7 @@ class ImageDiskReference(Model): 'lun': {'key': 'lun', 'type': 'int'}, } - def __init__(self, id, lun=None): - super(ImageDiskReference, self).__init__() - self.id = id - self.lun = lun + def __init__(self, **kwargs): + super(ImageDiskReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.lun = kwargs.get('lun', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_disk_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_disk_reference_py3.py new file mode 100644 index 000000000000..191563557acb --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_disk_reference_py3.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 msrest.serialization import Model + + +class ImageDiskReference(Model): + """The source image used for creating the disk. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. A relative uri containing either a Platform Imgage + Repository or user image reference. + :type id: str + :param lun: If the disk is created from an image's data disk, this is an + index that indicates which of the data disks in the image to use. For OS + disks, this field is null. + :type lun: int + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__(self, *, id: str, lun: int=None, **kwargs) -> None: + super(ImageDiskReference, self).__init__(**kwargs) + self.id = id + self.lun = lun diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_os_disk.py index 9e656959bbcd..f1d05ae32c94 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_os_disk.py @@ -15,14 +15,16 @@ class ImageOSDisk(Model): """Describes an Operating System disk. - :param os_type: This property allows you to specify the type of the OS - that is included in the disk if creating a VM from a custom image. + All required parameters must be populated in order to send to Azure. + + :param os_type: Required. This property allows you to specify the type of + the OS that is included in the disk if creating a VM from a custom image.

    Possible values are:

    **Windows**

    **Linux**. Possible values include: 'Windows', 'Linux' :type os_type: str or ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemTypes - :param os_state: The OS State. Possible values include: 'Generalized', - 'Specialized' + :param os_state: Required. The OS State. Possible values include: + 'Generalized', 'Specialized' :type os_state: str or ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemStateTypes :param snapshot: The snapshot. @@ -63,13 +65,13 @@ class ImageOSDisk(Model): 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, } - def __init__(self, os_type, os_state, snapshot=None, managed_disk=None, blob_uri=None, caching=None, disk_size_gb=None, storage_account_type=None): - super(ImageOSDisk, self).__init__() - self.os_type = os_type - self.os_state = os_state - self.snapshot = snapshot - self.managed_disk = managed_disk - self.blob_uri = blob_uri - self.caching = caching - self.disk_size_gb = disk_size_gb - self.storage_account_type = storage_account_type + def __init__(self, **kwargs): + super(ImageOSDisk, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.os_state = kwargs.get('os_state', None) + self.snapshot = kwargs.get('snapshot', None) + self.managed_disk = kwargs.get('managed_disk', None) + self.blob_uri = kwargs.get('blob_uri', None) + self.caching = kwargs.get('caching', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.storage_account_type = kwargs.get('storage_account_type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_os_disk_py3.py new file mode 100644 index 000000000000..1e7ac3e5bd13 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_os_disk_py3.py @@ -0,0 +1,77 @@ +# 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 msrest.serialization import Model + + +class ImageOSDisk(Model): + """Describes an Operating System disk. + + All required parameters must be populated in order to send to Azure. + + :param os_type: Required. This property allows you to specify the type of + the OS that is included in the disk if creating a VM from a custom image. +

    Possible values are:

    **Windows**

    **Linux**. + Possible values include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemTypes + :param os_state: Required. The OS State. Possible values include: + 'Generalized', 'Specialized' + :type os_state: str or + ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemStateTypes + :param snapshot: The snapshot. + :type snapshot: ~azure.mgmt.compute.v2017_03_30.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: ~azure.mgmt.compute.v2017_03_30.models.SubResource + :param blob_uri: The Virtual Hard Disk. + :type blob_uri: str + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2017_03_30.models.CachingTypes + :param disk_size_gb: Specifies the size of empty data disks in gigabytes. + This element can be used to overwrite the name of the disk in a virtual + machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + :param storage_account_type: Specifies the storage account type for the + managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible + values include: 'Standard_LRS', 'Premium_LRS' + :type storage_account_type: str or + ~azure.mgmt.compute.v2017_03_30.models.StorageAccountTypes + """ + + _validation = { + 'os_type': {'required': True}, + 'os_state': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'os_state': {'key': 'osState', 'type': 'OperatingSystemStateTypes'}, + 'snapshot': {'key': 'snapshot', 'type': 'SubResource'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'SubResource'}, + 'blob_uri': {'key': 'blobUri', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, + } + + def __init__(self, *, os_type, os_state, snapshot=None, managed_disk=None, blob_uri: str=None, caching=None, disk_size_gb: int=None, storage_account_type=None, **kwargs) -> None: + super(ImageOSDisk, self).__init__(**kwargs) + self.os_type = os_type + self.os_state = os_state + self.snapshot = snapshot + self.managed_disk = managed_disk + self.blob_uri = blob_uri + self.caching = caching + self.disk_size_gb = disk_size_gb + self.storage_account_type = storage_account_type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_py3.py new file mode 100644 index 000000000000..103ab400bb6a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_py3.py @@ -0,0 +1,70 @@ +# 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 .resource import Resource + + +class Image(Resource): + """The source user image virtual hard disk. The virtual hard disk will be + copied before being attached to the virtual machine. If SourceImage is + provided, the destination virtual hard drive must not exist. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param source_virtual_machine: The source virtual machine from which Image + is created. + :type source_virtual_machine: + ~azure.mgmt.compute.v2017_03_30.models.SubResource + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2017_03_30.models.ImageStorageProfile + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source_virtual_machine': {'key': 'properties.sourceVirtualMachine', 'type': 'SubResource'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'ImageStorageProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, source_virtual_machine=None, storage_profile=None, **kwargs) -> None: + super(Image, self).__init__(location=location, tags=tags, **kwargs) + self.source_virtual_machine = source_virtual_machine + self.storage_profile = storage_profile + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_reference.py index 9ec2177fa5ad..b8f929f4ad70 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_reference.py @@ -46,9 +46,9 @@ class ImageReference(SubResource): 'version': {'key': 'version', 'type': 'str'}, } - def __init__(self, id=None, publisher=None, offer=None, sku=None, version=None): - super(ImageReference, self).__init__(id=id) - self.publisher = publisher - self.offer = offer - self.sku = sku - self.version = version + def __init__(self, **kwargs): + super(ImageReference, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.offer = kwargs.get('offer', None) + self.sku = kwargs.get('sku', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_reference_py3.py new file mode 100644 index 000000000000..f44047d4c087 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_reference_py3.py @@ -0,0 +1,54 @@ +# 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 .sub_resource import SubResource + + +class ImageReference(SubResource): + """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. + + :param id: Resource Id + :type id: str + :param publisher: The image publisher. + :type publisher: str + :param offer: Specifies the offer of the platform image or marketplace + image used to create the virtual machine. + :type offer: str + :param sku: The image SKU. + :type sku: str + :param 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. + :type version: str + """ + + _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'}, + } + + def __init__(self, *, id: str=None, publisher: str=None, offer: str=None, sku: str=None, version: str=None, **kwargs) -> None: + super(ImageReference, self).__init__(id=id, **kwargs) + self.publisher = publisher + self.offer = offer + self.sku = sku + self.version = version diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_storage_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_storage_profile.py index 164867488a9f..6a62f7be35c9 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_storage_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_storage_profile.py @@ -15,9 +15,11 @@ class ImageStorageProfile(Model): """Describes a storage profile. - :param os_disk: Specifies information about the operating system disk used - by the virtual machine.

    For more information about disks, see - [About disks and VHDs for Azure virtual + All required parameters must be populated in order to send to Azure. + + :param os_disk: Required. Specifies information about the operating system + disk used by the virtual machine.

    For more information about + disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). :type os_disk: ~azure.mgmt.compute.v2017_03_30.models.ImageOSDisk :param data_disks: Specifies the parameters that are used to add a data @@ -37,7 +39,7 @@ class ImageStorageProfile(Model): 'data_disks': {'key': 'dataDisks', 'type': '[ImageDataDisk]'}, } - def __init__(self, os_disk, data_disks=None): - super(ImageStorageProfile, self).__init__() - self.os_disk = os_disk - self.data_disks = data_disks + def __init__(self, **kwargs): + super(ImageStorageProfile, self).__init__(**kwargs) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_storage_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_storage_profile_py3.py new file mode 100644 index 000000000000..af250086f9ab --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/image_storage_profile_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class ImageStorageProfile(Model): + """Describes a storage profile. + + All required parameters must be populated in order to send to Azure. + + :param os_disk: Required. Specifies information about the operating system + disk used by the virtual machine.

    For more information about + disks, see [About disks and VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type os_disk: ~azure.mgmt.compute.v2017_03_30.models.ImageOSDisk + :param data_disks: Specifies the parameters that are used to add a data + disk to a virtual machine.

    For more information about disks, see + [About disks and VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type data_disks: + list[~azure.mgmt.compute.v2017_03_30.models.ImageDataDisk] + """ + + _validation = { + 'os_disk': {'required': True}, + } + + _attribute_map = { + 'os_disk': {'key': 'osDisk', 'type': 'ImageOSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[ImageDataDisk]'}, + } + + def __init__(self, *, os_disk, data_disks=None, **kwargs) -> None: + super(ImageStorageProfile, self).__init__(**kwargs) + self.os_disk = os_disk + self.data_disks = data_disks diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/inner_error.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/inner_error.py index de77683e2fc8..6324249d7c19 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/inner_error.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/inner_error.py @@ -26,7 +26,7 @@ class InnerError(Model): 'errordetail': {'key': 'errordetail', 'type': 'str'}, } - def __init__(self, exceptiontype=None, errordetail=None): - super(InnerError, self).__init__() - self.exceptiontype = exceptiontype - self.errordetail = errordetail + def __init__(self, **kwargs): + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = kwargs.get('exceptiontype', None) + self.errordetail = kwargs.get('errordetail', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/inner_error_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/inner_error_py3.py new file mode 100644 index 000000000000..ccec30d7b53f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/inner_error_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class InnerError(Model): + """Inner error details. + + :param exceptiontype: The exception type. + :type exceptiontype: str + :param errordetail: The internal error message or exception dump. + :type errordetail: str + """ + + _attribute_map = { + 'exceptiontype': {'key': 'exceptiontype', 'type': 'str'}, + 'errordetail': {'key': 'errordetail', 'type': 'str'}, + } + + def __init__(self, *, exceptiontype: str=None, errordetail: str=None, **kwargs) -> None: + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = exceptiontype + self.errordetail = errordetail diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/instance_view_status.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/instance_view_status.py index 0f26f2c6802c..bad5209dc286 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/instance_view_status.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/instance_view_status.py @@ -38,10 +38,10 @@ class InstanceViewStatus(Model): 'time': {'key': 'time', 'type': 'iso-8601'}, } - def __init__(self, code=None, level=None, display_status=None, message=None, time=None): - super(InstanceViewStatus, self).__init__() - self.code = code - self.level = level - self.display_status = display_status - self.message = message - self.time = time + def __init__(self, **kwargs): + super(InstanceViewStatus, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.level = kwargs.get('level', None) + self.display_status = kwargs.get('display_status', None) + self.message = kwargs.get('message', None) + self.time = kwargs.get('time', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/instance_view_status_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/instance_view_status_py3.py new file mode 100644 index 000000000000..a9cc415679e4 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/instance_view_status_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class InstanceViewStatus(Model): + """Instance view status. + + :param code: The status code. + :type code: str + :param level: The level code. Possible values include: 'Info', 'Warning', + 'Error' + :type level: str or + ~azure.mgmt.compute.v2017_03_30.models.StatusLevelTypes + :param display_status: The short localizable label for the status. + :type display_status: str + :param message: The detailed status message, including for alerts and + error messages. + :type message: str + :param time: The time of the status. + :type time: datetime + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'StatusLevelTypes'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__(self, *, code: str=None, level=None, display_status: str=None, message: str=None, time=None, **kwargs) -> None: + super(InstanceViewStatus, self).__init__(**kwargs) + self.code = code + self.level = level + self.display_status = display_status + self.message = message + self.time = time diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_and_key_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_and_key_reference.py index 57656e4ba02f..9b05d8d9a81f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_and_key_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_and_key_reference.py @@ -16,10 +16,12 @@ class KeyVaultAndKeyReference(Model): """Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the encryptionKey. - :param source_vault: Resource id of the KeyVault containing the key or - secret + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the + key or secret :type source_vault: ~azure.mgmt.compute.v2017_03_30.models.SourceVault - :param key_url: Url pointing to a key or secret in KeyVault + :param key_url: Required. Url pointing to a key or secret in KeyVault :type key_url: str """ @@ -33,7 +35,7 @@ class KeyVaultAndKeyReference(Model): 'key_url': {'key': 'keyUrl', 'type': 'str'}, } - def __init__(self, source_vault, key_url): - super(KeyVaultAndKeyReference, self).__init__() - self.source_vault = source_vault - self.key_url = key_url + def __init__(self, **kwargs): + super(KeyVaultAndKeyReference, self).__init__(**kwargs) + self.source_vault = kwargs.get('source_vault', None) + self.key_url = kwargs.get('key_url', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_and_key_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_and_key_reference_py3.py new file mode 100644 index 000000000000..524521adb8b3 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_and_key_reference_py3.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 msrest.serialization import Model + + +class KeyVaultAndKeyReference(Model): + """Key Vault Key Url and vault id of KeK, KeK is optional and when provided is + used to unwrap the encryptionKey. + + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the + key or secret + :type source_vault: ~azure.mgmt.compute.v2017_03_30.models.SourceVault + :param key_url: Required. Url pointing to a key or secret in KeyVault + :type key_url: str + """ + + _validation = { + 'source_vault': {'required': True}, + 'key_url': {'required': True}, + } + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + } + + def __init__(self, *, source_vault, key_url: str, **kwargs) -> None: + super(KeyVaultAndKeyReference, self).__init__(**kwargs) + self.source_vault = source_vault + self.key_url = key_url diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_and_secret_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_and_secret_reference.py index c0f7f6d47092..8ca1e94d1ef4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_and_secret_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_and_secret_reference.py @@ -15,10 +15,12 @@ class KeyVaultAndSecretReference(Model): """Key Vault Secret Url and vault id of the encryption key . - :param source_vault: Resource id of the KeyVault containing the key or - secret + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the + key or secret :type source_vault: ~azure.mgmt.compute.v2017_03_30.models.SourceVault - :param secret_url: Url pointing to a key or secret in KeyVault + :param secret_url: Required. Url pointing to a key or secret in KeyVault :type secret_url: str """ @@ -32,7 +34,7 @@ class KeyVaultAndSecretReference(Model): 'secret_url': {'key': 'secretUrl', 'type': 'str'}, } - def __init__(self, source_vault, secret_url): - super(KeyVaultAndSecretReference, self).__init__() - self.source_vault = source_vault - self.secret_url = secret_url + def __init__(self, **kwargs): + super(KeyVaultAndSecretReference, self).__init__(**kwargs) + self.source_vault = kwargs.get('source_vault', None) + self.secret_url = kwargs.get('secret_url', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_and_secret_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_and_secret_reference_py3.py new file mode 100644 index 000000000000..441f3b3e7474 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_and_secret_reference_py3.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 msrest.serialization import Model + + +class KeyVaultAndSecretReference(Model): + """Key Vault Secret Url and vault id of the encryption key . + + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the + key or secret + :type source_vault: ~azure.mgmt.compute.v2017_03_30.models.SourceVault + :param secret_url: Required. Url pointing to a key or secret in KeyVault + :type secret_url: str + """ + + _validation = { + 'source_vault': {'required': True}, + 'secret_url': {'required': True}, + } + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'secret_url': {'key': 'secretUrl', 'type': 'str'}, + } + + def __init__(self, *, source_vault, secret_url: str, **kwargs) -> None: + super(KeyVaultAndSecretReference, self).__init__(**kwargs) + self.source_vault = source_vault + self.secret_url = secret_url diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_key_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_key_reference.py index 4f46bdcad394..92145037b737 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_key_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_key_reference.py @@ -15,9 +15,13 @@ class KeyVaultKeyReference(Model): """Describes a reference to Key Vault Key. - :param key_url: The URL referencing a key encryption key in Key Vault. + All required parameters must be populated in order to send to Azure. + + :param key_url: Required. The URL referencing a key encryption key in Key + Vault. :type key_url: str - :param source_vault: The relative URL of the Key Vault containing the key. + :param source_vault: Required. The relative URL of the Key Vault + containing the key. :type source_vault: ~azure.mgmt.compute.v2017_03_30.models.SubResource """ @@ -31,7 +35,7 @@ class KeyVaultKeyReference(Model): 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, } - def __init__(self, key_url, source_vault): - super(KeyVaultKeyReference, self).__init__() - self.key_url = key_url - self.source_vault = source_vault + def __init__(self, **kwargs): + super(KeyVaultKeyReference, self).__init__(**kwargs) + self.key_url = kwargs.get('key_url', None) + self.source_vault = kwargs.get('source_vault', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_key_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_key_reference_py3.py new file mode 100644 index 000000000000..33c5c26753a7 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_key_reference_py3.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 msrest.serialization import Model + + +class KeyVaultKeyReference(Model): + """Describes a reference to Key Vault Key. + + All required parameters must be populated in order to send to Azure. + + :param key_url: Required. The URL referencing a key encryption key in Key + Vault. + :type key_url: str + :param source_vault: Required. The relative URL of the Key Vault + containing the key. + :type source_vault: ~azure.mgmt.compute.v2017_03_30.models.SubResource + """ + + _validation = { + 'key_url': {'required': True}, + 'source_vault': {'required': True}, + } + + _attribute_map = { + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, + } + + def __init__(self, *, key_url: str, source_vault, **kwargs) -> None: + super(KeyVaultKeyReference, self).__init__(**kwargs) + self.key_url = key_url + self.source_vault = source_vault diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_secret_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_secret_reference.py index 2a2f87ad36f8..08b6714cbc93 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_secret_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_secret_reference.py @@ -15,10 +15,12 @@ class KeyVaultSecretReference(Model): """Describes a reference to Key Vault Secret. - :param secret_url: The URL referencing a secret in a Key Vault. + All required parameters must be populated in order to send to Azure. + + :param secret_url: Required. The URL referencing a secret in a Key Vault. :type secret_url: str - :param source_vault: The relative URL of the Key Vault containing the - secret. + :param source_vault: Required. The relative URL of the Key Vault + containing the secret. :type source_vault: ~azure.mgmt.compute.v2017_03_30.models.SubResource """ @@ -32,7 +34,7 @@ class KeyVaultSecretReference(Model): 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, } - def __init__(self, secret_url, source_vault): - super(KeyVaultSecretReference, self).__init__() - self.secret_url = secret_url - self.source_vault = source_vault + def __init__(self, **kwargs): + super(KeyVaultSecretReference, self).__init__(**kwargs) + self.secret_url = kwargs.get('secret_url', None) + self.source_vault = kwargs.get('source_vault', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_secret_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_secret_reference_py3.py new file mode 100644 index 000000000000..08aee3ef629c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/key_vault_secret_reference_py3.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 msrest.serialization import Model + + +class KeyVaultSecretReference(Model): + """Describes a reference to Key Vault Secret. + + All required parameters must be populated in order to send to Azure. + + :param secret_url: Required. The URL referencing a secret in a Key Vault. + :type secret_url: str + :param source_vault: Required. The relative URL of the Key Vault + containing the secret. + :type source_vault: ~azure.mgmt.compute.v2017_03_30.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, **kwargs) -> None: + super(KeyVaultSecretReference, self).__init__(**kwargs) + self.secret_url = secret_url + self.source_vault = source_vault diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/linux_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/linux_configuration.py index 7fba6293c431..07e5c9a55895 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/linux_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/linux_configuration.py @@ -33,7 +33,7 @@ class LinuxConfiguration(Model): 'ssh': {'key': 'ssh', 'type': 'SshConfiguration'}, } - def __init__(self, disable_password_authentication=None, ssh=None): - super(LinuxConfiguration, self).__init__() - self.disable_password_authentication = disable_password_authentication - self.ssh = ssh + def __init__(self, **kwargs): + super(LinuxConfiguration, self).__init__(**kwargs) + self.disable_password_authentication = kwargs.get('disable_password_authentication', None) + self.ssh = kwargs.get('ssh', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/linux_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/linux_configuration_py3.py new file mode 100644 index 000000000000..63d138590b0e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/linux_configuration_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class LinuxConfiguration(Model): + """Specifies the Linux operating system settings on the virtual machine. +

    For a list of supported Linux distributions, see [Linux on + Azure-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) +

    For running non-endorsed distributions, see [Information for + Non-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + + :param disable_password_authentication: Specifies whether password + authentication should be disabled. + :type disable_password_authentication: bool + :param ssh: Specifies the ssh key configuration for a Linux OS. + :type ssh: ~azure.mgmt.compute.v2017_03_30.models.SshConfiguration + """ + + _attribute_map = { + 'disable_password_authentication': {'key': 'disablePasswordAuthentication', 'type': 'bool'}, + 'ssh': {'key': 'ssh', 'type': 'SshConfiguration'}, + } + + def __init__(self, *, disable_password_authentication: bool=None, ssh=None, **kwargs) -> None: + super(LinuxConfiguration, self).__init__(**kwargs) + self.disable_password_authentication = disable_password_authentication + self.ssh = ssh diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/maintenance_redeploy_status.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/maintenance_redeploy_status.py index fc17566b3701..183ed22922d3 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/maintenance_redeploy_status.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/maintenance_redeploy_status.py @@ -49,12 +49,12 @@ class MaintenanceRedeployStatus(Model): 'last_operation_message': {'key': 'lastOperationMessage', 'type': 'str'}, } - def __init__(self, is_customer_initiated_maintenance_allowed=None, pre_maintenance_window_start_time=None, pre_maintenance_window_end_time=None, maintenance_window_start_time=None, maintenance_window_end_time=None, last_operation_result_code=None, last_operation_message=None): - super(MaintenanceRedeployStatus, self).__init__() - self.is_customer_initiated_maintenance_allowed = is_customer_initiated_maintenance_allowed - self.pre_maintenance_window_start_time = pre_maintenance_window_start_time - self.pre_maintenance_window_end_time = pre_maintenance_window_end_time - self.maintenance_window_start_time = maintenance_window_start_time - self.maintenance_window_end_time = maintenance_window_end_time - self.last_operation_result_code = last_operation_result_code - self.last_operation_message = last_operation_message + def __init__(self, **kwargs): + super(MaintenanceRedeployStatus, self).__init__(**kwargs) + self.is_customer_initiated_maintenance_allowed = kwargs.get('is_customer_initiated_maintenance_allowed', None) + self.pre_maintenance_window_start_time = kwargs.get('pre_maintenance_window_start_time', None) + self.pre_maintenance_window_end_time = kwargs.get('pre_maintenance_window_end_time', None) + self.maintenance_window_start_time = kwargs.get('maintenance_window_start_time', None) + self.maintenance_window_end_time = kwargs.get('maintenance_window_end_time', None) + self.last_operation_result_code = kwargs.get('last_operation_result_code', None) + self.last_operation_message = kwargs.get('last_operation_message', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/maintenance_redeploy_status_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/maintenance_redeploy_status_py3.py new file mode 100644 index 000000000000..1d3532edebde --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/maintenance_redeploy_status_py3.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class MaintenanceRedeployStatus(Model): + """Maintenance Operation Status. + + :param is_customer_initiated_maintenance_allowed: True, if customer is + allowed to perform Maintenance. + :type is_customer_initiated_maintenance_allowed: bool + :param pre_maintenance_window_start_time: Start Time for the Pre + Maintenance Window. + :type pre_maintenance_window_start_time: datetime + :param pre_maintenance_window_end_time: End Time for the Pre Maintenance + Window. + :type pre_maintenance_window_end_time: datetime + :param maintenance_window_start_time: Start Time for the Maintenance + Window. + :type maintenance_window_start_time: datetime + :param maintenance_window_end_time: End Time for the Maintenance Window. + :type maintenance_window_end_time: datetime + :param last_operation_result_code: The Last Maintenance Operation Result + Code. Possible values include: 'None', 'RetryLater', 'MaintenanceAborted', + 'MaintenanceCompleted' + :type last_operation_result_code: str or + ~azure.mgmt.compute.v2017_03_30.models.MaintenanceOperationResultCodeTypes + :param last_operation_message: Message returned for the last Maintenance + Operation. + :type last_operation_message: str + """ + + _attribute_map = { + 'is_customer_initiated_maintenance_allowed': {'key': 'isCustomerInitiatedMaintenanceAllowed', 'type': 'bool'}, + 'pre_maintenance_window_start_time': {'key': 'preMaintenanceWindowStartTime', 'type': 'iso-8601'}, + 'pre_maintenance_window_end_time': {'key': 'preMaintenanceWindowEndTime', 'type': 'iso-8601'}, + 'maintenance_window_start_time': {'key': 'maintenanceWindowStartTime', 'type': 'iso-8601'}, + 'maintenance_window_end_time': {'key': 'maintenanceWindowEndTime', 'type': 'iso-8601'}, + 'last_operation_result_code': {'key': 'lastOperationResultCode', 'type': 'MaintenanceOperationResultCodeTypes'}, + 'last_operation_message': {'key': 'lastOperationMessage', 'type': 'str'}, + } + + def __init__(self, *, is_customer_initiated_maintenance_allowed: bool=None, pre_maintenance_window_start_time=None, pre_maintenance_window_end_time=None, maintenance_window_start_time=None, maintenance_window_end_time=None, last_operation_result_code=None, last_operation_message: str=None, **kwargs) -> None: + super(MaintenanceRedeployStatus, self).__init__(**kwargs) + self.is_customer_initiated_maintenance_allowed = is_customer_initiated_maintenance_allowed + self.pre_maintenance_window_start_time = pre_maintenance_window_start_time + self.pre_maintenance_window_end_time = pre_maintenance_window_end_time + self.maintenance_window_start_time = maintenance_window_start_time + self.maintenance_window_end_time = maintenance_window_end_time + self.last_operation_result_code = last_operation_result_code + self.last_operation_message = last_operation_message diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/managed_disk_parameters.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/managed_disk_parameters.py index 1de0d42dc440..5bf0757e76a9 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/managed_disk_parameters.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/managed_disk_parameters.py @@ -29,6 +29,6 @@ class ManagedDiskParameters(SubResource): 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, } - def __init__(self, id=None, storage_account_type=None): - super(ManagedDiskParameters, self).__init__(id=id) - self.storage_account_type = storage_account_type + def __init__(self, **kwargs): + super(ManagedDiskParameters, self).__init__(**kwargs) + self.storage_account_type = kwargs.get('storage_account_type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/managed_disk_parameters_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/managed_disk_parameters_py3.py new file mode 100644 index 000000000000..d28adf8baf36 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/managed_disk_parameters_py3.py @@ -0,0 +1,34 @@ +# 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 .sub_resource import SubResource + + +class ManagedDiskParameters(SubResource): + """The parameters of a managed disk. + + :param id: Resource Id + :type id: str + :param storage_account_type: Specifies the storage account type for the + managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible + values include: 'Standard_LRS', 'Premium_LRS' + :type storage_account_type: str or + ~azure.mgmt.compute.v2017_03_30.models.StorageAccountTypes + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, + } + + def __init__(self, *, id: str=None, storage_account_type=None, **kwargs) -> None: + super(ManagedDiskParameters, self).__init__(id=id, **kwargs) + self.storage_account_type = storage_account_type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/network_interface_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/network_interface_reference.py index 80c743c0d8e3..b86e305e3f74 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/network_interface_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/network_interface_reference.py @@ -27,6 +27,6 @@ class NetworkInterfaceReference(SubResource): 'primary': {'key': 'properties.primary', 'type': 'bool'}, } - def __init__(self, id=None, primary=None): - super(NetworkInterfaceReference, self).__init__(id=id) - self.primary = primary + def __init__(self, **kwargs): + super(NetworkInterfaceReference, self).__init__(**kwargs) + self.primary = kwargs.get('primary', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/network_interface_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/network_interface_reference_py3.py new file mode 100644 index 000000000000..f42ead50fc36 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/network_interface_reference_py3.py @@ -0,0 +1,32 @@ +# 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 .sub_resource import SubResource + + +class NetworkInterfaceReference(SubResource): + """Describes a network interface reference. + + :param id: Resource Id + :type id: str + :param primary: Specifies the primary network interface in case the + virtual machine has more than 1 network interface. + :type primary: bool + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + } + + def __init__(self, *, id: str=None, primary: bool=None, **kwargs) -> None: + super(NetworkInterfaceReference, self).__init__(id=id, **kwargs) + self.primary = primary diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/network_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/network_profile.py index 9a50e7630e4f..fc0a548ab07b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/network_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/network_profile.py @@ -25,6 +25,6 @@ class NetworkProfile(Model): 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceReference]'}, } - def __init__(self, network_interfaces=None): - super(NetworkProfile, self).__init__() - self.network_interfaces = network_interfaces + def __init__(self, **kwargs): + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/network_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/network_profile_py3.py new file mode 100644 index 000000000000..f974d8eef777 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/network_profile_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkProfile(Model): + """Specifies the network interfaces of the virtual machine. + + :param network_interfaces: Specifies the list of resource Ids for the + network interfaces associated with the virtual machine. + :type network_interfaces: + list[~azure.mgmt.compute.v2017_03_30.models.NetworkInterfaceReference] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceReference]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = network_interfaces diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/operation_status_response.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/operation_status_response.py index 6e10430632a0..2a767a845e06 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/operation_status_response.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/operation_status_response.py @@ -46,8 +46,8 @@ class OperationStatusResponse(Model): 'error': {'key': 'error', 'type': 'ApiError'}, } - def __init__(self): - super(OperationStatusResponse, self).__init__() + def __init__(self, **kwargs): + super(OperationStatusResponse, self).__init__(**kwargs) self.name = None self.status = None self.start_time = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/operation_status_response_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/operation_status_response_py3.py new file mode 100644 index 000000000000..94409eeb6db7 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/operation_status_response_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class OperationStatusResponse(Model): + """Operation status response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation ID + :vartype name: str + :ivar status: Operation status + :vartype status: str + :ivar start_time: Start time of the operation + :vartype start_time: datetime + :ivar end_time: End time of the operation + :vartype end_time: datetime + :ivar error: Api error + :vartype error: ~azure.mgmt.compute.v2017_03_30.models.ApiError + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationStatusResponse, self).__init__(**kwargs) + self.name = None + self.status = None + self.start_time = None + self.end_time = None + self.error = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_disk.py index 884c505c2ebf..b30836ab57c7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_disk.py @@ -18,6 +18,8 @@ class OSDisk(Model): VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + All required parameters must be populated in order to send to Azure. + :param 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** @@ -42,8 +44,8 @@ class OSDisk(Model):

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2017_03_30.models.CachingTypes - :param create_option: Specifies how the virtual machine should be - created.

    Possible values are:

    **Attach** \\u2013 This + :param create_option: Required. Specifies how the virtual machine should + be created.

    Possible values are:

    **Attach** \\u2013 This value is used when you are using a specialized disk to create the virtual machine.

    **FromImage** \\u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform @@ -77,14 +79,14 @@ class OSDisk(Model): 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, } - def __init__(self, create_option, os_type=None, encryption_settings=None, name=None, vhd=None, image=None, caching=None, disk_size_gb=None, managed_disk=None): - super(OSDisk, self).__init__() - self.os_type = os_type - self.encryption_settings = encryption_settings - self.name = name - self.vhd = vhd - self.image = image - self.caching = caching - self.create_option = create_option - self.disk_size_gb = disk_size_gb - self.managed_disk = managed_disk + def __init__(self, **kwargs): + super(OSDisk, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.encryption_settings = kwargs.get('encryption_settings', None) + self.name = kwargs.get('name', None) + self.vhd = kwargs.get('vhd', None) + self.image = kwargs.get('image', None) + self.caching = kwargs.get('caching', None) + self.create_option = kwargs.get('create_option', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.managed_disk = kwargs.get('managed_disk', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_disk_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_disk_image.py index d5db85d07e80..41945d80b1eb 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_disk_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_disk_image.py @@ -15,8 +15,10 @@ class OSDiskImage(Model): """Contains the os disk image information. - :param operating_system: The operating system of the osDiskImage. Possible - values include: 'Windows', 'Linux' + All required parameters must be populated in order to send to Azure. + + :param operating_system: Required. The operating system of the + osDiskImage. Possible values include: 'Windows', 'Linux' :type operating_system: str or ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemTypes """ @@ -29,6 +31,6 @@ class OSDiskImage(Model): 'operating_system': {'key': 'operatingSystem', 'type': 'OperatingSystemTypes'}, } - def __init__(self, operating_system): - super(OSDiskImage, self).__init__() - self.operating_system = operating_system + def __init__(self, **kwargs): + super(OSDiskImage, self).__init__(**kwargs) + self.operating_system = kwargs.get('operating_system', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_disk_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_disk_image_py3.py new file mode 100644 index 000000000000..0d1a5431f0cf --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_disk_image_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class OSDiskImage(Model): + """Contains the os disk image information. + + All required parameters must be populated in order to send to Azure. + + :param operating_system: Required. The operating system of the + osDiskImage. Possible values include: 'Windows', 'Linux' + :type operating_system: str or + ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemTypes + """ + + _validation = { + 'operating_system': {'required': True}, + } + + _attribute_map = { + 'operating_system': {'key': 'operatingSystem', 'type': 'OperatingSystemTypes'}, + } + + def __init__(self, *, operating_system, **kwargs) -> None: + super(OSDiskImage, self).__init__(**kwargs) + self.operating_system = operating_system diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_disk_py3.py new file mode 100644 index 000000000000..49610fe43158 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_disk_py3.py @@ -0,0 +1,92 @@ +# 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 msrest.serialization import Model + + +class OSDisk(Model): + """Specifies information about the operating system disk used by the virtual + machine.

    For more information about disks, see [About disks and + VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + + All required parameters must be populated in order to send to Azure. + + :param 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**. Possible values include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemTypes + :param encryption_settings: Specifies the encryption settings for the OS + Disk.

    Minimum api-version: 2015-06-15 + :type encryption_settings: + ~azure.mgmt.compute.v2017_03_30.models.DiskEncryptionSettings + :param name: The disk name. + :type name: str + :param vhd: The virtual hard disk. + :type vhd: ~azure.mgmt.compute.v2017_03_30.models.VirtualHardDisk + :param image: The source user image virtual hard disk. The virtual hard + disk will be copied before being attached to the virtual machine. If + SourceImage is provided, the destination virtual hard drive must not + exist. + :type image: ~azure.mgmt.compute.v2017_03_30.models.VirtualHardDisk + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2017_03_30.models.CachingTypes + :param create_option: Required. Specifies how the virtual machine should + be created.

    Possible values are:

    **Attach** \\u2013 This + value is used when you are using a specialized disk to create the virtual + machine.

    **FromImage** \\u2013 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. Possible values include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2017_03_30.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in + gigabytes. This element can be used to overwrite the name of the disk in a + virtual machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2017_03_30.models.ManagedDiskParameters + """ + + _validation = { + 'create_option': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': 'DiskEncryptionSettings'}, + 'name': {'key': 'name', 'type': 'str'}, + 'vhd': {'key': 'vhd', 'type': 'VirtualHardDisk'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, + } + + def __init__(self, *, create_option, os_type=None, encryption_settings=None, name: str=None, vhd=None, image=None, caching=None, disk_size_gb: int=None, managed_disk=None, **kwargs) -> None: + super(OSDisk, self).__init__(**kwargs) + self.os_type = os_type + self.encryption_settings = encryption_settings + self.name = name + self.vhd = vhd + self.image = image + self.caching = caching + self.create_option = create_option + self.disk_size_gb = disk_size_gb + self.managed_disk = managed_disk diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_profile.py index d5c4c24aff2a..688e872bdc9c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_profile.py @@ -88,12 +88,12 @@ class OSProfile(Model): 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, } - def __init__(self, computer_name=None, admin_username=None, admin_password=None, custom_data=None, windows_configuration=None, linux_configuration=None, secrets=None): - super(OSProfile, self).__init__() - self.computer_name = computer_name - 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 + def __init__(self, **kwargs): + super(OSProfile, self).__init__(**kwargs) + self.computer_name = kwargs.get('computer_name', None) + self.admin_username = kwargs.get('admin_username', None) + self.admin_password = kwargs.get('admin_password', None) + self.custom_data = kwargs.get('custom_data', None) + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + self.secrets = kwargs.get('secrets', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_profile_py3.py new file mode 100644 index 000000000000..53b946fb208f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_profile_py3.py @@ -0,0 +1,99 @@ +# 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 msrest.serialization import Model + + +class OSProfile(Model): + """Specifies the operating system settings for the virtual machine. + + :param computer_name: Specifies the host OS name of the virtual machine. +

    **Max-length (Windows):** 15 characters

    **Max-length + (Linux):** 64 characters.

    For naming conventions and restrictions + see [Azure infrastructure services implementation + guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + :type computer_name: str + :param admin_username: Specifies the name of the administrator account. +

    **Windows-only restriction:** Cannot end in "."

    + **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".

    **Minimum-length (Linux):** 1 + character

    **Max-length (Linux):** 64 characters

    + **Max-length (Windows):** 20 characters

  • For root access to + the Linux VM, see [Using root privileges on Linux virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + For a list of built-in system users on Linux that should not be used in + this field, see [Selecting User Names for Linux on + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type admin_username: str + :param admin_password: Specifies the password of the administrator + account.

    **Minimum-length (Windows):** 8 characters

    + **Minimum-length (Linux):** 6 characters

    **Max-length + (Windows):** 123 characters

    **Max-length (Linux):** 72 characters +

    **Complexity requirements:** 3 out of 4 conditions below need to + be fulfilled
    Has lower characters
    Has upper characters
    Has a + digit
    Has a special character (Regex match [\\W_])

    + **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + "iloveyou!"

    For resetting the password, see [How to reset the + Remote Desktop service or its login password in a Windows + VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    For resetting root password, see [Manage users, SSH, and check or + repair disks on Azure Linux VMs using the VMAccess + Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + :type admin_password: str + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type custom_data: str + :param windows_configuration: Specifies Windows operating system settings + on the virtual machine. + :type windows_configuration: + ~azure.mgmt.compute.v2017_03_30.models.WindowsConfiguration + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) +

    For running non-endorsed distributions, see [Information for + Non-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + :type linux_configuration: + ~azure.mgmt.compute.v2017_03_30.models.LinuxConfiguration + :param secrets: Specifies set of certificates that should be installed + onto the virtual machine. + :type secrets: + list[~azure.mgmt.compute.v2017_03_30.models.VaultSecretGroup] + """ + + _attribute_map = { + 'computer_name': {'key': 'computerName', '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]'}, + } + + def __init__(self, *, computer_name: str=None, admin_username: str=None, admin_password: str=None, custom_data: str=None, windows_configuration=None, linux_configuration=None, secrets=None, **kwargs) -> None: + super(OSProfile, self).__init__(**kwargs) + self.computer_name = computer_name + 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 diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/plan.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/plan.py index 772160aef635..d42b6b32cfac 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/plan.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/plan.py @@ -38,9 +38,9 @@ class Plan(Model): 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, } - def __init__(self, name=None, publisher=None, product=None, promotion_code=None): - super(Plan, self).__init__() - self.name = name - self.publisher = publisher - self.product = product - self.promotion_code = promotion_code + def __init__(self, **kwargs): + super(Plan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/plan_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/plan_py3.py new file mode 100644 index 000000000000..9cca2c78a123 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/plan_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class Plan(Model): + """Specifies information about the marketplace image used to create the + virtual machine. This element is only used for marketplace images. Before + you can use a marketplace image from an API, you must enable the image for + programmatic use. In the Azure portal, find the marketplace image that you + want to use and then click **Want to deploy programmatically, Get Started + ->**. Enter any required information and then click **Save**. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: Specifies the product of the image from the marketplace. + This is the same value as Offer under the imageReference element. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, publisher: str=None, product: str=None, promotion_code: str=None, **kwargs) -> None: + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/purchase_plan.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/purchase_plan.py index aa29cb02ab78..2e1509addca6 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/purchase_plan.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/purchase_plan.py @@ -16,12 +16,15 @@ class PurchasePlan(Model): """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - :param publisher: The publisher ID. + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The publisher ID. :type publisher: str - :param name: The plan ID. + :param name: Required. The plan ID. :type name: str - :param product: Specifies the product of the image from the marketplace. - This is the same value as Offer under the imageReference element. + :param product: Required. Specifies the product of the image from the + marketplace. This is the same value as Offer under the imageReference + element. :type product: str """ @@ -37,8 +40,8 @@ class PurchasePlan(Model): 'product': {'key': 'product', 'type': 'str'}, } - def __init__(self, publisher, name, product): - super(PurchasePlan, self).__init__() - self.publisher = publisher - self.name = name - self.product = product + def __init__(self, **kwargs): + super(PurchasePlan, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.name = kwargs.get('name', None) + self.product = kwargs.get('product', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/purchase_plan_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/purchase_plan_py3.py new file mode 100644 index 000000000000..26f7996f1633 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/purchase_plan_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class PurchasePlan(Model): + """Used for establishing the purchase context of any 3rd Party artifact + through MarketPlace. + + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The publisher ID. + :type publisher: str + :param name: Required. The plan ID. + :type name: str + :param product: Required. Specifies the product of the image from the + marketplace. This is the same value as Offer under the imageReference + element. + :type product: str + """ + + _validation = { + 'publisher': {'required': True}, + 'name': {'required': True}, + 'product': {'required': True}, + } + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__(self, *, publisher: str, name: str, product: str, **kwargs) -> None: + super(PurchasePlan, self).__init__(**kwargs) + self.publisher = publisher + self.name = name + self.product = product diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource.py index 10269b591c68..5dd7d481c685 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource.py @@ -18,13 +18,15 @@ class Resource(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -45,10 +47,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_py3.py new file mode 100644 index 000000000000..2f3702caf609 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_py3.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku.py index 0a2655561a3b..894acd3c6c97 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku.py @@ -80,8 +80,8 @@ class ResourceSku(Model): 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, } - def __init__(self): - super(ResourceSku, self).__init__() + def __init__(self, **kwargs): + super(ResourceSku, self).__init__(**kwargs) self.resource_type = None self.name = None self.tier = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_capabilities.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_capabilities.py index 278f55789e9e..1248116584dd 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_capabilities.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_capabilities.py @@ -34,7 +34,7 @@ class ResourceSkuCapabilities(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self): - super(ResourceSkuCapabilities, self).__init__() + def __init__(self, **kwargs): + super(ResourceSkuCapabilities, self).__init__(**kwargs) self.name = None self.value = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_capabilities_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_capabilities_py3.py new file mode 100644 index 000000000000..c7a095c1f04b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_capabilities_py3.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 msrest.serialization import Model + + +class ResourceSkuCapabilities(Model): + """Describes The SKU capabilites object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: An invariant to describe the feature. + :vartype name: str + :ivar value: An invariant if the feature is measured by quantity. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSkuCapabilities, self).__init__(**kwargs) + self.name = None + self.value = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_capacity.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_capacity.py index 6ff20e066825..38eb0d5c8764 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_capacity.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_capacity.py @@ -44,8 +44,8 @@ class ResourceSkuCapacity(Model): 'scale_type': {'key': 'scaleType', 'type': 'ResourceSkuCapacityScaleType'}, } - def __init__(self): - super(ResourceSkuCapacity, self).__init__() + def __init__(self, **kwargs): + super(ResourceSkuCapacity, self).__init__(**kwargs) self.minimum = None self.maximum = None self.default = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_capacity_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_capacity_py3.py new file mode 100644 index 000000000000..7117ed227846 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_capacity_py3.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class ResourceSkuCapacity(Model): + """Describes scaling information of a SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar minimum: The minimum capacity. + :vartype minimum: long + :ivar maximum: The maximum capacity that can be set. + :vartype maximum: long + :ivar default: The default capacity. + :vartype default: long + :ivar scale_type: The scale type applicable to the sku. Possible values + include: 'Automatic', 'Manual', 'None' + :vartype scale_type: str or + ~azure.mgmt.compute.v2017_03_30.models.ResourceSkuCapacityScaleType + """ + + _validation = { + 'minimum': {'readonly': True}, + 'maximum': {'readonly': True}, + 'default': {'readonly': True}, + 'scale_type': {'readonly': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'long'}, + 'maximum': {'key': 'maximum', 'type': 'long'}, + 'default': {'key': 'default', 'type': 'long'}, + 'scale_type': {'key': 'scaleType', 'type': 'ResourceSkuCapacityScaleType'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSkuCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default = None + self.scale_type = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_costs.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_costs.py index 103f21eb6428..293adaf0962c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_costs.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_costs.py @@ -38,8 +38,8 @@ class ResourceSkuCosts(Model): 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, } - def __init__(self): - super(ResourceSkuCosts, self).__init__() + def __init__(self, **kwargs): + super(ResourceSkuCosts, self).__init__(**kwargs) self.meter_id = None self.quantity = None self.extended_unit = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_costs_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_costs_py3.py new file mode 100644 index 000000000000..59e7036807d6 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_costs_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class ResourceSkuCosts(Model): + """Describes metadata for retrieving price info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar meter_id: Used for querying price from commerce. + :vartype meter_id: str + :ivar quantity: The multiplier is needed to extend the base metered cost. + :vartype quantity: long + :ivar extended_unit: An invariant to show the extended unit. + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterID', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSkuCosts, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_py3.py new file mode 100644 index 000000000000..85fc2af934d3 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_py3.py @@ -0,0 +1,96 @@ +# 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 msrest.serialization import Model + + +class ResourceSku(Model): + """Describes an available Compute SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_type: The type of resource the SKU applies to. + :vartype resource_type: str + :ivar name: The name of SKU. + :vartype name: str + :ivar tier: Specifies the tier of virtual machines in a scale set.

    Possible Values:

    **Standard**

    **Basic** + :vartype tier: str + :ivar size: The Size of the SKU. + :vartype size: str + :ivar family: The Family of this particular SKU. + :vartype family: str + :ivar kind: The Kind of resources that are supported in this SKU. + :vartype kind: str + :ivar capacity: Specifies the number of virtual machines in the scale set. + :vartype capacity: + ~azure.mgmt.compute.v2017_03_30.models.ResourceSkuCapacity + :ivar locations: The set of locations that the SKU is available. + :vartype locations: list[str] + :ivar api_versions: The api versions that support this SKU. + :vartype api_versions: list[str] + :ivar costs: Metadata for retrieving price info. + :vartype costs: + list[~azure.mgmt.compute.v2017_03_30.models.ResourceSkuCosts] + :ivar capabilities: A name value pair to describe the capability. + :vartype capabilities: + list[~azure.mgmt.compute.v2017_03_30.models.ResourceSkuCapabilities] + :ivar restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :vartype restrictions: + list[~azure.mgmt.compute.v2017_03_30.models.ResourceSkuRestrictions] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, + 'kind': {'readonly': True}, + 'capacity': {'readonly': True}, + 'locations': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'costs': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'ResourceSkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'costs': {'key': 'costs', 'type': '[ResourceSkuCosts]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapabilities]'}, + 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.tier = None + self.size = None + self.family = None + self.kind = None + self.capacity = None + self.locations = None + self.api_versions = None + self.costs = None + self.capabilities = None + self.restrictions = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_restrictions.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_restrictions.py index 9e96fe54fbd5..fb13a519b831 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_restrictions.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_restrictions.py @@ -42,8 +42,8 @@ class ResourceSkuRestrictions(Model): 'reason_code': {'key': 'reasonCode', 'type': 'ResourceSkuRestrictionsReasonCode'}, } - def __init__(self): - super(ResourceSkuRestrictions, self).__init__() + def __init__(self, **kwargs): + super(ResourceSkuRestrictions, self).__init__(**kwargs) self.type = None self.values = None self.reason_code = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_restrictions_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_restrictions_py3.py new file mode 100644 index 000000000000..9a4296e74dd0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_sku_restrictions_py3.py @@ -0,0 +1,49 @@ +# 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 msrest.serialization import Model + + +class ResourceSkuRestrictions(Model): + """Describes scaling information of a SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. Possible values include: 'Location' + :vartype type: str or + ~azure.mgmt.compute.v2017_03_30.models.ResourceSkuRestrictionsType + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :ivar reason_code: The reason for restriction. Possible values include: + 'QuotaId', 'NotAvailableForSubscription' + :vartype reason_code: str or + ~azure.mgmt.compute.v2017_03_30.models.ResourceSkuRestrictionsReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + 'reason_code': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'ResourceSkuRestrictionsType'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'ResourceSkuRestrictionsReasonCode'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSkuRestrictions, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_update.py index ae7e917c5585..949f11d6d91a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_update.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_update.py @@ -26,7 +26,7 @@ class ResourceUpdate(Model): 'sku': {'key': 'sku', 'type': 'DiskSku'}, } - def __init__(self, tags=None, sku=None): - super(ResourceUpdate, self).__init__() - self.tags = tags - self.sku = sku + def __init__(self, **kwargs): + super(ResourceUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_update_py3.py new file mode 100644 index 000000000000..97d1f52f4e74 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/resource_update_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class ResourceUpdate(Model): + """The Resource model definition. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: + :type sku: ~azure.mgmt.compute.v2017_03_30.models.DiskSku + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + } + + def __init__(self, *, tags=None, sku=None, **kwargs) -> None: + super(ResourceUpdate, self).__init__(**kwargs) + self.tags = tags + self.sku = sku diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_policy.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_policy.py index 40b1ca96380f..1eecaa5e2e65 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_policy.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_policy.py @@ -55,9 +55,9 @@ class RollingUpgradePolicy(Model): 'pause_time_between_batches': {'key': 'pauseTimeBetweenBatches', 'type': 'str'}, } - def __init__(self, max_batch_instance_percent=None, max_unhealthy_instance_percent=None, max_unhealthy_upgraded_instance_percent=None, pause_time_between_batches=None): - super(RollingUpgradePolicy, self).__init__() - self.max_batch_instance_percent = max_batch_instance_percent - self.max_unhealthy_instance_percent = max_unhealthy_instance_percent - self.max_unhealthy_upgraded_instance_percent = max_unhealthy_upgraded_instance_percent - self.pause_time_between_batches = pause_time_between_batches + def __init__(self, **kwargs): + super(RollingUpgradePolicy, self).__init__(**kwargs) + self.max_batch_instance_percent = kwargs.get('max_batch_instance_percent', None) + self.max_unhealthy_instance_percent = kwargs.get('max_unhealthy_instance_percent', None) + self.max_unhealthy_upgraded_instance_percent = kwargs.get('max_unhealthy_upgraded_instance_percent', None) + self.pause_time_between_batches = kwargs.get('pause_time_between_batches', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_policy_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_policy_py3.py new file mode 100644 index 000000000000..e698a382f112 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_policy_py3.py @@ -0,0 +1,63 @@ +# 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 msrest.serialization import Model + + +class RollingUpgradePolicy(Model): + """The configuration parameters used while performing a rolling upgrade. + + :param max_batch_instance_percent: The maximum percent of total virtual + machine instances that will be upgraded simultaneously by the rolling + upgrade in one batch. As this is a maximum, unhealthy instances in + previous or future batches can cause the percentage of instances in a + batch to decrease to ensure higher reliability. The default value for this + parameter is 20%. + :type max_batch_instance_percent: int + :param max_unhealthy_instance_percent: The maximum percentage of the total + virtual machine instances in the scale set that can be simultaneously + unhealthy, either as a result of being upgraded, or by being found in an + unhealthy state by the virtual machine health checks before the rolling + upgrade aborts. This constraint will be checked prior to starting any + batch. The default value for this parameter is 20%. + :type max_unhealthy_instance_percent: int + :param max_unhealthy_upgraded_instance_percent: The maximum percentage of + upgraded virtual machine instances that can be found to be in an unhealthy + state. This check will happen after each batch is upgraded. If this + percentage is ever exceeded, the rolling update aborts. The default value + for this parameter is 20%. + :type max_unhealthy_upgraded_instance_percent: int + :param pause_time_between_batches: The wait time between completing the + update for all virtual machines in one batch and starting the next batch. + The time duration should be specified in ISO 8601 format. The default + value is 0 seconds (PT0S). + :type pause_time_between_batches: str + """ + + _validation = { + 'max_batch_instance_percent': {'maximum': 100, 'minimum': 5}, + 'max_unhealthy_instance_percent': {'maximum': 100, 'minimum': 5}, + 'max_unhealthy_upgraded_instance_percent': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'max_batch_instance_percent': {'key': 'maxBatchInstancePercent', 'type': 'int'}, + 'max_unhealthy_instance_percent': {'key': 'maxUnhealthyInstancePercent', 'type': 'int'}, + 'max_unhealthy_upgraded_instance_percent': {'key': 'maxUnhealthyUpgradedInstancePercent', 'type': 'int'}, + 'pause_time_between_batches': {'key': 'pauseTimeBetweenBatches', 'type': 'str'}, + } + + def __init__(self, *, max_batch_instance_percent: int=None, max_unhealthy_instance_percent: int=None, max_unhealthy_upgraded_instance_percent: int=None, pause_time_between_batches: str=None, **kwargs) -> None: + super(RollingUpgradePolicy, self).__init__(**kwargs) + self.max_batch_instance_percent = max_batch_instance_percent + self.max_unhealthy_instance_percent = max_unhealthy_instance_percent + self.max_unhealthy_upgraded_instance_percent = max_unhealthy_upgraded_instance_percent + self.pause_time_between_batches = pause_time_between_batches diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_progress_info.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_progress_info.py index 01d1624f1f4f..87e40590e275 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_progress_info.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_progress_info.py @@ -47,8 +47,8 @@ class RollingUpgradeProgressInfo(Model): 'pending_instance_count': {'key': 'pendingInstanceCount', 'type': 'int'}, } - def __init__(self): - super(RollingUpgradeProgressInfo, self).__init__() + def __init__(self, **kwargs): + super(RollingUpgradeProgressInfo, self).__init__(**kwargs) self.successful_instance_count = None self.failed_instance_count = None self.in_progress_instance_count = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_progress_info_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_progress_info_py3.py new file mode 100644 index 000000000000..060abc3063b4 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_progress_info_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class RollingUpgradeProgressInfo(Model): + """Information about the number of virtual machine instances in each upgrade + state. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar successful_instance_count: The number of instances that have been + successfully upgraded. + :vartype successful_instance_count: int + :ivar failed_instance_count: The number of instances that have failed to + be upgraded successfully. + :vartype failed_instance_count: int + :ivar in_progress_instance_count: The number of instances that are + currently being upgraded. + :vartype in_progress_instance_count: int + :ivar pending_instance_count: The number of instances that have not yet + begun to be upgraded. + :vartype pending_instance_count: int + """ + + _validation = { + 'successful_instance_count': {'readonly': True}, + 'failed_instance_count': {'readonly': True}, + 'in_progress_instance_count': {'readonly': True}, + 'pending_instance_count': {'readonly': True}, + } + + _attribute_map = { + 'successful_instance_count': {'key': 'successfulInstanceCount', 'type': 'int'}, + 'failed_instance_count': {'key': 'failedInstanceCount', 'type': 'int'}, + 'in_progress_instance_count': {'key': 'inProgressInstanceCount', 'type': 'int'}, + 'pending_instance_count': {'key': 'pendingInstanceCount', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(RollingUpgradeProgressInfo, self).__init__(**kwargs) + self.successful_instance_count = None + self.failed_instance_count = None + self.in_progress_instance_count = None + self.pending_instance_count = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_running_status.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_running_status.py index 01e837ff3ddc..e0ad273c569d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_running_status.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_running_status.py @@ -46,8 +46,8 @@ class RollingUpgradeRunningStatus(Model): 'last_action_time': {'key': 'lastActionTime', 'type': 'iso-8601'}, } - def __init__(self): - super(RollingUpgradeRunningStatus, self).__init__() + def __init__(self, **kwargs): + super(RollingUpgradeRunningStatus, self).__init__(**kwargs) self.code = None self.start_time = None self.last_action = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_running_status_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_running_status_py3.py new file mode 100644 index 000000000000..dfc9888b3922 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_running_status_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class RollingUpgradeRunningStatus(Model): + """Information about the current running state of the overall upgrade. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Code indicating the current status of the upgrade. Possible + values include: 'RollingForward', 'Cancelled', 'Completed', 'Faulted' + :vartype code: str or + ~azure.mgmt.compute.v2017_03_30.models.RollingUpgradeStatusCode + :ivar start_time: Start time of the upgrade. + :vartype start_time: datetime + :ivar last_action: The last action performed on the rolling upgrade. + Possible values include: 'Start', 'Cancel' + :vartype last_action: str or + ~azure.mgmt.compute.v2017_03_30.models.RollingUpgradeActionType + :ivar last_action_time: Last action time of the upgrade. + :vartype last_action_time: datetime + """ + + _validation = { + 'code': {'readonly': True}, + 'start_time': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_time': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'RollingUpgradeStatusCode'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'last_action': {'key': 'lastAction', 'type': 'RollingUpgradeActionType'}, + 'last_action_time': {'key': 'lastActionTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(RollingUpgradeRunningStatus, self).__init__(**kwargs) + self.code = None + self.start_time = None + self.last_action = None + self.last_action_time = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_status_info.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_status_info.py index a5620c88f269..6edf813e207b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_status_info.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_status_info.py @@ -18,13 +18,15 @@ class RollingUpgradeStatusInfo(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -66,8 +68,8 @@ class RollingUpgradeStatusInfo(Resource): 'error': {'key': 'properties.error', 'type': 'ApiError'}, } - def __init__(self, location, tags=None): - super(RollingUpgradeStatusInfo, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(RollingUpgradeStatusInfo, self).__init__(**kwargs) self.policy = None self.running_status = None self.progress = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_status_info_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_status_info_py3.py new file mode 100644 index 000000000000..bae19f30c775 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/rolling_upgrade_status_info_py3.py @@ -0,0 +1,76 @@ +# 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 .resource import Resource + + +class RollingUpgradeStatusInfo(Resource): + """The status of the latest virtual machine scale set rolling upgrade. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar policy: The rolling upgrade policies applied for this upgrade. + :vartype policy: + ~azure.mgmt.compute.v2017_03_30.models.RollingUpgradePolicy + :ivar running_status: Information about the current running state of the + overall upgrade. + :vartype running_status: + ~azure.mgmt.compute.v2017_03_30.models.RollingUpgradeRunningStatus + :ivar progress: Information about the number of virtual machine instances + in each upgrade state. + :vartype progress: + ~azure.mgmt.compute.v2017_03_30.models.RollingUpgradeProgressInfo + :ivar error: Error details for this upgrade, if there are any. + :vartype error: ~azure.mgmt.compute.v2017_03_30.models.ApiError + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'policy': {'readonly': True}, + 'running_status': {'readonly': True}, + 'progress': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'policy': {'key': 'properties.policy', 'type': 'RollingUpgradePolicy'}, + 'running_status': {'key': 'properties.runningStatus', 'type': 'RollingUpgradeRunningStatus'}, + 'progress': {'key': 'properties.progress', 'type': 'RollingUpgradeProgressInfo'}, + 'error': {'key': 'properties.error', 'type': 'ApiError'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(RollingUpgradeStatusInfo, self).__init__(location=location, tags=tags, **kwargs) + self.policy = None + self.running_status = None + self.progress = None + self.error = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_document.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_document.py index a46ce0ee1eb1..7d01415a6686 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_document.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_document.py @@ -15,19 +15,21 @@ class RunCommandDocument(RunCommandDocumentBase): """Describes the properties of a Run Command. - :param schema: The VM run command schema. + All required parameters must be populated in order to send to Azure. + + :param schema: Required. The VM run command schema. :type schema: str - :param id: The VM run command id. + :param id: Required. The VM run command id. :type id: str - :param os_type: The Operating System type. Possible values include: - 'Windows', 'Linux' + :param os_type: Required. The Operating System type. Possible values + include: 'Windows', 'Linux' :type os_type: str or ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemTypes - :param label: The VM run command label. + :param label: Required. The VM run command label. :type label: str - :param description: The VM run command description. + :param description: Required. The VM run command description. :type description: str - :param script: The script to be executed. + :param script: Required. The script to be executed. :type script: list[str] :param parameters: The parameters used by the script. :type parameters: @@ -53,7 +55,7 @@ class RunCommandDocument(RunCommandDocumentBase): 'parameters': {'key': 'parameters', 'type': '[RunCommandParameterDefinition]'}, } - def __init__(self, schema, id, os_type, label, description, script, parameters=None): - super(RunCommandDocument, self).__init__(schema=schema, id=id, os_type=os_type, label=label, description=description) - self.script = script - self.parameters = parameters + def __init__(self, **kwargs): + super(RunCommandDocument, self).__init__(**kwargs) + self.script = kwargs.get('script', None) + self.parameters = kwargs.get('parameters', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_document_base.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_document_base.py index 78d51f0924b4..b9df22a4daa7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_document_base.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_document_base.py @@ -15,17 +15,19 @@ class RunCommandDocumentBase(Model): """Describes the properties of a Run Command metadata. - :param schema: The VM run command schema. + All required parameters must be populated in order to send to Azure. + + :param schema: Required. The VM run command schema. :type schema: str - :param id: The VM run command id. + :param id: Required. The VM run command id. :type id: str - :param os_type: The Operating System type. Possible values include: - 'Windows', 'Linux' + :param os_type: Required. The Operating System type. Possible values + include: 'Windows', 'Linux' :type os_type: str or ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemTypes - :param label: The VM run command label. + :param label: Required. The VM run command label. :type label: str - :param description: The VM run command description. + :param description: Required. The VM run command description. :type description: str """ @@ -45,10 +47,10 @@ class RunCommandDocumentBase(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, schema, id, os_type, label, description): - super(RunCommandDocumentBase, self).__init__() - self.schema = schema - self.id = id - self.os_type = os_type - self.label = label - self.description = description + def __init__(self, **kwargs): + super(RunCommandDocumentBase, self).__init__(**kwargs) + self.schema = kwargs.get('schema', None) + self.id = kwargs.get('id', None) + self.os_type = kwargs.get('os_type', None) + self.label = kwargs.get('label', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_document_base_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_document_base_py3.py new file mode 100644 index 000000000000..91c55b1ad7f5 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_document_base_py3.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class RunCommandDocumentBase(Model): + """Describes the properties of a Run Command metadata. + + All required parameters must be populated in order to send to Azure. + + :param schema: Required. The VM run command schema. + :type schema: str + :param id: Required. The VM run command id. + :type id: str + :param os_type: Required. The Operating System type. Possible values + include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemTypes + :param label: Required. The VM run command label. + :type label: str + :param description: Required. The VM run command description. + :type description: str + """ + + _validation = { + 'schema': {'required': True}, + 'id': {'required': True}, + 'os_type': {'required': True}, + 'label': {'required': True}, + 'description': {'required': True}, + } + + _attribute_map = { + 'schema': {'key': '$schema', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'label': {'key': 'label', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, schema: str, id: str, os_type, label: str, description: str, **kwargs) -> None: + super(RunCommandDocumentBase, self).__init__(**kwargs) + self.schema = schema + self.id = id + self.os_type = os_type + self.label = label + self.description = description diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_document_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_document_py3.py new file mode 100644 index 000000000000..8148374fdfd1 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_document_py3.py @@ -0,0 +1,61 @@ +# 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 .run_command_document_base import RunCommandDocumentBase + + +class RunCommandDocument(RunCommandDocumentBase): + """Describes the properties of a Run Command. + + All required parameters must be populated in order to send to Azure. + + :param schema: Required. The VM run command schema. + :type schema: str + :param id: Required. The VM run command id. + :type id: str + :param os_type: Required. The Operating System type. Possible values + include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemTypes + :param label: Required. The VM run command label. + :type label: str + :param description: Required. The VM run command description. + :type description: str + :param script: Required. The script to be executed. + :type script: list[str] + :param parameters: The parameters used by the script. + :type parameters: + list[~azure.mgmt.compute.v2017_03_30.models.RunCommandParameterDefinition] + """ + + _validation = { + 'schema': {'required': True}, + 'id': {'required': True}, + 'os_type': {'required': True}, + 'label': {'required': True}, + 'description': {'required': True}, + 'script': {'required': True}, + } + + _attribute_map = { + 'schema': {'key': '$schema', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'label': {'key': 'label', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'script': {'key': 'script', 'type': '[str]'}, + 'parameters': {'key': 'parameters', 'type': '[RunCommandParameterDefinition]'}, + } + + def __init__(self, *, schema: str, id: str, os_type, label: str, description: str, script, parameters=None, **kwargs) -> None: + super(RunCommandDocument, self).__init__(schema=schema, id=id, os_type=os_type, label=label, description=description, **kwargs) + self.script = script + self.parameters = parameters diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_input.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_input.py index a55184914abb..b21071138d78 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_input.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_input.py @@ -15,7 +15,9 @@ class RunCommandInput(Model): """Capture Virtual Machine parameters. - :param command_id: The run command id. + All required parameters must be populated in order to send to Azure. + + :param command_id: Required. The run command id. :type command_id: str :param script: Optional. The script to be executed. When this value is given, the given script will override the default script of the command. @@ -35,8 +37,8 @@ class RunCommandInput(Model): 'parameters': {'key': 'parameters', 'type': '[RunCommandInputParameter]'}, } - def __init__(self, command_id, script=None, parameters=None): - super(RunCommandInput, self).__init__() - self.command_id = command_id - self.script = script - self.parameters = parameters + def __init__(self, **kwargs): + super(RunCommandInput, self).__init__(**kwargs) + self.command_id = kwargs.get('command_id', None) + self.script = kwargs.get('script', None) + self.parameters = kwargs.get('parameters', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_input_parameter.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_input_parameter.py index 6eb4db622454..cd76ad81bfa2 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_input_parameter.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_input_parameter.py @@ -15,9 +15,11 @@ class RunCommandInputParameter(Model): """Describes the properties of a run command parameter. - :param name: The run command parameter name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The run command parameter name. :type name: str - :param value: The run command parameter value. + :param value: Required. The run command parameter value. :type value: str """ @@ -31,7 +33,7 @@ class RunCommandInputParameter(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, name, value): - super(RunCommandInputParameter, self).__init__() - self.name = name - self.value = value + def __init__(self, **kwargs): + super(RunCommandInputParameter, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_input_parameter_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_input_parameter_py3.py new file mode 100644 index 000000000000..6013f038a1c3 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_input_parameter_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class RunCommandInputParameter(Model): + """Describes the properties of a run command parameter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The run command parameter name. + :type name: str + :param value: Required. The run command parameter value. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str, value: str, **kwargs) -> None: + super(RunCommandInputParameter, self).__init__(**kwargs) + self.name = name + self.value = value diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_input_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_input_py3.py new file mode 100644 index 000000000000..ea92282275ce --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_input_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RunCommandInput(Model): + """Capture Virtual Machine parameters. + + All required parameters must be populated in order to send to Azure. + + :param command_id: Required. The run command id. + :type command_id: str + :param script: Optional. The script to be executed. When this value is + given, the given script will override the default script of the command. + :type script: list[str] + :param parameters: The run command parameters. + :type parameters: + list[~azure.mgmt.compute.v2017_03_30.models.RunCommandInputParameter] + """ + + _validation = { + 'command_id': {'required': True}, + } + + _attribute_map = { + 'command_id': {'key': 'commandId', 'type': 'str'}, + 'script': {'key': 'script', 'type': '[str]'}, + 'parameters': {'key': 'parameters', 'type': '[RunCommandInputParameter]'}, + } + + def __init__(self, *, command_id: str, script=None, parameters=None, **kwargs) -> None: + super(RunCommandInput, self).__init__(**kwargs) + self.command_id = command_id + self.script = script + self.parameters = parameters diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_parameter_definition.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_parameter_definition.py index 1292feb3e9bd..e09f774d8241 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_parameter_definition.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_parameter_definition.py @@ -15,9 +15,11 @@ class RunCommandParameterDefinition(Model): """Describes the properties of a run command parameter. - :param name: The run command parameter name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The run command parameter name. :type name: str - :param type: The run command parameter type. + :param type: Required. The run command parameter type. :type type: str :param default_value: The run command parameter default value. :type default_value: str @@ -38,9 +40,9 @@ class RunCommandParameterDefinition(Model): 'required': {'key': 'required', 'type': 'bool'}, } - def __init__(self, name, type, default_value=None, required=False): - super(RunCommandParameterDefinition, self).__init__() - self.name = name - self.type = type - self.default_value = default_value - self.required = required + def __init__(self, **kwargs): + super(RunCommandParameterDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.default_value = kwargs.get('default_value', None) + self.required = kwargs.get('required', False) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_parameter_definition_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_parameter_definition_py3.py new file mode 100644 index 000000000000..e5fbc708f965 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_parameter_definition_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class RunCommandParameterDefinition(Model): + """Describes the properties of a run command parameter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The run command parameter name. + :type name: str + :param type: Required. The run command parameter type. + :type type: str + :param default_value: The run command parameter default value. + :type default_value: str + :param required: The run command parameter required. Default value: False + . + :type required: bool + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + 'required': {'key': 'required', 'type': 'bool'}, + } + + def __init__(self, *, name: str, type: str, default_value: str=None, required: bool=False, **kwargs) -> None: + super(RunCommandParameterDefinition, self).__init__(**kwargs) + self.name = name + self.type = type + self.default_value = default_value + self.required = required diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_result.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_result.py index aa5ada2ddd07..a72c4f194c8d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_result.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_result.py @@ -49,6 +49,6 @@ class RunCommandResult(OperationStatusResponse): 'output': {'key': 'properties.output', 'type': 'object'}, } - def __init__(self, output=None): - super(RunCommandResult, self).__init__() - self.output = output + def __init__(self, **kwargs): + super(RunCommandResult, self).__init__(**kwargs) + self.output = kwargs.get('output', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_result_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_result_py3.py new file mode 100644 index 000000000000..02fbd534c279 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/run_command_result_py3.py @@ -0,0 +1,54 @@ +# 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 .operation_status_response import OperationStatusResponse + + +class RunCommandResult(OperationStatusResponse): + """Run command operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation ID + :vartype name: str + :ivar status: Operation status + :vartype status: str + :ivar start_time: Start time of the operation + :vartype start_time: datetime + :ivar end_time: End time of the operation + :vartype end_time: datetime + :ivar error: Api error + :vartype error: ~azure.mgmt.compute.v2017_03_30.models.ApiError + :param output: Operation output data (raw JSON) + :type output: object + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + 'output': {'key': 'properties.output', 'type': 'object'}, + } + + def __init__(self, *, output=None, **kwargs) -> None: + super(RunCommandResult, self).__init__(, **kwargs) + self.output = output diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sku.py index 16755dc57b65..5c07709435e0 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sku.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sku.py @@ -31,8 +31,8 @@ class Sku(Model): 'capacity': {'key': 'capacity', 'type': 'long'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(Sku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sku_py3.py new file mode 100644 index 000000000000..f6bc74afaadc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sku_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class Sku(Model): + """Describes a virtual machine scale set sku. + + :param name: The sku name. + :type name: str + :param tier: Specifies the tier of virtual machines in a scale set.

    Possible Values:

    **Standard**

    **Basic** + :type tier: str + :param capacity: Specifies the number of virtual machines in the scale + set. + :type capacity: long + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'long'}, + } + + def __init__(self, *, name: str=None, tier: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/snapshot.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/snapshot.py index 46826529218c..be778fd923b7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/snapshot.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/snapshot.py @@ -18,13 +18,15 @@ class Snapshot(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -38,8 +40,8 @@ class Snapshot(Resource): 'Windows', 'Linux' :type os_type: str or ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemTypes - :param creation_data: Disk source information. CreationData information - cannot be changed after the disk has been created. + :param creation_data: Required. Disk source information. CreationData + information cannot be changed after the disk has been created. :type creation_data: ~azure.mgmt.compute.v2017_03_30.models.CreationData :param disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is @@ -81,13 +83,13 @@ class Snapshot(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, location, creation_data, tags=None, sku=None, os_type=None, disk_size_gb=None, encryption_settings=None): - super(Snapshot, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(Snapshot, self).__init__(**kwargs) self.managed_by = None - self.sku = sku + self.sku = kwargs.get('sku', None) self.time_created = None - self.os_type = os_type - self.creation_data = creation_data - self.disk_size_gb = disk_size_gb - self.encryption_settings = encryption_settings + self.os_type = kwargs.get('os_type', None) + self.creation_data = kwargs.get('creation_data', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings = kwargs.get('encryption_settings', None) self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/snapshot_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/snapshot_py3.py new file mode 100644 index 000000000000..efa9b70bfefe --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/snapshot_py3.py @@ -0,0 +1,95 @@ +# 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 .resource import Resource + + +class Snapshot(Resource): + """Snapshot 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 Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar managed_by: Unused. Always Null. + :vartype managed_by: str + :param sku: + :type sku: ~azure.mgmt.compute.v2017_03_30.models.DiskSku + :ivar time_created: The time when the disk was created. + :vartype time_created: datetime + :param os_type: The Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemTypes + :param creation_data: Required. Disk source information. CreationData + information cannot be changed after the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2017_03_30.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2017_03_30.models.EncryptionSettings + :ivar provisioning_state: The disk provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'managed_by': {'readonly': True}, + 'time_created': {'readonly': True}, + 'creation_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, creation_data, tags=None, sku=None, os_type=None, disk_size_gb: int=None, encryption_settings=None, **kwargs) -> None: + super(Snapshot, self).__init__(location=location, tags=tags, **kwargs) + self.managed_by = None + self.sku = sku + self.time_created = None + self.os_type = os_type + self.creation_data = creation_data + self.disk_size_gb = disk_size_gb + self.encryption_settings = encryption_settings + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/snapshot_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/snapshot_update.py index 06be0cadd70a..de7f5642a846 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/snapshot_update.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/snapshot_update.py @@ -42,8 +42,8 @@ class SnapshotUpdate(ResourceUpdate): 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, } - def __init__(self, tags=None, sku=None, os_type=None, disk_size_gb=None, encryption_settings=None): - super(SnapshotUpdate, self).__init__(tags=tags, sku=sku) - self.os_type = os_type - self.disk_size_gb = disk_size_gb - self.encryption_settings = encryption_settings + def __init__(self, **kwargs): + super(SnapshotUpdate, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings = kwargs.get('encryption_settings', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/snapshot_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/snapshot_update_py3.py new file mode 100644 index 000000000000..5890514da5aa --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/snapshot_update_py3.py @@ -0,0 +1,49 @@ +# 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 .resource_update import ResourceUpdate + + +class SnapshotUpdate(ResourceUpdate): + """Snapshot update resource. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: + :type sku: ~azure.mgmt.compute.v2017_03_30.models.DiskSku + :param os_type: the Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemTypes + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2017_03_30.models.EncryptionSettings + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + } + + def __init__(self, *, tags=None, sku=None, os_type=None, disk_size_gb: int=None, encryption_settings=None, **kwargs) -> None: + super(SnapshotUpdate, self).__init__(tags=tags, sku=sku, **kwargs) + self.os_type = os_type + self.disk_size_gb = disk_size_gb + self.encryption_settings = encryption_settings diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/source_vault.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/source_vault.py index 5f242d159d4c..9b16302ebbfb 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/source_vault.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/source_vault.py @@ -24,6 +24,6 @@ class SourceVault(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SourceVault, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SourceVault, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/source_vault_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/source_vault_py3.py new file mode 100644 index 000000000000..13eea5461390 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/source_vault_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SourceVault(Model): + """The vault id is an Azure Resource Manager Resoure id in the form + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}. + + :param id: Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SourceVault, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/ssh_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/ssh_configuration.py index 120fd437d060..e5c7e9b2cabd 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/ssh_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/ssh_configuration.py @@ -25,6 +25,6 @@ class SshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[SshPublicKey]'}, } - def __init__(self, public_keys=None): - super(SshConfiguration, self).__init__() - self.public_keys = public_keys + def __init__(self, **kwargs): + super(SshConfiguration, self).__init__(**kwargs) + self.public_keys = kwargs.get('public_keys', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/ssh_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/ssh_configuration_py3.py new file mode 100644 index 000000000000..09fe7514dd72 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/ssh_configuration_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SshConfiguration(Model): + """SSH configuration for Linux based VMs running on Azure. + + :param public_keys: The list of SSH public keys used to authenticate with + linux based VMs. + :type public_keys: + list[~azure.mgmt.compute.v2017_03_30.models.SshPublicKey] + """ + + _attribute_map = { + 'public_keys': {'key': 'publicKeys', 'type': '[SshPublicKey]'}, + } + + def __init__(self, *, public_keys=None, **kwargs) -> None: + super(SshConfiguration, self).__init__(**kwargs) + self.public_keys = public_keys diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/ssh_public_key.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/ssh_public_key.py index 2fe6756641cb..122e0d3b9fdd 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/ssh_public_key.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/ssh_public_key.py @@ -33,7 +33,7 @@ class SshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, path=None, key_data=None): - super(SshPublicKey, self).__init__() - self.path = path - self.key_data = key_data + def __init__(self, **kwargs): + super(SshPublicKey, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.key_data = kwargs.get('key_data', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/ssh_public_key_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/ssh_public_key_py3.py new file mode 100644 index 000000000000..b16ee085b36b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/ssh_public_key_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class SshPublicKey(Model): + """Contains information about SSH certificate public key and the path on the + Linux VM where the public key is placed. + + :param 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 + :type path: str + :param 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/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + :type key_data: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'key_data': {'key': 'keyData', 'type': 'str'}, + } + + def __init__(self, *, path: str=None, key_data: str=None, **kwargs) -> None: + super(SshPublicKey, self).__init__(**kwargs) + self.path = path + self.key_data = key_data diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/storage_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/storage_profile.py index f10bdc762b45..300d5bc464f7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/storage_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/storage_profile.py @@ -40,8 +40,8 @@ class StorageProfile(Model): 'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'}, } - def __init__(self, image_reference=None, os_disk=None, data_disks=None): - super(StorageProfile, self).__init__() - self.image_reference = image_reference - self.os_disk = os_disk - self.data_disks = data_disks + def __init__(self, **kwargs): + super(StorageProfile, self).__init__(**kwargs) + self.image_reference = kwargs.get('image_reference', None) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/storage_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/storage_profile_py3.py new file mode 100644 index 000000000000..1a256407486c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/storage_profile_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class StorageProfile(Model): + """Specifies the storage settings for the virtual machine disks. + + :param 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. + :type image_reference: + ~azure.mgmt.compute.v2017_03_30.models.ImageReference + :param os_disk: Specifies information about the operating system disk used + by the virtual machine.

    For more information about disks, see + [About disks and VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type os_disk: ~azure.mgmt.compute.v2017_03_30.models.OSDisk + :param data_disks: Specifies the parameters that are used to add a data + disk to a virtual machine.

    For more information about disks, see + [About disks and VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type data_disks: list[~azure.mgmt.compute.v2017_03_30.models.DataDisk] + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'OSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'}, + } + + def __init__(self, *, image_reference=None, os_disk=None, data_disks=None, **kwargs) -> None: + super(StorageProfile, self).__init__(**kwargs) + self.image_reference = image_reference + self.os_disk = os_disk + self.data_disks = data_disks diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sub_resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sub_resource.py index b32875f54c8e..11e092cc6ff5 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sub_resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sub_resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sub_resource_py3.py new file mode 100644 index 000000000000..29e5afee38f9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class SubResource(Model): + """SubResource. + + :param id: Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sub_resource_read_only.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sub_resource_read_only.py index 308c52a8420b..4a0ec466c0d4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sub_resource_read_only.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sub_resource_read_only.py @@ -30,6 +30,6 @@ class SubResourceReadOnly(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self): - super(SubResourceReadOnly, self).__init__() + def __init__(self, **kwargs): + super(SubResourceReadOnly, self).__init__(**kwargs) self.id = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sub_resource_read_only_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sub_resource_read_only_py3.py new file mode 100644 index 000000000000..cb918e9a2ac6 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/sub_resource_read_only_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class SubResourceReadOnly(Model): + """SubResourceReadOnly. + + 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) -> None: + super(SubResourceReadOnly, self).__init__(**kwargs) + self.id = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/update_resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/update_resource.py index 404aae42f184..b1d2898ff082 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/update_resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/update_resource.py @@ -23,6 +23,6 @@ class UpdateResource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, tags=None): - super(UpdateResource, self).__init__() - self.tags = tags + def __init__(self, **kwargs): + super(UpdateResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/update_resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/update_resource_py3.py new file mode 100644 index 000000000000..c06c17c124d9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/update_resource_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class UpdateResource(Model): + """The Update Resource model definition. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(UpdateResource, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/upgrade_policy.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/upgrade_policy.py index 0b3c3e6dfc80..f80408916ab5 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/upgrade_policy.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/upgrade_policy.py @@ -38,8 +38,8 @@ class UpgradePolicy(Model): 'automatic_os_upgrade': {'key': 'automaticOSUpgrade', 'type': 'bool'}, } - def __init__(self, mode=None, rolling_upgrade_policy=None, automatic_os_upgrade=None): - super(UpgradePolicy, self).__init__() - self.mode = mode - self.rolling_upgrade_policy = rolling_upgrade_policy - self.automatic_os_upgrade = automatic_os_upgrade + def __init__(self, **kwargs): + super(UpgradePolicy, self).__init__(**kwargs) + self.mode = kwargs.get('mode', None) + self.rolling_upgrade_policy = kwargs.get('rolling_upgrade_policy', None) + self.automatic_os_upgrade = kwargs.get('automatic_os_upgrade', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/upgrade_policy_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/upgrade_policy_py3.py new file mode 100644 index 000000000000..5ebb99df5bff --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/upgrade_policy_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class UpgradePolicy(Model): + """Describes an upgrade policy - automatic, manual, or rolling. + + :param mode: Specifies the mode of an upgrade to virtual machines in the + scale set.

    Possible values are:

    **Manual** - You + control the application of updates to virtual machines in the scale set. + You do this by using the manualUpgrade action.

    **Automatic** - + All virtual machines in the scale set are automatically updated at the + same time. Possible values include: 'Automatic', 'Manual', 'Rolling' + :type mode: str or ~azure.mgmt.compute.v2017_03_30.models.UpgradeMode + :param rolling_upgrade_policy: The configuration parameters used while + performing a rolling upgrade. + :type rolling_upgrade_policy: + ~azure.mgmt.compute.v2017_03_30.models.RollingUpgradePolicy + :param automatic_os_upgrade: Whether OS upgrades should automatically be + applied to scale set instances in a rolling fashion when a newer version + of the image becomes available. + :type automatic_os_upgrade: bool + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'UpgradeMode'}, + 'rolling_upgrade_policy': {'key': 'rollingUpgradePolicy', 'type': 'RollingUpgradePolicy'}, + 'automatic_os_upgrade': {'key': 'automaticOSUpgrade', 'type': 'bool'}, + } + + def __init__(self, *, mode=None, rolling_upgrade_policy=None, automatic_os_upgrade: bool=None, **kwargs) -> None: + super(UpgradePolicy, self).__init__(**kwargs) + self.mode = mode + self.rolling_upgrade_policy = rolling_upgrade_policy + self.automatic_os_upgrade = automatic_os_upgrade diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/usage.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/usage.py index d7bb82255ab5..810c694c9b8c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/usage.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/usage.py @@ -18,14 +18,16 @@ class Usage(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar unit: An enum describing the unit of usage measurement. Default - value: "Count" . + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of usage measurement. + Default value: "Count" . :vartype unit: str - :param current_value: The current usage of the resource. + :param current_value: Required. The current usage of the resource. :type current_value: int - :param limit: The maximum permitted usage of the resource. + :param limit: Required. The maximum permitted usage of the resource. :type limit: long - :param name: The name of the type of usage. + :param name: Required. The name of the type of usage. :type name: ~azure.mgmt.compute.v2017_03_30.models.UsageName """ @@ -45,8 +47,8 @@ class Usage(Model): unit = "Count" - def __init__(self, current_value, limit, name): - super(Usage, self).__init__() - self.current_value = current_value - self.limit = limit - self.name = name + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/usage_name.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/usage_name.py index 799c1f896da3..e2560936493e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/usage_name.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/usage_name.py @@ -26,7 +26,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(UsageName, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/usage_name_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/usage_name_py3.py new file mode 100644 index 000000000000..ad0b77459f75 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class UsageName(Model): + """The Usage Names. + + :param value: The name of the resource. + :type value: str + :param localized_value: The localized name of the resource. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/usage_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/usage_py3.py new file mode 100644 index 000000000000..64100ce07d54 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/usage_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class Usage(Model): + """Describes Compute Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of usage measurement. + Default value: "Count" . + :vartype unit: str + :param current_value: Required. The current usage of the resource. + :type current_value: int + :param limit: Required. The maximum permitted usage of the resource. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.compute.v2017_03_30.models.UsageName + """ + + _validation = { + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__(self, *, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/vault_certificate.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/vault_certificate.py index 8d4d05955de4..b173def6f820 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/vault_certificate.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/vault_certificate.py @@ -40,7 +40,7 @@ class VaultCertificate(Model): 'certificate_store': {'key': 'certificateStore', 'type': 'str'}, } - def __init__(self, certificate_url=None, certificate_store=None): - super(VaultCertificate, self).__init__() - self.certificate_url = certificate_url - self.certificate_store = certificate_store + def __init__(self, **kwargs): + super(VaultCertificate, self).__init__(**kwargs) + self.certificate_url = kwargs.get('certificate_url', None) + self.certificate_store = kwargs.get('certificate_store', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/vault_certificate_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/vault_certificate_py3.py new file mode 100644 index 000000000000..eda5ba1c3f1d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/vault_certificate_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VaultCertificate(Model): + """Describes a single certificate reference in a Key Vault, and where the + certificate should reside on the VM. + + :param 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](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + In this case, your certificate needs to be It is the Base64 encoding of + the following JSON Object which is encoded in UTF-8:

    {
    + "data":"",
    "dataType":"pfx",
    + "password":""
    } + :type certificate_url: str + :param 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 .crt + for the X509 certificate file and .prv for private + key. Both of these files are .pem formatted. + :type certificate_store: str + """ + + _attribute_map = { + 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, + 'certificate_store': {'key': 'certificateStore', 'type': 'str'}, + } + + def __init__(self, *, certificate_url: str=None, certificate_store: str=None, **kwargs) -> None: + super(VaultCertificate, self).__init__(**kwargs) + self.certificate_url = certificate_url + self.certificate_store = certificate_store diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/vault_secret_group.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/vault_secret_group.py index 1a259a5f8d58..2001e0f4d9a6 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/vault_secret_group.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/vault_secret_group.py @@ -29,7 +29,7 @@ class VaultSecretGroup(Model): 'vault_certificates': {'key': 'vaultCertificates', 'type': '[VaultCertificate]'}, } - def __init__(self, source_vault=None, vault_certificates=None): - super(VaultSecretGroup, self).__init__() - self.source_vault = source_vault - self.vault_certificates = vault_certificates + def __init__(self, **kwargs): + super(VaultSecretGroup, self).__init__(**kwargs) + self.source_vault = kwargs.get('source_vault', None) + self.vault_certificates = kwargs.get('vault_certificates', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/vault_secret_group_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/vault_secret_group_py3.py new file mode 100644 index 000000000000..21f0c1c281d8 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/vault_secret_group_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class VaultSecretGroup(Model): + """Describes a set of certificates which are all in the same Key Vault. + + :param source_vault: The relative URL of the Key Vault containing all of + the certificates in VaultCertificates. + :type source_vault: ~azure.mgmt.compute.v2017_03_30.models.SubResource + :param vault_certificates: The list of key vault references in SourceVault + which contain certificates. + :type vault_certificates: + list[~azure.mgmt.compute.v2017_03_30.models.VaultCertificate] + """ + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, + 'vault_certificates': {'key': 'vaultCertificates', 'type': '[VaultCertificate]'}, + } + + def __init__(self, *, source_vault=None, vault_certificates=None, **kwargs) -> None: + super(VaultSecretGroup, self).__init__(**kwargs) + self.source_vault = source_vault + self.vault_certificates = vault_certificates diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_hard_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_hard_disk.py index af1725d302af..5e3ad9dea7d4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_hard_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_hard_disk.py @@ -23,6 +23,6 @@ class VirtualHardDisk(Model): 'uri': {'key': 'uri', 'type': 'str'}, } - def __init__(self, uri=None): - super(VirtualHardDisk, self).__init__() - self.uri = uri + def __init__(self, **kwargs): + super(VirtualHardDisk, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_hard_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_hard_disk_py3.py new file mode 100644 index 000000000000..9c069b95f084 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_hard_disk_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class VirtualHardDisk(Model): + """Describes the uri of a disk. + + :param uri: Specifies the virtual hard disk's uri. + :type uri: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__(self, *, uri: str=None, **kwargs) -> None: + super(VirtualHardDisk, self).__init__(**kwargs) + self.uri = uri diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine.py index d4052612ceec..91200e1f8905 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine.py @@ -18,13 +18,15 @@ class VirtualMachine(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -130,19 +132,19 @@ class VirtualMachine(Resource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, location, tags=None, plan=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type=None, identity=None, zones=None): - super(VirtualMachine, self).__init__(location=location, tags=tags) - self.plan = plan - self.hardware_profile = hardware_profile - self.storage_profile = storage_profile - self.os_profile = os_profile - self.network_profile = network_profile - self.diagnostics_profile = diagnostics_profile - self.availability_set = availability_set + def __init__(self, **kwargs): + super(VirtualMachine, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.os_profile = kwargs.get('os_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.availability_set = kwargs.get('availability_set', None) self.provisioning_state = None self.instance_view = None - self.license_type = license_type + self.license_type = kwargs.get('license_type', None) self.vm_id = None self.resources = None - self.identity = identity - self.zones = zones + self.identity = kwargs.get('identity', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_agent_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_agent_instance_view.py index 9f8e26f5acb7..a711ec14f83d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_agent_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_agent_instance_view.py @@ -32,8 +32,8 @@ class VirtualMachineAgentInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, vm_agent_version=None, extension_handlers=None, statuses=None): - super(VirtualMachineAgentInstanceView, self).__init__() - self.vm_agent_version = vm_agent_version - self.extension_handlers = extension_handlers - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineAgentInstanceView, self).__init__(**kwargs) + self.vm_agent_version = kwargs.get('vm_agent_version', None) + self.extension_handlers = kwargs.get('extension_handlers', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_agent_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_agent_instance_view_py3.py new file mode 100644 index 000000000000..9925dfec860b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_agent_instance_view_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineAgentInstanceView(Model): + """The instance view of the VM Agent running on the virtual machine. + + :param vm_agent_version: The VM Agent full version. + :type vm_agent_version: str + :param extension_handlers: The virtual machine extension handler instance + view. + :type extension_handlers: + list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtensionHandlerInstanceView] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2017_03_30.models.InstanceViewStatus] + """ + + _attribute_map = { + 'vm_agent_version': {'key': 'vmAgentVersion', 'type': 'str'}, + 'extension_handlers': {'key': 'extensionHandlers', 'type': '[VirtualMachineExtensionHandlerInstanceView]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, vm_agent_version: str=None, extension_handlers=None, statuses=None, **kwargs) -> None: + super(VirtualMachineAgentInstanceView, self).__init__(**kwargs) + self.vm_agent_version = vm_agent_version + self.extension_handlers = extension_handlers + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_capture_parameters.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_capture_parameters.py index b406f387ffed..4e6ffbea7a4f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_capture_parameters.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_capture_parameters.py @@ -15,12 +15,15 @@ class VirtualMachineCaptureParameters(Model): """Capture Virtual Machine parameters. - :param vhd_prefix: The captured virtual hard disk's name prefix. + All required parameters must be populated in order to send to Azure. + + :param vhd_prefix: Required. The captured virtual hard disk's name prefix. :type vhd_prefix: str - :param destination_container_name: The destination container name. + :param destination_container_name: Required. The destination container + name. :type destination_container_name: str - :param overwrite_vhds: Specifies whether to overwrite the destination - virtual hard disk, in case of conflict. + :param overwrite_vhds: Required. Specifies whether to overwrite the + destination virtual hard disk, in case of conflict. :type overwrite_vhds: bool """ @@ -36,8 +39,8 @@ class VirtualMachineCaptureParameters(Model): 'overwrite_vhds': {'key': 'overwriteVhds', 'type': 'bool'}, } - def __init__(self, vhd_prefix, destination_container_name, overwrite_vhds): - super(VirtualMachineCaptureParameters, self).__init__() - self.vhd_prefix = vhd_prefix - self.destination_container_name = destination_container_name - self.overwrite_vhds = overwrite_vhds + def __init__(self, **kwargs): + super(VirtualMachineCaptureParameters, self).__init__(**kwargs) + self.vhd_prefix = kwargs.get('vhd_prefix', None) + self.destination_container_name = kwargs.get('destination_container_name', None) + self.overwrite_vhds = kwargs.get('overwrite_vhds', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_capture_parameters_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_capture_parameters_py3.py new file mode 100644 index 000000000000..1866cdc23300 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_capture_parameters_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineCaptureParameters(Model): + """Capture Virtual Machine parameters. + + All required parameters must be populated in order to send to Azure. + + :param vhd_prefix: Required. The captured virtual hard disk's name prefix. + :type vhd_prefix: str + :param destination_container_name: Required. The destination container + name. + :type destination_container_name: str + :param overwrite_vhds: Required. Specifies whether to overwrite the + destination virtual hard disk, in case of conflict. + :type overwrite_vhds: bool + """ + + _validation = { + 'vhd_prefix': {'required': True}, + 'destination_container_name': {'required': True}, + 'overwrite_vhds': {'required': True}, + } + + _attribute_map = { + 'vhd_prefix': {'key': 'vhdPrefix', 'type': 'str'}, + 'destination_container_name': {'key': 'destinationContainerName', 'type': 'str'}, + 'overwrite_vhds': {'key': 'overwriteVhds', 'type': 'bool'}, + } + + def __init__(self, *, vhd_prefix: str, destination_container_name: str, overwrite_vhds: bool, **kwargs) -> None: + super(VirtualMachineCaptureParameters, self).__init__(**kwargs) + self.vhd_prefix = vhd_prefix + self.destination_container_name = destination_container_name + self.overwrite_vhds = overwrite_vhds diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_capture_result.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_capture_result.py index 95e26a427e83..2b0df7406a34 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_capture_result.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_capture_result.py @@ -26,6 +26,6 @@ class VirtualMachineCaptureResult(SubResource): 'output': {'key': 'properties.output', 'type': 'object'}, } - def __init__(self, id=None, output=None): - super(VirtualMachineCaptureResult, self).__init__(id=id) - self.output = output + def __init__(self, **kwargs): + super(VirtualMachineCaptureResult, self).__init__(**kwargs) + self.output = kwargs.get('output', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_capture_result_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_capture_result_py3.py new file mode 100644 index 000000000000..da449b8e9154 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_capture_result_py3.py @@ -0,0 +1,31 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineCaptureResult(SubResource): + """Resource Id. + + :param id: Resource Id + :type id: str + :param output: Operation output data (raw JSON) + :type output: object + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'output': {'key': 'properties.output', 'type': 'object'}, + } + + def __init__(self, *, id: str=None, output=None, **kwargs) -> None: + super(VirtualMachineCaptureResult, self).__init__(id=id, **kwargs) + self.output = output diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension.py index 1145d45ad01f..acca6db783aa 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension.py @@ -18,13 +18,15 @@ class VirtualMachineExtension(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -82,14 +84,14 @@ class VirtualMachineExtension(Resource): 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineExtensionInstanceView'}, } - def __init__(self, location, tags=None, force_update_tag=None, publisher=None, virtual_machine_extension_type=None, type_handler_version=None, auto_upgrade_minor_version=None, settings=None, protected_settings=None, instance_view=None): - super(VirtualMachineExtension, self).__init__(location=location, tags=tags) - self.force_update_tag = force_update_tag - self.publisher = publisher - self.virtual_machine_extension_type = virtual_machine_extension_type - self.type_handler_version = type_handler_version - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings + def __init__(self, **kwargs): + super(VirtualMachineExtension, self).__init__(**kwargs) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.virtual_machine_extension_type = kwargs.get('virtual_machine_extension_type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) self.provisioning_state = None - self.instance_view = instance_view + self.instance_view = kwargs.get('instance_view', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_handler_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_handler_instance_view.py index 6005246552d3..ce1652f57296 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_handler_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_handler_instance_view.py @@ -30,8 +30,8 @@ class VirtualMachineExtensionHandlerInstanceView(Model): 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, } - def __init__(self, type=None, type_handler_version=None, status=None): - super(VirtualMachineExtensionHandlerInstanceView, self).__init__() - self.type = type - self.type_handler_version = type_handler_version - self.status = status + def __init__(self, **kwargs): + super(VirtualMachineExtensionHandlerInstanceView, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.status = kwargs.get('status', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_handler_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_handler_instance_view_py3.py new file mode 100644 index 000000000000..8cc721eca97b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_handler_instance_view_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineExtensionHandlerInstanceView(Model): + """The instance view of a virtual machine extension handler. + + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param status: The extension handler status. + :type status: ~azure.mgmt.compute.v2017_03_30.models.InstanceViewStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, + } + + def __init__(self, *, type: str=None, type_handler_version: str=None, status=None, **kwargs) -> None: + super(VirtualMachineExtensionHandlerInstanceView, self).__init__(**kwargs) + self.type = type + self.type_handler_version = type_handler_version + self.status = status diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_image.py index 7614699a78da..7273e2b84754 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_image.py @@ -18,23 +18,26 @@ class VirtualMachineExtensionImage(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param operating_system: The operating system this extension supports. - :type operating_system: str - :param compute_role: The type of role (IaaS or PaaS) this extension + :param operating_system: Required. The operating system this extension supports. + :type operating_system: str + :param compute_role: Required. The type of role (IaaS or PaaS) this + extension supports. :type compute_role: str - :param handler_schema: The schema defined by publisher, where extension - consumers should provide settings in a matching schema. + :param handler_schema: Required. The schema defined by publisher, where + extension consumers should provide settings in a matching schema. :type handler_schema: str :param vm_scale_set_enabled: Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but @@ -69,10 +72,10 @@ class VirtualMachineExtensionImage(Resource): 'supports_multiple_extensions': {'key': 'properties.supportsMultipleExtensions', 'type': 'bool'}, } - def __init__(self, location, operating_system, compute_role, handler_schema, tags=None, vm_scale_set_enabled=None, supports_multiple_extensions=None): - super(VirtualMachineExtensionImage, self).__init__(location=location, tags=tags) - self.operating_system = operating_system - self.compute_role = compute_role - self.handler_schema = handler_schema - self.vm_scale_set_enabled = vm_scale_set_enabled - self.supports_multiple_extensions = supports_multiple_extensions + def __init__(self, **kwargs): + super(VirtualMachineExtensionImage, self).__init__(**kwargs) + self.operating_system = kwargs.get('operating_system', None) + self.compute_role = kwargs.get('compute_role', None) + self.handler_schema = kwargs.get('handler_schema', None) + self.vm_scale_set_enabled = kwargs.get('vm_scale_set_enabled', None) + self.supports_multiple_extensions = kwargs.get('supports_multiple_extensions', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_image_py3.py new file mode 100644 index 000000000000..217accab02f0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_image_py3.py @@ -0,0 +1,81 @@ +# 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 .resource import Resource + + +class VirtualMachineExtensionImage(Resource): + """Describes a Virtual Machine Extension Image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param operating_system: Required. The operating system this extension + supports. + :type operating_system: str + :param compute_role: Required. The type of role (IaaS or PaaS) this + extension supports. + :type compute_role: str + :param handler_schema: Required. The schema defined by publisher, where + extension consumers should provide settings in a matching schema. + :type handler_schema: str + :param vm_scale_set_enabled: Whether the extension can be used on xRP + VMScaleSets. By default existing extensions are usable on scalesets, but + there might be cases where a publisher wants to explicitly indicate the + extension is only enabled for CRP VMs but not VMSS. + :type vm_scale_set_enabled: bool + :param supports_multiple_extensions: Whether the handler can support + multiple extensions. + :type supports_multiple_extensions: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'operating_system': {'required': True}, + 'compute_role': {'required': True}, + 'handler_schema': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'operating_system': {'key': 'properties.operatingSystem', 'type': 'str'}, + 'compute_role': {'key': 'properties.computeRole', 'type': 'str'}, + 'handler_schema': {'key': 'properties.handlerSchema', 'type': 'str'}, + 'vm_scale_set_enabled': {'key': 'properties.vmScaleSetEnabled', 'type': 'bool'}, + 'supports_multiple_extensions': {'key': 'properties.supportsMultipleExtensions', 'type': 'bool'}, + } + + def __init__(self, *, location: str, operating_system: str, compute_role: str, handler_schema: str, tags=None, vm_scale_set_enabled: bool=None, supports_multiple_extensions: bool=None, **kwargs) -> None: + super(VirtualMachineExtensionImage, self).__init__(location=location, tags=tags, **kwargs) + self.operating_system = operating_system + self.compute_role = compute_role + self.handler_schema = handler_schema + self.vm_scale_set_enabled = vm_scale_set_enabled + self.supports_multiple_extensions = supports_multiple_extensions diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_instance_view.py index 6468a0600bf5..911d11800a27 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_instance_view.py @@ -38,10 +38,10 @@ class VirtualMachineExtensionInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, name=None, type=None, type_handler_version=None, substatuses=None, statuses=None): - super(VirtualMachineExtensionInstanceView, self).__init__() - self.name = name - self.type = type - self.type_handler_version = type_handler_version - self.substatuses = substatuses - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineExtensionInstanceView, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.substatuses = kwargs.get('substatuses', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_instance_view_py3.py new file mode 100644 index 000000000000..8a463c3bfe1c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_instance_view_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineExtensionInstanceView(Model): + """The instance view of a virtual machine extension. + + :param name: The virtual machine extension name. + :type name: str + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param substatuses: The resource status information. + :type substatuses: + list[~azure.mgmt.compute.v2017_03_30.models.InstanceViewStatus] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2017_03_30.models.InstanceViewStatus] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'substatuses': {'key': 'substatuses', 'type': '[InstanceViewStatus]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, name: str=None, type: str=None, type_handler_version: str=None, substatuses=None, statuses=None, **kwargs) -> None: + super(VirtualMachineExtensionInstanceView, self).__init__(**kwargs) + self.name = name + self.type = type + self.type_handler_version = type_handler_version + self.substatuses = substatuses + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_py3.py new file mode 100644 index 000000000000..90ac643e6af3 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_extension_py3.py @@ -0,0 +1,97 @@ +# 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 .resource import Resource + + +class VirtualMachineExtension(Resource): + """Describes a Virtual Machine Extension. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param force_update_tag: How the extension handler should be forced to + update even if the extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param virtual_machine_extension_type: Specifies the type of the + extension; an example is "CustomScriptExtension". + :type virtual_machine_extension_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either + protectedSettings or protectedSettingsFromKeyVault or no protected + settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :param instance_view: The virtual machine extension instance view. + :type instance_view: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtensionInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'virtual_machine_extension_type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineExtensionInstanceView'}, + } + + def __init__(self, *, location: str, tags=None, force_update_tag: str=None, publisher: str=None, virtual_machine_extension_type: str=None, type_handler_version: str=None, auto_upgrade_minor_version: bool=None, settings=None, protected_settings=None, instance_view=None, **kwargs) -> None: + super(VirtualMachineExtension, self).__init__(location=location, tags=tags, **kwargs) + self.force_update_tag = force_update_tag + self.publisher = publisher + self.virtual_machine_extension_type = virtual_machine_extension_type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None + self.instance_view = instance_view diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_health_status.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_health_status.py index 430aca5066dd..3e090308f6e4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_health_status.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_health_status.py @@ -30,6 +30,6 @@ class VirtualMachineHealthStatus(Model): 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, } - def __init__(self): - super(VirtualMachineHealthStatus, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineHealthStatus, self).__init__(**kwargs) self.status = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_health_status_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_health_status_py3.py new file mode 100644 index 000000000000..b8259077b098 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_health_status_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineHealthStatus(Model): + """The health status of the VM. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The health status information for the VM. + :vartype status: ~azure.mgmt.compute.v2017_03_30.models.InstanceViewStatus + """ + + _validation = { + 'status': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineHealthStatus, self).__init__(**kwargs) + self.status = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_identity.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_identity.py index 206c68c73457..c80cf2eb3930 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_identity.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_identity.py @@ -40,8 +40,8 @@ class VirtualMachineIdentity(Model): 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, } - def __init__(self, type=None): - super(VirtualMachineIdentity, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = type + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_identity_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_identity_py3.py new file mode 100644 index 000000000000..b12f77bea153 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_identity_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineIdentity(Model): + """Identity for the virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of virtual machine identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the virtual machine. + :vartype tenant_id: str + :param type: The type of identity used for the virtual machine. Currently, + the only supported type is 'SystemAssigned', which implicitly creates an + identity. Possible values include: 'SystemAssigned' + :type type: str or + ~azure.mgmt.compute.v2017_03_30.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(VirtualMachineIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_image.py index cdf345460ef4..2d2fd671b549 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_image.py @@ -15,11 +15,13 @@ class VirtualMachineImage(VirtualMachineImageResource): """Describes a Virtual Machine Image. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The name of the resource. + :param name: Required. The name of the resource. :type name: str - :param location: The supported Azure location of the resource. + :param location: Required. The supported Azure location of the resource. :type location: str :param tags: Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your @@ -50,8 +52,8 @@ class VirtualMachineImage(VirtualMachineImageResource): 'data_disk_images': {'key': 'properties.dataDiskImages', 'type': '[DataDiskImage]'}, } - def __init__(self, name, location, id=None, tags=None, plan=None, os_disk_image=None, data_disk_images=None): - super(VirtualMachineImage, self).__init__(id=id, name=name, location=location, tags=tags) - self.plan = plan - self.os_disk_image = os_disk_image - self.data_disk_images = data_disk_images + def __init__(self, **kwargs): + super(VirtualMachineImage, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.os_disk_image = kwargs.get('os_disk_image', None) + self.data_disk_images = kwargs.get('data_disk_images', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_image_py3.py new file mode 100644 index 000000000000..91c71128968d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_image_py3.py @@ -0,0 +1,59 @@ +# 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 .virtual_machine_image_resource import VirtualMachineImageResource + + +class VirtualMachineImage(VirtualMachineImageResource): + """Describes a Virtual Machine Image. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The name of the resource. + :type name: str + :param location: Required. The supported Azure location of the resource. + :type location: str + :param tags: Specifies the tags that are assigned to the virtual machine. + For more information about using tags, see [Using tags to organize your + Azure + resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + :type tags: dict[str, str] + :param plan: + :type plan: ~azure.mgmt.compute.v2017_03_30.models.PurchasePlan + :param os_disk_image: + :type os_disk_image: ~azure.mgmt.compute.v2017_03_30.models.OSDiskImage + :param data_disk_images: + :type data_disk_images: + list[~azure.mgmt.compute.v2017_03_30.models.DataDiskImage] + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'properties.plan', 'type': 'PurchasePlan'}, + 'os_disk_image': {'key': 'properties.osDiskImage', 'type': 'OSDiskImage'}, + 'data_disk_images': {'key': 'properties.dataDiskImages', 'type': '[DataDiskImage]'}, + } + + def __init__(self, *, name: str, location: str, id: str=None, tags=None, plan=None, os_disk_image=None, data_disk_images=None, **kwargs) -> None: + super(VirtualMachineImage, self).__init__(id=id, name=name, location=location, tags=tags, **kwargs) + self.plan = plan + self.os_disk_image = os_disk_image + self.data_disk_images = data_disk_images diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_image_resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_image_resource.py index a7029041061d..8807cc8f391b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_image_resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_image_resource.py @@ -15,11 +15,13 @@ class VirtualMachineImageResource(SubResource): """Virtual machine image resource information. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The name of the resource. + :param name: Required. The name of the resource. :type name: str - :param location: The supported Azure location of the resource. + :param location: Required. The supported Azure location of the resource. :type location: str :param tags: Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your @@ -40,8 +42,8 @@ class VirtualMachineImageResource(SubResource): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, name, location, id=None, tags=None): - super(VirtualMachineImageResource, self).__init__(id=id) - self.name = name - self.location = location - self.tags = tags + def __init__(self, **kwargs): + super(VirtualMachineImageResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_image_resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_image_resource_py3.py new file mode 100644 index 000000000000..48a968bf2fbf --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_image_resource_py3.py @@ -0,0 +1,49 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineImageResource(SubResource): + """Virtual machine image resource information. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The name of the resource. + :type name: str + :param location: Required. The supported Azure location of the resource. + :type location: str + :param tags: Specifies the tags that are assigned to the virtual machine. + For more information about using tags, see [Using tags to organize your + Azure + resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + :type tags: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, name: str, location: str, id: str=None, tags=None, **kwargs) -> None: + super(VirtualMachineImageResource, self).__init__(id=id, **kwargs) + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_instance_view.py index d71d47d69eb9..e6c6b90ec611 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_instance_view.py @@ -59,14 +59,14 @@ class VirtualMachineInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, platform_update_domain=None, platform_fault_domain=None, rdp_thumb_print=None, vm_agent=None, maintenance_redeploy_status=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None): - super(VirtualMachineInstanceView, self).__init__() - self.platform_update_domain = platform_update_domain - self.platform_fault_domain = platform_fault_domain - self.rdp_thumb_print = rdp_thumb_print - self.vm_agent = vm_agent - self.maintenance_redeploy_status = maintenance_redeploy_status - self.disks = disks - self.extensions = extensions - self.boot_diagnostics = boot_diagnostics - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineInstanceView, self).__init__(**kwargs) + self.platform_update_domain = kwargs.get('platform_update_domain', None) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.rdp_thumb_print = kwargs.get('rdp_thumb_print', None) + self.vm_agent = kwargs.get('vm_agent', None) + self.maintenance_redeploy_status = kwargs.get('maintenance_redeploy_status', None) + self.disks = kwargs.get('disks', None) + self.extensions = kwargs.get('extensions', None) + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_instance_view_py3.py new file mode 100644 index 000000000000..2466342d3503 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_instance_view_py3.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineInstanceView(Model): + """The instance view of a virtual machine. + + :param platform_update_domain: Specifies the update domain of the virtual + machine. + :type platform_update_domain: int + :param platform_fault_domain: Specifies the fault domain of the virtual + machine. + :type platform_fault_domain: int + :param rdp_thumb_print: The Remote desktop certificate thumbprint. + :type rdp_thumb_print: str + :param vm_agent: The VM Agent running on the virtual machine. + :type vm_agent: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineAgentInstanceView + :param maintenance_redeploy_status: The Maintenance Operation status on + the virtual machine. + :type maintenance_redeploy_status: + ~azure.mgmt.compute.v2017_03_30.models.MaintenanceRedeployStatus + :param disks: The virtual machine disk information. + :type disks: list[~azure.mgmt.compute.v2017_03_30.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtensionInstanceView] + :param boot_diagnostics: Boot Diagnostics is a debugging feature which + allows you to view Console Output and Screenshot to diagnose VM status. +

    For Linux Virtual Machines, you can easily view the output of + your console log.

    For both Windows and Linux virtual machines, + Azure also enables you to see a screenshot of the VM from the hypervisor. + :type boot_diagnostics: + ~azure.mgmt.compute.v2017_03_30.models.BootDiagnosticsInstanceView + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2017_03_30.models.InstanceViewStatus] + """ + + _attribute_map = { + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'int'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, + 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, + 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, + 'maintenance_redeploy_status': {'key': 'maintenanceRedeployStatus', 'type': 'MaintenanceRedeployStatus'}, + 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnosticsInstanceView'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, platform_update_domain: int=None, platform_fault_domain: int=None, rdp_thumb_print: str=None, vm_agent=None, maintenance_redeploy_status=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None, **kwargs) -> None: + super(VirtualMachineInstanceView, self).__init__(**kwargs) + self.platform_update_domain = platform_update_domain + self.platform_fault_domain = platform_fault_domain + self.rdp_thumb_print = rdp_thumb_print + self.vm_agent = vm_agent + self.maintenance_redeploy_status = maintenance_redeploy_status + self.disks = disks + self.extensions = extensions + self.boot_diagnostics = boot_diagnostics + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_py3.py new file mode 100644 index 000000000000..791291568f1b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_py3.py @@ -0,0 +1,150 @@ +# 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 .resource import Resource + + +class VirtualMachine(Resource): + """Describes a Virtual Machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2017_03_30.models.Plan + :param hardware_profile: Specifies the hardware settings for the virtual + machine. + :type hardware_profile: + ~azure.mgmt.compute.v2017_03_30.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2017_03_30.models.StorageProfile + :param os_profile: Specifies the operating system settings for the virtual + machine. + :type os_profile: ~azure.mgmt.compute.v2017_03_30.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual + machine. + :type network_profile: + ~azure.mgmt.compute.v2017_03_30.models.NetworkProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. +

    Minimum api-version: 2015-06-15. + :type diagnostics_profile: + ~azure.mgmt.compute.v2017_03_30.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set + that the virtual machine should be assigned to. Virtual machines specified + in the same availability set are allocated to different nodes to maximize + availability. For more information about availability sets, see [Manage + the availability of virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + :type availability_set: ~azure.mgmt.compute.v2017_03_30.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used + was licensed on-premises. This element is only used for images that + contain the Windows Server operating system.

    Possible values are: +

    Windows_Client

    Windows_Server

    If this element + is included in a request for an update, the value must match the initial + value. This value cannot be updated.

    For more information, see + [Azure Hybrid Use Benefit for Windows + Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Minimum api-version: 2015-06-15 + :type license_type: str + :ivar vm_id: Specifies the VM unique ID which is a 128-bits identifier + that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read + using platform BIOS commands. + :vartype vm_id: str + :ivar resources: The virtual machine child extension resources. + :vartype resources: + list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtension] + :param identity: The identity of the virtual machine, if configured. + :type identity: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineIdentity + :param zones: The virtual machine zones. + :type zones: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'vm_id': {'readonly': True}, + 'resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineIdentity'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str, tags=None, plan=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type: str=None, identity=None, zones=None, **kwargs) -> None: + super(VirtualMachine, self).__init__(location=location, tags=tags, **kwargs) + self.plan = plan + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.os_profile = os_profile + self.network_profile = network_profile + self.diagnostics_profile = diagnostics_profile + self.availability_set = availability_set + self.provisioning_state = None + self.instance_view = None + self.license_type = license_type + self.vm_id = None + self.resources = None + self.identity = identity + self.zones = zones diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set.py index f84a017b3f3d..70385ea757b0 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set.py @@ -18,13 +18,15 @@ class VirtualMachineScaleSet(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -90,15 +92,15 @@ class VirtualMachineScaleSet(Resource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, location, tags=None, sku=None, plan=None, upgrade_policy=None, virtual_machine_profile=None, overprovision=None, single_placement_group=None, identity=None, zones=None): - super(VirtualMachineScaleSet, self).__init__(location=location, tags=tags) - self.sku = sku - self.plan = plan - self.upgrade_policy = upgrade_policy - self.virtual_machine_profile = virtual_machine_profile + def __init__(self, **kwargs): + super(VirtualMachineScaleSet, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.plan = kwargs.get('plan', None) + self.upgrade_policy = kwargs.get('upgrade_policy', None) + self.virtual_machine_profile = kwargs.get('virtual_machine_profile', None) self.provisioning_state = None - self.overprovision = overprovision + self.overprovision = kwargs.get('overprovision', None) self.unique_id = None - self.single_placement_group = single_placement_group - self.identity = identity - self.zones = zones + self.single_placement_group = kwargs.get('single_placement_group', None) + self.identity = kwargs.get('identity', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_data_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_data_disk.py index ca901ab3482c..43b4d78fe75d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_data_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_data_disk.py @@ -15,19 +15,21 @@ class VirtualMachineScaleSetDataDisk(Model): """Describes a virtual machine scale set data disk. + All required parameters must be populated in order to send to Azure. + :param name: The disk name. :type name: str - :param 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. + :param lun: Required. 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. :type lun: int :param caching: Specifies the caching requirements.

    Possible values are:

    **None**

    **ReadOnly**

    **ReadWrite**

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2017_03_30.models.CachingTypes - :param create_option: The create option. Possible values include: - 'FromImage', 'Empty', 'Attach' + :param create_option: Required. The create option. Possible values + include: 'FromImage', 'Empty', 'Attach' :type create_option: str or ~azure.mgmt.compute.v2017_03_30.models.DiskCreateOptionTypes :param disk_size_gb: Specifies the size of an empty data disk in @@ -53,11 +55,11 @@ class VirtualMachineScaleSetDataDisk(Model): 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, } - def __init__(self, lun, create_option, name=None, caching=None, disk_size_gb=None, managed_disk=None): - super(VirtualMachineScaleSetDataDisk, self).__init__() - self.name = name - self.lun = lun - self.caching = caching - self.create_option = create_option - self.disk_size_gb = disk_size_gb - self.managed_disk = managed_disk + def __init__(self, **kwargs): + super(VirtualMachineScaleSetDataDisk, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.lun = kwargs.get('lun', None) + self.caching = kwargs.get('caching', None) + self.create_option = kwargs.get('create_option', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.managed_disk = kwargs.get('managed_disk', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_data_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_data_disk_py3.py new file mode 100644 index 000000000000..8fca185a969f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_data_disk_py3.py @@ -0,0 +1,65 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetDataDisk(Model): + """Describes a virtual machine scale set data disk. + + All required parameters must be populated in order to send to Azure. + + :param name: The disk name. + :type name: str + :param lun: Required. 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. + :type lun: int + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2017_03_30.models.CachingTypes + :param create_option: Required. The create option. Possible values + include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2017_03_30.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in + gigabytes. This element can be used to overwrite the name of the disk in a + virtual machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetManagedDiskParameters + """ + + _validation = { + 'lun': {'required': True}, + 'create_option': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, + } + + def __init__(self, *, lun: int, create_option, name: str=None, caching=None, disk_size_gb: int=None, managed_disk=None, **kwargs) -> None: + super(VirtualMachineScaleSetDataDisk, self).__init__(**kwargs) + self.name = name + self.lun = lun + self.caching = caching + self.create_option = create_option + self.disk_size_gb = disk_size_gb + self.managed_disk = managed_disk diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_extension.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_extension.py index 68e2be4e922d..24a487547a2a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_extension.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_extension.py @@ -67,14 +67,14 @@ class VirtualMachineScaleSetExtension(SubResourceReadOnly): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, name=None, force_update_tag=None, publisher=None, type=None, type_handler_version=None, auto_upgrade_minor_version=None, settings=None, protected_settings=None): - super(VirtualMachineScaleSetExtension, self).__init__() - self.name = name - 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.settings = settings - self.protected_settings = protected_settings + def __init__(self, **kwargs): + super(VirtualMachineScaleSetExtension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_extension_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_extension_profile.py index dfa1466ae45b..5ac81fd695bb 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_extension_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_extension_profile.py @@ -25,6 +25,6 @@ class VirtualMachineScaleSetExtensionProfile(Model): 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetExtension]'}, } - def __init__(self, extensions=None): - super(VirtualMachineScaleSetExtensionProfile, self).__init__() - self.extensions = extensions + def __init__(self, **kwargs): + super(VirtualMachineScaleSetExtensionProfile, self).__init__(**kwargs) + self.extensions = kwargs.get('extensions', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_extension_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_extension_profile_py3.py new file mode 100644 index 000000000000..5970cc73e624 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_extension_profile_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetExtensionProfile(Model): + """Describes a virtual machine scale set extension profile. + + :param extensions: The virtual machine scale set child extension + resources. + :type extensions: + list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetExtension] + """ + + _attribute_map = { + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetExtension]'}, + } + + def __init__(self, *, extensions=None, **kwargs) -> None: + super(VirtualMachineScaleSetExtensionProfile, self).__init__(**kwargs) + self.extensions = extensions diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_extension_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_extension_py3.py new file mode 100644 index 000000000000..2243c6ae1f04 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_extension_py3.py @@ -0,0 +1,80 @@ +# 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 .sub_resource_read_only import SubResourceReadOnly + + +class VirtualMachineScaleSetExtension(SubResourceReadOnly): + """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 + :param name: The name of the extension. + :type name: str + :param 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. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either + protectedSettings or protectedSettingsFromKeyVault or no protected + settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, force_update_tag: str=None, publisher: str=None, type: str=None, type_handler_version: str=None, auto_upgrade_minor_version: bool=None, settings=None, protected_settings=None, **kwargs) -> None: + super(VirtualMachineScaleSetExtension, self).__init__(, **kwargs) + self.name = name + 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.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_identity.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_identity.py index 79398a4e23a9..d7c55680208c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_identity.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_identity.py @@ -42,8 +42,8 @@ class VirtualMachineScaleSetIdentity(Model): 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, } - def __init__(self, type=None): - super(VirtualMachineScaleSetIdentity, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = type + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_identity_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_identity_py3.py new file mode 100644 index 000000000000..109730c06e1b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_identity_py3.py @@ -0,0 +1,49 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetIdentity(Model): + """Identity for the virtual machine scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of virtual machine scale set + identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the virtual machine scale + set. + :vartype tenant_id: str + :param type: The type of identity used for the virtual machine scale set. + Currently, the only supported type is 'SystemAssigned', which implicitly + creates an identity. Possible values include: 'SystemAssigned' + :type type: str or + ~azure.mgmt.compute.v2017_03_30.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(VirtualMachineScaleSetIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_instance_view.py index ebad6930c03a..4c3ef65a1dd2 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_instance_view.py @@ -41,8 +41,8 @@ class VirtualMachineScaleSetInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, statuses=None): - super(VirtualMachineScaleSetInstanceView, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetInstanceView, self).__init__(**kwargs) self.virtual_machine = None self.extensions = None - self.statuses = statuses + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_instance_view_py3.py new file mode 100644 index 000000000000..4c8d32ed063f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_instance_view_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetInstanceView(Model): + """The instance view of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar virtual_machine: The instance view status summary for the virtual + machine scale set. + :vartype virtual_machine: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetInstanceViewStatusesSummary + :ivar extensions: The extensions information. + :vartype extensions: + list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetVMExtensionsSummary] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2017_03_30.models.InstanceViewStatus] + """ + + _validation = { + 'virtual_machine': {'readonly': True}, + 'extensions': {'readonly': True}, + } + + _attribute_map = { + 'virtual_machine': {'key': 'virtualMachine', 'type': 'VirtualMachineScaleSetInstanceViewStatusesSummary'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetVMExtensionsSummary]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, statuses=None, **kwargs) -> None: + super(VirtualMachineScaleSetInstanceView, self).__init__(**kwargs) + self.virtual_machine = None + self.extensions = None + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_instance_view_statuses_summary.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_instance_view_statuses_summary.py index 00fb334a2d09..9c8bc6132317 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_instance_view_statuses_summary.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_instance_view_statuses_summary.py @@ -32,6 +32,6 @@ class VirtualMachineScaleSetInstanceViewStatusesSummary(Model): 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, } - def __init__(self): - super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__(**kwargs) self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_instance_view_statuses_summary_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_instance_view_statuses_summary_py3.py new file mode 100644 index 000000000000..28bf19b450f6 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_instance_view_statuses_summary_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetInstanceViewStatusesSummary(Model): + """Instance view statuses summary for virtual machines of a virtual machine + scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar statuses_summary: The extensions information. + :vartype statuses_summary: + list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineStatusCodeCount] + """ + + _validation = { + 'statuses_summary': {'readonly': True}, + } + + _attribute_map = { + 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__(**kwargs) + self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_ip_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_ip_configuration.py index 1fb671d5a187..435f14097f05 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_ip_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_ip_configuration.py @@ -15,9 +15,11 @@ class VirtualMachineScaleSetIPConfiguration(SubResource): """Describes a virtual machine scale set network profile's IP configuration. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The IP configuration name. + :param name: Required. The IP configuration name. :type name: str :param subnet: Specifies the identifier of the subnet. :type subnet: ~azure.mgmt.compute.v2017_03_30.models.ApiEntityReference @@ -69,13 +71,13 @@ class VirtualMachineScaleSetIPConfiguration(SubResource): 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, } - def __init__(self, name, id=None, subnet=None, primary=None, public_ip_address_configuration=None, private_ip_address_version=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_pools=None): - super(VirtualMachineScaleSetIPConfiguration, self).__init__(id=id) - self.name = name - 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.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools + def __init__(self, **kwargs): + super(VirtualMachineScaleSetIPConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.public_ip_address_configuration = kwargs.get('public_ip_address_configuration', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_pools = kwargs.get('load_balancer_inbound_nat_pools', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_ip_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_ip_configuration_py3.py new file mode 100644 index 000000000000..f11b3584d844 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_ip_configuration_py3.py @@ -0,0 +1,83 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineScaleSetIPConfiguration(SubResource): + """Describes a virtual machine scale set network profile's IP configuration. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The IP configuration name. + :type name: str + :param subnet: Specifies the identifier of the subnet. + :type subnet: ~azure.mgmt.compute.v2017_03_30.models.ApiEntityReference + :param primary: Specifies the primary network interface in case the + virtual machine has more than 1 network interface. + :type primary: bool + :param public_ip_address_configuration: The publicIPAddressConfiguration. + :type public_ip_address_configuration: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetPublicIPAddressConfiguration + :param 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'. + Possible values include: 'IPv4', 'IPv6' + :type private_ip_address_version: str or + ~azure.mgmt.compute.v2017_03_30.models.IPVersion + :param 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. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.compute.v2017_03_30.models.SubResource] + :param 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 load balancer. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.compute.v2017_03_30.models.SubResource] + :param 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 load balancer + :type load_balancer_inbound_nat_pools: + list[~azure.mgmt.compute.v2017_03_30.models.SubResource] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'ApiEntityReference'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address_configuration': {'key': 'properties.publicIPAddressConfiguration', 'type': 'VirtualMachineScaleSetPublicIPAddressConfiguration'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, + } + + def __init__(self, *, name: str, id: str=None, subnet=None, primary: bool=None, public_ip_address_configuration=None, private_ip_address_version=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_pools=None, **kwargs) -> None: + super(VirtualMachineScaleSetIPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + 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.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_managed_disk_parameters.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_managed_disk_parameters.py index 2f2fd1348fdf..d7dd53592e5e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_managed_disk_parameters.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_managed_disk_parameters.py @@ -26,6 +26,6 @@ class VirtualMachineScaleSetManagedDiskParameters(Model): 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, } - def __init__(self, storage_account_type=None): - super(VirtualMachineScaleSetManagedDiskParameters, self).__init__() - self.storage_account_type = storage_account_type + def __init__(self, **kwargs): + super(VirtualMachineScaleSetManagedDiskParameters, self).__init__(**kwargs) + self.storage_account_type = kwargs.get('storage_account_type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_managed_disk_parameters_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_managed_disk_parameters_py3.py new file mode 100644 index 000000000000..58cd587c6b54 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_managed_disk_parameters_py3.py @@ -0,0 +1,31 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetManagedDiskParameters(Model): + """Describes the parameters of a ScaleSet managed disk. + + :param storage_account_type: Specifies the storage account type for the + managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible + values include: 'Standard_LRS', 'Premium_LRS' + :type storage_account_type: str or + ~azure.mgmt.compute.v2017_03_30.models.StorageAccountTypes + """ + + _attribute_map = { + 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, + } + + def __init__(self, *, storage_account_type=None, **kwargs) -> None: + super(VirtualMachineScaleSetManagedDiskParameters, self).__init__(**kwargs) + self.storage_account_type = storage_account_type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_configuration.py index 1df5d9eb792b..69d2808f1ff2 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_configuration.py @@ -16,9 +16,11 @@ class VirtualMachineScaleSetNetworkConfiguration(SubResource): """Describes a virtual machine scale set network profile's network configurations. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The network configuration name. + :param name: Required. The network configuration name. :type name: str :param primary: Specifies the primary network interface in case the virtual machine has more than 1 network interface. @@ -33,8 +35,8 @@ class VirtualMachineScaleSetNetworkConfiguration(SubResource): interfaces. :type dns_settings: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings - :param ip_configurations: Specifies the IP configurations of the network - interface. + :param ip_configurations: Required. Specifies the IP configurations of the + network interface. :type ip_configurations: list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetIPConfiguration] """ @@ -54,11 +56,11 @@ class VirtualMachineScaleSetNetworkConfiguration(SubResource): 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetIPConfiguration]'}, } - def __init__(self, name, ip_configurations, id=None, primary=None, enable_accelerated_networking=None, network_security_group=None, dns_settings=None): - super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(id=id) - self.name = name - self.primary = primary - self.enable_accelerated_networking = enable_accelerated_networking - self.network_security_group = network_security_group - self.dns_settings = dns_settings - self.ip_configurations = ip_configurations + def __init__(self, **kwargs): + super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.primary = kwargs.get('primary', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_configurations = kwargs.get('ip_configurations', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_configuration_dns_settings.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_configuration_dns_settings.py index fa83c5a0b792..04e1c619383f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_configuration_dns_settings.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_configuration_dns_settings.py @@ -24,6 +24,6 @@ class VirtualMachineScaleSetNetworkConfigurationDnsSettings(Model): 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, } - def __init__(self, dns_servers=None): - super(VirtualMachineScaleSetNetworkConfigurationDnsSettings, self).__init__() - self.dns_servers = dns_servers + def __init__(self, **kwargs): + super(VirtualMachineScaleSetNetworkConfigurationDnsSettings, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_configuration_dns_settings_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_configuration_dns_settings_py3.py new file mode 100644 index 000000000000..5607f74d3c6a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_configuration_dns_settings_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetNetworkConfigurationDnsSettings(Model): + """Describes a virtual machines scale sets network configuration's DNS + settings. + + :param dns_servers: List of DNS servers IP addresses + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__(self, *, dns_servers=None, **kwargs) -> None: + super(VirtualMachineScaleSetNetworkConfigurationDnsSettings, self).__init__(**kwargs) + self.dns_servers = dns_servers diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_configuration_py3.py new file mode 100644 index 000000000000..0f184fa10b2f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_configuration_py3.py @@ -0,0 +1,66 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineScaleSetNetworkConfiguration(SubResource): + """Describes a virtual machine scale set network profile's network + configurations. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The network configuration name. + :type name: str + :param primary: Specifies the primary network interface in case the + virtual machine has more than 1 network interface. + :type primary: bool + :param enable_accelerated_networking: Specifies whether the network + interface is accelerated networking-enabled. + :type enable_accelerated_networking: bool + :param network_security_group: The network security group. + :type network_security_group: + ~azure.mgmt.compute.v2017_03_30.models.SubResource + :param dns_settings: The dns settings to be applied on the network + interfaces. + :type dns_settings: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings + :param ip_configurations: Required. Specifies the IP configurations of the + network interface. + :type ip_configurations: + list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetIPConfiguration] + """ + + _validation = { + 'name': {'required': True}, + 'ip_configurations': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetNetworkConfigurationDnsSettings'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetIPConfiguration]'}, + } + + def __init__(self, *, name: str, ip_configurations, id: str=None, primary: bool=None, enable_accelerated_networking: bool=None, network_security_group=None, dns_settings=None, **kwargs) -> None: + super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.network_security_group = network_security_group + self.dns_settings = dns_settings + self.ip_configurations = ip_configurations diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_profile.py index 660f3d34c110..34fb37e837eb 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_profile.py @@ -32,7 +32,7 @@ class VirtualMachineScaleSetNetworkProfile(Model): 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetNetworkConfiguration]'}, } - def __init__(self, health_probe=None, network_interface_configurations=None): - super(VirtualMachineScaleSetNetworkProfile, self).__init__() - self.health_probe = health_probe - self.network_interface_configurations = network_interface_configurations + def __init__(self, **kwargs): + super(VirtualMachineScaleSetNetworkProfile, self).__init__(**kwargs) + self.health_probe = kwargs.get('health_probe', None) + self.network_interface_configurations = kwargs.get('network_interface_configurations', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_profile_py3.py new file mode 100644 index 000000000000..9189367b9b1f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_network_profile_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetNetworkProfile(Model): + """Describes a virtual machine scale set network profile. + + :param 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}'. + :type health_probe: + ~azure.mgmt.compute.v2017_03_30.models.ApiEntityReference + :param network_interface_configurations: The list of network + configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetNetworkConfiguration] + """ + + _attribute_map = { + 'health_probe': {'key': 'healthProbe', 'type': 'ApiEntityReference'}, + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetNetworkConfiguration]'}, + } + + def __init__(self, *, health_probe=None, network_interface_configurations=None, **kwargs) -> None: + super(VirtualMachineScaleSetNetworkProfile, self).__init__(**kwargs) + self.health_probe = health_probe + self.network_interface_configurations = network_interface_configurations diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_os_disk.py index dfc790fda218..c4d359b7fd46 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_os_disk.py @@ -15,6 +15,8 @@ class VirtualMachineScaleSetOSDisk(Model): """Describes a virtual machine scale set operating system disk. + All required parameters must be populated in order to send to Azure. + :param name: The disk name. :type name: str :param caching: Specifies the caching requirements.

    Possible @@ -22,13 +24,13 @@ class VirtualMachineScaleSetOSDisk(Model):

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2017_03_30.models.CachingTypes - :param create_option: Specifies how the virtual machines in the scale set - should be created.

    The only allowed value is: **FromImage** - \\u2013 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. Possible - values include: 'FromImage', 'Empty', 'Attach' + :param create_option: Required. Specifies how the virtual machines in the + scale set should be created.

    The only allowed value is: + **FromImage** \\u2013 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. + Possible values include: 'FromImage', 'Empty', 'Attach' :type create_option: str or ~azure.mgmt.compute.v2017_03_30.models.DiskCreateOptionTypes :param os_type: This property allows you to specify the type of the OS @@ -62,12 +64,12 @@ class VirtualMachineScaleSetOSDisk(Model): 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, } - def __init__(self, create_option, name=None, caching=None, os_type=None, image=None, vhd_containers=None, managed_disk=None): - super(VirtualMachineScaleSetOSDisk, self).__init__() - self.name = name - self.caching = caching - self.create_option = create_option - self.os_type = os_type - self.image = image - self.vhd_containers = vhd_containers - self.managed_disk = managed_disk + def __init__(self, **kwargs): + super(VirtualMachineScaleSetOSDisk, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.caching = kwargs.get('caching', None) + self.create_option = kwargs.get('create_option', None) + self.os_type = kwargs.get('os_type', None) + self.image = kwargs.get('image', None) + self.vhd_containers = kwargs.get('vhd_containers', None) + self.managed_disk = kwargs.get('managed_disk', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_os_disk_py3.py new file mode 100644 index 000000000000..a0a05b14340b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_os_disk_py3.py @@ -0,0 +1,75 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetOSDisk(Model): + """Describes a virtual machine scale set operating system disk. + + All required parameters must be populated in order to send to Azure. + + :param name: The disk name. + :type name: str + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2017_03_30.models.CachingTypes + :param create_option: Required. Specifies how the virtual machines in the + scale set should be created.

    The only allowed value is: + **FromImage** \\u2013 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. + Possible values include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2017_03_30.models.DiskCreateOptionTypes + :param 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**. Possible values include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2017_03_30.models.OperatingSystemTypes + :param image: Specifies information about the unmanaged user image to base + the scale set on. + :type image: ~azure.mgmt.compute.v2017_03_30.models.VirtualHardDisk + :param vhd_containers: Specifies the container urls that are used to store + operating system disks for the scale set. + :type vhd_containers: list[str] + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetManagedDiskParameters + """ + + _validation = { + 'create_option': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, + } + + def __init__(self, *, create_option, name: str=None, caching=None, os_type=None, image=None, vhd_containers=None, managed_disk=None, **kwargs) -> None: + super(VirtualMachineScaleSetOSDisk, self).__init__(**kwargs) + self.name = name + self.caching = caching + self.create_option = create_option + self.os_type = os_type + self.image = image + self.vhd_containers = vhd_containers + self.managed_disk = managed_disk diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_os_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_os_profile.py index 2fd62e806968..317633a0edf7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_os_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_os_profile.py @@ -86,12 +86,12 @@ class VirtualMachineScaleSetOSProfile(Model): 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, } - def __init__(self, computer_name_prefix=None, admin_username=None, admin_password=None, custom_data=None, windows_configuration=None, linux_configuration=None, secrets=None): - super(VirtualMachineScaleSetOSProfile, self).__init__() - 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 + def __init__(self, **kwargs): + super(VirtualMachineScaleSetOSProfile, self).__init__(**kwargs) + self.computer_name_prefix = kwargs.get('computer_name_prefix', None) + self.admin_username = kwargs.get('admin_username', None) + self.admin_password = kwargs.get('admin_password', None) + self.custom_data = kwargs.get('custom_data', None) + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + self.secrets = kwargs.get('secrets', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_os_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_os_profile_py3.py new file mode 100644 index 000000000000..1d7c698b243f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_os_profile_py3.py @@ -0,0 +1,97 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetOSProfile(Model): + """Describes a virtual machine scale set OS profile. + + :param 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. + :type computer_name_prefix: str + :param admin_username: Specifies the name of the administrator account. +

    **Windows-only restriction:** Cannot end in "."

    + **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".

    **Minimum-length (Linux):** 1 + character

    **Max-length (Linux):** 64 characters

    + **Max-length (Windows):** 20 characters

  • For root access to + the Linux VM, see [Using root privileges on Linux virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + For a list of built-in system users on Linux that should not be used in + this field, see [Selecting User Names for Linux on + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type admin_username: str + :param admin_password: Specifies the password of the administrator + account.

    **Minimum-length (Windows):** 8 characters

    + **Minimum-length (Linux):** 6 characters

    **Max-length + (Windows):** 123 characters

    **Max-length (Linux):** 72 characters +

    **Complexity requirements:** 3 out of 4 conditions below need to + be fulfilled
    Has lower characters
    Has upper characters
    Has a + digit
    Has a special character (Regex match [\\W_])

    + **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + "iloveyou!"

    For resetting the password, see [How to reset the + Remote Desktop service or its login password in a Windows + VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    For resetting root password, see [Manage users, SSH, and check or + repair disks on Azure Linux VMs using the VMAccess + Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + :type admin_password: str + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type custom_data: str + :param windows_configuration: Specifies Windows operating system settings + on the virtual machine. + :type windows_configuration: + ~azure.mgmt.compute.v2017_03_30.models.WindowsConfiguration + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) +

    For running non-endorsed distributions, see [Information for + Non-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + :type linux_configuration: + ~azure.mgmt.compute.v2017_03_30.models.LinuxConfiguration + :param secrets: Specifies set of certificates that should be installed + onto the virtual machines in the scale set. + :type secrets: + list[~azure.mgmt.compute.v2017_03_30.models.VaultSecretGroup] + """ + + _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]'}, + } + + def __init__(self, *, computer_name_prefix: str=None, admin_username: str=None, admin_password: str=None, custom_data: str=None, windows_configuration=None, linux_configuration=None, secrets=None, **kwargs) -> None: + super(VirtualMachineScaleSetOSProfile, self).__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 diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_public_ip_address_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_public_ip_address_configuration.py index c3bd84db31f0..72a44aa185c0 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_public_ip_address_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_public_ip_address_configuration.py @@ -16,7 +16,9 @@ class VirtualMachineScaleSetPublicIPAddressConfiguration(Model): """Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. - :param name: The publicIP address configuration name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The publicIP address configuration name. :type name: str :param idle_timeout_in_minutes: The idle timeout of the public IP address. :type idle_timeout_in_minutes: int @@ -36,8 +38,8 @@ class VirtualMachineScaleSetPublicIPAddressConfiguration(Model): 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'}, } - def __init__(self, name, idle_timeout_in_minutes=None, dns_settings=None): - super(VirtualMachineScaleSetPublicIPAddressConfiguration, self).__init__() - self.name = name - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.dns_settings = dns_settings + def __init__(self, **kwargs): + super(VirtualMachineScaleSetPublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.dns_settings = kwargs.get('dns_settings', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_public_ip_address_configuration_dns_settings.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_public_ip_address_configuration_dns_settings.py index b247010d8c4a..2fe562244372 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_public_ip_address_configuration_dns_settings.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_public_ip_address_configuration_dns_settings.py @@ -16,9 +16,11 @@ class VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings(Model): """Describes a virtual machines scale sets network configuration's DNS settings. - :param 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 + All required parameters must be populated in order to send to Azure. + + :param domain_name_label: Required. 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 :type domain_name_label: str """ @@ -30,6 +32,6 @@ class VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings(Model): 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, } - def __init__(self, domain_name_label): - super(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings, self).__init__() - self.domain_name_label = domain_name_label + def __init__(self, **kwargs): + super(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings, self).__init__(**kwargs) + self.domain_name_label = kwargs.get('domain_name_label', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_public_ip_address_configuration_dns_settings_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_public_ip_address_configuration_dns_settings_py3.py new file mode 100644 index 000000000000..326a36708ff4 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_public_ip_address_configuration_dns_settings_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings(Model): + """Describes a virtual machines scale sets network configuration's DNS + settings. + + All required parameters must be populated in order to send to Azure. + + :param domain_name_label: Required. 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 + :type domain_name_label: str + """ + + _validation = { + 'domain_name_label': {'required': True}, + } + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + } + + def __init__(self, *, domain_name_label: str, **kwargs) -> None: + super(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings, self).__init__(**kwargs) + self.domain_name_label = domain_name_label diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_public_ip_address_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_public_ip_address_configuration_py3.py new file mode 100644 index 000000000000..d4db0b75b9ba --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_public_ip_address_configuration_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetPublicIPAddressConfiguration(Model): + """Describes a virtual machines scale set IP Configuration's PublicIPAddress + configuration. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The publicIP address configuration name. + :type name: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param dns_settings: The dns settings to be applied on the publicIP + addresses . + :type dns_settings: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'}, + } + + def __init__(self, *, name: str, idle_timeout_in_minutes: int=None, dns_settings=None, **kwargs) -> None: + super(VirtualMachineScaleSetPublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = name + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.dns_settings = dns_settings diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_py3.py new file mode 100644 index 000000000000..f1058061da23 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_py3.py @@ -0,0 +1,106 @@ +# 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 .resource import Resource + + +class VirtualMachineScaleSet(Resource): + """Describes a Virtual Machine Scale Set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The virtual machine scale set sku. + :type sku: ~azure.mgmt.compute.v2017_03_30.models.Sku + :param plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2017_03_30.models.Plan + :param upgrade_policy: The upgrade policy. + :type upgrade_policy: ~azure.mgmt.compute.v2017_03_30.models.UpgradePolicy + :param virtual_machine_profile: The virtual machine profile. + :type virtual_machine_profile: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetVMProfile + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :param overprovision: Specifies whether the Virtual Machine Scale Set + should be overprovisioned. + :type overprovision: bool + :ivar unique_id: Specifies the ID which uniquely identifies a Virtual + Machine Scale Set. + :vartype unique_id: str + :param single_placement_group: When true this limits the scale set to a + single placement group, of max size 100 virtual machines. + :type single_placement_group: bool + :param identity: The identity of the virtual machine scale set, if + configured. + :type identity: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetIdentity + :param zones: The virtual machine scale set zones. + :type zones: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'unique_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'upgrade_policy': {'key': 'properties.upgradePolicy', 'type': 'UpgradePolicy'}, + 'virtual_machine_profile': {'key': 'properties.virtualMachineProfile', 'type': 'VirtualMachineScaleSetVMProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'overprovision': {'key': 'properties.overprovision', 'type': 'bool'}, + 'unique_id': {'key': 'properties.uniqueId', 'type': 'str'}, + 'single_placement_group': {'key': 'properties.singlePlacementGroup', 'type': 'bool'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str, tags=None, sku=None, plan=None, upgrade_policy=None, virtual_machine_profile=None, overprovision: bool=None, single_placement_group: bool=None, identity=None, zones=None, **kwargs) -> None: + super(VirtualMachineScaleSet, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.plan = plan + self.upgrade_policy = upgrade_policy + self.virtual_machine_profile = virtual_machine_profile + self.provisioning_state = None + self.overprovision = overprovision + self.unique_id = None + self.single_placement_group = single_placement_group + self.identity = identity + self.zones = zones diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_sku.py index c96da40cf31e..7df68f8507c3 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_sku.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_sku.py @@ -39,8 +39,8 @@ class VirtualMachineScaleSetSku(Model): 'capacity': {'key': 'capacity', 'type': 'VirtualMachineScaleSetSkuCapacity'}, } - def __init__(self): - super(VirtualMachineScaleSetSku, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetSku, self).__init__(**kwargs) self.resource_type = None self.sku = None self.capacity = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_sku_capacity.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_sku_capacity.py index 5557b650935c..9b483b29e72b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_sku_capacity.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_sku_capacity.py @@ -44,8 +44,8 @@ class VirtualMachineScaleSetSkuCapacity(Model): 'scale_type': {'key': 'scaleType', 'type': 'VirtualMachineScaleSetSkuScaleType'}, } - def __init__(self): - super(VirtualMachineScaleSetSkuCapacity, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetSkuCapacity, self).__init__(**kwargs) self.minimum = None self.maximum = None self.default_capacity = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_sku_capacity_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_sku_capacity_py3.py new file mode 100644 index 000000000000..167f1b55495e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_sku_capacity_py3.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetSkuCapacity(Model): + """Describes scaling information of a sku. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar minimum: The minimum capacity. + :vartype minimum: long + :ivar maximum: The maximum capacity that can be set. + :vartype maximum: long + :ivar default_capacity: The default capacity. + :vartype default_capacity: long + :ivar scale_type: The scale type applicable to the sku. Possible values + include: 'Automatic', 'None' + :vartype scale_type: str or + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetSkuScaleType + """ + + _validation = { + 'minimum': {'readonly': True}, + 'maximum': {'readonly': True}, + 'default_capacity': {'readonly': True}, + 'scale_type': {'readonly': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'long'}, + 'maximum': {'key': 'maximum', 'type': 'long'}, + 'default_capacity': {'key': 'defaultCapacity', 'type': 'long'}, + 'scale_type': {'key': 'scaleType', 'type': 'VirtualMachineScaleSetSkuScaleType'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetSkuCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default_capacity = None + self.scale_type = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_sku_py3.py new file mode 100644 index 000000000000..3855816f1f80 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_sku_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetSku(Model): + """Describes an available virtual machine scale set sku. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_type: The type of resource the sku applies to. + :vartype resource_type: str + :ivar sku: The Sku. + :vartype sku: ~azure.mgmt.compute.v2017_03_30.models.Sku + :ivar capacity: Specifies the number of virtual machines in the scale set. + :vartype capacity: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetSkuCapacity + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'sku': {'readonly': True}, + 'capacity': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'capacity': {'key': 'capacity', 'type': 'VirtualMachineScaleSetSkuCapacity'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetSku, self).__init__(**kwargs) + self.resource_type = None + self.sku = None + self.capacity = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_storage_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_storage_profile.py index a5be051cbe71..eea90cc9e86e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_storage_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_storage_profile.py @@ -42,8 +42,8 @@ class VirtualMachineScaleSetStorageProfile(Model): 'data_disks': {'key': 'dataDisks', 'type': '[VirtualMachineScaleSetDataDisk]'}, } - def __init__(self, image_reference=None, os_disk=None, data_disks=None): - super(VirtualMachineScaleSetStorageProfile, self).__init__() - self.image_reference = image_reference - self.os_disk = os_disk - self.data_disks = data_disks + def __init__(self, **kwargs): + super(VirtualMachineScaleSetStorageProfile, self).__init__(**kwargs) + self.image_reference = kwargs.get('image_reference', None) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_storage_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_storage_profile_py3.py new file mode 100644 index 000000000000..e36c69eb5668 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_storage_profile_py3.py @@ -0,0 +1,49 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetStorageProfile(Model): + """Describes a virtual machine scale set storage profile. + + :param 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. + :type image_reference: + ~azure.mgmt.compute.v2017_03_30.models.ImageReference + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type os_disk: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetOSDisk + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type data_disks: + list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetDataDisk] + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'VirtualMachineScaleSetOSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[VirtualMachineScaleSetDataDisk]'}, + } + + def __init__(self, *, image_reference=None, os_disk=None, data_disks=None, **kwargs) -> None: + super(VirtualMachineScaleSetStorageProfile, self).__init__(**kwargs) + self.image_reference = image_reference + self.os_disk = os_disk + self.data_disks = data_disks diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update.py index 813afe4cbf2a..f0e05bd78e2e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update.py @@ -50,12 +50,12 @@ class VirtualMachineScaleSetUpdate(UpdateResource): 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, } - def __init__(self, tags=None, sku=None, plan=None, upgrade_policy=None, virtual_machine_profile=None, overprovision=None, single_placement_group=None, identity=None): - super(VirtualMachineScaleSetUpdate, self).__init__(tags=tags) - self.sku = sku - self.plan = plan - self.upgrade_policy = upgrade_policy - self.virtual_machine_profile = virtual_machine_profile - self.overprovision = overprovision - self.single_placement_group = single_placement_group - self.identity = identity + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdate, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.plan = kwargs.get('plan', None) + self.upgrade_policy = kwargs.get('upgrade_policy', None) + self.virtual_machine_profile = kwargs.get('virtual_machine_profile', None) + self.overprovision = kwargs.get('overprovision', None) + self.single_placement_group = kwargs.get('single_placement_group', None) + self.identity = kwargs.get('identity', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_ip_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_ip_configuration.py index 5471c4d8a9de..4e40f478cf3a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_ip_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_ip_configuration.py @@ -59,13 +59,13 @@ class VirtualMachineScaleSetUpdateIPConfiguration(SubResource): 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, } - def __init__(self, id=None, name=None, subnet=None, primary=None, public_ip_address_configuration=None, private_ip_address_version=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_pools=None): - super(VirtualMachineScaleSetUpdateIPConfiguration, self).__init__(id=id) - self.name = name - 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.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdateIPConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.public_ip_address_configuration = kwargs.get('public_ip_address_configuration', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_pools = kwargs.get('load_balancer_inbound_nat_pools', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_ip_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_ip_configuration_py3.py new file mode 100644 index 000000000000..f7860d495575 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_ip_configuration_py3.py @@ -0,0 +1,71 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineScaleSetUpdateIPConfiguration(SubResource): + """Describes a virtual machine scale set network profile's IP configuration. + + :param id: Resource Id + :type id: str + :param name: The IP configuration name. + :type name: str + :param subnet: The subnet. + :type subnet: ~azure.mgmt.compute.v2017_03_30.models.ApiEntityReference + :param primary: Specifies the primary IP Configuration in case the network + interface has more than one IP Configuration. + :type primary: bool + :param public_ip_address_configuration: The publicIPAddressConfiguration. + :type public_ip_address_configuration: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetUpdatePublicIPAddressConfiguration + :param 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'. + Possible values include: 'IPv4', 'IPv6' + :type private_ip_address_version: str or + ~azure.mgmt.compute.v2017_03_30.models.IPVersion + :param application_gateway_backend_address_pools: The application gateway + backend address pools. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.compute.v2017_03_30.models.SubResource] + :param load_balancer_backend_address_pools: The load balancer backend + address pools. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.compute.v2017_03_30.models.SubResource] + :param load_balancer_inbound_nat_pools: The load balancer inbound nat + pools. + :type load_balancer_inbound_nat_pools: + list[~azure.mgmt.compute.v2017_03_30.models.SubResource] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'ApiEntityReference'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address_configuration': {'key': 'properties.publicIPAddressConfiguration', 'type': 'VirtualMachineScaleSetUpdatePublicIPAddressConfiguration'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, + } + + def __init__(self, *, id: str=None, name: str=None, subnet=None, primary: bool=None, public_ip_address_configuration=None, private_ip_address_version=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_pools=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdateIPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + 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.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_network_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_network_configuration.py index 47c8d95525ab..d4b239a579d3 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_network_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_network_configuration.py @@ -47,11 +47,11 @@ class VirtualMachineScaleSetUpdateNetworkConfiguration(SubResource): 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetUpdateIPConfiguration]'}, } - def __init__(self, id=None, name=None, primary=None, enable_accelerated_networking=None, network_security_group=None, dns_settings=None, ip_configurations=None): - super(VirtualMachineScaleSetUpdateNetworkConfiguration, self).__init__(id=id) - self.name = name - self.primary = primary - self.enable_accelerated_networking = enable_accelerated_networking - self.network_security_group = network_security_group - self.dns_settings = dns_settings - self.ip_configurations = ip_configurations + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdateNetworkConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.primary = kwargs.get('primary', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_configurations = kwargs.get('ip_configurations', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_network_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_network_configuration_py3.py new file mode 100644 index 000000000000..9ff9c77dc275 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_network_configuration_py3.py @@ -0,0 +1,57 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineScaleSetUpdateNetworkConfiguration(SubResource): + """Describes a virtual machine scale set network profile's network + configurations. + + :param id: Resource Id + :type id: str + :param name: The network configuration name. + :type name: str + :param primary: Whether this is a primary NIC on a virtual machine. + :type primary: bool + :param enable_accelerated_networking: Specifies whether the network + interface is accelerated networking-enabled. + :type enable_accelerated_networking: bool + :param network_security_group: The network security group. + :type network_security_group: + ~azure.mgmt.compute.v2017_03_30.models.SubResource + :param dns_settings: The dns settings to be applied on the network + interfaces. + :type dns_settings: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings + :param ip_configurations: The virtual machine scale set IP Configuration. + :type ip_configurations: + list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetUpdateIPConfiguration] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetNetworkConfigurationDnsSettings'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetUpdateIPConfiguration]'}, + } + + def __init__(self, *, id: str=None, name: str=None, primary: bool=None, enable_accelerated_networking: bool=None, network_security_group=None, dns_settings=None, ip_configurations=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdateNetworkConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.network_security_group = network_security_group + self.dns_settings = dns_settings + self.ip_configurations = ip_configurations diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_network_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_network_profile.py index 2e7d2e9d4663..f454544145ca 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_network_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_network_profile.py @@ -25,6 +25,6 @@ class VirtualMachineScaleSetUpdateNetworkProfile(Model): 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetUpdateNetworkConfiguration]'}, } - def __init__(self, network_interface_configurations=None): - super(VirtualMachineScaleSetUpdateNetworkProfile, self).__init__() - self.network_interface_configurations = network_interface_configurations + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdateNetworkProfile, self).__init__(**kwargs) + self.network_interface_configurations = kwargs.get('network_interface_configurations', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_network_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_network_profile_py3.py new file mode 100644 index 000000000000..ac421c4a18d7 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_network_profile_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetUpdateNetworkProfile(Model): + """Describes a virtual machine scale set network profile. + + :param network_interface_configurations: The list of network + configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetUpdateNetworkConfiguration] + """ + + _attribute_map = { + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetUpdateNetworkConfiguration]'}, + } + + def __init__(self, *, network_interface_configurations=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdateNetworkProfile, self).__init__(**kwargs) + self.network_interface_configurations = network_interface_configurations diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_os_disk.py index 26f403f7985d..cdc8991bda95 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_os_disk.py @@ -37,9 +37,9 @@ class VirtualMachineScaleSetUpdateOSDisk(Model): 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, } - def __init__(self, caching=None, image=None, vhd_containers=None, managed_disk=None): - super(VirtualMachineScaleSetUpdateOSDisk, self).__init__() - self.caching = caching - self.image = image - self.vhd_containers = vhd_containers - self.managed_disk = managed_disk + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdateOSDisk, self).__init__(**kwargs) + self.caching = kwargs.get('caching', None) + self.image = kwargs.get('image', None) + self.vhd_containers = kwargs.get('vhd_containers', None) + self.managed_disk = kwargs.get('managed_disk', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_os_disk_py3.py new file mode 100644 index 000000000000..3357b7c3aedb --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_os_disk_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetUpdateOSDisk(Model): + """Describes virtual machine scale set operating system disk Update Object. + This should be used for Updating VMSS OS Disk. + + :param caching: The caching type. Possible values include: 'None', + 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2017_03_30.models.CachingTypes + :param image: The Source User Image VirtualHardDisk. This VirtualHardDisk + will be copied before using it to attach to the Virtual Machine. If + SourceImage is provided, the destination VirtualHardDisk should not exist. + :type image: ~azure.mgmt.compute.v2017_03_30.models.VirtualHardDisk + :param vhd_containers: The list of virtual hard disk container uris. + :type vhd_containers: list[str] + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetManagedDiskParameters + """ + + _attribute_map = { + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, + } + + def __init__(self, *, caching=None, image=None, vhd_containers=None, managed_disk=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdateOSDisk, self).__init__(**kwargs) + self.caching = caching + self.image = image + self.vhd_containers = vhd_containers + self.managed_disk = managed_disk diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_os_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_os_profile.py index c537bb406a04..2a450b7a5743 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_os_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_os_profile.py @@ -35,9 +35,9 @@ class VirtualMachineScaleSetUpdateOSProfile(Model): 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, } - def __init__(self, custom_data=None, windows_configuration=None, linux_configuration=None, secrets=None): - super(VirtualMachineScaleSetUpdateOSProfile, self).__init__() - self.custom_data = custom_data - self.windows_configuration = windows_configuration - self.linux_configuration = linux_configuration - self.secrets = secrets + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdateOSProfile, self).__init__(**kwargs) + self.custom_data = kwargs.get('custom_data', None) + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + self.secrets = kwargs.get('secrets', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_os_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_os_profile_py3.py new file mode 100644 index 000000000000..18b1e26f7176 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_os_profile_py3.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 msrest.serialization import Model + + +class VirtualMachineScaleSetUpdateOSProfile(Model): + """Describes a virtual machine scale set OS profile. + + :param custom_data: A base-64 encoded string of custom data. + :type custom_data: str + :param windows_configuration: The Windows Configuration of the OS profile. + :type windows_configuration: + ~azure.mgmt.compute.v2017_03_30.models.WindowsConfiguration + :param linux_configuration: The Linux Configuration of the OS profile. + :type linux_configuration: + ~azure.mgmt.compute.v2017_03_30.models.LinuxConfiguration + :param secrets: The List of certificates for addition to the VM. + :type secrets: + list[~azure.mgmt.compute.v2017_03_30.models.VaultSecretGroup] + """ + + _attribute_map = { + 'custom_data': {'key': 'customData', 'type': 'str'}, + 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'WindowsConfiguration'}, + 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'LinuxConfiguration'}, + 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, + } + + def __init__(self, *, custom_data: str=None, windows_configuration=None, linux_configuration=None, secrets=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdateOSProfile, self).__init__(**kwargs) + self.custom_data = custom_data + self.windows_configuration = windows_configuration + self.linux_configuration = linux_configuration + self.secrets = secrets diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_public_ip_address_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_public_ip_address_configuration.py index 01f93444a77a..225b662d4296 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_public_ip_address_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_public_ip_address_configuration.py @@ -32,8 +32,8 @@ class VirtualMachineScaleSetUpdatePublicIPAddressConfiguration(Model): 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'}, } - def __init__(self, name=None, idle_timeout_in_minutes=None, dns_settings=None): - super(VirtualMachineScaleSetUpdatePublicIPAddressConfiguration, self).__init__() - self.name = name - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.dns_settings = dns_settings + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdatePublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.dns_settings = kwargs.get('dns_settings', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_public_ip_address_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_public_ip_address_configuration_py3.py new file mode 100644 index 000000000000..0c6bc55ac163 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_public_ip_address_configuration_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetUpdatePublicIPAddressConfiguration(Model): + """Describes a virtual machines scale set IP Configuration's PublicIPAddress + configuration. + + :param name: The publicIP address configuration name. + :type name: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param dns_settings: The dns settings to be applied on the publicIP + addresses . + :type dns_settings: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'}, + } + + def __init__(self, *, name: str=None, idle_timeout_in_minutes: int=None, dns_settings=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdatePublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = name + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.dns_settings = dns_settings diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_py3.py new file mode 100644 index 000000000000..c27c33be47de --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_py3.py @@ -0,0 +1,61 @@ +# 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 .update_resource import UpdateResource + + +class VirtualMachineScaleSetUpdate(UpdateResource): + """Describes a Virtual Machine Scale Set. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The virtual machine scale set sku. + :type sku: ~azure.mgmt.compute.v2017_03_30.models.Sku + :param plan: The purchase plan when deploying a virtual machine scale set + from VM Marketplace images. + :type plan: ~azure.mgmt.compute.v2017_03_30.models.Plan + :param upgrade_policy: The upgrade policy. + :type upgrade_policy: ~azure.mgmt.compute.v2017_03_30.models.UpgradePolicy + :param virtual_machine_profile: The virtual machine profile. + :type virtual_machine_profile: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetUpdateVMProfile + :param overprovision: Specifies whether the Virtual Machine Scale Set + should be overprovisioned. + :type overprovision: bool + :param single_placement_group: When true this limits the scale set to a + single placement group, of max size 100 virtual machines. + :type single_placement_group: bool + :param identity: The identity of the virtual machine scale set, if + configured. + :type identity: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetIdentity + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'upgrade_policy': {'key': 'properties.upgradePolicy', 'type': 'UpgradePolicy'}, + 'virtual_machine_profile': {'key': 'properties.virtualMachineProfile', 'type': 'VirtualMachineScaleSetUpdateVMProfile'}, + 'overprovision': {'key': 'properties.overprovision', 'type': 'bool'}, + 'single_placement_group': {'key': 'properties.singlePlacementGroup', 'type': 'bool'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, + } + + def __init__(self, *, tags=None, sku=None, plan=None, upgrade_policy=None, virtual_machine_profile=None, overprovision: bool=None, single_placement_group: bool=None, identity=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdate, self).__init__(tags=tags, **kwargs) + self.sku = sku + self.plan = plan + self.upgrade_policy = upgrade_policy + self.virtual_machine_profile = virtual_machine_profile + self.overprovision = overprovision + self.single_placement_group = single_placement_group + self.identity = identity diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_storage_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_storage_profile.py index 130137d04cc1..68723e6f8c26 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_storage_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_storage_profile.py @@ -32,8 +32,8 @@ class VirtualMachineScaleSetUpdateStorageProfile(Model): 'data_disks': {'key': 'dataDisks', 'type': '[VirtualMachineScaleSetDataDisk]'}, } - def __init__(self, image_reference=None, os_disk=None, data_disks=None): - super(VirtualMachineScaleSetUpdateStorageProfile, self).__init__() - self.image_reference = image_reference - self.os_disk = os_disk - self.data_disks = data_disks + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdateStorageProfile, self).__init__(**kwargs) + self.image_reference = kwargs.get('image_reference', None) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_storage_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_storage_profile_py3.py new file mode 100644 index 000000000000..10e544fa8ff5 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_storage_profile_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetUpdateStorageProfile(Model): + """Describes a virtual machine scale set storage profile. + + :param image_reference: The image reference. + :type image_reference: + ~azure.mgmt.compute.v2017_03_30.models.ImageReference + :param os_disk: The OS disk. + :type os_disk: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetUpdateOSDisk + :param data_disks: The data disks. + :type data_disks: + list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetDataDisk] + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'VirtualMachineScaleSetUpdateOSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[VirtualMachineScaleSetDataDisk]'}, + } + + def __init__(self, *, image_reference=None, os_disk=None, data_disks=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdateStorageProfile, self).__init__(**kwargs) + self.image_reference = image_reference + self.os_disk = os_disk + self.data_disks = data_disks diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_vm_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_vm_profile.py index e50bd9f076fd..769e70ebc7b4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_vm_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_vm_profile.py @@ -45,11 +45,11 @@ class VirtualMachineScaleSetUpdateVMProfile(Model): 'license_type': {'key': 'licenseType', 'type': 'str'}, } - def __init__(self, os_profile=None, storage_profile=None, network_profile=None, diagnostics_profile=None, extension_profile=None, license_type=None): - super(VirtualMachineScaleSetUpdateVMProfile, self).__init__() - self.os_profile = os_profile - self.storage_profile = storage_profile - self.network_profile = network_profile - self.diagnostics_profile = diagnostics_profile - self.extension_profile = extension_profile - self.license_type = license_type + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdateVMProfile, self).__init__(**kwargs) + self.os_profile = kwargs.get('os_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.extension_profile = kwargs.get('extension_profile', None) + self.license_type = kwargs.get('license_type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_vm_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_vm_profile_py3.py new file mode 100644 index 000000000000..7af111bbdb5e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_vm_profile_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetUpdateVMProfile(Model): + """Describes a virtual machine scale set virtual machine profile. + + :param os_profile: The virtual machine scale set OS profile. + :type os_profile: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetUpdateOSProfile + :param storage_profile: The virtual machine scale set storage profile. + :type storage_profile: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetUpdateStorageProfile + :param network_profile: The virtual machine scale set network profile. + :type network_profile: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetUpdateNetworkProfile + :param diagnostics_profile: The virtual machine scale set diagnostics + profile. + :type diagnostics_profile: + ~azure.mgmt.compute.v2017_03_30.models.DiagnosticsProfile + :param extension_profile: The virtual machine scale set extension profile. + :type extension_profile: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetExtensionProfile + :param license_type: The license type, which is for bring your own license + scenario. + :type license_type: str + """ + + _attribute_map = { + 'os_profile': {'key': 'osProfile', 'type': 'VirtualMachineScaleSetUpdateOSProfile'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'VirtualMachineScaleSetUpdateStorageProfile'}, + 'network_profile': {'key': 'networkProfile', 'type': 'VirtualMachineScaleSetUpdateNetworkProfile'}, + 'diagnostics_profile': {'key': 'diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'extension_profile': {'key': 'extensionProfile', 'type': 'VirtualMachineScaleSetExtensionProfile'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + } + + def __init__(self, *, os_profile=None, storage_profile=None, network_profile=None, diagnostics_profile=None, extension_profile=None, license_type: str=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdateVMProfile, self).__init__(**kwargs) + self.os_profile = os_profile + self.storage_profile = storage_profile + self.network_profile = network_profile + self.diagnostics_profile = diagnostics_profile + self.extension_profile = extension_profile + self.license_type = license_type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm.py index 8e04ba611f6c..8a36a7dff817 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm.py @@ -18,13 +18,15 @@ class VirtualMachineScaleSetVM(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -134,20 +136,20 @@ class VirtualMachineScaleSetVM(Resource): 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, } - def __init__(self, location, tags=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type=None, plan=None): - super(VirtualMachineScaleSetVM, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVM, self).__init__(**kwargs) self.instance_id = None self.sku = None self.latest_model_applied = None self.vm_id = None self.instance_view = None - self.hardware_profile = hardware_profile - self.storage_profile = storage_profile - self.os_profile = os_profile - self.network_profile = network_profile - self.diagnostics_profile = diagnostics_profile - self.availability_set = availability_set + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.os_profile = kwargs.get('os_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.availability_set = kwargs.get('availability_set', None) self.provisioning_state = None - self.license_type = license_type - self.plan = plan + self.license_type = kwargs.get('license_type', None) + self.plan = kwargs.get('plan', None) self.resources = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_extensions_summary.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_extensions_summary.py index 4140f1648fb3..e0010d843bff 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_extensions_summary.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_extensions_summary.py @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMExtensionsSummary(Model): 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, } - def __init__(self): - super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__(**kwargs) self.name = None self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_extensions_summary_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_extensions_summary_py3.py new file mode 100644 index 000000000000..df6fe0e1d5f6 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_extensions_summary_py3.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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMExtensionsSummary(Model): + """Extensions summary for virtual machines of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The extension name. + :vartype name: str + :ivar statuses_summary: The extensions information. + :vartype statuses_summary: + list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineStatusCodeCount] + """ + + _validation = { + 'name': {'readonly': True}, + 'statuses_summary': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__(**kwargs) + self.name = None + self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_ids.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_ids.py index 681ab449f3f2..772c66dad326 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_ids.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_ids.py @@ -25,6 +25,6 @@ class VirtualMachineScaleSetVMInstanceIDs(Model): 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, } - def __init__(self, instance_ids=None): - super(VirtualMachineScaleSetVMInstanceIDs, self).__init__() - self.instance_ids = instance_ids + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMInstanceIDs, self).__init__(**kwargs) + self.instance_ids = kwargs.get('instance_ids', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_ids_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_ids_py3.py new file mode 100644 index 000000000000..658a8ccb87d5 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_ids_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetVMInstanceIDs(Model): + """Specifies a list of virtual machine instance IDs from the VM scale set. + + :param instance_ids: The virtual machine scale set instance ids. Omitting + the virtual machine scale set instance ids will result in the operation + being performed on all virtual machines in the virtual machine scale set. + :type instance_ids: list[str] + """ + + _attribute_map = { + 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, + } + + def __init__(self, *, instance_ids=None, **kwargs) -> None: + super(VirtualMachineScaleSetVMInstanceIDs, self).__init__(**kwargs) + self.instance_ids = instance_ids diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_required_ids.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_required_ids.py index 2a35798001fa..ece250dd4fd4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_required_ids.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_required_ids.py @@ -15,7 +15,9 @@ class VirtualMachineScaleSetVMInstanceRequiredIDs(Model): """Specifies a list of virtual machine instance IDs from the VM scale set. - :param instance_ids: The virtual machine scale set instance ids. + All required parameters must be populated in order to send to Azure. + + :param instance_ids: Required. The virtual machine scale set instance ids. :type instance_ids: list[str] """ @@ -27,6 +29,6 @@ class VirtualMachineScaleSetVMInstanceRequiredIDs(Model): 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, } - def __init__(self, instance_ids): - super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__() - self.instance_ids = instance_ids + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__(**kwargs) + self.instance_ids = kwargs.get('instance_ids', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_required_ids_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_required_ids_py3.py new file mode 100644 index 000000000000..f32c6181467d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_required_ids_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMInstanceRequiredIDs(Model): + """Specifies a list of virtual machine instance IDs from the VM scale set. + + All required parameters must be populated in order to send to Azure. + + :param instance_ids: Required. The virtual machine scale set instance ids. + :type instance_ids: list[str] + """ + + _validation = { + 'instance_ids': {'required': True}, + } + + _attribute_map = { + 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, + } + + def __init__(self, *, instance_ids, **kwargs) -> None: + super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__(**kwargs) + self.instance_ids = instance_ids diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_view.py index fb7ef5159883..489f4fe28548 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_view.py @@ -67,15 +67,15 @@ class VirtualMachineScaleSetVMInstanceView(Model): 'placement_group_id': {'key': 'placementGroupId', 'type': 'str'}, } - def __init__(self, platform_update_domain=None, platform_fault_domain=None, rdp_thumb_print=None, vm_agent=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None, placement_group_id=None): - super(VirtualMachineScaleSetVMInstanceView, self).__init__() - self.platform_update_domain = platform_update_domain - self.platform_fault_domain = platform_fault_domain - self.rdp_thumb_print = rdp_thumb_print - self.vm_agent = vm_agent - self.disks = disks - self.extensions = extensions + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMInstanceView, self).__init__(**kwargs) + self.platform_update_domain = kwargs.get('platform_update_domain', None) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.rdp_thumb_print = kwargs.get('rdp_thumb_print', None) + self.vm_agent = kwargs.get('vm_agent', None) + self.disks = kwargs.get('disks', None) + self.extensions = kwargs.get('extensions', None) self.vm_health = None - self.boot_diagnostics = boot_diagnostics - self.statuses = statuses - self.placement_group_id = placement_group_id + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) + self.statuses = kwargs.get('statuses', None) + self.placement_group_id = kwargs.get('placement_group_id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_view_py3.py new file mode 100644 index 000000000000..25821e5bfe74 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_view_py3.py @@ -0,0 +1,81 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMInstanceView(Model): + """The instance view of a virtual machine scale set VM. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param platform_update_domain: The Update Domain count. + :type platform_update_domain: int + :param platform_fault_domain: The Fault Domain count. + :type platform_fault_domain: int + :param rdp_thumb_print: The Remote desktop certificate thumbprint. + :type rdp_thumb_print: str + :param vm_agent: The VM Agent running on the virtual machine. + :type vm_agent: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineAgentInstanceView + :param disks: The disks information. + :type disks: list[~azure.mgmt.compute.v2017_03_30.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtensionInstanceView] + :ivar vm_health: The health status for the VM. + :vartype vm_health: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineHealthStatus + :param boot_diagnostics: Boot Diagnostics is a debugging feature which + allows you to view Console Output and Screenshot to diagnose VM status. +

    For Linux Virtual Machines, you can easily view the output of + your console log.

    For both Windows and Linux virtual machines, + Azure also enables you to see a screenshot of the VM from the hypervisor. + :type boot_diagnostics: + ~azure.mgmt.compute.v2017_03_30.models.BootDiagnosticsInstanceView + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2017_03_30.models.InstanceViewStatus] + :param placement_group_id: The placement group in which the VM is running. + If the VM is deallocated it will not have a placementGroupId. + :type placement_group_id: str + """ + + _validation = { + 'vm_health': {'readonly': True}, + } + + _attribute_map = { + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'int'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, + 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, + 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, + 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, + 'vm_health': {'key': 'vmHealth', 'type': 'VirtualMachineHealthStatus'}, + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnosticsInstanceView'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + 'placement_group_id': {'key': 'placementGroupId', 'type': 'str'}, + } + + def __init__(self, *, platform_update_domain: int=None, platform_fault_domain: int=None, rdp_thumb_print: str=None, vm_agent=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None, placement_group_id: str=None, **kwargs) -> None: + super(VirtualMachineScaleSetVMInstanceView, self).__init__(**kwargs) + self.platform_update_domain = platform_update_domain + self.platform_fault_domain = platform_fault_domain + self.rdp_thumb_print = rdp_thumb_print + self.vm_agent = vm_agent + self.disks = disks + self.extensions = extensions + self.vm_health = None + self.boot_diagnostics = boot_diagnostics + self.statuses = statuses + self.placement_group_id = placement_group_id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_profile.py index 30bd0d1f1345..f874d2898304 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_profile.py @@ -56,11 +56,11 @@ class VirtualMachineScaleSetVMProfile(Model): 'license_type': {'key': 'licenseType', 'type': 'str'}, } - def __init__(self, os_profile=None, storage_profile=None, network_profile=None, diagnostics_profile=None, extension_profile=None, license_type=None): - super(VirtualMachineScaleSetVMProfile, self).__init__() - self.os_profile = os_profile - self.storage_profile = storage_profile - self.network_profile = network_profile - self.diagnostics_profile = diagnostics_profile - self.extension_profile = extension_profile - self.license_type = license_type + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMProfile, self).__init__(**kwargs) + self.os_profile = kwargs.get('os_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.extension_profile = kwargs.get('extension_profile', None) + self.license_type = kwargs.get('license_type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_profile_py3.py new file mode 100644 index 000000000000..8c58976e2670 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_profile_py3.py @@ -0,0 +1,66 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMProfile(Model): + """Describes a virtual machine scale set virtual machine profile. + + :param os_profile: Specifies the operating system settings for the virtual + machines in the scale set. + :type os_profile: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetOSProfile + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetStorageProfile + :param network_profile: Specifies properties of the network interfaces of + the virtual machines in the scale set. + :type network_profile: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetNetworkProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. +

    Minimum api-version: 2015-06-15. + :type diagnostics_profile: + ~azure.mgmt.compute.v2017_03_30.models.DiagnosticsProfile + :param extension_profile: Specifies a collection of settings for + extensions installed on virtual machines in the scale set. + :type extension_profile: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetExtensionProfile + :param license_type: Specifies that the image or disk that is being used + was licensed on-premises. This element is only used for images that + contain the Windows Server operating system.

    Possible values are: +

    Windows_Client

    Windows_Server

    If this element + is included in a request for an update, the value must match the initial + value. This value cannot be updated.

    For more information, see + [Azure Hybrid Use Benefit for Windows + Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Minimum api-version: 2015-06-15 + :type license_type: str + """ + + _attribute_map = { + 'os_profile': {'key': 'osProfile', 'type': 'VirtualMachineScaleSetOSProfile'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'VirtualMachineScaleSetStorageProfile'}, + 'network_profile': {'key': 'networkProfile', 'type': 'VirtualMachineScaleSetNetworkProfile'}, + 'diagnostics_profile': {'key': 'diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'extension_profile': {'key': 'extensionProfile', 'type': 'VirtualMachineScaleSetExtensionProfile'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + } + + def __init__(self, *, os_profile=None, storage_profile=None, network_profile=None, diagnostics_profile=None, extension_profile=None, license_type: str=None, **kwargs) -> None: + super(VirtualMachineScaleSetVMProfile, self).__init__(**kwargs) + self.os_profile = os_profile + self.storage_profile = storage_profile + self.network_profile = network_profile + self.diagnostics_profile = diagnostics_profile + self.extension_profile = extension_profile + self.license_type = license_type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_py3.py new file mode 100644 index 000000000000..ee6d74113a2b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_py3.py @@ -0,0 +1,155 @@ +# 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 .resource import Resource + + +class VirtualMachineScaleSetVM(Resource): + """Describes a virtual machine scale set virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar instance_id: The virtual machine instance ID. + :vartype instance_id: str + :ivar sku: The virtual machine SKU. + :vartype sku: ~azure.mgmt.compute.v2017_03_30.models.Sku + :ivar latest_model_applied: Specifies whether the latest model has been + applied to the virtual machine. + :vartype latest_model_applied: bool + :ivar vm_id: Azure VM unique ID. + :vartype vm_id: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineInstanceView + :param hardware_profile: Specifies the hardware settings for the virtual + machine. + :type hardware_profile: + ~azure.mgmt.compute.v2017_03_30.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2017_03_30.models.StorageProfile + :param os_profile: Specifies the operating system settings for the virtual + machine. + :type os_profile: ~azure.mgmt.compute.v2017_03_30.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual + machine. + :type network_profile: + ~azure.mgmt.compute.v2017_03_30.models.NetworkProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. +

    Minimum api-version: 2015-06-15. + :type diagnostics_profile: + ~azure.mgmt.compute.v2017_03_30.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set + that the virtual machine should be assigned to. Virtual machines specified + in the same availability set are allocated to different nodes to maximize + availability. For more information about availability sets, see [Manage + the availability of virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + :type availability_set: ~azure.mgmt.compute.v2017_03_30.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :param license_type: Specifies that the image or disk that is being used + was licensed on-premises. This element is only used for images that + contain the Windows Server operating system.

    Possible values are: +

    Windows_Client

    Windows_Server

    If this element + is included in a request for an update, the value must match the initial + value. This value cannot be updated.

    For more information, see + [Azure Hybrid Use Benefit for Windows + Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Minimum api-version: 2015-06-15 + :type license_type: str + :param plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2017_03_30.models.Plan + :ivar resources: The virtual machine child extension resources. + :vartype resources: + list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtension] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'instance_id': {'readonly': True}, + 'sku': {'readonly': True}, + 'latest_model_applied': {'readonly': True}, + 'vm_id': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'instance_id': {'key': 'instanceId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'latest_model_applied': {'key': 'properties.latestModelApplied', 'type': 'bool'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, + } + + def __init__(self, *, location: str, tags=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type: str=None, plan=None, **kwargs) -> None: + super(VirtualMachineScaleSetVM, self).__init__(location=location, tags=tags, **kwargs) + self.instance_id = None + self.sku = None + self.latest_model_applied = None + self.vm_id = None + self.instance_view = None + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.os_profile = os_profile + self.network_profile = network_profile + self.diagnostics_profile = diagnostics_profile + self.availability_set = availability_set + self.provisioning_state = None + self.license_type = license_type + self.plan = plan + self.resources = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_size.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_size.py index 3f4fa7f06b70..0fef3efd6c8e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_size.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_size.py @@ -43,11 +43,11 @@ class VirtualMachineSize(Model): 'max_data_disk_count': {'key': 'maxDataDiskCount', 'type': 'int'}, } - def __init__(self, name=None, number_of_cores=None, os_disk_size_in_mb=None, resource_disk_size_in_mb=None, memory_in_mb=None, max_data_disk_count=None): - super(VirtualMachineSize, self).__init__() - self.name = name - self.number_of_cores = number_of_cores - self.os_disk_size_in_mb = os_disk_size_in_mb - self.resource_disk_size_in_mb = resource_disk_size_in_mb - self.memory_in_mb = memory_in_mb - self.max_data_disk_count = max_data_disk_count + def __init__(self, **kwargs): + super(VirtualMachineSize, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.number_of_cores = kwargs.get('number_of_cores', None) + self.os_disk_size_in_mb = kwargs.get('os_disk_size_in_mb', None) + self.resource_disk_size_in_mb = kwargs.get('resource_disk_size_in_mb', None) + self.memory_in_mb = kwargs.get('memory_in_mb', None) + self.max_data_disk_count = kwargs.get('max_data_disk_count', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_size_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_size_py3.py new file mode 100644 index 000000000000..9f99ba20ce42 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_size_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineSize(Model): + """Describes the properties of a VM size. + + :param name: The name of the virtual machine size. + :type name: str + :param number_of_cores: The number of cores supported by the virtual + machine size. + :type number_of_cores: int + :param os_disk_size_in_mb: The OS disk size, in MB, allowed by the virtual + machine size. + :type os_disk_size_in_mb: int + :param resource_disk_size_in_mb: The resource disk size, in MB, allowed by + the virtual machine size. + :type resource_disk_size_in_mb: int + :param memory_in_mb: The amount of memory, in MB, supported by the virtual + machine size. + :type memory_in_mb: int + :param max_data_disk_count: The maximum number of data disks that can be + attached to the virtual machine size. + :type max_data_disk_count: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'number_of_cores': {'key': 'numberOfCores', 'type': 'int'}, + 'os_disk_size_in_mb': {'key': 'osDiskSizeInMB', 'type': 'int'}, + 'resource_disk_size_in_mb': {'key': 'resourceDiskSizeInMB', 'type': 'int'}, + 'memory_in_mb': {'key': 'memoryInMB', 'type': 'int'}, + 'max_data_disk_count': {'key': 'maxDataDiskCount', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, number_of_cores: int=None, os_disk_size_in_mb: int=None, resource_disk_size_in_mb: int=None, memory_in_mb: int=None, max_data_disk_count: int=None, **kwargs) -> None: + super(VirtualMachineSize, self).__init__(**kwargs) + self.name = name + self.number_of_cores = number_of_cores + self.os_disk_size_in_mb = os_disk_size_in_mb + self.resource_disk_size_in_mb = resource_disk_size_in_mb + self.memory_in_mb = memory_in_mb + self.max_data_disk_count = max_data_disk_count diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_status_code_count.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_status_code_count.py index 177515706064..7df7b702acd7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_status_code_count.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_status_code_count.py @@ -35,7 +35,7 @@ class VirtualMachineStatusCodeCount(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self): - super(VirtualMachineStatusCodeCount, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineStatusCodeCount, self).__init__(**kwargs) self.code = None self.count = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_status_code_count_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_status_code_count_py3.py new file mode 100644 index 000000000000..c38800073a95 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_status_code_count_py3.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 msrest.serialization import Model + + +class VirtualMachineStatusCodeCount(Model): + """The status code and count of the virtual machine scale set instance view + status summary. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The instance view status code. + :vartype code: str + :ivar count: The number of instances having a particular status code. + :vartype count: int + """ + + _validation = { + 'code': {'readonly': True}, + 'count': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineStatusCodeCount, self).__init__(**kwargs) + self.code = None + self.count = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/win_rm_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/win_rm_configuration.py index 78661815d694..d50cf4086203 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/win_rm_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/win_rm_configuration.py @@ -24,6 +24,6 @@ class WinRMConfiguration(Model): 'listeners': {'key': 'listeners', 'type': '[WinRMListener]'}, } - def __init__(self, listeners=None): - super(WinRMConfiguration, self).__init__() - self.listeners = listeners + def __init__(self, **kwargs): + super(WinRMConfiguration, self).__init__(**kwargs) + self.listeners = kwargs.get('listeners', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/win_rm_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/win_rm_configuration_py3.py new file mode 100644 index 000000000000..01f177397f32 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/win_rm_configuration_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WinRMConfiguration(Model): + """Describes Windows Remote Management configuration of the VM. + + :param listeners: The list of Windows Remote Management listeners + :type listeners: + list[~azure.mgmt.compute.v2017_03_30.models.WinRMListener] + """ + + _attribute_map = { + 'listeners': {'key': 'listeners', 'type': '[WinRMListener]'}, + } + + def __init__(self, *, listeners=None, **kwargs) -> None: + super(WinRMConfiguration, self).__init__(**kwargs) + self.listeners = listeners diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/win_rm_listener.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/win_rm_listener.py index d1e9fd98655e..6810cc597f00 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/win_rm_listener.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/win_rm_listener.py @@ -36,7 +36,7 @@ class WinRMListener(Model): 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, } - def __init__(self, protocol=None, certificate_url=None): - super(WinRMListener, self).__init__() - self.protocol = protocol - self.certificate_url = certificate_url + def __init__(self, **kwargs): + super(WinRMListener, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.certificate_url = kwargs.get('certificate_url', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/win_rm_listener_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/win_rm_listener_py3.py new file mode 100644 index 000000000000..dcd585dcf57f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/win_rm_listener_py3.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 msrest.serialization import Model + + +class WinRMListener(Model): + """Describes Protocol and thumbprint of Windows Remote Management listener. + + :param protocol: Specifies the protocol of listener.

    Possible + values are:
    **http**

    **https**. Possible values include: + 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.compute.v2017_03_30.models.ProtocolTypes + :param 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](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + In this case, your certificate needs to be It is the Base64 encoding of + the following JSON Object which is encoded in UTF-8:

    {
    + "data":"",
    "dataType":"pfx",
    + "password":""
    } + :type certificate_url: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'ProtocolTypes'}, + 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, + } + + def __init__(self, *, protocol=None, certificate_url: str=None, **kwargs) -> None: + super(WinRMListener, self).__init__(**kwargs) + self.protocol = protocol + self.certificate_url = certificate_url diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/windows_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/windows_configuration.py index bd6efdc3890c..7c0655f326cb 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/windows_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/windows_configuration.py @@ -45,10 +45,10 @@ class WindowsConfiguration(Model): 'win_rm': {'key': 'winRM', 'type': 'WinRMConfiguration'}, } - def __init__(self, provision_vm_agent=None, enable_automatic_updates=None, time_zone=None, additional_unattend_content=None, win_rm=None): - super(WindowsConfiguration, self).__init__() - 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.win_rm = win_rm + def __init__(self, **kwargs): + super(WindowsConfiguration, self).__init__(**kwargs) + self.provision_vm_agent = kwargs.get('provision_vm_agent', None) + self.enable_automatic_updates = kwargs.get('enable_automatic_updates', None) + self.time_zone = kwargs.get('time_zone', None) + self.additional_unattend_content = kwargs.get('additional_unattend_content', None) + self.win_rm = kwargs.get('win_rm', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/windows_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/windows_configuration_py3.py new file mode 100644 index 000000000000..b2dd2acef034 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/windows_configuration_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class WindowsConfiguration(Model): + """Specifies Windows operating system settings on the virtual machine. + + :param 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. + :type provision_vm_agent: bool + :param enable_automatic_updates: Indicates whether virtual machine is + enabled for automatic updates. + :type enable_automatic_updates: bool + :param time_zone: Specifies the time zone of the virtual machine. e.g. + "Pacific Standard Time" + :type time_zone: str + :param 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. + :type additional_unattend_content: + list[~azure.mgmt.compute.v2017_03_30.models.AdditionalUnattendContent] + :param win_rm: Specifies the Windows Remote Management listeners. This + enables remote Windows PowerShell. + :type win_rm: ~azure.mgmt.compute.v2017_03_30.models.WinRMConfiguration + """ + + _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]'}, + 'win_rm': {'key': 'winRM', 'type': 'WinRMConfiguration'}, + } + + def __init__(self, *, provision_vm_agent: bool=None, enable_automatic_updates: bool=None, time_zone: str=None, additional_unattend_content=None, win_rm=None, **kwargs) -> None: + super(WindowsConfiguration, self).__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.win_rm = win_rm diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/availability_sets_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/availability_sets_operations.py index 0d65ece3b973..ce2e741626f2 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/availability_sets_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/availability_sets_operations.py @@ -22,7 +22,7 @@ class AvailabilitySetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-03-30". """ @@ -60,7 +60,7 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -105,6 +105,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} def delete( self, resource_group_name, availability_set_name, custom_headers=None, raw=False, **operation_config): @@ -125,7 +126,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -166,6 +167,7 @@ def delete( return client_raw_response return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} def get( self, resource_group_name, availability_set_name, custom_headers=None, raw=False, **operation_config): @@ -186,7 +188,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -227,6 +229,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -248,7 +251,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -294,6 +297,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets'} def list_available_sizes( self, resource_group_name, availability_set_name, custom_headers=None, raw=False, **operation_config): @@ -318,7 +322,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes' + url = self.list_available_sizes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -365,3 +369,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_available_sizes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/disks_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/disks_operations.py index 65a50ecf6902..c2b0c8aabe46 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/disks_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/disks_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class DisksOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-03-30". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -106,13 +106,16 @@ def create_or_update( operation. :type disk: ~azure.mgmt.compute.v2017_03_30.models.Disk :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Disk or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Disk or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.Disk] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.Disk]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('Disk', response) if raw: @@ -155,18 +136,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} def _update_initial( self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}' + url = self.update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -215,7 +198,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, polling=True, **operation_config): """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -229,13 +212,16 @@ def update( operation. :type disk: ~azure.mgmt.compute.v2017_03_30.models.DiskUpdate :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Disk or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Disk or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.Disk] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.Disk]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -246,30 +232,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('Disk', response) if raw: @@ -278,12 +242,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} def get( self, resource_group_name, disk_name, custom_headers=None, raw=False, **operation_config): @@ -307,7 +273,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}' + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -348,12 +314,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} def _delete_initial( self, resource_group_name, disk_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}' + url = self.delete.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -396,7 +363,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, disk_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, disk_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a disk. :param resource_group_name: The name of the resource group. @@ -407,13 +374,16 @@ def delete( length is 80 characters. :type disk_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -423,30 +393,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -455,12 +403,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -482,7 +432,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') @@ -528,6 +478,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -547,7 +498,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -592,6 +543,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks'} def _grant_access_initial( @@ -599,7 +551,7 @@ def _grant_access_initial( grant_access_data = models.GrantAccessData(access=access, duration_in_seconds=duration_in_seconds) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess' + url = self.grant_access.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -646,7 +598,7 @@ def _grant_access_initial( return deserialized def grant_access( - self, resource_group_name, disk_name, access, duration_in_seconds, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, disk_name, access, duration_in_seconds, custom_headers=None, raw=False, polling=True, **operation_config): """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -663,13 +615,16 @@ def grant_access( access expires. :type duration_in_seconds: int :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns AccessUri or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AccessUri or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.AccessUri] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.AccessUri]] :raises: :class:`CloudError` """ raw_result = self._grant_access_initial( @@ -681,30 +636,8 @@ def grant_access( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('AccessUri', response) if raw: @@ -713,18 +646,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + grant_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess'} def _revoke_access_initial( self, resource_group_name, disk_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess' + url = self.revoke_access.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -767,7 +702,7 @@ def _revoke_access_initial( return deserialized def revoke_access( - self, resource_group_name, disk_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, disk_name, custom_headers=None, raw=False, polling=True, **operation_config): """Revokes access to a disk. :param resource_group_name: The name of the resource group. @@ -778,13 +713,16 @@ def revoke_access( length is 80 characters. :type disk_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._revoke_access_initial( @@ -794,30 +732,8 @@ def revoke_access( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -826,9 +742,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + revoke_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/images_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/images_operations.py index 7b0bcd64bb6d..684b505f7197 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/images_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/images_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ImagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-03-30". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, image_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'imageName': self._serialize.url("image_name", image_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, image_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, image_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update an image. :param resource_group_name: The name of the resource group. @@ -102,13 +102,16 @@ def create_or_update( :param parameters: Parameters supplied to the Create Image operation. :type parameters: ~azure.mgmt.compute.v2017_03_30.models.Image :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Image or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Image or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.Image] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.Image]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -119,30 +122,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('Image', response) if raw: @@ -151,18 +132,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} def _delete_initial( self, resource_group_name, image_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'imageName': self._serialize.url("image_name", image_name, 'str'), @@ -205,7 +188,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, image_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, image_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -213,13 +196,16 @@ def delete( :param image_name: The name of the image. :type image_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -229,30 +215,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -261,12 +225,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} def get( self, resource_group_name, image_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -289,7 +255,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'imageName': self._serialize.url("image_name", image_name, 'str'), @@ -332,6 +298,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -353,7 +320,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -399,6 +366,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -420,7 +388,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -465,3 +433,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/resource_skus_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/resource_skus_operations.py index 7da2466b610b..036647ac8e85 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/resource_skus_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/resource_skus_operations.py @@ -22,7 +22,7 @@ class ResourceSkusOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-03-30". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/snapshots_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/snapshots_operations.py index 3a1e8eeb85d3..9c209cb1ac47 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/snapshots_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/snapshots_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SnapshotsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-03-30". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -106,13 +106,16 @@ def create_or_update( operation. :type snapshot: ~azure.mgmt.compute.v2017_03_30.models.Snapshot :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Snapshot or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Snapshot or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.Snapshot] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.Snapshot]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('Snapshot', response) if raw: @@ -155,18 +136,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} def _update_initial( self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}' + url = self.update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -215,7 +198,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, polling=True, **operation_config): """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -229,13 +212,16 @@ def update( snapshot operation. :type snapshot: ~azure.mgmt.compute.v2017_03_30.models.SnapshotUpdate :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Snapshot or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Snapshot or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.Snapshot] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.Snapshot]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -246,30 +232,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('Snapshot', response) if raw: @@ -278,12 +242,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} def get( self, resource_group_name, snapshot_name, custom_headers=None, raw=False, **operation_config): @@ -307,7 +273,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}' + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -348,12 +314,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} def _delete_initial( self, resource_group_name, snapshot_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}' + url = self.delete.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -396,7 +363,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, snapshot_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, snapshot_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a snapshot. :param resource_group_name: The name of the resource group. @@ -407,13 +374,16 @@ def delete( is 80 characters. :type snapshot_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -423,30 +393,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -455,12 +403,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -482,7 +432,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') @@ -528,6 +478,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -547,7 +498,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -592,6 +543,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots'} def _grant_access_initial( @@ -599,7 +551,7 @@ def _grant_access_initial( grant_access_data = models.GrantAccessData(access=access, duration_in_seconds=duration_in_seconds) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess' + url = self.grant_access.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -646,7 +598,7 @@ def _grant_access_initial( return deserialized def grant_access( - self, resource_group_name, snapshot_name, access, duration_in_seconds, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, snapshot_name, access, duration_in_seconds, custom_headers=None, raw=False, polling=True, **operation_config): """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -663,13 +615,16 @@ def grant_access( access expires. :type duration_in_seconds: int :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns AccessUri or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AccessUri or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.AccessUri] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.AccessUri]] :raises: :class:`CloudError` """ raw_result = self._grant_access_initial( @@ -681,30 +636,8 @@ def grant_access( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('AccessUri', response) if raw: @@ -713,18 +646,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + grant_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess'} def _revoke_access_initial( self, resource_group_name, snapshot_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess' + url = self.revoke_access.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -767,7 +702,7 @@ def _revoke_access_initial( return deserialized def revoke_access( - self, resource_group_name, snapshot_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, snapshot_name, custom_headers=None, raw=False, polling=True, **operation_config): """Revokes access to a snapshot. :param resource_group_name: The name of the resource group. @@ -778,13 +713,16 @@ def revoke_access( is 80 characters. :type snapshot_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._revoke_access_initial( @@ -794,30 +732,8 @@ def revoke_access( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -826,9 +742,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + revoke_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/usage_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/usage_operations.py index ac2d3af87ced..6c1900a7c5ea 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/usage_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/usage_operations.py @@ -22,7 +22,7 @@ class UsageOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-03-30". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -105,3 +105,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_extension_images_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_extension_images_operations.py index 87c040e28702..63453c94920f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_extension_images_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_extension_images_operations.py @@ -22,7 +22,7 @@ class VirtualMachineExtensionImagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-03-30". """ @@ -61,7 +61,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}' + url = self.get.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -104,6 +104,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}'} def list_types( self, location, publisher_name, custom_headers=None, raw=False, **operation_config): @@ -125,7 +126,7 @@ def list_types( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types' + url = self.list_types.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -166,6 +167,7 @@ def list_types( return client_raw_response return deserialized + list_types.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types'} def list_versions( self, location, publisher_name, type, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): @@ -195,7 +197,7 @@ def list_versions( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions' + url = self.list_versions.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -243,3 +245,4 @@ def list_versions( return client_raw_response return deserialized + list_versions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_extensions_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_extensions_operations.py index 0152efa68761..f688392c7ed1 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_extensions_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_extensions_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineExtensionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-03-30". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -93,7 +93,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -108,13 +108,16 @@ def create_or_update( :type extension_parameters: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtension :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineExtension or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachineExtension + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtension] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtension]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -126,30 +129,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineExtension', response) if raw: @@ -158,18 +139,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} def _delete_initial( self, resource_group_name, vm_name, vm_extension_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -213,7 +196,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_name, vm_extension_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, vm_extension_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -224,13 +207,16 @@ def delete( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -241,30 +227,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -273,12 +237,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} def get( self, resource_group_name, vm_name, vm_extension_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -304,7 +270,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -348,3 +314,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_images_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_images_operations.py index 362260bfc985..d222bf9aa7e7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_images_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_images_operations.py @@ -22,7 +22,7 @@ class VirtualMachineImagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-03-30". """ @@ -62,7 +62,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}' + url = self.get.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -106,6 +106,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}'} def list( self, location, publisher_name, offer, skus, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): @@ -138,7 +139,7 @@ def list( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -187,6 +188,7 @@ def list( return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions'} def list_offers( self, location, publisher_name, custom_headers=None, raw=False, **operation_config): @@ -209,7 +211,7 @@ def list_offers( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers' + url = self.list_offers.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -250,6 +252,7 @@ def list_offers( return client_raw_response return deserialized + list_offers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers'} def list_publishers( self, location, custom_headers=None, raw=False, **operation_config): @@ -270,7 +273,7 @@ def list_publishers( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers' + url = self.list_publishers.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -310,6 +313,7 @@ def list_publishers( return client_raw_response return deserialized + list_publishers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers'} def list_skus( self, location, publisher_name, offer, custom_headers=None, raw=False, **operation_config): @@ -334,7 +338,7 @@ def list_skus( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus' + url = self.list_skus.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -376,3 +380,4 @@ def list_skus( return client_raw_response return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_run_commands_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_run_commands_operations.py index 6eb8f4fdc1cd..60c0ba0cb259 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_run_commands_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_run_commands_operations.py @@ -22,7 +22,7 @@ class VirtualMachineRunCommandsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-03-30". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -103,6 +103,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands'} def get( self, location, command_id, custom_headers=None, raw=False, **operation_config): @@ -123,7 +124,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}' + url = self.get.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'commandId': self._serialize.url("command_id", command_id, 'str'), @@ -164,3 +165,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_scale_set_extensions_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_scale_set_extensions_operations.py index f4425b1b56be..737744d28691 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_scale_set_extensions_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_scale_set_extensions_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineScaleSetExtensionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-03-30". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, vm_scale_set_name, vmss_extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -93,7 +93,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, vm_scale_set_name, vmss_extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, vmss_extension_name, extension_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -108,13 +108,17 @@ def create_or_update( :type extension_parameters: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetExtension :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineScaleSetExtension or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualMachineScaleSetExtension or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetExtension] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetExtension]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -126,30 +130,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineScaleSetExtension', response) if raw: @@ -158,18 +140,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} def _delete_initial( self, resource_group_name, vm_scale_set_name, vmss_extension_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -213,7 +197,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_scale_set_name, vmss_extension_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, vmss_extension_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -224,13 +208,16 @@ def delete( :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -241,30 +228,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -273,12 +238,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} def get( self, resource_group_name, vm_scale_set_name, vmss_extension_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -306,7 +273,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -350,6 +317,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} def list( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -374,7 +342,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -421,3 +389,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_scale_set_rolling_upgrades_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_scale_set_rolling_upgrades_operations.py index f3649b7c2c29..510c2e37faff 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_scale_set_rolling_upgrades_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-03-30". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _cancel_initial( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel' + url = self.cancel.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -86,7 +86,7 @@ def _cancel_initial( return deserialized def cancel( - self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, polling=True, **operation_config): """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -94,13 +94,16 @@ def cancel( :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._cancel_initial( @@ -110,30 +113,8 @@ def cancel( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -142,18 +123,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel'} def _start_os_upgrade_initial( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade' + url = self.start_os_upgrade.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -196,7 +179,7 @@ def _start_os_upgrade_initial( return deserialized def start_os_upgrade( - self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, polling=True, **operation_config): """Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not @@ -207,13 +190,16 @@ def start_os_upgrade( :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_os_upgrade_initial( @@ -223,30 +209,8 @@ def start_os_upgrade( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -255,12 +219,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start_os_upgrade.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade'} def get_latest( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -283,7 +249,7 @@ def get_latest( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest' + url = self.get_latest.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -324,3 +290,4 @@ def get_latest( return client_raw_response return deserialized + get_latest.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_scale_set_vms_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_scale_set_vms_operations.py index 4a17135db2cf..121b1a331375 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_scale_set_vms_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_scale_set_vms_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-03-30". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _reimage_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage' + url = self.reimage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -87,7 +87,7 @@ def _reimage_initial( return deserialized def reimage( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. @@ -98,13 +98,16 @@ def reimage( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._reimage_initial( @@ -115,30 +118,8 @@ def reimage( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -147,18 +128,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage'} def _reimage_all_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall' + url = self.reimage_all.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -202,7 +185,7 @@ def _reimage_all_initial( return deserialized def reimage_all( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. @@ -214,13 +197,16 @@ def reimage_all( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._reimage_all_initial( @@ -231,30 +217,8 @@ def reimage_all( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -263,18 +227,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reimage_all.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall'} def _deallocate_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate' + url = self.deallocate.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -318,7 +284,7 @@ def _deallocate_initial( return deserialized def deallocate( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is @@ -331,13 +297,16 @@ def deallocate( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._deallocate_initial( @@ -348,30 +317,8 @@ def deallocate( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -380,18 +327,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate'} def _delete_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -435,7 +384,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -445,13 +394,16 @@ def delete( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -462,30 +414,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -494,12 +424,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} def get( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): @@ -523,7 +455,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -565,6 +497,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} def get_instance_view( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): @@ -589,7 +522,7 @@ def get_instance_view( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView' + url = self.get_instance_view.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -631,6 +564,7 @@ def get_instance_view( return client_raw_response return deserialized + get_instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView'} def list( self, resource_group_name, virtual_machine_scale_set_name, filter=None, select=None, expand=None, custom_headers=None, raw=False, **operation_config): @@ -660,7 +594,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -713,12 +647,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines'} def _power_off_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff' + url = self.power_off.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -762,7 +697,7 @@ def _power_off_initial( return deserialized def power_off( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid @@ -775,13 +710,16 @@ def power_off( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._power_off_initial( @@ -792,30 +730,8 @@ def power_off( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -824,18 +740,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff'} def _restart_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart' + url = self.restart.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -879,7 +797,7 @@ def _restart_initial( return deserialized def restart( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -889,13 +807,16 @@ def restart( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._restart_initial( @@ -906,30 +827,8 @@ def restart( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -938,18 +837,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart'} def _start_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -993,7 +894,7 @@ def _start_initial( return deserialized def start( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1003,13 +904,16 @@ def start( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -1020,30 +924,8 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1052,9 +934,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_scale_sets_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_scale_sets_operations.py index 635c5c29a1c4..2b3ad31f8937 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_scale_sets_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_scale_sets_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineScaleSetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-03-30". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, vm_scale_set_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, vm_scale_set_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -104,13 +104,16 @@ def create_or_update( :type parameters: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSet :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineScaleSet or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachineScaleSet + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSet] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSet]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -121,30 +124,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineScaleSet', response) if raw: @@ -153,18 +134,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def _update_initial( self, resource_group_name, vm_scale_set_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -211,7 +194,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, vm_scale_set_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -223,13 +206,16 @@ def update( :type parameters: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetUpdate :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineScaleSet or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachineScaleSet + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSet] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSet]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -240,30 +226,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineScaleSet', response) if raw: @@ -272,18 +236,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def _delete_initial( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -326,7 +292,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -334,13 +300,16 @@ def delete( :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -350,30 +319,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -382,12 +329,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def get( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -408,7 +357,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -449,6 +398,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def _deallocate_initial( @@ -458,7 +408,7 @@ def _deallocate_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate' + url = self.deallocate.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -508,7 +458,7 @@ def _deallocate_initial( return deserialized def deallocate( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set @@ -524,13 +474,16 @@ def deallocate( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._deallocate_initial( @@ -541,30 +494,8 @@ def deallocate( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -573,12 +504,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate'} def _delete_instances_initial( @@ -586,7 +519,7 @@ def _delete_instances_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceRequiredIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete' + url = self.delete_instances.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -633,7 +566,7 @@ def _delete_instances_initial( return deserialized def delete_instances( - self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -643,13 +576,16 @@ def delete_instances( :param instance_ids: The virtual machine scale set instance ids. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_instances_initial( @@ -660,30 +596,8 @@ def delete_instances( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -692,12 +606,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_instances.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete'} def get_instance_view( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -720,7 +636,7 @@ def get_instance_view( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView' + url = self.get_instance_view.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -761,6 +677,7 @@ def get_instance_view( return client_raw_response return deserialized + get_instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -782,7 +699,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -828,6 +745,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -850,7 +768,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -895,6 +813,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets'} def list_skus( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -919,7 +838,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus' + url = self.list_skus.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -966,6 +885,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus'} def _power_off_initial( @@ -975,7 +895,7 @@ def _power_off_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff' + url = self.power_off.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1025,7 +945,7 @@ def _power_off_initial( return deserialized def power_off( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid @@ -1041,13 +961,16 @@ def power_off( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._power_off_initial( @@ -1058,30 +981,8 @@ def power_off( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1090,12 +991,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff'} def _restart_initial( @@ -1105,7 +1008,7 @@ def _restart_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart' + url = self.restart.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1155,7 +1058,7 @@ def _restart_initial( return deserialized def restart( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1168,13 +1071,16 @@ def restart( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._restart_initial( @@ -1185,30 +1091,8 @@ def restart( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1217,12 +1101,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart'} def _start_initial( @@ -1232,7 +1118,7 @@ def _start_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1282,7 +1168,7 @@ def _start_initial( return deserialized def start( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1295,13 +1181,16 @@ def start( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -1312,30 +1201,8 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1344,12 +1211,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start'} def _update_instances_initial( @@ -1357,7 +1226,7 @@ def _update_instances_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceRequiredIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade' + url = self.update_instances.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1404,7 +1273,7 @@ def _update_instances_initial( return deserialized def update_instances( - self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, polling=True, **operation_config): """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. @@ -1415,13 +1284,16 @@ def update_instances( :param instance_ids: The virtual machine scale set instance ids. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._update_instances_initial( @@ -1432,30 +1304,8 @@ def update_instances( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1464,12 +1314,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_instances.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade'} def _reimage_initial( @@ -1479,7 +1331,7 @@ def _reimage_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage' + url = self.reimage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1529,7 +1381,7 @@ def _reimage_initial( return deserialized def reimage( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. @@ -1543,13 +1395,16 @@ def reimage( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._reimage_initial( @@ -1560,30 +1415,8 @@ def reimage( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1592,12 +1425,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage'} def _reimage_all_initial( @@ -1607,7 +1442,7 @@ def _reimage_all_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall' + url = self.reimage_all.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1657,7 +1492,7 @@ def _reimage_all_initial( return deserialized def reimage_all( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. @@ -1671,13 +1506,16 @@ def reimage_all( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._reimage_all_initial( @@ -1688,30 +1526,8 @@ def reimage_all( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1720,9 +1536,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reimage_all.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_sizes_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_sizes_operations.py index 399e1df9732d..58bfd693c7e2 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_sizes_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machine_sizes_operations.py @@ -22,7 +22,7 @@ class VirtualMachineSizesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-03-30". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -105,3 +105,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machines_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machines_operations.py index 5878880159c0..a223a0cae1fc 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machines_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/virtual_machines_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachinesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-03-30". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _capture_initial( self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture' + url = self.capture.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -90,7 +90,7 @@ def _capture_initial( return deserialized def capture( - self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -103,13 +103,17 @@ def capture( :type parameters: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineCaptureParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineCaptureResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualMachineCaptureResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineCaptureResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineCaptureResult]] :raises: :class:`CloudError` """ raw_result = self._capture_initial( @@ -120,30 +124,8 @@ def capture( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineCaptureResult', response) if raw: @@ -152,18 +134,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture'} def _create_or_update_initial( self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -212,7 +196,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -224,13 +208,16 @@ def create_or_update( :type parameters: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachine :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachine or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachine or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.VirtualMachine] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.VirtualMachine]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -241,30 +228,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachine', response) if raw: @@ -273,18 +238,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} def _delete_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -327,7 +294,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -335,13 +302,16 @@ def delete( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -351,30 +321,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -383,12 +331,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} def get( self, resource_group_name, vm_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -414,7 +364,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -457,6 +407,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} def instance_view( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): @@ -478,7 +429,7 @@ def instance_view( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView' + url = self.instance_view.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -519,12 +470,13 @@ def instance_view( return client_raw_response return deserialized + instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView'} def _convert_to_managed_disks_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks' + url = self.convert_to_managed_disks.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -567,7 +519,7 @@ def _convert_to_managed_disks_initial( return deserialized def convert_to_managed_disks( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. @@ -577,13 +529,16 @@ def convert_to_managed_disks( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._convert_to_managed_disks_initial( @@ -593,30 +548,8 @@ def convert_to_managed_disks( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -625,18 +558,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + convert_to_managed_disks.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks'} def _deallocate_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate' + url = self.deallocate.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -679,7 +614,7 @@ def _deallocate_initial( return deserialized def deallocate( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. @@ -689,13 +624,16 @@ def deallocate( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._deallocate_initial( @@ -705,30 +643,8 @@ def deallocate( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -737,12 +653,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate'} def generalize( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): @@ -763,7 +681,7 @@ def generalize( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize' + url = self.generalize.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -804,6 +722,7 @@ def generalize( return client_raw_response return deserialized + generalize.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -827,7 +746,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -873,6 +792,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -894,7 +814,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -939,6 +859,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines'} def list_available_sizes( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): @@ -963,7 +884,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes' + url = self.list_available_sizes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1010,12 +931,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_available_sizes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes'} def _power_off_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff' + url = self.power_off.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1058,7 +980,7 @@ def _power_off_initial( return deserialized def power_off( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. @@ -1068,13 +990,16 @@ def power_off( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._power_off_initial( @@ -1084,30 +1009,8 @@ def power_off( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1116,18 +1019,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff'} def _restart_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart' + url = self.restart.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1170,7 +1075,7 @@ def _restart_initial( return deserialized def restart( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1178,13 +1083,16 @@ def restart( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._restart_initial( @@ -1194,30 +1102,8 @@ def restart( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1226,18 +1112,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart'} def _start_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1280,7 +1168,7 @@ def _start_initial( return deserialized def start( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1288,13 +1176,16 @@ def start( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -1304,30 +1195,8 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1336,18 +1205,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start'} def _redeploy_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy' + url = self.redeploy.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1390,7 +1261,7 @@ def _redeploy_initial( return deserialized def redeploy( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to redeploy a virtual machine. :param resource_group_name: The name of the resource group. @@ -1398,13 +1269,16 @@ def redeploy( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._redeploy_initial( @@ -1414,30 +1288,8 @@ def redeploy( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1446,18 +1298,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + redeploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy'} def _perform_maintenance_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance' + url = self.perform_maintenance.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1500,7 +1354,7 @@ def _perform_maintenance_initial( return deserialized def perform_maintenance( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1508,13 +1362,16 @@ def perform_maintenance( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._perform_maintenance_initial( @@ -1524,30 +1381,8 @@ def perform_maintenance( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1556,18 +1391,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + perform_maintenance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance'} def _run_command_initial( self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand' + url = self.run_command.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1614,7 +1451,7 @@ def _run_command_initial( return deserialized def run_command( - self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1625,13 +1462,16 @@ def run_command( :type parameters: ~azure.mgmt.compute.v2017_03_30.models.RunCommandInput :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RunCommandResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RunCommandResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_03_30.models.RunCommandResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_03_30.models.RunCommandResult]] :raises: :class:`CloudError` """ raw_result = self._run_command_initial( @@ -1642,30 +1482,8 @@ def run_command( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RunCommandResult', response) if raw: @@ -1674,9 +1492,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/__init__.py index c4a8bde0aaa4..88a8e42394f5 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/__init__.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/__init__.py @@ -9,13 +9,22 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource_sku_capacity import ResourceSkuCapacity -from .resource_sku_costs import ResourceSkuCosts -from .resource_sku_capabilities import ResourceSkuCapabilities -from .resource_sku_restriction_info import ResourceSkuRestrictionInfo -from .resource_sku_restrictions import ResourceSkuRestrictions -from .resource_sku_location_info import ResourceSkuLocationInfo -from .resource_sku import ResourceSku +try: + from .resource_sku_capacity_py3 import ResourceSkuCapacity + from .resource_sku_costs_py3 import ResourceSkuCosts + from .resource_sku_capabilities_py3 import ResourceSkuCapabilities + from .resource_sku_restriction_info_py3 import ResourceSkuRestrictionInfo + from .resource_sku_restrictions_py3 import ResourceSkuRestrictions + from .resource_sku_location_info_py3 import ResourceSkuLocationInfo + from .resource_sku_py3 import ResourceSku +except (SyntaxError, ImportError): + from .resource_sku_capacity import ResourceSkuCapacity + from .resource_sku_costs import ResourceSkuCosts + from .resource_sku_capabilities import ResourceSkuCapabilities + from .resource_sku_restriction_info import ResourceSkuRestrictionInfo + from .resource_sku_restrictions import ResourceSkuRestrictions + from .resource_sku_location_info import ResourceSkuLocationInfo + from .resource_sku import ResourceSku from .resource_sku_paged import ResourceSkuPaged from .compute_management_client_enums import ( ResourceSkuCapacityScaleType, diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/compute_management_client_enums.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/compute_management_client_enums.py index 8a5234f462c7..7b1680238d1c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/compute_management_client_enums.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/compute_management_client_enums.py @@ -12,20 +12,20 @@ from enum import Enum -class ResourceSkuCapacityScaleType(Enum): +class ResourceSkuCapacityScaleType(str, Enum): automatic = "Automatic" manual = "Manual" none = "None" -class ResourceSkuRestrictionsType(Enum): +class ResourceSkuRestrictionsType(str, Enum): location = "Location" zone = "Zone" -class ResourceSkuRestrictionsReasonCode(Enum): +class ResourceSkuRestrictionsReasonCode(str, Enum): quota_id = "QuotaId" not_available_for_subscription = "NotAvailableForSubscription" diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku.py index 098e4a03ada4..4efb6a2db23a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku.py @@ -86,8 +86,8 @@ class ResourceSku(Model): 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, } - def __init__(self): - super(ResourceSku, self).__init__() + def __init__(self, **kwargs): + super(ResourceSku, self).__init__(**kwargs) self.resource_type = None self.name = None self.tier = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_capabilities.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_capabilities.py index 278f55789e9e..1248116584dd 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_capabilities.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_capabilities.py @@ -34,7 +34,7 @@ class ResourceSkuCapabilities(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self): - super(ResourceSkuCapabilities, self).__init__() + def __init__(self, **kwargs): + super(ResourceSkuCapabilities, self).__init__(**kwargs) self.name = None self.value = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_capabilities_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_capabilities_py3.py new file mode 100644 index 000000000000..c7a095c1f04b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_capabilities_py3.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 msrest.serialization import Model + + +class ResourceSkuCapabilities(Model): + """Describes The SKU capabilites object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: An invariant to describe the feature. + :vartype name: str + :ivar value: An invariant if the feature is measured by quantity. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSkuCapabilities, self).__init__(**kwargs) + self.name = None + self.value = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_capacity.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_capacity.py index d43a8018a9b9..54444d0a5191 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_capacity.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_capacity.py @@ -44,8 +44,8 @@ class ResourceSkuCapacity(Model): 'scale_type': {'key': 'scaleType', 'type': 'ResourceSkuCapacityScaleType'}, } - def __init__(self): - super(ResourceSkuCapacity, self).__init__() + def __init__(self, **kwargs): + super(ResourceSkuCapacity, self).__init__(**kwargs) self.minimum = None self.maximum = None self.default = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_capacity_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_capacity_py3.py new file mode 100644 index 000000000000..9f87229170f4 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_capacity_py3.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class ResourceSkuCapacity(Model): + """Describes scaling information of a SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar minimum: The minimum capacity. + :vartype minimum: long + :ivar maximum: The maximum capacity that can be set. + :vartype maximum: long + :ivar default: The default capacity. + :vartype default: long + :ivar scale_type: The scale type applicable to the sku. Possible values + include: 'Automatic', 'Manual', 'None' + :vartype scale_type: str or + ~azure.mgmt.compute.v2017_09_01.models.ResourceSkuCapacityScaleType + """ + + _validation = { + 'minimum': {'readonly': True}, + 'maximum': {'readonly': True}, + 'default': {'readonly': True}, + 'scale_type': {'readonly': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'long'}, + 'maximum': {'key': 'maximum', 'type': 'long'}, + 'default': {'key': 'default', 'type': 'long'}, + 'scale_type': {'key': 'scaleType', 'type': 'ResourceSkuCapacityScaleType'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSkuCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default = None + self.scale_type = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_costs.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_costs.py index 103f21eb6428..293adaf0962c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_costs.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_costs.py @@ -38,8 +38,8 @@ class ResourceSkuCosts(Model): 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, } - def __init__(self): - super(ResourceSkuCosts, self).__init__() + def __init__(self, **kwargs): + super(ResourceSkuCosts, self).__init__(**kwargs) self.meter_id = None self.quantity = None self.extended_unit = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_costs_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_costs_py3.py new file mode 100644 index 000000000000..59e7036807d6 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_costs_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class ResourceSkuCosts(Model): + """Describes metadata for retrieving price info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar meter_id: Used for querying price from commerce. + :vartype meter_id: str + :ivar quantity: The multiplier is needed to extend the base metered cost. + :vartype quantity: long + :ivar extended_unit: An invariant to show the extended unit. + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterID', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSkuCosts, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_location_info.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_location_info.py index db62b0ecea05..93527f5eda34 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_location_info.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_location_info.py @@ -34,7 +34,7 @@ class ResourceSkuLocationInfo(Model): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self): - super(ResourceSkuLocationInfo, self).__init__() + def __init__(self, **kwargs): + super(ResourceSkuLocationInfo, self).__init__(**kwargs) self.location = None self.zones = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_location_info_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_location_info_py3.py new file mode 100644 index 000000000000..a03c6d92fe8e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_location_info_py3.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 msrest.serialization import Model + + +class ResourceSkuLocationInfo(Model): + """ResourceSkuLocationInfo. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar location: Location of the SKU + :vartype location: str + :ivar zones: List of availability zones where the SKU is supported. + :vartype zones: list[str] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_py3.py new file mode 100644 index 000000000000..7d98b1935d73 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_py3.py @@ -0,0 +1,103 @@ +# 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 msrest.serialization import Model + + +class ResourceSku(Model): + """Describes an available Compute SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_type: The type of resource the SKU applies to. + :vartype resource_type: str + :ivar name: The name of SKU. + :vartype name: str + :ivar tier: Specifies the tier of virtual machines in a scale set.

    Possible Values:

    **Standard**

    **Basic** + :vartype tier: str + :ivar size: The Size of the SKU. + :vartype size: str + :ivar family: The Family of this particular SKU. + :vartype family: str + :ivar kind: The Kind of resources that are supported in this SKU. + :vartype kind: str + :ivar capacity: Specifies the number of virtual machines in the scale set. + :vartype capacity: + ~azure.mgmt.compute.v2017_09_01.models.ResourceSkuCapacity + :ivar locations: The set of locations that the SKU is available. + :vartype locations: list[str] + :ivar location_info: A list of locations and availability zones in those + locations where the SKU is available. + :vartype location_info: + list[~azure.mgmt.compute.v2017_09_01.models.ResourceSkuLocationInfo] + :ivar api_versions: The api versions that support this SKU. + :vartype api_versions: list[str] + :ivar costs: Metadata for retrieving price info. + :vartype costs: + list[~azure.mgmt.compute.v2017_09_01.models.ResourceSkuCosts] + :ivar capabilities: A name value pair to describe the capability. + :vartype capabilities: + list[~azure.mgmt.compute.v2017_09_01.models.ResourceSkuCapabilities] + :ivar restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :vartype restrictions: + list[~azure.mgmt.compute.v2017_09_01.models.ResourceSkuRestrictions] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, + 'kind': {'readonly': True}, + 'capacity': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'costs': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'ResourceSkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ResourceSkuLocationInfo]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'costs': {'key': 'costs', 'type': '[ResourceSkuCosts]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapabilities]'}, + 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.tier = None + self.size = None + self.family = None + self.kind = None + self.capacity = None + self.locations = None + self.location_info = None + self.api_versions = None + self.costs = None + self.capabilities = None + self.restrictions = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_restriction_info.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_restriction_info.py index 66002fc56998..677e93463d58 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_restriction_info.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_restriction_info.py @@ -34,7 +34,7 @@ class ResourceSkuRestrictionInfo(Model): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self): - super(ResourceSkuRestrictionInfo, self).__init__() + def __init__(self, **kwargs): + super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) self.locations = None self.zones = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_restriction_info_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_restriction_info_py3.py new file mode 100644 index 000000000000..008cf8d4c5fa --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_restriction_info_py3.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 msrest.serialization import Model + + +class ResourceSkuRestrictionInfo(Model): + """ResourceSkuRestrictionInfo. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar locations: Locations where the SKU is restricted + :vartype locations: list[str] + :ivar zones: List of availability zones where the SKU is restricted. + :vartype zones: list[str] + """ + + _validation = { + 'locations': {'readonly': True}, + 'zones': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = None + self.zones = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_restrictions.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_restrictions.py index 8d8b1fff6370..1aeefcc483bd 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_restrictions.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_restrictions.py @@ -49,8 +49,8 @@ class ResourceSkuRestrictions(Model): 'reason_code': {'key': 'reasonCode', 'type': 'ResourceSkuRestrictionsReasonCode'}, } - def __init__(self): - super(ResourceSkuRestrictions, self).__init__() + def __init__(self, **kwargs): + super(ResourceSkuRestrictions, self).__init__(**kwargs) self.type = None self.values = None self.restriction_info = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_restrictions_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_restrictions_py3.py new file mode 100644 index 000000000000..24d45f0f78ed --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/models/resource_sku_restrictions_py3.py @@ -0,0 +1,57 @@ +# 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 msrest.serialization import Model + + +class ResourceSkuRestrictions(Model): + """Describes scaling information of a SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. Possible values include: 'Location', + 'Zone' + :vartype type: str or + ~azure.mgmt.compute.v2017_09_01.models.ResourceSkuRestrictionsType + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :ivar restriction_info: The information about the restriction where the + SKU cannot be used. + :vartype restriction_info: + ~azure.mgmt.compute.v2017_09_01.models.ResourceSkuRestrictionInfo + :ivar reason_code: The reason for restriction. Possible values include: + 'QuotaId', 'NotAvailableForSubscription' + :vartype reason_code: str or + ~azure.mgmt.compute.v2017_09_01.models.ResourceSkuRestrictionsReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + 'restriction_info': {'readonly': True}, + 'reason_code': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'ResourceSkuRestrictionsType'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'ResourceSkuRestrictionsReasonCode'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSkuRestrictions, self).__init__(**kwargs) + self.type = None + self.values = None + self.restriction_info = None + self.reason_code = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/resource_skus_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/resource_skus_operations.py index bcd00cb56478..a6b8de4df819 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/resource_skus_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/resource_skus_operations.py @@ -22,7 +22,7 @@ class ResourceSkusOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-09-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/compute_management_client.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/compute_management_client.py index c15fc468573e..2666801ff54a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/compute_management_client.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/compute_management_client.py @@ -13,6 +13,7 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from .operations.operations import Operations from .operations.availability_sets_operations import AvailabilitySetsOperations from .operations.virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations from .operations.virtual_machine_extensions_operations import VirtualMachineExtensionsOperations @@ -25,6 +26,7 @@ from .operations.virtual_machine_scale_set_extensions_operations import VirtualMachineScaleSetExtensionsOperations from .operations.virtual_machine_scale_set_rolling_upgrades_operations import VirtualMachineScaleSetRollingUpgradesOperations from .operations.virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations +from .operations.log_analytics_operations import LogAnalyticsOperations from .operations.virtual_machine_run_commands_operations import VirtualMachineRunCommandsOperations from . import models @@ -69,6 +71,8 @@ class ComputeManagementClient(object): :ivar config: Configuration for client. :vartype config: ComputeManagementClientConfiguration + :ivar operations: Operations operations + :vartype operations: azure.mgmt.compute.v2017_12_01.operations.Operations :ivar availability_sets: AvailabilitySets operations :vartype availability_sets: azure.mgmt.compute.v2017_12_01.operations.AvailabilitySetsOperations :ivar virtual_machine_extension_images: VirtualMachineExtensionImages operations @@ -93,6 +97,8 @@ class ComputeManagementClient(object): :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2017_12_01.operations.VirtualMachineScaleSetRollingUpgradesOperations :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMs operations :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2017_12_01.operations.VirtualMachineScaleSetVMsOperations + :ivar log_analytics: LogAnalytics operations + :vartype log_analytics: azure.mgmt.compute.v2017_12_01.operations.LogAnalyticsOperations :ivar virtual_machine_run_commands: VirtualMachineRunCommands operations :vartype virtual_machine_run_commands: azure.mgmt.compute.v2017_12_01.operations.VirtualMachineRunCommandsOperations @@ -117,6 +123,8 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) self.availability_sets = AvailabilitySetsOperations( self._client, self.config, self._serialize, self._deserialize) self.virtual_machine_extension_images = VirtualMachineExtensionImagesOperations( @@ -141,5 +149,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.virtual_machine_scale_set_vms = VirtualMachineScaleSetVMsOperations( self._client, self.config, self._serialize, self._deserialize) + self.log_analytics = LogAnalyticsOperations( + self._client, self.config, self._serialize, self._deserialize) self.virtual_machine_run_commands = VirtualMachineRunCommandsOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/__init__.py index 3d6e82bd216d..b8d6e058d197 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/__init__.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/__init__.py @@ -9,116 +9,249 @@ # regenerated. # -------------------------------------------------------------------------- -from .instance_view_status import InstanceViewStatus -from .sub_resource import SubResource -from .sku import Sku -from .availability_set import AvailabilitySet -from .virtual_machine_size import VirtualMachineSize -from .virtual_machine_extension_image import VirtualMachineExtensionImage -from .virtual_machine_image_resource import VirtualMachineImageResource -from .virtual_machine_extension_instance_view import VirtualMachineExtensionInstanceView -from .virtual_machine_extension import VirtualMachineExtension -from .purchase_plan import PurchasePlan -from .os_disk_image import OSDiskImage -from .data_disk_image import DataDiskImage -from .virtual_machine_image import VirtualMachineImage -from .usage_name import UsageName -from .usage import Usage -from .virtual_machine_capture_parameters import VirtualMachineCaptureParameters -from .virtual_machine_capture_result import VirtualMachineCaptureResult -from .plan import Plan -from .hardware_profile import HardwareProfile -from .image_reference import ImageReference -from .key_vault_secret_reference import KeyVaultSecretReference -from .key_vault_key_reference import KeyVaultKeyReference -from .disk_encryption_settings import DiskEncryptionSettings -from .virtual_hard_disk import VirtualHardDisk -from .managed_disk_parameters import ManagedDiskParameters -from .os_disk import OSDisk -from .data_disk import DataDisk -from .storage_profile import StorageProfile -from .additional_unattend_content import AdditionalUnattendContent -from .win_rm_listener import WinRMListener -from .win_rm_configuration import WinRMConfiguration -from .windows_configuration import WindowsConfiguration -from .ssh_public_key import SshPublicKey -from .ssh_configuration import SshConfiguration -from .linux_configuration import LinuxConfiguration -from .vault_certificate import VaultCertificate -from .vault_secret_group import VaultSecretGroup -from .os_profile import OSProfile -from .network_interface_reference import NetworkInterfaceReference -from .network_profile import NetworkProfile -from .boot_diagnostics import BootDiagnostics -from .diagnostics_profile import DiagnosticsProfile -from .virtual_machine_extension_handler_instance_view import VirtualMachineExtensionHandlerInstanceView -from .virtual_machine_agent_instance_view import VirtualMachineAgentInstanceView -from .disk_instance_view import DiskInstanceView -from .boot_diagnostics_instance_view import BootDiagnosticsInstanceView -from .virtual_machine_identity import VirtualMachineIdentity -from .maintenance_redeploy_status import MaintenanceRedeployStatus -from .virtual_machine_instance_view import VirtualMachineInstanceView -from .virtual_machine import VirtualMachine -from .rolling_upgrade_policy import RollingUpgradePolicy -from .upgrade_policy import UpgradePolicy -from .image_os_disk import ImageOSDisk -from .image_data_disk import ImageDataDisk -from .image_storage_profile import ImageStorageProfile -from .image import Image -from .virtual_machine_scale_set_identity import VirtualMachineScaleSetIdentity -from .virtual_machine_scale_set_os_profile import VirtualMachineScaleSetOSProfile -from .virtual_machine_scale_set_update_os_profile import VirtualMachineScaleSetUpdateOSProfile -from .virtual_machine_scale_set_managed_disk_parameters import VirtualMachineScaleSetManagedDiskParameters -from .virtual_machine_scale_set_os_disk import VirtualMachineScaleSetOSDisk -from .virtual_machine_scale_set_update_os_disk import VirtualMachineScaleSetUpdateOSDisk -from .virtual_machine_scale_set_data_disk import VirtualMachineScaleSetDataDisk -from .virtual_machine_scale_set_storage_profile import VirtualMachineScaleSetStorageProfile -from .virtual_machine_scale_set_update_storage_profile import VirtualMachineScaleSetUpdateStorageProfile -from .api_entity_reference import ApiEntityReference -from .virtual_machine_scale_set_public_ip_address_configuration_dns_settings import VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings -from .virtual_machine_scale_set_public_ip_address_configuration import VirtualMachineScaleSetPublicIPAddressConfiguration -from .virtual_machine_scale_set_update_public_ip_address_configuration import VirtualMachineScaleSetUpdatePublicIPAddressConfiguration -from .virtual_machine_scale_set_ip_configuration import VirtualMachineScaleSetIPConfiguration -from .virtual_machine_scale_set_update_ip_configuration import VirtualMachineScaleSetUpdateIPConfiguration -from .virtual_machine_scale_set_network_configuration_dns_settings import VirtualMachineScaleSetNetworkConfigurationDnsSettings -from .virtual_machine_scale_set_network_configuration import VirtualMachineScaleSetNetworkConfiguration -from .virtual_machine_scale_set_update_network_configuration import VirtualMachineScaleSetUpdateNetworkConfiguration -from .virtual_machine_scale_set_network_profile import VirtualMachineScaleSetNetworkProfile -from .virtual_machine_scale_set_update_network_profile import VirtualMachineScaleSetUpdateNetworkProfile -from .virtual_machine_scale_set_extension import VirtualMachineScaleSetExtension -from .virtual_machine_scale_set_extension_profile import VirtualMachineScaleSetExtensionProfile -from .virtual_machine_scale_set_vm_profile import VirtualMachineScaleSetVMProfile -from .virtual_machine_scale_set_update_vm_profile import VirtualMachineScaleSetUpdateVMProfile -from .virtual_machine_scale_set import VirtualMachineScaleSet -from .virtual_machine_scale_set_update import VirtualMachineScaleSetUpdate -from .virtual_machine_scale_set_vm_instance_ids import VirtualMachineScaleSetVMInstanceIDs -from .virtual_machine_scale_set_vm_instance_required_ids import VirtualMachineScaleSetVMInstanceRequiredIDs -from .virtual_machine_status_code_count import VirtualMachineStatusCodeCount -from .virtual_machine_scale_set_instance_view_statuses_summary import VirtualMachineScaleSetInstanceViewStatusesSummary -from .virtual_machine_scale_set_vm_extensions_summary import VirtualMachineScaleSetVMExtensionsSummary -from .virtual_machine_scale_set_instance_view import VirtualMachineScaleSetInstanceView -from .virtual_machine_scale_set_sku_capacity import VirtualMachineScaleSetSkuCapacity -from .virtual_machine_scale_set_sku import VirtualMachineScaleSetSku -from .virtual_machine_scale_set_vm import VirtualMachineScaleSetVM -from .virtual_machine_health_status import VirtualMachineHealthStatus -from .virtual_machine_scale_set_vm_instance_view import VirtualMachineScaleSetVMInstanceView -from .rolling_upgrade_running_status import RollingUpgradeRunningStatus -from .rolling_upgrade_progress_info import RollingUpgradeProgressInfo -from .api_error_base import ApiErrorBase -from .inner_error import InnerError -from .api_error import ApiError -from .rolling_upgrade_status_info import RollingUpgradeStatusInfo -from .compute_long_running_operation_properties import ComputeLongRunningOperationProperties -from .resource import Resource -from .update_resource import UpdateResource -from .sub_resource_read_only import SubResourceReadOnly -from .operation_status_response import OperationStatusResponse -from .run_command_input_parameter import RunCommandInputParameter -from .run_command_input import RunCommandInput -from .run_command_parameter_definition import RunCommandParameterDefinition -from .run_command_document_base import RunCommandDocumentBase -from .run_command_document import RunCommandDocument -from .run_command_result import RunCommandResult +try: + from .compute_operation_value_py3 import ComputeOperationValue + from .instance_view_status_py3 import InstanceViewStatus + from .sub_resource_py3 import SubResource + from .sku_py3 import Sku + from .availability_set_py3 import AvailabilitySet + from .availability_set_update_py3 import AvailabilitySetUpdate + from .virtual_machine_size_py3 import VirtualMachineSize + from .virtual_machine_extension_image_py3 import VirtualMachineExtensionImage + from .virtual_machine_image_resource_py3 import VirtualMachineImageResource + from .virtual_machine_extension_instance_view_py3 import VirtualMachineExtensionInstanceView + from .virtual_machine_extension_py3 import VirtualMachineExtension + from .purchase_plan_py3 import PurchasePlan + from .os_disk_image_py3 import OSDiskImage + from .data_disk_image_py3 import DataDiskImage + from .virtual_machine_image_py3 import VirtualMachineImage + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .virtual_machine_capture_parameters_py3 import VirtualMachineCaptureParameters + from .virtual_machine_capture_result_py3 import VirtualMachineCaptureResult + from .plan_py3 import Plan + from .hardware_profile_py3 import HardwareProfile + from .image_reference_py3 import ImageReference + from .key_vault_secret_reference_py3 import KeyVaultSecretReference + from .key_vault_key_reference_py3 import KeyVaultKeyReference + from .disk_encryption_settings_py3 import DiskEncryptionSettings + from .virtual_hard_disk_py3 import VirtualHardDisk + from .managed_disk_parameters_py3 import ManagedDiskParameters + from .os_disk_py3 import OSDisk + from .data_disk_py3 import DataDisk + from .storage_profile_py3 import StorageProfile + from .additional_unattend_content_py3 import AdditionalUnattendContent + from .win_rm_listener_py3 import WinRMListener + from .win_rm_configuration_py3 import WinRMConfiguration + from .windows_configuration_py3 import WindowsConfiguration + from .ssh_public_key_py3 import SshPublicKey + from .ssh_configuration_py3 import SshConfiguration + from .linux_configuration_py3 import LinuxConfiguration + from .vault_certificate_py3 import VaultCertificate + from .vault_secret_group_py3 import VaultSecretGroup + from .os_profile_py3 import OSProfile + from .network_interface_reference_py3 import NetworkInterfaceReference + from .network_profile_py3 import NetworkProfile + from .boot_diagnostics_py3 import BootDiagnostics + from .diagnostics_profile_py3 import DiagnosticsProfile + from .virtual_machine_extension_handler_instance_view_py3 import VirtualMachineExtensionHandlerInstanceView + from .virtual_machine_agent_instance_view_py3 import VirtualMachineAgentInstanceView + from .disk_instance_view_py3 import DiskInstanceView + from .boot_diagnostics_instance_view_py3 import BootDiagnosticsInstanceView + from .virtual_machine_identity_py3 import VirtualMachineIdentity + from .maintenance_redeploy_status_py3 import MaintenanceRedeployStatus + from .virtual_machine_instance_view_py3 import VirtualMachineInstanceView + from .virtual_machine_py3 import VirtualMachine + from .virtual_machine_update_py3 import VirtualMachineUpdate + from .rolling_upgrade_policy_py3 import RollingUpgradePolicy + from .upgrade_policy_py3 import UpgradePolicy + from .image_os_disk_py3 import ImageOSDisk + from .image_data_disk_py3 import ImageDataDisk + from .image_storage_profile_py3 import ImageStorageProfile + from .image_py3 import Image + from .image_update_py3 import ImageUpdate + from .virtual_machine_scale_set_identity_py3 import VirtualMachineScaleSetIdentity + from .virtual_machine_scale_set_os_profile_py3 import VirtualMachineScaleSetOSProfile + from .virtual_machine_scale_set_update_os_profile_py3 import VirtualMachineScaleSetUpdateOSProfile + from .virtual_machine_scale_set_managed_disk_parameters_py3 import VirtualMachineScaleSetManagedDiskParameters + from .virtual_machine_scale_set_os_disk_py3 import VirtualMachineScaleSetOSDisk + from .virtual_machine_scale_set_update_os_disk_py3 import VirtualMachineScaleSetUpdateOSDisk + from .virtual_machine_scale_set_data_disk_py3 import VirtualMachineScaleSetDataDisk + from .virtual_machine_scale_set_storage_profile_py3 import VirtualMachineScaleSetStorageProfile + from .virtual_machine_scale_set_update_storage_profile_py3 import VirtualMachineScaleSetUpdateStorageProfile + from .api_entity_reference_py3 import ApiEntityReference + from .virtual_machine_scale_set_public_ip_address_configuration_dns_settings_py3 import VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + from .virtual_machine_scale_set_public_ip_address_configuration_py3 import VirtualMachineScaleSetPublicIPAddressConfiguration + from .virtual_machine_scale_set_update_public_ip_address_configuration_py3 import VirtualMachineScaleSetUpdatePublicIPAddressConfiguration + from .virtual_machine_scale_set_ip_configuration_py3 import VirtualMachineScaleSetIPConfiguration + from .virtual_machine_scale_set_update_ip_configuration_py3 import VirtualMachineScaleSetUpdateIPConfiguration + from .virtual_machine_scale_set_network_configuration_dns_settings_py3 import VirtualMachineScaleSetNetworkConfigurationDnsSettings + from .virtual_machine_scale_set_network_configuration_py3 import VirtualMachineScaleSetNetworkConfiguration + from .virtual_machine_scale_set_update_network_configuration_py3 import VirtualMachineScaleSetUpdateNetworkConfiguration + from .virtual_machine_scale_set_network_profile_py3 import VirtualMachineScaleSetNetworkProfile + from .virtual_machine_scale_set_update_network_profile_py3 import VirtualMachineScaleSetUpdateNetworkProfile + from .virtual_machine_scale_set_extension_py3 import VirtualMachineScaleSetExtension + from .virtual_machine_scale_set_extension_profile_py3 import VirtualMachineScaleSetExtensionProfile + from .virtual_machine_scale_set_vm_profile_py3 import VirtualMachineScaleSetVMProfile + from .virtual_machine_scale_set_update_vm_profile_py3 import VirtualMachineScaleSetUpdateVMProfile + from .virtual_machine_scale_set_py3 import VirtualMachineScaleSet + from .virtual_machine_scale_set_update_py3 import VirtualMachineScaleSetUpdate + from .virtual_machine_scale_set_vm_instance_ids_py3 import VirtualMachineScaleSetVMInstanceIDs + from .virtual_machine_scale_set_vm_instance_required_ids_py3 import VirtualMachineScaleSetVMInstanceRequiredIDs + from .virtual_machine_status_code_count_py3 import VirtualMachineStatusCodeCount + from .virtual_machine_scale_set_instance_view_statuses_summary_py3 import VirtualMachineScaleSetInstanceViewStatusesSummary + from .virtual_machine_scale_set_vm_extensions_summary_py3 import VirtualMachineScaleSetVMExtensionsSummary + from .virtual_machine_scale_set_instance_view_py3 import VirtualMachineScaleSetInstanceView + from .virtual_machine_scale_set_sku_capacity_py3 import VirtualMachineScaleSetSkuCapacity + from .virtual_machine_scale_set_sku_py3 import VirtualMachineScaleSetSku + from .virtual_machine_scale_set_vm_py3 import VirtualMachineScaleSetVM + from .virtual_machine_health_status_py3 import VirtualMachineHealthStatus + from .virtual_machine_scale_set_vm_instance_view_py3 import VirtualMachineScaleSetVMInstanceView + from .rolling_upgrade_running_status_py3 import RollingUpgradeRunningStatus + from .rolling_upgrade_progress_info_py3 import RollingUpgradeProgressInfo + from .api_error_base_py3 import ApiErrorBase + from .inner_error_py3 import InnerError + from .api_error_py3 import ApiError + from .rolling_upgrade_status_info_py3 import RollingUpgradeStatusInfo + from .compute_long_running_operation_properties_py3 import ComputeLongRunningOperationProperties + from .resource_py3 import Resource + from .update_resource_py3 import UpdateResource + from .sub_resource_read_only_py3 import SubResourceReadOnly + from .recovery_walk_response_py3 import RecoveryWalkResponse + from .operation_status_response_py3 import OperationStatusResponse + from .request_rate_by_interval_input_py3 import RequestRateByIntervalInput + from .throttled_requests_input_py3 import ThrottledRequestsInput + from .log_analytics_input_base_py3 import LogAnalyticsInputBase + from .log_analytics_output_py3 import LogAnalyticsOutput + from .log_analytics_operation_result_py3 import LogAnalyticsOperationResult + from .run_command_input_parameter_py3 import RunCommandInputParameter + from .run_command_input_py3 import RunCommandInput + from .run_command_parameter_definition_py3 import RunCommandParameterDefinition + from .run_command_document_base_py3 import RunCommandDocumentBase + from .run_command_document_py3 import RunCommandDocument + from .run_command_result_py3 import RunCommandResult +except (SyntaxError, ImportError): + from .compute_operation_value import ComputeOperationValue + from .instance_view_status import InstanceViewStatus + from .sub_resource import SubResource + from .sku import Sku + from .availability_set import AvailabilitySet + from .availability_set_update import AvailabilitySetUpdate + from .virtual_machine_size import VirtualMachineSize + from .virtual_machine_extension_image import VirtualMachineExtensionImage + from .virtual_machine_image_resource import VirtualMachineImageResource + from .virtual_machine_extension_instance_view import VirtualMachineExtensionInstanceView + from .virtual_machine_extension import VirtualMachineExtension + from .purchase_plan import PurchasePlan + from .os_disk_image import OSDiskImage + from .data_disk_image import DataDiskImage + from .virtual_machine_image import VirtualMachineImage + from .usage_name import UsageName + from .usage import Usage + from .virtual_machine_capture_parameters import VirtualMachineCaptureParameters + from .virtual_machine_capture_result import VirtualMachineCaptureResult + from .plan import Plan + from .hardware_profile import HardwareProfile + from .image_reference import ImageReference + from .key_vault_secret_reference import KeyVaultSecretReference + from .key_vault_key_reference import KeyVaultKeyReference + from .disk_encryption_settings import DiskEncryptionSettings + from .virtual_hard_disk import VirtualHardDisk + from .managed_disk_parameters import ManagedDiskParameters + from .os_disk import OSDisk + from .data_disk import DataDisk + from .storage_profile import StorageProfile + from .additional_unattend_content import AdditionalUnattendContent + from .win_rm_listener import WinRMListener + from .win_rm_configuration import WinRMConfiguration + from .windows_configuration import WindowsConfiguration + from .ssh_public_key import SshPublicKey + from .ssh_configuration import SshConfiguration + from .linux_configuration import LinuxConfiguration + from .vault_certificate import VaultCertificate + from .vault_secret_group import VaultSecretGroup + from .os_profile import OSProfile + from .network_interface_reference import NetworkInterfaceReference + from .network_profile import NetworkProfile + from .boot_diagnostics import BootDiagnostics + from .diagnostics_profile import DiagnosticsProfile + from .virtual_machine_extension_handler_instance_view import VirtualMachineExtensionHandlerInstanceView + from .virtual_machine_agent_instance_view import VirtualMachineAgentInstanceView + from .disk_instance_view import DiskInstanceView + from .boot_diagnostics_instance_view import BootDiagnosticsInstanceView + from .virtual_machine_identity import VirtualMachineIdentity + from .maintenance_redeploy_status import MaintenanceRedeployStatus + from .virtual_machine_instance_view import VirtualMachineInstanceView + from .virtual_machine import VirtualMachine + from .virtual_machine_update import VirtualMachineUpdate + from .rolling_upgrade_policy import RollingUpgradePolicy + from .upgrade_policy import UpgradePolicy + from .image_os_disk import ImageOSDisk + from .image_data_disk import ImageDataDisk + from .image_storage_profile import ImageStorageProfile + from .image import Image + from .image_update import ImageUpdate + from .virtual_machine_scale_set_identity import VirtualMachineScaleSetIdentity + from .virtual_machine_scale_set_os_profile import VirtualMachineScaleSetOSProfile + from .virtual_machine_scale_set_update_os_profile import VirtualMachineScaleSetUpdateOSProfile + from .virtual_machine_scale_set_managed_disk_parameters import VirtualMachineScaleSetManagedDiskParameters + from .virtual_machine_scale_set_os_disk import VirtualMachineScaleSetOSDisk + from .virtual_machine_scale_set_update_os_disk import VirtualMachineScaleSetUpdateOSDisk + from .virtual_machine_scale_set_data_disk import VirtualMachineScaleSetDataDisk + from .virtual_machine_scale_set_storage_profile import VirtualMachineScaleSetStorageProfile + from .virtual_machine_scale_set_update_storage_profile import VirtualMachineScaleSetUpdateStorageProfile + from .api_entity_reference import ApiEntityReference + from .virtual_machine_scale_set_public_ip_address_configuration_dns_settings import VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + from .virtual_machine_scale_set_public_ip_address_configuration import VirtualMachineScaleSetPublicIPAddressConfiguration + from .virtual_machine_scale_set_update_public_ip_address_configuration import VirtualMachineScaleSetUpdatePublicIPAddressConfiguration + from .virtual_machine_scale_set_ip_configuration import VirtualMachineScaleSetIPConfiguration + from .virtual_machine_scale_set_update_ip_configuration import VirtualMachineScaleSetUpdateIPConfiguration + from .virtual_machine_scale_set_network_configuration_dns_settings import VirtualMachineScaleSetNetworkConfigurationDnsSettings + from .virtual_machine_scale_set_network_configuration import VirtualMachineScaleSetNetworkConfiguration + from .virtual_machine_scale_set_update_network_configuration import VirtualMachineScaleSetUpdateNetworkConfiguration + from .virtual_machine_scale_set_network_profile import VirtualMachineScaleSetNetworkProfile + from .virtual_machine_scale_set_update_network_profile import VirtualMachineScaleSetUpdateNetworkProfile + from .virtual_machine_scale_set_extension import VirtualMachineScaleSetExtension + from .virtual_machine_scale_set_extension_profile import VirtualMachineScaleSetExtensionProfile + from .virtual_machine_scale_set_vm_profile import VirtualMachineScaleSetVMProfile + from .virtual_machine_scale_set_update_vm_profile import VirtualMachineScaleSetUpdateVMProfile + from .virtual_machine_scale_set import VirtualMachineScaleSet + from .virtual_machine_scale_set_update import VirtualMachineScaleSetUpdate + from .virtual_machine_scale_set_vm_instance_ids import VirtualMachineScaleSetVMInstanceIDs + from .virtual_machine_scale_set_vm_instance_required_ids import VirtualMachineScaleSetVMInstanceRequiredIDs + from .virtual_machine_status_code_count import VirtualMachineStatusCodeCount + from .virtual_machine_scale_set_instance_view_statuses_summary import VirtualMachineScaleSetInstanceViewStatusesSummary + from .virtual_machine_scale_set_vm_extensions_summary import VirtualMachineScaleSetVMExtensionsSummary + from .virtual_machine_scale_set_instance_view import VirtualMachineScaleSetInstanceView + from .virtual_machine_scale_set_sku_capacity import VirtualMachineScaleSetSkuCapacity + from .virtual_machine_scale_set_sku import VirtualMachineScaleSetSku + from .virtual_machine_scale_set_vm import VirtualMachineScaleSetVM + from .virtual_machine_health_status import VirtualMachineHealthStatus + from .virtual_machine_scale_set_vm_instance_view import VirtualMachineScaleSetVMInstanceView + from .rolling_upgrade_running_status import RollingUpgradeRunningStatus + from .rolling_upgrade_progress_info import RollingUpgradeProgressInfo + from .api_error_base import ApiErrorBase + from .inner_error import InnerError + from .api_error import ApiError + from .rolling_upgrade_status_info import RollingUpgradeStatusInfo + from .compute_long_running_operation_properties import ComputeLongRunningOperationProperties + from .resource import Resource + from .update_resource import UpdateResource + from .sub_resource_read_only import SubResourceReadOnly + from .recovery_walk_response import RecoveryWalkResponse + from .operation_status_response import OperationStatusResponse + from .request_rate_by_interval_input import RequestRateByIntervalInput + from .throttled_requests_input import ThrottledRequestsInput + from .log_analytics_input_base import LogAnalyticsInputBase + from .log_analytics_output import LogAnalyticsOutput + from .log_analytics_operation_result import LogAnalyticsOperationResult + from .run_command_input_parameter import RunCommandInputParameter + from .run_command_input import RunCommandInput + from .run_command_parameter_definition import RunCommandParameterDefinition + from .run_command_document_base import RunCommandDocumentBase + from .run_command_document import RunCommandDocument + from .run_command_result import RunCommandResult +from .compute_operation_value_paged import ComputeOperationValuePaged from .availability_set_paged import AvailabilitySetPaged from .virtual_machine_size_paged import VirtualMachineSizePaged from .usage_paged import UsagePaged @@ -149,14 +282,17 @@ VirtualMachineScaleSetSkuScaleType, RollingUpgradeStatusCode, RollingUpgradeActionType, + IntervalInMins, InstanceViewTypes, ) __all__ = [ + 'ComputeOperationValue', 'InstanceViewStatus', 'SubResource', 'Sku', 'AvailabilitySet', + 'AvailabilitySetUpdate', 'VirtualMachineSize', 'VirtualMachineExtensionImage', 'VirtualMachineImageResource', @@ -203,12 +339,14 @@ 'MaintenanceRedeployStatus', 'VirtualMachineInstanceView', 'VirtualMachine', + 'VirtualMachineUpdate', 'RollingUpgradePolicy', 'UpgradePolicy', 'ImageOSDisk', 'ImageDataDisk', 'ImageStorageProfile', 'Image', + 'ImageUpdate', 'VirtualMachineScaleSetIdentity', 'VirtualMachineScaleSetOSProfile', 'VirtualMachineScaleSetUpdateOSProfile', @@ -256,13 +394,20 @@ 'Resource', 'UpdateResource', 'SubResourceReadOnly', + 'RecoveryWalkResponse', 'OperationStatusResponse', + 'RequestRateByIntervalInput', + 'ThrottledRequestsInput', + 'LogAnalyticsInputBase', + 'LogAnalyticsOutput', + 'LogAnalyticsOperationResult', 'RunCommandInputParameter', 'RunCommandInput', 'RunCommandParameterDefinition', 'RunCommandDocumentBase', 'RunCommandDocument', 'RunCommandResult', + 'ComputeOperationValuePaged', 'AvailabilitySetPaged', 'VirtualMachineSizePaged', 'UsagePaged', @@ -292,5 +437,6 @@ 'VirtualMachineScaleSetSkuScaleType', 'RollingUpgradeStatusCode', 'RollingUpgradeActionType', + 'IntervalInMins', 'InstanceViewTypes', ] diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/additional_unattend_content.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/additional_unattend_content.py index 24c66c287827..ddbc9f5f506f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/additional_unattend_content.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/additional_unattend_content.py @@ -44,9 +44,9 @@ class AdditionalUnattendContent(Model): 'content': {'key': 'content', 'type': 'str'}, } - def __init__(self, pass_name=None, component_name=None, setting_name=None, content=None): - super(AdditionalUnattendContent, self).__init__() - self.pass_name = pass_name - self.component_name = component_name - self.setting_name = setting_name - self.content = content + def __init__(self, **kwargs): + super(AdditionalUnattendContent, self).__init__(**kwargs) + self.pass_name = kwargs.get('pass_name', None) + self.component_name = kwargs.get('component_name', None) + self.setting_name = kwargs.get('setting_name', None) + self.content = kwargs.get('content', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/additional_unattend_content_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/additional_unattend_content_py3.py new file mode 100644 index 000000000000..3c4cad773bf5 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/additional_unattend_content_py3.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class AdditionalUnattendContent(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. + + :param pass_name: The pass name. Currently, the only allowable value is + OobeSystem. Possible values include: 'OobeSystem' + :type pass_name: str or ~azure.mgmt.compute.v2017_12_01.models.PassNames + :param component_name: The component name. Currently, the only allowable + value is Microsoft-Windows-Shell-Setup. Possible values include: + 'Microsoft-Windows-Shell-Setup' + :type component_name: str or + ~azure.mgmt.compute.v2017_12_01.models.ComponentNames + :param setting_name: Specifies the name of the setting to which the + content applies. Possible values are: FirstLogonCommands and AutoLogon. + Possible values include: 'AutoLogon', 'FirstLogonCommands' + :type setting_name: str or + ~azure.mgmt.compute.v2017_12_01.models.SettingNames + :param 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. + :type content: str + """ + + _attribute_map = { + 'pass_name': {'key': 'passName', 'type': 'PassNames'}, + 'component_name': {'key': 'componentName', 'type': 'ComponentNames'}, + 'setting_name': {'key': 'settingName', 'type': 'SettingNames'}, + 'content': {'key': 'content', 'type': 'str'}, + } + + def __init__(self, *, pass_name=None, component_name=None, setting_name=None, content: str=None, **kwargs) -> None: + super(AdditionalUnattendContent, self).__init__(**kwargs) + self.pass_name = pass_name + self.component_name = component_name + self.setting_name = setting_name + self.content = content diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_entity_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_entity_reference.py index 27696aacc3dc..d1bf572e916d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_entity_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_entity_reference.py @@ -24,6 +24,6 @@ class ApiEntityReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(ApiEntityReference, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(ApiEntityReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_entity_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_entity_reference_py3.py new file mode 100644 index 000000000000..da3e07082381 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_entity_reference_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApiEntityReference(Model): + """The API entity reference. + + :param id: The ARM resource id in the form of + /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(ApiEntityReference, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_error.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_error.py index 00f0be3bc85b..253e4718038d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_error.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_error.py @@ -35,10 +35,10 @@ class ApiError(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, details=None, innererror=None, code=None, target=None, message=None): - super(ApiError, self).__init__() - self.details = details - self.innererror = innererror - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ApiError, self).__init__(**kwargs) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_error_base.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_error_base.py index 2fb33a0ff411..655c08638905 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_error_base.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_error_base.py @@ -29,8 +29,8 @@ class ApiErrorBase(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, target=None, message=None): - super(ApiErrorBase, self).__init__() - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ApiErrorBase, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_error_base_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_error_base_py3.py new file mode 100644 index 000000000000..5ba95aa0283e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_error_base_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ApiErrorBase(Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ApiErrorBase, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_error_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_error_py3.py new file mode 100644 index 000000000000..f399dc1395af --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/api_error_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApiError(Model): + """Api error. + + :param details: The Api error details + :type details: list[~azure.mgmt.compute.v2017_12_01.models.ApiErrorBase] + :param innererror: The Api inner error + :type innererror: ~azure.mgmt.compute.v2017_12_01.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, details=None, innererror=None, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ApiError, self).__init__(**kwargs) + self.details = details + self.innererror = innererror + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set.py index b70815b39282..e5a61bb520e4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set.py @@ -28,13 +28,15 @@ class AvailabilitySet(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -74,10 +76,10 @@ class AvailabilitySet(Resource): 'sku': {'key': 'sku', 'type': 'Sku'}, } - def __init__(self, location, tags=None, platform_update_domain_count=None, platform_fault_domain_count=None, virtual_machines=None, sku=None): - super(AvailabilitySet, self).__init__(location=location, tags=tags) - self.platform_update_domain_count = platform_update_domain_count - self.platform_fault_domain_count = platform_fault_domain_count - self.virtual_machines = virtual_machines + def __init__(self, **kwargs): + super(AvailabilitySet, self).__init__(**kwargs) + self.platform_update_domain_count = kwargs.get('platform_update_domain_count', None) + self.platform_fault_domain_count = kwargs.get('platform_fault_domain_count', None) + self.virtual_machines = kwargs.get('virtual_machines', None) self.statuses = None - self.sku = sku + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set_py3.py new file mode 100644 index 000000000000..0c9c9d33e2a9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set_py3.py @@ -0,0 +1,85 @@ +# 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 .resource import Resource + + +class AvailabilitySet(Resource): + """Specifies information about the availability set that the virtual machine + should be assigned to. Virtual machines specified in the same availability + set are allocated to different nodes to maximize availability. For more + information about availability sets, see [Manage the availability of + virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param platform_update_domain_count: Update Domain count. + :type platform_update_domain_count: int + :param platform_fault_domain_count: Fault Domain count. + :type platform_fault_domain_count: int + :param virtual_machines: A list of references to all virtual machines in + the availability set. + :type virtual_machines: + list[~azure.mgmt.compute.v2017_12_01.models.SubResource] + :ivar statuses: The resource status information. + :vartype statuses: + list[~azure.mgmt.compute.v2017_12_01.models.InstanceViewStatus] + :param sku: Sku of the availability set + :type sku: ~azure.mgmt.compute.v2017_12_01.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'statuses': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'platform_update_domain_count': {'key': 'properties.platformUpdateDomainCount', 'type': 'int'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResource]'}, + 'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, location: str, tags=None, platform_update_domain_count: int=None, platform_fault_domain_count: int=None, virtual_machines=None, sku=None, **kwargs) -> None: + super(AvailabilitySet, self).__init__(location=location, tags=tags, **kwargs) + self.platform_update_domain_count = platform_update_domain_count + self.platform_fault_domain_count = platform_fault_domain_count + self.virtual_machines = virtual_machines + self.statuses = None + self.sku = sku diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set_update.py new file mode 100644 index 000000000000..c432a4e85d04 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set_update.py @@ -0,0 +1,67 @@ +# 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 .update_resource import UpdateResource + + +class AvailabilitySetUpdate(UpdateResource): + """Specifies information about the availability set that the virtual machine + should be assigned to. Virtual machines specified in the same availability + set are allocated to different nodes to maximize availability. For more + information about availability sets, see [Manage the availability of + virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param tags: Resource tags + :type tags: dict[str, str] + :param platform_update_domain_count: Update Domain count. + :type platform_update_domain_count: int + :param platform_fault_domain_count: Fault Domain count. + :type platform_fault_domain_count: int + :param virtual_machines: A list of references to all virtual machines in + the availability set. + :type virtual_machines: + list[~azure.mgmt.compute.v2017_12_01.models.SubResource] + :ivar statuses: The resource status information. + :vartype statuses: + list[~azure.mgmt.compute.v2017_12_01.models.InstanceViewStatus] + :param sku: Sku of the availability set + :type sku: ~azure.mgmt.compute.v2017_12_01.models.Sku + """ + + _validation = { + 'statuses': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'platform_update_domain_count': {'key': 'properties.platformUpdateDomainCount', 'type': 'int'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResource]'}, + 'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(AvailabilitySetUpdate, self).__init__(**kwargs) + self.platform_update_domain_count = kwargs.get('platform_update_domain_count', None) + self.platform_fault_domain_count = kwargs.get('platform_fault_domain_count', None) + self.virtual_machines = kwargs.get('virtual_machines', None) + self.statuses = None + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set_update_py3.py new file mode 100644 index 000000000000..515ceb56c4d3 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set_update_py3.py @@ -0,0 +1,67 @@ +# 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 .update_resource import UpdateResource + + +class AvailabilitySetUpdate(UpdateResource): + """Specifies information about the availability set that the virtual machine + should be assigned to. Virtual machines specified in the same availability + set are allocated to different nodes to maximize availability. For more + information about availability sets, see [Manage the availability of + virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param tags: Resource tags + :type tags: dict[str, str] + :param platform_update_domain_count: Update Domain count. + :type platform_update_domain_count: int + :param platform_fault_domain_count: Fault Domain count. + :type platform_fault_domain_count: int + :param virtual_machines: A list of references to all virtual machines in + the availability set. + :type virtual_machines: + list[~azure.mgmt.compute.v2017_12_01.models.SubResource] + :ivar statuses: The resource status information. + :vartype statuses: + list[~azure.mgmt.compute.v2017_12_01.models.InstanceViewStatus] + :param sku: Sku of the availability set + :type sku: ~azure.mgmt.compute.v2017_12_01.models.Sku + """ + + _validation = { + 'statuses': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'platform_update_domain_count': {'key': 'properties.platformUpdateDomainCount', 'type': 'int'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResource]'}, + 'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, tags=None, platform_update_domain_count: int=None, platform_fault_domain_count: int=None, virtual_machines=None, sku=None, **kwargs) -> None: + super(AvailabilitySetUpdate, self).__init__(tags=tags, **kwargs) + self.platform_update_domain_count = platform_update_domain_count + self.platform_fault_domain_count = platform_fault_domain_count + self.virtual_machines = virtual_machines + self.statuses = None + self.sku = sku diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/boot_diagnostics.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/boot_diagnostics.py index c94d188e3fba..ca3dbdd4f23c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/boot_diagnostics.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/boot_diagnostics.py @@ -32,7 +32,7 @@ class BootDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, enabled=None, storage_uri=None): - super(BootDiagnostics, self).__init__() - self.enabled = enabled - self.storage_uri = storage_uri + def __init__(self, **kwargs): + super(BootDiagnostics, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.storage_uri = kwargs.get('storage_uri', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/boot_diagnostics_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/boot_diagnostics_instance_view.py index 4ec7b385558d..6fe1f84a3910 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/boot_diagnostics_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/boot_diagnostics_instance_view.py @@ -26,7 +26,7 @@ class BootDiagnosticsInstanceView(Model): 'serial_console_log_blob_uri': {'key': 'serialConsoleLogBlobUri', 'type': 'str'}, } - def __init__(self, console_screenshot_blob_uri=None, serial_console_log_blob_uri=None): - super(BootDiagnosticsInstanceView, self).__init__() - self.console_screenshot_blob_uri = console_screenshot_blob_uri - self.serial_console_log_blob_uri = serial_console_log_blob_uri + def __init__(self, **kwargs): + super(BootDiagnosticsInstanceView, self).__init__(**kwargs) + self.console_screenshot_blob_uri = kwargs.get('console_screenshot_blob_uri', None) + self.serial_console_log_blob_uri = kwargs.get('serial_console_log_blob_uri', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/boot_diagnostics_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/boot_diagnostics_instance_view_py3.py new file mode 100644 index 000000000000..d85b51981ab9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/boot_diagnostics_instance_view_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class BootDiagnosticsInstanceView(Model): + """The instance view of a virtual machine boot diagnostics. + + :param console_screenshot_blob_uri: The console screenshot blob URI. + :type console_screenshot_blob_uri: str + :param serial_console_log_blob_uri: The Linux serial console log blob Uri. + :type serial_console_log_blob_uri: str + """ + + _attribute_map = { + 'console_screenshot_blob_uri': {'key': 'consoleScreenshotBlobUri', 'type': 'str'}, + 'serial_console_log_blob_uri': {'key': 'serialConsoleLogBlobUri', 'type': 'str'}, + } + + def __init__(self, *, console_screenshot_blob_uri: str=None, serial_console_log_blob_uri: str=None, **kwargs) -> None: + super(BootDiagnosticsInstanceView, self).__init__(**kwargs) + self.console_screenshot_blob_uri = console_screenshot_blob_uri + self.serial_console_log_blob_uri = serial_console_log_blob_uri diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/boot_diagnostics_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/boot_diagnostics_py3.py new file mode 100644 index 000000000000..b0a756ea4fa0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/boot_diagnostics_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class BootDiagnostics(Model): + """Boot Diagnostics is a debugging feature which allows you to view Console + Output and Screenshot to diagnose VM status.

    For Linux Virtual + Machines, you can easily view the output of your console log.

    For + both Windows and Linux virtual machines, Azure also enables you to see a + screenshot of the VM from the hypervisor. + + :param enabled: Whether boot diagnostics should be enabled on the Virtual + Machine. + :type enabled: bool + :param storage_uri: Uri of the storage account to use for placing the + console output and screenshot. + :type storage_uri: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, storage_uri: str=None, **kwargs) -> None: + super(BootDiagnostics, self).__init__(**kwargs) + self.enabled = enabled + self.storage_uri = storage_uri diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_long_running_operation_properties.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_long_running_operation_properties.py index f8ca23e0ccdf..66ff353eb206 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_long_running_operation_properties.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_long_running_operation_properties.py @@ -23,6 +23,6 @@ class ComputeLongRunningOperationProperties(Model): 'output': {'key': 'output', 'type': 'object'}, } - def __init__(self, output=None): - super(ComputeLongRunningOperationProperties, self).__init__() - self.output = output + def __init__(self, **kwargs): + super(ComputeLongRunningOperationProperties, self).__init__(**kwargs) + self.output = kwargs.get('output', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_long_running_operation_properties_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_long_running_operation_properties_py3.py new file mode 100644 index 000000000000..a4ffd6c8c32f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_long_running_operation_properties_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class ComputeLongRunningOperationProperties(Model): + """Compute-specific operation properties, including output. + + :param output: Operation output data (raw JSON) + :type output: object + """ + + _attribute_map = { + 'output': {'key': 'output', 'type': 'object'}, + } + + def __init__(self, *, output=None, **kwargs) -> None: + super(ComputeLongRunningOperationProperties, self).__init__(**kwargs) + self.output = output diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_management_client_enums.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_management_client_enums.py index c143eed1080b..1346ccd35f76 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_management_client_enums.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_management_client_enums.py @@ -12,20 +12,20 @@ from enum import Enum -class StatusLevelTypes(Enum): +class StatusLevelTypes(str, Enum): info = "Info" warning = "Warning" error = "Error" -class OperatingSystemTypes(Enum): +class OperatingSystemTypes(str, Enum): windows = "Windows" linux = "Linux" -class VirtualMachineSizeTypes(Enum): +class VirtualMachineSizeTypes(str, Enum): basic_a0 = "Basic_A0" basic_a1 = "Basic_A1" @@ -51,6 +51,12 @@ class VirtualMachineSizeTypes(Enum): standard_a2m_v2 = "Standard_A2m_v2" standard_a4m_v2 = "Standard_A4m_v2" standard_a8m_v2 = "Standard_A8m_v2" + standard_b1s = "Standard_B1s" + standard_b1ms = "Standard_B1ms" + standard_b2s = "Standard_B2s" + standard_b2ms = "Standard_B2ms" + standard_b4ms = "Standard_B4ms" + standard_b8ms = "Standard_B8ms" standard_d1 = "Standard_D1" standard_d2 = "Standard_D2" standard_d3 = "Standard_D3" @@ -64,6 +70,18 @@ class VirtualMachineSizeTypes(Enum): standard_d3_v2 = "Standard_D3_v2" standard_d4_v2 = "Standard_D4_v2" standard_d5_v2 = "Standard_D5_v2" + standard_d2_v3 = "Standard_D2_v3" + standard_d4_v3 = "Standard_D4_v3" + standard_d8_v3 = "Standard_D8_v3" + standard_d16_v3 = "Standard_D16_v3" + standard_d32_v3 = "Standard_D32_v3" + standard_d64_v3 = "Standard_D64_v3" + standard_d2s_v3 = "Standard_D2s_v3" + standard_d4s_v3 = "Standard_D4s_v3" + standard_d8s_v3 = "Standard_D8s_v3" + standard_d16s_v3 = "Standard_D16s_v3" + standard_d32s_v3 = "Standard_D32s_v3" + standard_d64s_v3 = "Standard_D64s_v3" standard_d11_v2 = "Standard_D11_v2" standard_d12_v2 = "Standard_D12_v2" standard_d13_v2 = "Standard_D13_v2" @@ -87,6 +105,26 @@ class VirtualMachineSizeTypes(Enum): standard_ds13_v2 = "Standard_DS13_v2" standard_ds14_v2 = "Standard_DS14_v2" standard_ds15_v2 = "Standard_DS15_v2" + standard_ds13_4_v2 = "Standard_DS13-4_v2" + standard_ds13_2_v2 = "Standard_DS13-2_v2" + standard_ds14_8_v2 = "Standard_DS14-8_v2" + standard_ds14_4_v2 = "Standard_DS14-4_v2" + standard_e2_v3 = "Standard_E2_v3" + standard_e4_v3 = "Standard_E4_v3" + standard_e8_v3 = "Standard_E8_v3" + standard_e16_v3 = "Standard_E16_v3" + standard_e32_v3 = "Standard_E32_v3" + standard_e64_v3 = "Standard_E64_v3" + standard_e2s_v3 = "Standard_E2s_v3" + standard_e4s_v3 = "Standard_E4s_v3" + standard_e8s_v3 = "Standard_E8s_v3" + standard_e16s_v3 = "Standard_E16s_v3" + standard_e32s_v3 = "Standard_E32s_v3" + standard_e64s_v3 = "Standard_E64s_v3" + standard_e32_16_v3 = "Standard_E32-16_v3" + standard_e32_8s_v3 = "Standard_E32-8s_v3" + standard_e64_32s_v3 = "Standard_E64-32s_v3" + standard_e64_16s_v3 = "Standard_E64-16s_v3" standard_f1 = "Standard_F1" standard_f2 = "Standard_F2" standard_f4 = "Standard_F4" @@ -97,6 +135,13 @@ class VirtualMachineSizeTypes(Enum): standard_f4s = "Standard_F4s" standard_f8s = "Standard_F8s" standard_f16s = "Standard_F16s" + standard_f2s_v2 = "Standard_F2s_v2" + standard_f4s_v2 = "Standard_F4s_v2" + standard_f8s_v2 = "Standard_F8s_v2" + standard_f16s_v2 = "Standard_F16s_v2" + standard_f32s_v2 = "Standard_F32s_v2" + standard_f64s_v2 = "Standard_F64s_v2" + standard_f72s_v2 = "Standard_F72s_v2" standard_g1 = "Standard_G1" standard_g2 = "Standard_G2" standard_g3 = "Standard_G3" @@ -107,6 +152,10 @@ class VirtualMachineSizeTypes(Enum): standard_gs3 = "Standard_GS3" standard_gs4 = "Standard_GS4" standard_gs5 = "Standard_GS5" + standard_gs4_8 = "Standard_GS4-8" + standard_gs4_4 = "Standard_GS4-4" + standard_gs5_16 = "Standard_GS5-16" + standard_gs5_8 = "Standard_GS5-8" standard_h8 = "Standard_H8" standard_h16 = "Standard_H16" standard_h8m = "Standard_H8m" @@ -117,58 +166,78 @@ class VirtualMachineSizeTypes(Enum): standard_l8s = "Standard_L8s" standard_l16s = "Standard_L16s" standard_l32s = "Standard_L32s" + standard_m64s = "Standard_M64s" + standard_m64ms = "Standard_M64ms" + standard_m128s = "Standard_M128s" + standard_m128ms = "Standard_M128ms" + standard_m64_32ms = "Standard_M64-32ms" + standard_m64_16ms = "Standard_M64-16ms" + standard_m128_64ms = "Standard_M128-64ms" + standard_m128_32ms = "Standard_M128-32ms" standard_nc6 = "Standard_NC6" standard_nc12 = "Standard_NC12" standard_nc24 = "Standard_NC24" standard_nc24r = "Standard_NC24r" + standard_nc6s_v2 = "Standard_NC6s_v2" + standard_nc12s_v2 = "Standard_NC12s_v2" + standard_nc24s_v2 = "Standard_NC24s_v2" + standard_nc24rs_v2 = "Standard_NC24rs_v2" + standard_nc6s_v3 = "Standard_NC6s_v3" + standard_nc12s_v3 = "Standard_NC12s_v3" + standard_nc24s_v3 = "Standard_NC24s_v3" + standard_nc24rs_v3 = "Standard_NC24rs_v3" + standard_nd6s = "Standard_ND6s" + standard_nd12s = "Standard_ND12s" + standard_nd24s = "Standard_ND24s" + standard_nd24rs = "Standard_ND24rs" standard_nv6 = "Standard_NV6" standard_nv12 = "Standard_NV12" standard_nv24 = "Standard_NV24" -class CachingTypes(Enum): +class CachingTypes(str, Enum): none = "None" read_only = "ReadOnly" read_write = "ReadWrite" -class DiskCreateOptionTypes(Enum): +class DiskCreateOptionTypes(str, Enum): from_image = "FromImage" empty = "Empty" attach = "Attach" -class StorageAccountTypes(Enum): +class StorageAccountTypes(str, Enum): standard_lrs = "Standard_LRS" premium_lrs = "Premium_LRS" -class PassNames(Enum): +class PassNames(str, Enum): oobe_system = "OobeSystem" -class ComponentNames(Enum): +class ComponentNames(str, Enum): microsoft_windows_shell_setup = "Microsoft-Windows-Shell-Setup" -class SettingNames(Enum): +class SettingNames(str, Enum): auto_logon = "AutoLogon" first_logon_commands = "FirstLogonCommands" -class ProtocolTypes(Enum): +class ProtocolTypes(str, Enum): http = "Http" https = "Https" -class ResourceIdentityType(Enum): +class ResourceIdentityType(str, Enum): system_assigned = "SystemAssigned" user_assigned = "UserAssigned" @@ -176,7 +245,7 @@ class ResourceIdentityType(Enum): none = "None" -class MaintenanceOperationResultCodeTypes(Enum): +class MaintenanceOperationResultCodeTypes(str, Enum): none = "None" retry_later = "RetryLater" @@ -184,38 +253,38 @@ class MaintenanceOperationResultCodeTypes(Enum): maintenance_completed = "MaintenanceCompleted" -class UpgradeMode(Enum): +class UpgradeMode(str, Enum): automatic = "Automatic" manual = "Manual" rolling = "Rolling" -class OperatingSystemStateTypes(Enum): +class OperatingSystemStateTypes(str, Enum): generalized = "Generalized" specialized = "Specialized" -class IPVersion(Enum): +class IPVersion(str, Enum): ipv4 = "IPv4" ipv6 = "IPv6" -class VirtualMachinePriorityTypes(Enum): +class VirtualMachinePriorityTypes(str, Enum): regular = "Regular" low = "Low" -class VirtualMachineScaleSetSkuScaleType(Enum): +class VirtualMachineScaleSetSkuScaleType(str, Enum): automatic = "Automatic" none = "None" -class RollingUpgradeStatusCode(Enum): +class RollingUpgradeStatusCode(str, Enum): rolling_forward = "RollingForward" cancelled = "Cancelled" @@ -223,12 +292,20 @@ class RollingUpgradeStatusCode(Enum): faulted = "Faulted" -class RollingUpgradeActionType(Enum): +class RollingUpgradeActionType(str, Enum): start = "Start" cancel = "Cancel" -class InstanceViewTypes(Enum): +class IntervalInMins(str, Enum): + + three_mins = "ThreeMins" + five_mins = "FiveMins" + thirty_mins = "ThirtyMins" + sixty_mins = "SixtyMins" + + +class InstanceViewTypes(str, Enum): instance_view = "instanceView" diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value.py new file mode 100644 index 000000000000..525ef3bbb69a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class ComputeOperationValue(Model): + """Describes the properties of a Compute Operation value. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar origin: The origin of the compute operation. + :vartype origin: str + :ivar name: The name of the compute operation. + :vartype name: str + :ivar operation: The display name of the compute operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + 'origin': {'readonly': True}, + 'name': {'readonly': True}, + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'operation': {'key': 'display.operation', 'type': 'str'}, + 'resource': {'key': 'display.resource', 'type': 'str'}, + 'description': {'key': 'display.description', 'type': 'str'}, + 'provider': {'key': 'display.provider', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComputeOperationValue, self).__init__(**kwargs) + self.origin = None + self.name = None + self.operation = None + self.resource = None + self.description = None + self.provider = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value_paged.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value_paged.py new file mode 100644 index 000000000000..d59724285f2d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class ComputeOperationValuePaged(Paged): + """ + A paging container for iterating over a list of :class:`ComputeOperationValue ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ComputeOperationValue]'} + } + + def __init__(self, *args, **kwargs): + + super(ComputeOperationValuePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value_py3.py new file mode 100644 index 000000000000..3c4388f312b9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value_py3.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class ComputeOperationValue(Model): + """Describes the properties of a Compute Operation value. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar origin: The origin of the compute operation. + :vartype origin: str + :ivar name: The name of the compute operation. + :vartype name: str + :ivar operation: The display name of the compute operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + 'origin': {'readonly': True}, + 'name': {'readonly': True}, + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'operation': {'key': 'display.operation', 'type': 'str'}, + 'resource': {'key': 'display.resource', 'type': 'str'}, + 'description': {'key': 'display.description', 'type': 'str'}, + 'provider': {'key': 'display.provider', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ComputeOperationValue, self).__init__(**kwargs) + self.origin = None + self.name = None + self.operation = None + self.resource = None + self.description = None + self.provider = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk.py index d74f48cca017..41e260cdca7e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk.py @@ -15,9 +15,11 @@ class DataDisk(Model): """Describes a data disk. - :param 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. + All required parameters must be populated in order to send to Azure. + + :param lun: Required. 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. :type lun: int :param name: The disk name. :type name: str @@ -33,8 +35,11 @@ class DataDisk(Model):

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2017_12_01.models.CachingTypes - :param create_option: Specifies how the virtual machine should be - created.

    Possible values are:

    **Attach** \\u2013 This + :param write_accelerator_enabled: Specifies whether writeAccelerator + should be enabled or disabled on the disk. + :type write_accelerator_enabled: bool + :param create_option: Required. Specifies how the virtual machine should + be created.

    Possible values are:

    **Attach** \\u2013 This value is used when you are using a specialized disk to create the virtual machine.

    **FromImage** \\u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform @@ -63,18 +68,20 @@ class DataDisk(Model): 'vhd': {'key': 'vhd', 'type': 'VirtualHardDisk'}, 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, - 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + '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': 'ManagedDiskParameters'}, } - def __init__(self, lun, create_option, name=None, vhd=None, image=None, caching=None, disk_size_gb=None, managed_disk=None): - super(DataDisk, self).__init__() - self.lun = lun - self.name = name - self.vhd = vhd - self.image = image - self.caching = caching - self.create_option = create_option - self.disk_size_gb = disk_size_gb - self.managed_disk = managed_disk + def __init__(self, **kwargs): + super(DataDisk, self).__init__(**kwargs) + self.lun = kwargs.get('lun', None) + self.name = kwargs.get('name', None) + self.vhd = kwargs.get('vhd', None) + self.image = kwargs.get('image', None) + self.caching = kwargs.get('caching', None) + self.write_accelerator_enabled = kwargs.get('write_accelerator_enabled', None) + self.create_option = kwargs.get('create_option', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.managed_disk = kwargs.get('managed_disk', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk_image.py index 60a4befc525f..b5dbfcefb472 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk_image.py @@ -32,6 +32,6 @@ class DataDiskImage(Model): 'lun': {'key': 'lun', 'type': 'int'}, } - def __init__(self): - super(DataDiskImage, self).__init__() + def __init__(self, **kwargs): + super(DataDiskImage, self).__init__(**kwargs) self.lun = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk_image_py3.py new file mode 100644 index 000000000000..8431a3988502 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk_image_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class DataDiskImage(Model): + """Contains the data disk images information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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. + :vartype lun: int + """ + + _validation = { + 'lun': {'readonly': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(DataDiskImage, self).__init__(**kwargs) + self.lun = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk_py3.py new file mode 100644 index 000000000000..b638a05f74a0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk_py3.py @@ -0,0 +1,87 @@ +# 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 msrest.serialization import Model + + +class DataDisk(Model): + """Describes a data disk. + + All required parameters must be populated in order to send to Azure. + + :param lun: Required. 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. + :type lun: int + :param name: The disk name. + :type name: str + :param vhd: The virtual hard disk. + :type vhd: ~azure.mgmt.compute.v2017_12_01.models.VirtualHardDisk + :param image: The source user image virtual hard disk. The virtual hard + disk will be copied before being attached to the virtual machine. If + SourceImage is provided, the destination virtual hard drive must not + exist. + :type image: ~azure.mgmt.compute.v2017_12_01.models.VirtualHardDisk + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2017_12_01.models.CachingTypes + :param write_accelerator_enabled: Specifies whether writeAccelerator + should be enabled or disabled on the disk. + :type write_accelerator_enabled: bool + :param create_option: Required. Specifies how the virtual machine should + be created.

    Possible values are:

    **Attach** \\u2013 This + value is used when you are using a specialized disk to create the virtual + machine.

    **FromImage** \\u2013 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. Possible values include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2017_12_01.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in + gigabytes. This element can be used to overwrite the name of the disk in a + virtual machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2017_12_01.models.ManagedDiskParameters + """ + + _validation = { + 'lun': {'required': True}, + 'create_option': {'required': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'vhd': {'key': 'vhd', 'type': 'VirtualHardDisk'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + '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': 'ManagedDiskParameters'}, + } + + def __init__(self, *, lun: int, create_option, name: str=None, vhd=None, image=None, caching=None, write_accelerator_enabled: bool=None, disk_size_gb: int=None, managed_disk=None, **kwargs) -> None: + super(DataDisk, self).__init__(**kwargs) + self.lun = lun + self.name = name + self.vhd = vhd + self.image = image + 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 diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/diagnostics_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/diagnostics_profile.py index ddf46657bebf..4734f23421f5 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/diagnostics_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/diagnostics_profile.py @@ -29,6 +29,6 @@ class DiagnosticsProfile(Model): 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnostics'}, } - def __init__(self, boot_diagnostics=None): - super(DiagnosticsProfile, self).__init__() - self.boot_diagnostics = boot_diagnostics + def __init__(self, **kwargs): + super(DiagnosticsProfile, self).__init__(**kwargs) + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/diagnostics_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/diagnostics_profile_py3.py new file mode 100644 index 000000000000..f14cb5a908be --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/diagnostics_profile_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class DiagnosticsProfile(Model): + """Specifies the boot diagnostic settings state.

    Minimum api-version: + 2015-06-15. + + :param boot_diagnostics: Boot Diagnostics is a debugging feature which + allows you to view Console Output and Screenshot to diagnose VM status. +

    For Linux Virtual Machines, you can easily view the output of + your console log.

    For both Windows and Linux virtual machines, + Azure also enables you to see a screenshot of the VM from the hypervisor. + :type boot_diagnostics: + ~azure.mgmt.compute.v2017_12_01.models.BootDiagnostics + """ + + _attribute_map = { + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnostics'}, + } + + def __init__(self, *, boot_diagnostics=None, **kwargs) -> None: + super(DiagnosticsProfile, self).__init__(**kwargs) + self.boot_diagnostics = boot_diagnostics diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/disk_encryption_settings.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/disk_encryption_settings.py index 7cf7429c2b5e..d7974b4359cf 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/disk_encryption_settings.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/disk_encryption_settings.py @@ -34,8 +34,8 @@ class DiskEncryptionSettings(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, disk_encryption_key=None, key_encryption_key=None, enabled=None): - super(DiskEncryptionSettings, self).__init__() - self.disk_encryption_key = disk_encryption_key - self.key_encryption_key = key_encryption_key - self.enabled = enabled + def __init__(self, **kwargs): + super(DiskEncryptionSettings, self).__init__(**kwargs) + self.disk_encryption_key = kwargs.get('disk_encryption_key', None) + self.key_encryption_key = kwargs.get('key_encryption_key', None) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/disk_encryption_settings_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/disk_encryption_settings_py3.py new file mode 100644 index 000000000000..9511bd6b4565 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/disk_encryption_settings_py3.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 msrest.serialization import Model + + +class DiskEncryptionSettings(Model): + """Describes a Encryption Settings for a Disk. + + :param disk_encryption_key: Specifies the location of the disk encryption + key, which is a Key Vault Secret. + :type disk_encryption_key: + ~azure.mgmt.compute.v2017_12_01.models.KeyVaultSecretReference + :param key_encryption_key: Specifies the location of the key encryption + key in Key Vault. + :type key_encryption_key: + ~azure.mgmt.compute.v2017_12_01.models.KeyVaultKeyReference + :param enabled: Specifies whether disk encryption should be enabled on the + virtual machine. + :type enabled: bool + """ + + _attribute_map = { + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultKeyReference'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, disk_encryption_key=None, key_encryption_key=None, enabled: bool=None, **kwargs) -> None: + super(DiskEncryptionSettings, self).__init__(**kwargs) + self.disk_encryption_key = disk_encryption_key + self.key_encryption_key = key_encryption_key + self.enabled = enabled diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/disk_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/disk_instance_view.py index 5e8ed05cd416..29813c789890 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/disk_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/disk_instance_view.py @@ -32,8 +32,8 @@ class DiskInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, name=None, encryption_settings=None, statuses=None): - super(DiskInstanceView, self).__init__() - self.name = name - self.encryption_settings = encryption_settings - self.statuses = statuses + def __init__(self, **kwargs): + super(DiskInstanceView, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.encryption_settings = kwargs.get('encryption_settings', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/disk_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/disk_instance_view_py3.py new file mode 100644 index 000000000000..675c5b073bff --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/disk_instance_view_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class DiskInstanceView(Model): + """The instance view of the disk. + + :param name: The disk name. + :type name: str + :param encryption_settings: Specifies the encryption settings for the OS + Disk.

    Minimum api-version: 2015-06-15 + :type encryption_settings: + list[~azure.mgmt.compute.v2017_12_01.models.DiskEncryptionSettings] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2017_12_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': '[DiskEncryptionSettings]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, name: str=None, encryption_settings=None, statuses=None, **kwargs) -> None: + super(DiskInstanceView, self).__init__(**kwargs) + self.name = name + self.encryption_settings = encryption_settings + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/hardware_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/hardware_profile.py index 8a09b0659ec3..84aad1c4ee3b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/hardware_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/hardware_profile.py @@ -21,35 +21,57 @@ class HardwareProfile(Model):

    The available VM sizes depend on region and availability set. For a list of available sizes use these APIs:

    [List all available virtual machine sizes in an availability - set](virtualmachines-list-sizes-availability-set.md)

    [List all - available virtual machine sizes in a - region](virtualmachines-list-sizes-region.md)

    [List all available - virtual machine sizes for - resizing](virtualmachines-list-sizes-for-resizing.md). Possible values - include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', - 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', - 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', - 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', - 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', - 'Standard_A8m_v2', 'Standard_D1', 'Standard_D2', 'Standard_D3', - 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', - 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', - 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', - 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', - 'Standard_DS2', 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', - 'Standard_DS12', 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', - 'Standard_DS2_v2', 'Standard_DS3_v2', 'Standard_DS4_v2', - 'Standard_DS5_v2', 'Standard_DS11_v2', 'Standard_DS12_v2', - 'Standard_DS13_v2', 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_F1', - 'Standard_F2', 'Standard_F4', 'Standard_F8', 'Standard_F16', - 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', 'Standard_F8s', - 'Standard_F16s', 'Standard_G1', 'Standard_G2', 'Standard_G3', - 'Standard_G4', 'Standard_G5', 'Standard_GS1', 'Standard_GS2', - 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_H8', - 'Standard_H16', 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', - 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', - 'Standard_L32s', 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', - 'Standard_NC24r', 'Standard_NV6', 'Standard_NV12', 'Standard_NV24' + set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) +

    [List all available virtual machine sizes in a + region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) +

    [List all available virtual machine sizes for + resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', + 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', + 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', + 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', + 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', + 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', + 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', + 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', + 'Standard_D5_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', + 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', + 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', + 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', + 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', + 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', + 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', + 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', + 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', + 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', + 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_DS13-4_v2', + 'Standard_DS13-2_v2', 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', + 'Standard_E2_v3', 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', + 'Standard_E32_v3', 'Standard_E64_v3', 'Standard_E2s_v3', + 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', + 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_E32-16_v3', + 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', 'Standard_E64-16s_v3', + 'Standard_F1', 'Standard_F2', 'Standard_F4', 'Standard_F8', + 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', + 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', 'Standard_F4s_v2', + 'Standard_F8s_v2', 'Standard_F16s_v2', 'Standard_F32s_v2', + 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', 'Standard_G2', + 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + 'Standard_NV12', 'Standard_NV24' :type vm_size: str or ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineSizeTypes """ @@ -58,6 +80,6 @@ class HardwareProfile(Model): 'vm_size': {'key': 'vmSize', 'type': 'str'}, } - def __init__(self, vm_size=None): - super(HardwareProfile, self).__init__() - self.vm_size = vm_size + def __init__(self, **kwargs): + super(HardwareProfile, self).__init__(**kwargs) + self.vm_size = kwargs.get('vm_size', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/hardware_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/hardware_profile_py3.py new file mode 100644 index 000000000000..605f0eb33fad --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/hardware_profile_py3.py @@ -0,0 +1,85 @@ +# 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 msrest.serialization import Model + + +class HardwareProfile(Model): + """Specifies the hardware settings for the virtual machine. + + :param vm_size: Specifies the size of the virtual machine. For more + information about virtual machine sizes, see [Sizes for virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    The available VM sizes depend on region and availability set. For + a list of available sizes use these APIs:

    [List all available + virtual machine sizes in an availability + set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) +

    [List all available virtual machine sizes in a + region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) +

    [List all available virtual machine sizes for + resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', + 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', + 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', + 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', + 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', + 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', + 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', + 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', + 'Standard_D5_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', + 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', + 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', + 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', + 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', + 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', + 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', + 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', + 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', + 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', + 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_DS13-4_v2', + 'Standard_DS13-2_v2', 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', + 'Standard_E2_v3', 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', + 'Standard_E32_v3', 'Standard_E64_v3', 'Standard_E2s_v3', + 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', + 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_E32-16_v3', + 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', 'Standard_E64-16s_v3', + 'Standard_F1', 'Standard_F2', 'Standard_F4', 'Standard_F8', + 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', + 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', 'Standard_F4s_v2', + 'Standard_F8s_v2', 'Standard_F16s_v2', 'Standard_F32s_v2', + 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', 'Standard_G2', + 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + 'Standard_NV12', 'Standard_NV24' + :type vm_size: str or + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineSizeTypes + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + } + + def __init__(self, *, vm_size=None, **kwargs) -> None: + super(HardwareProfile, self).__init__(**kwargs) + self.vm_size = vm_size diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image.py index 37a2fc79acda..889e56a305fc 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image.py @@ -20,13 +20,15 @@ class Image(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -61,8 +63,8 @@ class Image(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, location, tags=None, source_virtual_machine=None, storage_profile=None): - super(Image, self).__init__(location=location, tags=tags) - self.source_virtual_machine = source_virtual_machine - self.storage_profile = storage_profile + def __init__(self, **kwargs): + super(Image, self).__init__(**kwargs) + self.source_virtual_machine = kwargs.get('source_virtual_machine', None) + self.storage_profile = kwargs.get('storage_profile', None) self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_data_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_data_disk.py index 7e898bf5febd..f5f5c009b54e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_data_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_data_disk.py @@ -15,9 +15,11 @@ class ImageDataDisk(Model): """Describes a data disk. - :param 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. + All required parameters must be populated in order to send to Azure. + + :param lun: Required. 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. :type lun: int :param snapshot: The snapshot. :type snapshot: ~azure.mgmt.compute.v2017_12_01.models.SubResource @@ -52,15 +54,15 @@ class ImageDataDisk(Model): 'blob_uri': {'key': 'blobUri', 'type': 'str'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, } - def __init__(self, lun, snapshot=None, managed_disk=None, blob_uri=None, caching=None, disk_size_gb=None, storage_account_type=None): - super(ImageDataDisk, self).__init__() - self.lun = lun - self.snapshot = snapshot - self.managed_disk = managed_disk - self.blob_uri = blob_uri - self.caching = caching - self.disk_size_gb = disk_size_gb - self.storage_account_type = storage_account_type + def __init__(self, **kwargs): + super(ImageDataDisk, self).__init__(**kwargs) + self.lun = kwargs.get('lun', None) + self.snapshot = kwargs.get('snapshot', None) + self.managed_disk = kwargs.get('managed_disk', None) + self.blob_uri = kwargs.get('blob_uri', None) + self.caching = kwargs.get('caching', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.storage_account_type = kwargs.get('storage_account_type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_data_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_data_disk_py3.py new file mode 100644 index 000000000000..fa6eb1bdd30b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_data_disk_py3.py @@ -0,0 +1,68 @@ +# 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 msrest.serialization import Model + + +class ImageDataDisk(Model): + """Describes a data disk. + + All required parameters must be populated in order to send to Azure. + + :param lun: Required. 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. + :type lun: int + :param snapshot: The snapshot. + :type snapshot: ~azure.mgmt.compute.v2017_12_01.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: ~azure.mgmt.compute.v2017_12_01.models.SubResource + :param blob_uri: The Virtual Hard Disk. + :type blob_uri: str + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2017_12_01.models.CachingTypes + :param disk_size_gb: Specifies the size of empty data disks in gigabytes. + This element can be used to overwrite the name of the disk in a virtual + machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + :param storage_account_type: Specifies the storage account type for the + managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible + values include: 'Standard_LRS', 'Premium_LRS' + :type storage_account_type: str or + ~azure.mgmt.compute.v2017_12_01.models.StorageAccountTypes + """ + + _validation = { + 'lun': {'required': True}, + } + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + 'snapshot': {'key': 'snapshot', 'type': 'SubResource'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'SubResource'}, + 'blob_uri': {'key': 'blobUri', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + } + + def __init__(self, *, lun: int, snapshot=None, managed_disk=None, blob_uri: str=None, caching=None, disk_size_gb: int=None, storage_account_type=None, **kwargs) -> None: + super(ImageDataDisk, self).__init__(**kwargs) + self.lun = lun + self.snapshot = snapshot + self.managed_disk = managed_disk + self.blob_uri = blob_uri + self.caching = caching + self.disk_size_gb = disk_size_gb + self.storage_account_type = storage_account_type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk.py index cf302f8b0ad3..afb4cfee8502 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk.py @@ -15,14 +15,16 @@ class ImageOSDisk(Model): """Describes an Operating System disk. - :param os_type: This property allows you to specify the type of the OS - that is included in the disk if creating a VM from a custom image. + All required parameters must be populated in order to send to Azure. + + :param os_type: Required. This property allows you to specify the type of + the OS that is included in the disk if creating a VM from a custom image.

    Possible values are:

    **Windows**

    **Linux**. Possible values include: 'Windows', 'Linux' :type os_type: str or ~azure.mgmt.compute.v2017_12_01.models.OperatingSystemTypes - :param os_state: The OS State. Possible values include: 'Generalized', - 'Specialized' + :param os_state: Required. The OS State. Possible values include: + 'Generalized', 'Specialized' :type os_state: str or ~azure.mgmt.compute.v2017_12_01.models.OperatingSystemStateTypes :param snapshot: The snapshot. @@ -60,16 +62,16 @@ class ImageOSDisk(Model): 'blob_uri': {'key': 'blobUri', 'type': 'str'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, } - def __init__(self, os_type, os_state, snapshot=None, managed_disk=None, blob_uri=None, caching=None, disk_size_gb=None, storage_account_type=None): - super(ImageOSDisk, self).__init__() - self.os_type = os_type - self.os_state = os_state - self.snapshot = snapshot - self.managed_disk = managed_disk - self.blob_uri = blob_uri - self.caching = caching - self.disk_size_gb = disk_size_gb - self.storage_account_type = storage_account_type + def __init__(self, **kwargs): + super(ImageOSDisk, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.os_state = kwargs.get('os_state', None) + self.snapshot = kwargs.get('snapshot', None) + self.managed_disk = kwargs.get('managed_disk', None) + self.blob_uri = kwargs.get('blob_uri', None) + self.caching = kwargs.get('caching', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.storage_account_type = kwargs.get('storage_account_type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk_py3.py new file mode 100644 index 000000000000..82cf4bc8a8ff --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk_py3.py @@ -0,0 +1,77 @@ +# 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 msrest.serialization import Model + + +class ImageOSDisk(Model): + """Describes an Operating System disk. + + All required parameters must be populated in order to send to Azure. + + :param os_type: Required. This property allows you to specify the type of + the OS that is included in the disk if creating a VM from a custom image. +

    Possible values are:

    **Windows**

    **Linux**. + Possible values include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2017_12_01.models.OperatingSystemTypes + :param os_state: Required. The OS State. Possible values include: + 'Generalized', 'Specialized' + :type os_state: str or + ~azure.mgmt.compute.v2017_12_01.models.OperatingSystemStateTypes + :param snapshot: The snapshot. + :type snapshot: ~azure.mgmt.compute.v2017_12_01.models.SubResource + :param managed_disk: The managedDisk. + :type managed_disk: ~azure.mgmt.compute.v2017_12_01.models.SubResource + :param blob_uri: The Virtual Hard Disk. + :type blob_uri: str + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2017_12_01.models.CachingTypes + :param disk_size_gb: Specifies the size of empty data disks in gigabytes. + This element can be used to overwrite the name of the disk in a virtual + machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + :param storage_account_type: Specifies the storage account type for the + managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible + values include: 'Standard_LRS', 'Premium_LRS' + :type storage_account_type: str or + ~azure.mgmt.compute.v2017_12_01.models.StorageAccountTypes + """ + + _validation = { + 'os_type': {'required': True}, + 'os_state': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'os_state': {'key': 'osState', 'type': 'OperatingSystemStateTypes'}, + 'snapshot': {'key': 'snapshot', 'type': 'SubResource'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'SubResource'}, + 'blob_uri': {'key': 'blobUri', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + } + + def __init__(self, *, os_type, os_state, snapshot=None, managed_disk=None, blob_uri: str=None, caching=None, disk_size_gb: int=None, storage_account_type=None, **kwargs) -> None: + super(ImageOSDisk, self).__init__(**kwargs) + self.os_type = os_type + self.os_state = os_state + self.snapshot = snapshot + self.managed_disk = managed_disk + self.blob_uri = blob_uri + self.caching = caching + self.disk_size_gb = disk_size_gb + self.storage_account_type = storage_account_type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_py3.py new file mode 100644 index 000000000000..382edb4e40bd --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_py3.py @@ -0,0 +1,70 @@ +# 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 .resource import Resource + + +class Image(Resource): + """The source user image virtual hard disk. The virtual hard disk will be + copied before being attached to the virtual machine. If SourceImage is + provided, the destination virtual hard drive must not exist. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param source_virtual_machine: The source virtual machine from which Image + is created. + :type source_virtual_machine: + ~azure.mgmt.compute.v2017_12_01.models.SubResource + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2017_12_01.models.ImageStorageProfile + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source_virtual_machine': {'key': 'properties.sourceVirtualMachine', 'type': 'SubResource'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'ImageStorageProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, source_virtual_machine=None, storage_profile=None, **kwargs) -> None: + super(Image, self).__init__(location=location, tags=tags, **kwargs) + self.source_virtual_machine = source_virtual_machine + self.storage_profile = storage_profile + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_reference.py index 9ec2177fa5ad..b8f929f4ad70 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_reference.py @@ -46,9 +46,9 @@ class ImageReference(SubResource): 'version': {'key': 'version', 'type': 'str'}, } - def __init__(self, id=None, publisher=None, offer=None, sku=None, version=None): - super(ImageReference, self).__init__(id=id) - self.publisher = publisher - self.offer = offer - self.sku = sku - self.version = version + def __init__(self, **kwargs): + super(ImageReference, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.offer = kwargs.get('offer', None) + self.sku = kwargs.get('sku', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_reference_py3.py new file mode 100644 index 000000000000..f44047d4c087 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_reference_py3.py @@ -0,0 +1,54 @@ +# 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 .sub_resource import SubResource + + +class ImageReference(SubResource): + """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. + + :param id: Resource Id + :type id: str + :param publisher: The image publisher. + :type publisher: str + :param offer: Specifies the offer of the platform image or marketplace + image used to create the virtual machine. + :type offer: str + :param sku: The image SKU. + :type sku: str + :param 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. + :type version: str + """ + + _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'}, + } + + def __init__(self, *, id: str=None, publisher: str=None, offer: str=None, sku: str=None, version: str=None, **kwargs) -> None: + super(ImageReference, self).__init__(id=id, **kwargs) + self.publisher = publisher + self.offer = offer + self.sku = sku + self.version = version diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_storage_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_storage_profile.py index c9d7216f634e..96fbc8a86600 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_storage_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_storage_profile.py @@ -26,18 +26,20 @@ class ImageStorageProfile(Model): machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). :type data_disks: list[~azure.mgmt.compute.v2017_12_01.models.ImageDataDisk] + :param zone_resilient: Specifies whether an image is zone resilient or + not. Default is false. Zone resilient images can be created only in + regions that provide Zone Redundant Storage (ZRS). + :type zone_resilient: bool """ - _validation = { - 'os_disk': {'required': True}, - } - _attribute_map = { 'os_disk': {'key': 'osDisk', 'type': 'ImageOSDisk'}, 'data_disks': {'key': 'dataDisks', 'type': '[ImageDataDisk]'}, + 'zone_resilient': {'key': 'zoneResilient', 'type': 'bool'}, } - def __init__(self, os_disk, data_disks=None): - super(ImageStorageProfile, self).__init__() - self.os_disk = os_disk - self.data_disks = data_disks + def __init__(self, **kwargs): + super(ImageStorageProfile, self).__init__(**kwargs) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) + self.zone_resilient = kwargs.get('zone_resilient', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_storage_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_storage_profile_py3.py new file mode 100644 index 000000000000..be49697f8a8f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_storage_profile_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class ImageStorageProfile(Model): + """Describes a storage profile. + + :param os_disk: Specifies information about the operating system disk used + by the virtual machine.

    For more information about disks, see + [About disks and VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type os_disk: ~azure.mgmt.compute.v2017_12_01.models.ImageOSDisk + :param data_disks: Specifies the parameters that are used to add a data + disk to a virtual machine.

    For more information about disks, see + [About disks and VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type data_disks: + list[~azure.mgmt.compute.v2017_12_01.models.ImageDataDisk] + :param zone_resilient: Specifies whether an image is zone resilient or + not. Default is false. Zone resilient images can be created only in + regions that provide Zone Redundant Storage (ZRS). + :type zone_resilient: bool + """ + + _attribute_map = { + 'os_disk': {'key': 'osDisk', 'type': 'ImageOSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[ImageDataDisk]'}, + 'zone_resilient': {'key': 'zoneResilient', 'type': 'bool'}, + } + + def __init__(self, *, os_disk=None, data_disks=None, zone_resilient: bool=None, **kwargs) -> None: + super(ImageStorageProfile, self).__init__(**kwargs) + self.os_disk = os_disk + self.data_disks = data_disks + self.zone_resilient = zone_resilient diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_update.py new file mode 100644 index 000000000000..0bf42c8181e2 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_update.py @@ -0,0 +1,52 @@ +# 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 .update_resource import UpdateResource + + +class ImageUpdate(UpdateResource): + """The source user image virtual hard disk. The virtual hard disk will be + copied before being attached to the virtual machine. If SourceImage is + provided, the destination virtual hard drive must not exist. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param tags: Resource tags + :type tags: dict[str, str] + :param source_virtual_machine: The source virtual machine from which Image + is created. + :type source_virtual_machine: + ~azure.mgmt.compute.v2017_12_01.models.SubResource + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2017_12_01.models.ImageStorageProfile + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source_virtual_machine': {'key': 'properties.sourceVirtualMachine', 'type': 'SubResource'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'ImageStorageProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImageUpdate, self).__init__(**kwargs) + self.source_virtual_machine = kwargs.get('source_virtual_machine', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_update_py3.py new file mode 100644 index 000000000000..0638ddf354e4 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_update_py3.py @@ -0,0 +1,52 @@ +# 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 .update_resource import UpdateResource + + +class ImageUpdate(UpdateResource): + """The source user image virtual hard disk. The virtual hard disk will be + copied before being attached to the virtual machine. If SourceImage is + provided, the destination virtual hard drive must not exist. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param tags: Resource tags + :type tags: dict[str, str] + :param source_virtual_machine: The source virtual machine from which Image + is created. + :type source_virtual_machine: + ~azure.mgmt.compute.v2017_12_01.models.SubResource + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2017_12_01.models.ImageStorageProfile + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source_virtual_machine': {'key': 'properties.sourceVirtualMachine', 'type': 'SubResource'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'ImageStorageProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, tags=None, source_virtual_machine=None, storage_profile=None, **kwargs) -> None: + super(ImageUpdate, self).__init__(tags=tags, **kwargs) + self.source_virtual_machine = source_virtual_machine + self.storage_profile = storage_profile + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/inner_error.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/inner_error.py index de77683e2fc8..6324249d7c19 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/inner_error.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/inner_error.py @@ -26,7 +26,7 @@ class InnerError(Model): 'errordetail': {'key': 'errordetail', 'type': 'str'}, } - def __init__(self, exceptiontype=None, errordetail=None): - super(InnerError, self).__init__() - self.exceptiontype = exceptiontype - self.errordetail = errordetail + def __init__(self, **kwargs): + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = kwargs.get('exceptiontype', None) + self.errordetail = kwargs.get('errordetail', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/inner_error_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/inner_error_py3.py new file mode 100644 index 000000000000..ccec30d7b53f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/inner_error_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class InnerError(Model): + """Inner error details. + + :param exceptiontype: The exception type. + :type exceptiontype: str + :param errordetail: The internal error message or exception dump. + :type errordetail: str + """ + + _attribute_map = { + 'exceptiontype': {'key': 'exceptiontype', 'type': 'str'}, + 'errordetail': {'key': 'errordetail', 'type': 'str'}, + } + + def __init__(self, *, exceptiontype: str=None, errordetail: str=None, **kwargs) -> None: + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = exceptiontype + self.errordetail = errordetail diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/instance_view_status.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/instance_view_status.py index f8d7262a5005..b4c68fdfcaf8 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/instance_view_status.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/instance_view_status.py @@ -38,10 +38,10 @@ class InstanceViewStatus(Model): 'time': {'key': 'time', 'type': 'iso-8601'}, } - def __init__(self, code=None, level=None, display_status=None, message=None, time=None): - super(InstanceViewStatus, self).__init__() - self.code = code - self.level = level - self.display_status = display_status - self.message = message - self.time = time + def __init__(self, **kwargs): + super(InstanceViewStatus, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.level = kwargs.get('level', None) + self.display_status = kwargs.get('display_status', None) + self.message = kwargs.get('message', None) + self.time = kwargs.get('time', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/instance_view_status_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/instance_view_status_py3.py new file mode 100644 index 000000000000..d1e94fe3a593 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/instance_view_status_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class InstanceViewStatus(Model): + """Instance view status. + + :param code: The status code. + :type code: str + :param level: The level code. Possible values include: 'Info', 'Warning', + 'Error' + :type level: str or + ~azure.mgmt.compute.v2017_12_01.models.StatusLevelTypes + :param display_status: The short localizable label for the status. + :type display_status: str + :param message: The detailed status message, including for alerts and + error messages. + :type message: str + :param time: The time of the status. + :type time: datetime + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'StatusLevelTypes'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__(self, *, code: str=None, level=None, display_status: str=None, message: str=None, time=None, **kwargs) -> None: + super(InstanceViewStatus, self).__init__(**kwargs) + self.code = code + self.level = level + self.display_status = display_status + self.message = message + self.time = time diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/key_vault_key_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/key_vault_key_reference.py index 13d829be979d..dbd9aab31680 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/key_vault_key_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/key_vault_key_reference.py @@ -15,9 +15,13 @@ class KeyVaultKeyReference(Model): """Describes a reference to Key Vault Key. - :param key_url: The URL referencing a key encryption key in Key Vault. + All required parameters must be populated in order to send to Azure. + + :param key_url: Required. The URL referencing a key encryption key in Key + Vault. :type key_url: str - :param source_vault: The relative URL of the Key Vault containing the key. + :param source_vault: Required. The relative URL of the Key Vault + containing the key. :type source_vault: ~azure.mgmt.compute.v2017_12_01.models.SubResource """ @@ -31,7 +35,7 @@ class KeyVaultKeyReference(Model): 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, } - def __init__(self, key_url, source_vault): - super(KeyVaultKeyReference, self).__init__() - self.key_url = key_url - self.source_vault = source_vault + def __init__(self, **kwargs): + super(KeyVaultKeyReference, self).__init__(**kwargs) + self.key_url = kwargs.get('key_url', None) + self.source_vault = kwargs.get('source_vault', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/key_vault_key_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/key_vault_key_reference_py3.py new file mode 100644 index 000000000000..0cc9f051bc12 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/key_vault_key_reference_py3.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 msrest.serialization import Model + + +class KeyVaultKeyReference(Model): + """Describes a reference to Key Vault Key. + + All required parameters must be populated in order to send to Azure. + + :param key_url: Required. The URL referencing a key encryption key in Key + Vault. + :type key_url: str + :param source_vault: Required. The relative URL of the Key Vault + containing the key. + :type source_vault: ~azure.mgmt.compute.v2017_12_01.models.SubResource + """ + + _validation = { + 'key_url': {'required': True}, + 'source_vault': {'required': True}, + } + + _attribute_map = { + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, + } + + def __init__(self, *, key_url: str, source_vault, **kwargs) -> None: + super(KeyVaultKeyReference, self).__init__(**kwargs) + self.key_url = key_url + self.source_vault = source_vault diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/key_vault_secret_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/key_vault_secret_reference.py index 096b26b6ea0f..26f6dd38deab 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/key_vault_secret_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/key_vault_secret_reference.py @@ -15,10 +15,12 @@ class KeyVaultSecretReference(Model): """Describes a reference to Key Vault Secret. - :param secret_url: The URL referencing a secret in a Key Vault. + All required parameters must be populated in order to send to Azure. + + :param secret_url: Required. The URL referencing a secret in a Key Vault. :type secret_url: str - :param source_vault: The relative URL of the Key Vault containing the - secret. + :param source_vault: Required. The relative URL of the Key Vault + containing the secret. :type source_vault: ~azure.mgmt.compute.v2017_12_01.models.SubResource """ @@ -32,7 +34,7 @@ class KeyVaultSecretReference(Model): 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, } - def __init__(self, secret_url, source_vault): - super(KeyVaultSecretReference, self).__init__() - self.secret_url = secret_url - self.source_vault = source_vault + def __init__(self, **kwargs): + super(KeyVaultSecretReference, self).__init__(**kwargs) + self.secret_url = kwargs.get('secret_url', None) + self.source_vault = kwargs.get('source_vault', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/key_vault_secret_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/key_vault_secret_reference_py3.py new file mode 100644 index 000000000000..75bf7d78846e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/key_vault_secret_reference_py3.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 msrest.serialization import Model + + +class KeyVaultSecretReference(Model): + """Describes a reference to Key Vault Secret. + + All required parameters must be populated in order to send to Azure. + + :param secret_url: Required. The URL referencing a secret in a Key Vault. + :type secret_url: str + :param source_vault: Required. The relative URL of the Key Vault + containing the secret. + :type source_vault: ~azure.mgmt.compute.v2017_12_01.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, **kwargs) -> None: + super(KeyVaultSecretReference, self).__init__(**kwargs) + self.secret_url = secret_url + self.source_vault = source_vault diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/linux_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/linux_configuration.py index 8783ffba1d58..81edbf298df9 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/linux_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/linux_configuration.py @@ -33,7 +33,7 @@ class LinuxConfiguration(Model): 'ssh': {'key': 'ssh', 'type': 'SshConfiguration'}, } - def __init__(self, disable_password_authentication=None, ssh=None): - super(LinuxConfiguration, self).__init__() - self.disable_password_authentication = disable_password_authentication - self.ssh = ssh + def __init__(self, **kwargs): + super(LinuxConfiguration, self).__init__(**kwargs) + self.disable_password_authentication = kwargs.get('disable_password_authentication', None) + self.ssh = kwargs.get('ssh', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/linux_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/linux_configuration_py3.py new file mode 100644 index 000000000000..a2bc8ef028cc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/linux_configuration_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class LinuxConfiguration(Model): + """Specifies the Linux operating system settings on the virtual machine. +

    For a list of supported Linux distributions, see [Linux on + Azure-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) +

    For running non-endorsed distributions, see [Information for + Non-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + + :param disable_password_authentication: Specifies whether password + authentication should be disabled. + :type disable_password_authentication: bool + :param ssh: Specifies the ssh key configuration for a Linux OS. + :type ssh: ~azure.mgmt.compute.v2017_12_01.models.SshConfiguration + """ + + _attribute_map = { + 'disable_password_authentication': {'key': 'disablePasswordAuthentication', 'type': 'bool'}, + 'ssh': {'key': 'ssh', 'type': 'SshConfiguration'}, + } + + def __init__(self, *, disable_password_authentication: bool=None, ssh=None, **kwargs) -> None: + super(LinuxConfiguration, self).__init__(**kwargs) + self.disable_password_authentication = disable_password_authentication + self.ssh = ssh diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_input_base.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_input_base.py new file mode 100644 index 000000000000..843b739a0328 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_input_base.py @@ -0,0 +1,58 @@ +# 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 msrest.serialization import Model + + +class LogAnalyticsInputBase(Model): + """Api input base class for LogAnalytics Api. + + All required parameters must be populated in order to send to Azure. + + :param blob_container_sas_uri: Required. SAS Uri of the logging blob + container to which LogAnalytics Api writes output logs to. + :type blob_container_sas_uri: str + :param from_time: Required. From time of the query + :type from_time: datetime + :param to_time: Required. To time of the query + :type to_time: datetime + :param group_by_throttle_policy: Group query result by Throttle Policy + applied. + :type group_by_throttle_policy: bool + :param group_by_operation_name: Group query result by by Operation Name. + :type group_by_operation_name: bool + :param group_by_resource_name: Group query result by Resource Name. + :type group_by_resource_name: bool + """ + + _validation = { + 'blob_container_sas_uri': {'required': True}, + 'from_time': {'required': True}, + 'to_time': {'required': True}, + } + + _attribute_map = { + 'blob_container_sas_uri': {'key': 'blobContainerSasUri', 'type': 'str'}, + 'from_time': {'key': 'fromTime', 'type': 'iso-8601'}, + 'to_time': {'key': 'toTime', 'type': 'iso-8601'}, + 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, + 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, + 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(LogAnalyticsInputBase, self).__init__(**kwargs) + self.blob_container_sas_uri = kwargs.get('blob_container_sas_uri', None) + self.from_time = kwargs.get('from_time', None) + self.to_time = kwargs.get('to_time', None) + self.group_by_throttle_policy = kwargs.get('group_by_throttle_policy', None) + self.group_by_operation_name = kwargs.get('group_by_operation_name', None) + self.group_by_resource_name = kwargs.get('group_by_resource_name', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_input_base_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_input_base_py3.py new file mode 100644 index 000000000000..b9420117a8ca --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_input_base_py3.py @@ -0,0 +1,58 @@ +# 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 msrest.serialization import Model + + +class LogAnalyticsInputBase(Model): + """Api input base class for LogAnalytics Api. + + All required parameters must be populated in order to send to Azure. + + :param blob_container_sas_uri: Required. SAS Uri of the logging blob + container to which LogAnalytics Api writes output logs to. + :type blob_container_sas_uri: str + :param from_time: Required. From time of the query + :type from_time: datetime + :param to_time: Required. To time of the query + :type to_time: datetime + :param group_by_throttle_policy: Group query result by Throttle Policy + applied. + :type group_by_throttle_policy: bool + :param group_by_operation_name: Group query result by by Operation Name. + :type group_by_operation_name: bool + :param group_by_resource_name: Group query result by Resource Name. + :type group_by_resource_name: bool + """ + + _validation = { + 'blob_container_sas_uri': {'required': True}, + 'from_time': {'required': True}, + 'to_time': {'required': True}, + } + + _attribute_map = { + 'blob_container_sas_uri': {'key': 'blobContainerSasUri', 'type': 'str'}, + 'from_time': {'key': 'fromTime', 'type': 'iso-8601'}, + 'to_time': {'key': 'toTime', 'type': 'iso-8601'}, + 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, + 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, + 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + } + + def __init__(self, *, blob_container_sas_uri: str, from_time, to_time, group_by_throttle_policy: bool=None, group_by_operation_name: bool=None, group_by_resource_name: bool=None, **kwargs) -> None: + super(LogAnalyticsInputBase, self).__init__(**kwargs) + self.blob_container_sas_uri = blob_container_sas_uri + self.from_time = from_time + self.to_time = to_time + self.group_by_throttle_policy = group_by_throttle_policy + self.group_by_operation_name = group_by_operation_name + self.group_by_resource_name = group_by_resource_name diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_operation_result.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_operation_result.py new file mode 100644 index 000000000000..131f5fcee091 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_operation_result.py @@ -0,0 +1,56 @@ +# 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 .operation_status_response import OperationStatusResponse + + +class LogAnalyticsOperationResult(OperationStatusResponse): + """LogAnalytics operation status response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation ID + :vartype name: str + :ivar status: Operation status + :vartype status: str + :ivar start_time: Start time of the operation + :vartype start_time: datetime + :ivar end_time: End time of the operation + :vartype end_time: datetime + :ivar error: Api error + :vartype error: ~azure.mgmt.compute.v2017_12_01.models.ApiError + :ivar properties: LogAnalyticsOutput + :vartype properties: + ~azure.mgmt.compute.v2017_12_01.models.LogAnalyticsOutput + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + 'properties': {'key': 'properties', 'type': 'LogAnalyticsOutput'}, + } + + def __init__(self, **kwargs): + super(LogAnalyticsOperationResult, self).__init__(**kwargs) + self.properties = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_operation_result_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_operation_result_py3.py new file mode 100644 index 000000000000..21d2d2d05ab8 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_operation_result_py3.py @@ -0,0 +1,56 @@ +# 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 .operation_status_response import OperationStatusResponse + + +class LogAnalyticsOperationResult(OperationStatusResponse): + """LogAnalytics operation status response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation ID + :vartype name: str + :ivar status: Operation status + :vartype status: str + :ivar start_time: Start time of the operation + :vartype start_time: datetime + :ivar end_time: End time of the operation + :vartype end_time: datetime + :ivar error: Api error + :vartype error: ~azure.mgmt.compute.v2017_12_01.models.ApiError + :ivar properties: LogAnalyticsOutput + :vartype properties: + ~azure.mgmt.compute.v2017_12_01.models.LogAnalyticsOutput + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + 'properties': {'key': 'properties', 'type': 'LogAnalyticsOutput'}, + } + + def __init__(self, **kwargs) -> None: + super(LogAnalyticsOperationResult, self).__init__(, **kwargs) + self.properties = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_output.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_output.py new file mode 100644 index 000000000000..5ea1615011c3 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_output.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class LogAnalyticsOutput(Model): + """LogAnalytics output properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar output: Output file Uri path to blob container. + :vartype output: str + """ + + _validation = { + 'output': {'readonly': True}, + } + + _attribute_map = { + 'output': {'key': 'output', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LogAnalyticsOutput, self).__init__(**kwargs) + self.output = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_output_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_output_py3.py new file mode 100644 index 000000000000..71a428a8e49a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/log_analytics_output_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class LogAnalyticsOutput(Model): + """LogAnalytics output properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar output: Output file Uri path to blob container. + :vartype output: str + """ + + _validation = { + 'output': {'readonly': True}, + } + + _attribute_map = { + 'output': {'key': 'output', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(LogAnalyticsOutput, self).__init__(**kwargs) + self.output = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/maintenance_redeploy_status.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/maintenance_redeploy_status.py index fa90608f7a47..3a707b8d7e0e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/maintenance_redeploy_status.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/maintenance_redeploy_status.py @@ -49,12 +49,12 @@ class MaintenanceRedeployStatus(Model): 'last_operation_message': {'key': 'lastOperationMessage', 'type': 'str'}, } - def __init__(self, is_customer_initiated_maintenance_allowed=None, pre_maintenance_window_start_time=None, pre_maintenance_window_end_time=None, maintenance_window_start_time=None, maintenance_window_end_time=None, last_operation_result_code=None, last_operation_message=None): - super(MaintenanceRedeployStatus, self).__init__() - self.is_customer_initiated_maintenance_allowed = is_customer_initiated_maintenance_allowed - self.pre_maintenance_window_start_time = pre_maintenance_window_start_time - self.pre_maintenance_window_end_time = pre_maintenance_window_end_time - self.maintenance_window_start_time = maintenance_window_start_time - self.maintenance_window_end_time = maintenance_window_end_time - self.last_operation_result_code = last_operation_result_code - self.last_operation_message = last_operation_message + def __init__(self, **kwargs): + super(MaintenanceRedeployStatus, self).__init__(**kwargs) + self.is_customer_initiated_maintenance_allowed = kwargs.get('is_customer_initiated_maintenance_allowed', None) + self.pre_maintenance_window_start_time = kwargs.get('pre_maintenance_window_start_time', None) + self.pre_maintenance_window_end_time = kwargs.get('pre_maintenance_window_end_time', None) + self.maintenance_window_start_time = kwargs.get('maintenance_window_start_time', None) + self.maintenance_window_end_time = kwargs.get('maintenance_window_end_time', None) + self.last_operation_result_code = kwargs.get('last_operation_result_code', None) + self.last_operation_message = kwargs.get('last_operation_message', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/maintenance_redeploy_status_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/maintenance_redeploy_status_py3.py new file mode 100644 index 000000000000..a8d2a66f8d32 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/maintenance_redeploy_status_py3.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class MaintenanceRedeployStatus(Model): + """Maintenance Operation Status. + + :param is_customer_initiated_maintenance_allowed: True, if customer is + allowed to perform Maintenance. + :type is_customer_initiated_maintenance_allowed: bool + :param pre_maintenance_window_start_time: Start Time for the Pre + Maintenance Window. + :type pre_maintenance_window_start_time: datetime + :param pre_maintenance_window_end_time: End Time for the Pre Maintenance + Window. + :type pre_maintenance_window_end_time: datetime + :param maintenance_window_start_time: Start Time for the Maintenance + Window. + :type maintenance_window_start_time: datetime + :param maintenance_window_end_time: End Time for the Maintenance Window. + :type maintenance_window_end_time: datetime + :param last_operation_result_code: The Last Maintenance Operation Result + Code. Possible values include: 'None', 'RetryLater', 'MaintenanceAborted', + 'MaintenanceCompleted' + :type last_operation_result_code: str or + ~azure.mgmt.compute.v2017_12_01.models.MaintenanceOperationResultCodeTypes + :param last_operation_message: Message returned for the last Maintenance + Operation. + :type last_operation_message: str + """ + + _attribute_map = { + 'is_customer_initiated_maintenance_allowed': {'key': 'isCustomerInitiatedMaintenanceAllowed', 'type': 'bool'}, + 'pre_maintenance_window_start_time': {'key': 'preMaintenanceWindowStartTime', 'type': 'iso-8601'}, + 'pre_maintenance_window_end_time': {'key': 'preMaintenanceWindowEndTime', 'type': 'iso-8601'}, + 'maintenance_window_start_time': {'key': 'maintenanceWindowStartTime', 'type': 'iso-8601'}, + 'maintenance_window_end_time': {'key': 'maintenanceWindowEndTime', 'type': 'iso-8601'}, + 'last_operation_result_code': {'key': 'lastOperationResultCode', 'type': 'MaintenanceOperationResultCodeTypes'}, + 'last_operation_message': {'key': 'lastOperationMessage', 'type': 'str'}, + } + + def __init__(self, *, is_customer_initiated_maintenance_allowed: bool=None, pre_maintenance_window_start_time=None, pre_maintenance_window_end_time=None, maintenance_window_start_time=None, maintenance_window_end_time=None, last_operation_result_code=None, last_operation_message: str=None, **kwargs) -> None: + super(MaintenanceRedeployStatus, self).__init__(**kwargs) + self.is_customer_initiated_maintenance_allowed = is_customer_initiated_maintenance_allowed + self.pre_maintenance_window_start_time = pre_maintenance_window_start_time + self.pre_maintenance_window_end_time = pre_maintenance_window_end_time + self.maintenance_window_start_time = maintenance_window_start_time + self.maintenance_window_end_time = maintenance_window_end_time + self.last_operation_result_code = last_operation_result_code + self.last_operation_message = last_operation_message diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/managed_disk_parameters.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/managed_disk_parameters.py index db3b72b03891..508b95430415 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/managed_disk_parameters.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/managed_disk_parameters.py @@ -26,9 +26,9 @@ class ManagedDiskParameters(SubResource): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, } - def __init__(self, id=None, storage_account_type=None): - super(ManagedDiskParameters, self).__init__(id=id) - self.storage_account_type = storage_account_type + def __init__(self, **kwargs): + super(ManagedDiskParameters, self).__init__(**kwargs) + self.storage_account_type = kwargs.get('storage_account_type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/managed_disk_parameters_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/managed_disk_parameters_py3.py new file mode 100644 index 000000000000..cd11679f5f8d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/managed_disk_parameters_py3.py @@ -0,0 +1,34 @@ +# 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 .sub_resource import SubResource + + +class ManagedDiskParameters(SubResource): + """The parameters of a managed disk. + + :param id: Resource Id + :type id: str + :param storage_account_type: Specifies the storage account type for the + managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible + values include: 'Standard_LRS', 'Premium_LRS' + :type storage_account_type: str or + ~azure.mgmt.compute.v2017_12_01.models.StorageAccountTypes + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, storage_account_type=None, **kwargs) -> None: + super(ManagedDiskParameters, self).__init__(id=id, **kwargs) + self.storage_account_type = storage_account_type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/network_interface_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/network_interface_reference.py index 80c743c0d8e3..b86e305e3f74 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/network_interface_reference.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/network_interface_reference.py @@ -27,6 +27,6 @@ class NetworkInterfaceReference(SubResource): 'primary': {'key': 'properties.primary', 'type': 'bool'}, } - def __init__(self, id=None, primary=None): - super(NetworkInterfaceReference, self).__init__(id=id) - self.primary = primary + def __init__(self, **kwargs): + super(NetworkInterfaceReference, self).__init__(**kwargs) + self.primary = kwargs.get('primary', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/network_interface_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/network_interface_reference_py3.py new file mode 100644 index 000000000000..f42ead50fc36 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/network_interface_reference_py3.py @@ -0,0 +1,32 @@ +# 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 .sub_resource import SubResource + + +class NetworkInterfaceReference(SubResource): + """Describes a network interface reference. + + :param id: Resource Id + :type id: str + :param primary: Specifies the primary network interface in case the + virtual machine has more than 1 network interface. + :type primary: bool + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + } + + def __init__(self, *, id: str=None, primary: bool=None, **kwargs) -> None: + super(NetworkInterfaceReference, self).__init__(id=id, **kwargs) + self.primary = primary diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/network_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/network_profile.py index ce810524bbc6..0176effa4701 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/network_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/network_profile.py @@ -25,6 +25,6 @@ class NetworkProfile(Model): 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceReference]'}, } - def __init__(self, network_interfaces=None): - super(NetworkProfile, self).__init__() - self.network_interfaces = network_interfaces + def __init__(self, **kwargs): + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/network_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/network_profile_py3.py new file mode 100644 index 000000000000..80e37240104b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/network_profile_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkProfile(Model): + """Specifies the network interfaces of the virtual machine. + + :param network_interfaces: Specifies the list of resource Ids for the + network interfaces associated with the virtual machine. + :type network_interfaces: + list[~azure.mgmt.compute.v2017_12_01.models.NetworkInterfaceReference] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceReference]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = network_interfaces diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/operation_status_response.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/operation_status_response.py index 377d03c23aa1..6fbf5a148137 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/operation_status_response.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/operation_status_response.py @@ -46,8 +46,8 @@ class OperationStatusResponse(Model): 'error': {'key': 'error', 'type': 'ApiError'}, } - def __init__(self): - super(OperationStatusResponse, self).__init__() + def __init__(self, **kwargs): + super(OperationStatusResponse, self).__init__(**kwargs) self.name = None self.status = None self.start_time = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/operation_status_response_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/operation_status_response_py3.py new file mode 100644 index 000000000000..3c93c2616788 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/operation_status_response_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class OperationStatusResponse(Model): + """Operation status response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation ID + :vartype name: str + :ivar status: Operation status + :vartype status: str + :ivar start_time: Start time of the operation + :vartype start_time: datetime + :ivar end_time: End time of the operation + :vartype end_time: datetime + :ivar error: Api error + :vartype error: ~azure.mgmt.compute.v2017_12_01.models.ApiError + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationStatusResponse, self).__init__(**kwargs) + self.name = None + self.status = None + self.start_time = None + self.end_time = None + self.error = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk.py index dbd6011b4310..a81c8e1fec5e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk.py @@ -18,6 +18,8 @@ class OSDisk(Model): VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + All required parameters must be populated in order to send to Azure. + :param 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** @@ -42,8 +44,11 @@ class OSDisk(Model):

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2017_12_01.models.CachingTypes - :param create_option: Specifies how the virtual machine should be - created.

    Possible values are:

    **Attach** \\u2013 This + :param write_accelerator_enabled: Specifies whether writeAccelerator + should be enabled or disabled on the disk. + :type write_accelerator_enabled: bool + :param create_option: Required. Specifies how the virtual machine should + be created.

    Possible values are:

    **Attach** \\u2013 This value is used when you are using a specialized disk to create the virtual machine.

    **FromImage** \\u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform @@ -72,19 +77,21 @@ class OSDisk(Model): 'vhd': {'key': 'vhd', 'type': 'VirtualHardDisk'}, 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, - 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + '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': 'ManagedDiskParameters'}, } - def __init__(self, create_option, os_type=None, encryption_settings=None, name=None, vhd=None, image=None, caching=None, disk_size_gb=None, managed_disk=None): - super(OSDisk, self).__init__() - self.os_type = os_type - self.encryption_settings = encryption_settings - self.name = name - self.vhd = vhd - self.image = image - self.caching = caching - self.create_option = create_option - self.disk_size_gb = disk_size_gb - self.managed_disk = managed_disk + def __init__(self, **kwargs): + super(OSDisk, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.encryption_settings = kwargs.get('encryption_settings', None) + self.name = kwargs.get('name', None) + self.vhd = kwargs.get('vhd', None) + self.image = kwargs.get('image', None) + self.caching = kwargs.get('caching', None) + self.write_accelerator_enabled = kwargs.get('write_accelerator_enabled', None) + self.create_option = kwargs.get('create_option', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.managed_disk = kwargs.get('managed_disk', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk_image.py index a01728c603f1..1739604a335e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk_image.py @@ -15,8 +15,10 @@ class OSDiskImage(Model): """Contains the os disk image information. - :param operating_system: The operating system of the osDiskImage. Possible - values include: 'Windows', 'Linux' + All required parameters must be populated in order to send to Azure. + + :param operating_system: Required. The operating system of the + osDiskImage. Possible values include: 'Windows', 'Linux' :type operating_system: str or ~azure.mgmt.compute.v2017_12_01.models.OperatingSystemTypes """ @@ -29,6 +31,6 @@ class OSDiskImage(Model): 'operating_system': {'key': 'operatingSystem', 'type': 'OperatingSystemTypes'}, } - def __init__(self, operating_system): - super(OSDiskImage, self).__init__() - self.operating_system = operating_system + def __init__(self, **kwargs): + super(OSDiskImage, self).__init__(**kwargs) + self.operating_system = kwargs.get('operating_system', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk_image_py3.py new file mode 100644 index 000000000000..00a360b8ead5 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk_image_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class OSDiskImage(Model): + """Contains the os disk image information. + + All required parameters must be populated in order to send to Azure. + + :param operating_system: Required. The operating system of the + osDiskImage. Possible values include: 'Windows', 'Linux' + :type operating_system: str or + ~azure.mgmt.compute.v2017_12_01.models.OperatingSystemTypes + """ + + _validation = { + 'operating_system': {'required': True}, + } + + _attribute_map = { + 'operating_system': {'key': 'operatingSystem', 'type': 'OperatingSystemTypes'}, + } + + def __init__(self, *, operating_system, **kwargs) -> None: + super(OSDiskImage, self).__init__(**kwargs) + self.operating_system = operating_system diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk_py3.py new file mode 100644 index 000000000000..edfcc1b27230 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk_py3.py @@ -0,0 +1,97 @@ +# 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 msrest.serialization import Model + + +class OSDisk(Model): + """Specifies information about the operating system disk used by the virtual + machine.

    For more information about disks, see [About disks and + VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + + All required parameters must be populated in order to send to Azure. + + :param 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**. Possible values include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2017_12_01.models.OperatingSystemTypes + :param encryption_settings: Specifies the encryption settings for the OS + Disk.

    Minimum api-version: 2015-06-15 + :type encryption_settings: + ~azure.mgmt.compute.v2017_12_01.models.DiskEncryptionSettings + :param name: The disk name. + :type name: str + :param vhd: The virtual hard disk. + :type vhd: ~azure.mgmt.compute.v2017_12_01.models.VirtualHardDisk + :param image: The source user image virtual hard disk. The virtual hard + disk will be copied before being attached to the virtual machine. If + SourceImage is provided, the destination virtual hard drive must not + exist. + :type image: ~azure.mgmt.compute.v2017_12_01.models.VirtualHardDisk + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2017_12_01.models.CachingTypes + :param write_accelerator_enabled: Specifies whether writeAccelerator + should be enabled or disabled on the disk. + :type write_accelerator_enabled: bool + :param create_option: Required. Specifies how the virtual machine should + be created.

    Possible values are:

    **Attach** \\u2013 This + value is used when you are using a specialized disk to create the virtual + machine.

    **FromImage** \\u2013 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. Possible values include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2017_12_01.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in + gigabytes. This element can be used to overwrite the name of the disk in a + virtual machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2017_12_01.models.ManagedDiskParameters + """ + + _validation = { + 'create_option': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': 'DiskEncryptionSettings'}, + 'name': {'key': 'name', 'type': 'str'}, + 'vhd': {'key': 'vhd', 'type': 'VirtualHardDisk'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + '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': 'ManagedDiskParameters'}, + } + + def __init__(self, *, create_option, os_type=None, encryption_settings=None, name: str=None, vhd=None, image=None, caching=None, write_accelerator_enabled: bool=None, disk_size_gb: int=None, managed_disk=None, **kwargs) -> None: + super(OSDisk, self).__init__(**kwargs) + self.os_type = os_type + self.encryption_settings = encryption_settings + self.name = name + self.vhd = vhd + self.image = image + 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 diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_profile.py index e32c7d998c95..c046b33f6307 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_profile.py @@ -88,12 +88,12 @@ class OSProfile(Model): 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, } - def __init__(self, computer_name=None, admin_username=None, admin_password=None, custom_data=None, windows_configuration=None, linux_configuration=None, secrets=None): - super(OSProfile, self).__init__() - self.computer_name = computer_name - 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 + def __init__(self, **kwargs): + super(OSProfile, self).__init__(**kwargs) + self.computer_name = kwargs.get('computer_name', None) + self.admin_username = kwargs.get('admin_username', None) + self.admin_password = kwargs.get('admin_password', None) + self.custom_data = kwargs.get('custom_data', None) + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + self.secrets = kwargs.get('secrets', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_profile_py3.py new file mode 100644 index 000000000000..a6a4e8c4801a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_profile_py3.py @@ -0,0 +1,99 @@ +# 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 msrest.serialization import Model + + +class OSProfile(Model): + """Specifies the operating system settings for the virtual machine. + + :param computer_name: Specifies the host OS name of the virtual machine. +

    **Max-length (Windows):** 15 characters

    **Max-length + (Linux):** 64 characters.

    For naming conventions and restrictions + see [Azure infrastructure services implementation + guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + :type computer_name: str + :param admin_username: Specifies the name of the administrator account. +

    **Windows-only restriction:** Cannot end in "."

    + **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".

    **Minimum-length (Linux):** 1 + character

    **Max-length (Linux):** 64 characters

    + **Max-length (Windows):** 20 characters

  • For root access to + the Linux VM, see [Using root privileges on Linux virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + For a list of built-in system users on Linux that should not be used in + this field, see [Selecting User Names for Linux on + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type admin_username: str + :param admin_password: Specifies the password of the administrator + account.

    **Minimum-length (Windows):** 8 characters

    + **Minimum-length (Linux):** 6 characters

    **Max-length + (Windows):** 123 characters

    **Max-length (Linux):** 72 characters +

    **Complexity requirements:** 3 out of 4 conditions below need to + be fulfilled
    Has lower characters
    Has upper characters
    Has a + digit
    Has a special character (Regex match [\\W_])

    + **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + "iloveyou!"

    For resetting the password, see [How to reset the + Remote Desktop service or its login password in a Windows + VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    For resetting root password, see [Manage users, SSH, and check or + repair disks on Azure Linux VMs using the VMAccess + Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + :type admin_password: str + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type custom_data: str + :param windows_configuration: Specifies Windows operating system settings + on the virtual machine. + :type windows_configuration: + ~azure.mgmt.compute.v2017_12_01.models.WindowsConfiguration + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) +

    For running non-endorsed distributions, see [Information for + Non-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + :type linux_configuration: + ~azure.mgmt.compute.v2017_12_01.models.LinuxConfiguration + :param secrets: Specifies set of certificates that should be installed + onto the virtual machine. + :type secrets: + list[~azure.mgmt.compute.v2017_12_01.models.VaultSecretGroup] + """ + + _attribute_map = { + 'computer_name': {'key': 'computerName', '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]'}, + } + + def __init__(self, *, computer_name: str=None, admin_username: str=None, admin_password: str=None, custom_data: str=None, windows_configuration=None, linux_configuration=None, secrets=None, **kwargs) -> None: + super(OSProfile, self).__init__(**kwargs) + self.computer_name = computer_name + 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 diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/plan.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/plan.py index 772160aef635..d42b6b32cfac 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/plan.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/plan.py @@ -38,9 +38,9 @@ class Plan(Model): 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, } - def __init__(self, name=None, publisher=None, product=None, promotion_code=None): - super(Plan, self).__init__() - self.name = name - self.publisher = publisher - self.product = product - self.promotion_code = promotion_code + def __init__(self, **kwargs): + super(Plan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/plan_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/plan_py3.py new file mode 100644 index 000000000000..9cca2c78a123 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/plan_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class Plan(Model): + """Specifies information about the marketplace image used to create the + virtual machine. This element is only used for marketplace images. Before + you can use a marketplace image from an API, you must enable the image for + programmatic use. In the Azure portal, find the marketplace image that you + want to use and then click **Want to deploy programmatically, Get Started + ->**. Enter any required information and then click **Save**. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: Specifies the product of the image from the marketplace. + This is the same value as Offer under the imageReference element. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, publisher: str=None, product: str=None, promotion_code: str=None, **kwargs) -> None: + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/purchase_plan.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/purchase_plan.py index aa29cb02ab78..2e1509addca6 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/purchase_plan.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/purchase_plan.py @@ -16,12 +16,15 @@ class PurchasePlan(Model): """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - :param publisher: The publisher ID. + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The publisher ID. :type publisher: str - :param name: The plan ID. + :param name: Required. The plan ID. :type name: str - :param product: Specifies the product of the image from the marketplace. - This is the same value as Offer under the imageReference element. + :param product: Required. Specifies the product of the image from the + marketplace. This is the same value as Offer under the imageReference + element. :type product: str """ @@ -37,8 +40,8 @@ class PurchasePlan(Model): 'product': {'key': 'product', 'type': 'str'}, } - def __init__(self, publisher, name, product): - super(PurchasePlan, self).__init__() - self.publisher = publisher - self.name = name - self.product = product + def __init__(self, **kwargs): + super(PurchasePlan, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.name = kwargs.get('name', None) + self.product = kwargs.get('product', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/purchase_plan_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/purchase_plan_py3.py new file mode 100644 index 000000000000..26f7996f1633 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/purchase_plan_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class PurchasePlan(Model): + """Used for establishing the purchase context of any 3rd Party artifact + through MarketPlace. + + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The publisher ID. + :type publisher: str + :param name: Required. The plan ID. + :type name: str + :param product: Required. Specifies the product of the image from the + marketplace. This is the same value as Offer under the imageReference + element. + :type product: str + """ + + _validation = { + 'publisher': {'required': True}, + 'name': {'required': True}, + 'product': {'required': True}, + } + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__(self, *, publisher: str, name: str, product: str, **kwargs) -> None: + super(PurchasePlan, self).__init__(**kwargs) + self.publisher = publisher + self.name = name + self.product = product diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/recovery_walk_response.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/recovery_walk_response.py new file mode 100644 index 000000000000..8dcbca604c7e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/recovery_walk_response.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 msrest.serialization import Model + + +class RecoveryWalkResponse(Model): + """Response after calling a manual recovery walk. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar walk_performed: Whether the recovery walk was performed + :vartype walk_performed: bool + :ivar next_platform_update_domain: The next update domain that needs to be + walked. Null means walk spanning all update domains has been completed + :vartype next_platform_update_domain: int + """ + + _validation = { + 'walk_performed': {'readonly': True}, + 'next_platform_update_domain': {'readonly': True}, + } + + _attribute_map = { + 'walk_performed': {'key': 'walkPerformed', 'type': 'bool'}, + 'next_platform_update_domain': {'key': 'nextPlatformUpdateDomain', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(RecoveryWalkResponse, self).__init__(**kwargs) + self.walk_performed = None + self.next_platform_update_domain = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/recovery_walk_response_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/recovery_walk_response_py3.py new file mode 100644 index 000000000000..5b24a0ed9b7a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/recovery_walk_response_py3.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 msrest.serialization import Model + + +class RecoveryWalkResponse(Model): + """Response after calling a manual recovery walk. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar walk_performed: Whether the recovery walk was performed + :vartype walk_performed: bool + :ivar next_platform_update_domain: The next update domain that needs to be + walked. Null means walk spanning all update domains has been completed + :vartype next_platform_update_domain: int + """ + + _validation = { + 'walk_performed': {'readonly': True}, + 'next_platform_update_domain': {'readonly': True}, + } + + _attribute_map = { + 'walk_performed': {'key': 'walkPerformed', 'type': 'bool'}, + 'next_platform_update_domain': {'key': 'nextPlatformUpdateDomain', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(RecoveryWalkResponse, self).__init__(**kwargs) + self.walk_performed = None + self.next_platform_update_domain = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/request_rate_by_interval_input.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/request_rate_by_interval_input.py new file mode 100644 index 000000000000..5e238fafc90f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/request_rate_by_interval_input.py @@ -0,0 +1,60 @@ +# 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 .log_analytics_input_base import LogAnalyticsInputBase + + +class RequestRateByIntervalInput(LogAnalyticsInputBase): + """Api request input for LogAnalytics getRequestRateByInterval Api. + + All required parameters must be populated in order to send to Azure. + + :param blob_container_sas_uri: Required. SAS Uri of the logging blob + container to which LogAnalytics Api writes output logs to. + :type blob_container_sas_uri: str + :param from_time: Required. From time of the query + :type from_time: datetime + :param to_time: Required. To time of the query + :type to_time: datetime + :param group_by_throttle_policy: Group query result by Throttle Policy + applied. + :type group_by_throttle_policy: bool + :param group_by_operation_name: Group query result by by Operation Name. + :type group_by_operation_name: bool + :param group_by_resource_name: Group query result by Resource Name. + :type group_by_resource_name: bool + :param interval_length: Required. Interval value in minutes used to create + LogAnalytics call rate logs. Possible values include: 'ThreeMins', + 'FiveMins', 'ThirtyMins', 'SixtyMins' + :type interval_length: str or + ~azure.mgmt.compute.v2017_12_01.models.IntervalInMins + """ + + _validation = { + 'blob_container_sas_uri': {'required': True}, + 'from_time': {'required': True}, + 'to_time': {'required': True}, + 'interval_length': {'required': True}, + } + + _attribute_map = { + 'blob_container_sas_uri': {'key': 'blobContainerSasUri', 'type': 'str'}, + 'from_time': {'key': 'fromTime', 'type': 'iso-8601'}, + 'to_time': {'key': 'toTime', 'type': 'iso-8601'}, + 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, + 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, + 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + 'interval_length': {'key': 'intervalLength', 'type': 'IntervalInMins'}, + } + + def __init__(self, **kwargs): + super(RequestRateByIntervalInput, self).__init__(**kwargs) + self.interval_length = kwargs.get('interval_length', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/request_rate_by_interval_input_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/request_rate_by_interval_input_py3.py new file mode 100644 index 000000000000..5e931a0379aa --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/request_rate_by_interval_input_py3.py @@ -0,0 +1,60 @@ +# 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 .log_analytics_input_base import LogAnalyticsInputBase + + +class RequestRateByIntervalInput(LogAnalyticsInputBase): + """Api request input for LogAnalytics getRequestRateByInterval Api. + + All required parameters must be populated in order to send to Azure. + + :param blob_container_sas_uri: Required. SAS Uri of the logging blob + container to which LogAnalytics Api writes output logs to. + :type blob_container_sas_uri: str + :param from_time: Required. From time of the query + :type from_time: datetime + :param to_time: Required. To time of the query + :type to_time: datetime + :param group_by_throttle_policy: Group query result by Throttle Policy + applied. + :type group_by_throttle_policy: bool + :param group_by_operation_name: Group query result by by Operation Name. + :type group_by_operation_name: bool + :param group_by_resource_name: Group query result by Resource Name. + :type group_by_resource_name: bool + :param interval_length: Required. Interval value in minutes used to create + LogAnalytics call rate logs. Possible values include: 'ThreeMins', + 'FiveMins', 'ThirtyMins', 'SixtyMins' + :type interval_length: str or + ~azure.mgmt.compute.v2017_12_01.models.IntervalInMins + """ + + _validation = { + 'blob_container_sas_uri': {'required': True}, + 'from_time': {'required': True}, + 'to_time': {'required': True}, + 'interval_length': {'required': True}, + } + + _attribute_map = { + 'blob_container_sas_uri': {'key': 'blobContainerSasUri', 'type': 'str'}, + 'from_time': {'key': 'fromTime', 'type': 'iso-8601'}, + 'to_time': {'key': 'toTime', 'type': 'iso-8601'}, + 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, + 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, + 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + 'interval_length': {'key': 'intervalLength', 'type': 'IntervalInMins'}, + } + + def __init__(self, *, blob_container_sas_uri: str, from_time, to_time, interval_length, group_by_throttle_policy: bool=None, group_by_operation_name: bool=None, group_by_resource_name: bool=None, **kwargs) -> None: + super(RequestRateByIntervalInput, self).__init__(blob_container_sas_uri=blob_container_sas_uri, from_time=from_time, to_time=to_time, group_by_throttle_policy=group_by_throttle_policy, group_by_operation_name=group_by_operation_name, group_by_resource_name=group_by_resource_name, **kwargs) + self.interval_length = interval_length diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/resource.py index 10269b591c68..5dd7d481c685 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/resource.py @@ -18,13 +18,15 @@ class Resource(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -45,10 +47,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/resource_py3.py new file mode 100644 index 000000000000..2f3702caf609 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/resource_py3.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_policy.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_policy.py index 40b1ca96380f..1eecaa5e2e65 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_policy.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_policy.py @@ -55,9 +55,9 @@ class RollingUpgradePolicy(Model): 'pause_time_between_batches': {'key': 'pauseTimeBetweenBatches', 'type': 'str'}, } - def __init__(self, max_batch_instance_percent=None, max_unhealthy_instance_percent=None, max_unhealthy_upgraded_instance_percent=None, pause_time_between_batches=None): - super(RollingUpgradePolicy, self).__init__() - self.max_batch_instance_percent = max_batch_instance_percent - self.max_unhealthy_instance_percent = max_unhealthy_instance_percent - self.max_unhealthy_upgraded_instance_percent = max_unhealthy_upgraded_instance_percent - self.pause_time_between_batches = pause_time_between_batches + def __init__(self, **kwargs): + super(RollingUpgradePolicy, self).__init__(**kwargs) + self.max_batch_instance_percent = kwargs.get('max_batch_instance_percent', None) + self.max_unhealthy_instance_percent = kwargs.get('max_unhealthy_instance_percent', None) + self.max_unhealthy_upgraded_instance_percent = kwargs.get('max_unhealthy_upgraded_instance_percent', None) + self.pause_time_between_batches = kwargs.get('pause_time_between_batches', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_policy_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_policy_py3.py new file mode 100644 index 000000000000..e698a382f112 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_policy_py3.py @@ -0,0 +1,63 @@ +# 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 msrest.serialization import Model + + +class RollingUpgradePolicy(Model): + """The configuration parameters used while performing a rolling upgrade. + + :param max_batch_instance_percent: The maximum percent of total virtual + machine instances that will be upgraded simultaneously by the rolling + upgrade in one batch. As this is a maximum, unhealthy instances in + previous or future batches can cause the percentage of instances in a + batch to decrease to ensure higher reliability. The default value for this + parameter is 20%. + :type max_batch_instance_percent: int + :param max_unhealthy_instance_percent: The maximum percentage of the total + virtual machine instances in the scale set that can be simultaneously + unhealthy, either as a result of being upgraded, or by being found in an + unhealthy state by the virtual machine health checks before the rolling + upgrade aborts. This constraint will be checked prior to starting any + batch. The default value for this parameter is 20%. + :type max_unhealthy_instance_percent: int + :param max_unhealthy_upgraded_instance_percent: The maximum percentage of + upgraded virtual machine instances that can be found to be in an unhealthy + state. This check will happen after each batch is upgraded. If this + percentage is ever exceeded, the rolling update aborts. The default value + for this parameter is 20%. + :type max_unhealthy_upgraded_instance_percent: int + :param pause_time_between_batches: The wait time between completing the + update for all virtual machines in one batch and starting the next batch. + The time duration should be specified in ISO 8601 format. The default + value is 0 seconds (PT0S). + :type pause_time_between_batches: str + """ + + _validation = { + 'max_batch_instance_percent': {'maximum': 100, 'minimum': 5}, + 'max_unhealthy_instance_percent': {'maximum': 100, 'minimum': 5}, + 'max_unhealthy_upgraded_instance_percent': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'max_batch_instance_percent': {'key': 'maxBatchInstancePercent', 'type': 'int'}, + 'max_unhealthy_instance_percent': {'key': 'maxUnhealthyInstancePercent', 'type': 'int'}, + 'max_unhealthy_upgraded_instance_percent': {'key': 'maxUnhealthyUpgradedInstancePercent', 'type': 'int'}, + 'pause_time_between_batches': {'key': 'pauseTimeBetweenBatches', 'type': 'str'}, + } + + def __init__(self, *, max_batch_instance_percent: int=None, max_unhealthy_instance_percent: int=None, max_unhealthy_upgraded_instance_percent: int=None, pause_time_between_batches: str=None, **kwargs) -> None: + super(RollingUpgradePolicy, self).__init__(**kwargs) + self.max_batch_instance_percent = max_batch_instance_percent + self.max_unhealthy_instance_percent = max_unhealthy_instance_percent + self.max_unhealthy_upgraded_instance_percent = max_unhealthy_upgraded_instance_percent + self.pause_time_between_batches = pause_time_between_batches diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_progress_info.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_progress_info.py index 01d1624f1f4f..87e40590e275 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_progress_info.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_progress_info.py @@ -47,8 +47,8 @@ class RollingUpgradeProgressInfo(Model): 'pending_instance_count': {'key': 'pendingInstanceCount', 'type': 'int'}, } - def __init__(self): - super(RollingUpgradeProgressInfo, self).__init__() + def __init__(self, **kwargs): + super(RollingUpgradeProgressInfo, self).__init__(**kwargs) self.successful_instance_count = None self.failed_instance_count = None self.in_progress_instance_count = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_progress_info_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_progress_info_py3.py new file mode 100644 index 000000000000..060abc3063b4 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_progress_info_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class RollingUpgradeProgressInfo(Model): + """Information about the number of virtual machine instances in each upgrade + state. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar successful_instance_count: The number of instances that have been + successfully upgraded. + :vartype successful_instance_count: int + :ivar failed_instance_count: The number of instances that have failed to + be upgraded successfully. + :vartype failed_instance_count: int + :ivar in_progress_instance_count: The number of instances that are + currently being upgraded. + :vartype in_progress_instance_count: int + :ivar pending_instance_count: The number of instances that have not yet + begun to be upgraded. + :vartype pending_instance_count: int + """ + + _validation = { + 'successful_instance_count': {'readonly': True}, + 'failed_instance_count': {'readonly': True}, + 'in_progress_instance_count': {'readonly': True}, + 'pending_instance_count': {'readonly': True}, + } + + _attribute_map = { + 'successful_instance_count': {'key': 'successfulInstanceCount', 'type': 'int'}, + 'failed_instance_count': {'key': 'failedInstanceCount', 'type': 'int'}, + 'in_progress_instance_count': {'key': 'inProgressInstanceCount', 'type': 'int'}, + 'pending_instance_count': {'key': 'pendingInstanceCount', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(RollingUpgradeProgressInfo, self).__init__(**kwargs) + self.successful_instance_count = None + self.failed_instance_count = None + self.in_progress_instance_count = None + self.pending_instance_count = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_running_status.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_running_status.py index db6993eefa28..75574e9a9b43 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_running_status.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_running_status.py @@ -46,8 +46,8 @@ class RollingUpgradeRunningStatus(Model): 'last_action_time': {'key': 'lastActionTime', 'type': 'iso-8601'}, } - def __init__(self): - super(RollingUpgradeRunningStatus, self).__init__() + def __init__(self, **kwargs): + super(RollingUpgradeRunningStatus, self).__init__(**kwargs) self.code = None self.start_time = None self.last_action = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_running_status_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_running_status_py3.py new file mode 100644 index 000000000000..4479a1c66587 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_running_status_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class RollingUpgradeRunningStatus(Model): + """Information about the current running state of the overall upgrade. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Code indicating the current status of the upgrade. Possible + values include: 'RollingForward', 'Cancelled', 'Completed', 'Faulted' + :vartype code: str or + ~azure.mgmt.compute.v2017_12_01.models.RollingUpgradeStatusCode + :ivar start_time: Start time of the upgrade. + :vartype start_time: datetime + :ivar last_action: The last action performed on the rolling upgrade. + Possible values include: 'Start', 'Cancel' + :vartype last_action: str or + ~azure.mgmt.compute.v2017_12_01.models.RollingUpgradeActionType + :ivar last_action_time: Last action time of the upgrade. + :vartype last_action_time: datetime + """ + + _validation = { + 'code': {'readonly': True}, + 'start_time': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_time': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'RollingUpgradeStatusCode'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'last_action': {'key': 'lastAction', 'type': 'RollingUpgradeActionType'}, + 'last_action_time': {'key': 'lastActionTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(RollingUpgradeRunningStatus, self).__init__(**kwargs) + self.code = None + self.start_time = None + self.last_action = None + self.last_action_time = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_status_info.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_status_info.py index acec78a445a9..5ac9aabb9cc3 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_status_info.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_status_info.py @@ -18,13 +18,15 @@ class RollingUpgradeStatusInfo(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -66,8 +68,8 @@ class RollingUpgradeStatusInfo(Resource): 'error': {'key': 'properties.error', 'type': 'ApiError'}, } - def __init__(self, location, tags=None): - super(RollingUpgradeStatusInfo, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(RollingUpgradeStatusInfo, self).__init__(**kwargs) self.policy = None self.running_status = None self.progress = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_status_info_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_status_info_py3.py new file mode 100644 index 000000000000..a2fd0b7b6c02 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/rolling_upgrade_status_info_py3.py @@ -0,0 +1,76 @@ +# 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 .resource import Resource + + +class RollingUpgradeStatusInfo(Resource): + """The status of the latest virtual machine scale set rolling upgrade. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar policy: The rolling upgrade policies applied for this upgrade. + :vartype policy: + ~azure.mgmt.compute.v2017_12_01.models.RollingUpgradePolicy + :ivar running_status: Information about the current running state of the + overall upgrade. + :vartype running_status: + ~azure.mgmt.compute.v2017_12_01.models.RollingUpgradeRunningStatus + :ivar progress: Information about the number of virtual machine instances + in each upgrade state. + :vartype progress: + ~azure.mgmt.compute.v2017_12_01.models.RollingUpgradeProgressInfo + :ivar error: Error details for this upgrade, if there are any. + :vartype error: ~azure.mgmt.compute.v2017_12_01.models.ApiError + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'policy': {'readonly': True}, + 'running_status': {'readonly': True}, + 'progress': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'policy': {'key': 'properties.policy', 'type': 'RollingUpgradePolicy'}, + 'running_status': {'key': 'properties.runningStatus', 'type': 'RollingUpgradeRunningStatus'}, + 'progress': {'key': 'properties.progress', 'type': 'RollingUpgradeProgressInfo'}, + 'error': {'key': 'properties.error', 'type': 'ApiError'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(RollingUpgradeStatusInfo, self).__init__(location=location, tags=tags, **kwargs) + self.policy = None + self.running_status = None + self.progress = None + self.error = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_document.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_document.py index fe7f1d5040c8..42ed05596f77 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_document.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_document.py @@ -15,19 +15,21 @@ class RunCommandDocument(RunCommandDocumentBase): """Describes the properties of a Run Command. - :param schema: The VM run command schema. + All required parameters must be populated in order to send to Azure. + + :param schema: Required. The VM run command schema. :type schema: str - :param id: The VM run command id. + :param id: Required. The VM run command id. :type id: str - :param os_type: The Operating System type. Possible values include: - 'Windows', 'Linux' + :param os_type: Required. The Operating System type. Possible values + include: 'Windows', 'Linux' :type os_type: str or ~azure.mgmt.compute.v2017_12_01.models.OperatingSystemTypes - :param label: The VM run command label. + :param label: Required. The VM run command label. :type label: str - :param description: The VM run command description. + :param description: Required. The VM run command description. :type description: str - :param script: The script to be executed. + :param script: Required. The script to be executed. :type script: list[str] :param parameters: The parameters used by the script. :type parameters: @@ -53,7 +55,7 @@ class RunCommandDocument(RunCommandDocumentBase): 'parameters': {'key': 'parameters', 'type': '[RunCommandParameterDefinition]'}, } - def __init__(self, schema, id, os_type, label, description, script, parameters=None): - super(RunCommandDocument, self).__init__(schema=schema, id=id, os_type=os_type, label=label, description=description) - self.script = script - self.parameters = parameters + def __init__(self, **kwargs): + super(RunCommandDocument, self).__init__(**kwargs) + self.script = kwargs.get('script', None) + self.parameters = kwargs.get('parameters', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_document_base.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_document_base.py index 876011e0f93e..76d44f5e280e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_document_base.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_document_base.py @@ -15,17 +15,19 @@ class RunCommandDocumentBase(Model): """Describes the properties of a Run Command metadata. - :param schema: The VM run command schema. + All required parameters must be populated in order to send to Azure. + + :param schema: Required. The VM run command schema. :type schema: str - :param id: The VM run command id. + :param id: Required. The VM run command id. :type id: str - :param os_type: The Operating System type. Possible values include: - 'Windows', 'Linux' + :param os_type: Required. The Operating System type. Possible values + include: 'Windows', 'Linux' :type os_type: str or ~azure.mgmt.compute.v2017_12_01.models.OperatingSystemTypes - :param label: The VM run command label. + :param label: Required. The VM run command label. :type label: str - :param description: The VM run command description. + :param description: Required. The VM run command description. :type description: str """ @@ -45,10 +47,10 @@ class RunCommandDocumentBase(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, schema, id, os_type, label, description): - super(RunCommandDocumentBase, self).__init__() - self.schema = schema - self.id = id - self.os_type = os_type - self.label = label - self.description = description + def __init__(self, **kwargs): + super(RunCommandDocumentBase, self).__init__(**kwargs) + self.schema = kwargs.get('schema', None) + self.id = kwargs.get('id', None) + self.os_type = kwargs.get('os_type', None) + self.label = kwargs.get('label', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_document_base_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_document_base_py3.py new file mode 100644 index 000000000000..02d2b35e3074 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_document_base_py3.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class RunCommandDocumentBase(Model): + """Describes the properties of a Run Command metadata. + + All required parameters must be populated in order to send to Azure. + + :param schema: Required. The VM run command schema. + :type schema: str + :param id: Required. The VM run command id. + :type id: str + :param os_type: Required. The Operating System type. Possible values + include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2017_12_01.models.OperatingSystemTypes + :param label: Required. The VM run command label. + :type label: str + :param description: Required. The VM run command description. + :type description: str + """ + + _validation = { + 'schema': {'required': True}, + 'id': {'required': True}, + 'os_type': {'required': True}, + 'label': {'required': True}, + 'description': {'required': True}, + } + + _attribute_map = { + 'schema': {'key': '$schema', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'label': {'key': 'label', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, schema: str, id: str, os_type, label: str, description: str, **kwargs) -> None: + super(RunCommandDocumentBase, self).__init__(**kwargs) + self.schema = schema + self.id = id + self.os_type = os_type + self.label = label + self.description = description diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_document_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_document_py3.py new file mode 100644 index 000000000000..6dc3cd6c8a01 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_document_py3.py @@ -0,0 +1,61 @@ +# 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 .run_command_document_base import RunCommandDocumentBase + + +class RunCommandDocument(RunCommandDocumentBase): + """Describes the properties of a Run Command. + + All required parameters must be populated in order to send to Azure. + + :param schema: Required. The VM run command schema. + :type schema: str + :param id: Required. The VM run command id. + :type id: str + :param os_type: Required. The Operating System type. Possible values + include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2017_12_01.models.OperatingSystemTypes + :param label: Required. The VM run command label. + :type label: str + :param description: Required. The VM run command description. + :type description: str + :param script: Required. The script to be executed. + :type script: list[str] + :param parameters: The parameters used by the script. + :type parameters: + list[~azure.mgmt.compute.v2017_12_01.models.RunCommandParameterDefinition] + """ + + _validation = { + 'schema': {'required': True}, + 'id': {'required': True}, + 'os_type': {'required': True}, + 'label': {'required': True}, + 'description': {'required': True}, + 'script': {'required': True}, + } + + _attribute_map = { + 'schema': {'key': '$schema', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'label': {'key': 'label', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'script': {'key': 'script', 'type': '[str]'}, + 'parameters': {'key': 'parameters', 'type': '[RunCommandParameterDefinition]'}, + } + + def __init__(self, *, schema: str, id: str, os_type, label: str, description: str, script, parameters=None, **kwargs) -> None: + super(RunCommandDocument, self).__init__(schema=schema, id=id, os_type=os_type, label=label, description=description, **kwargs) + self.script = script + self.parameters = parameters diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_input.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_input.py index 4d053d66a6da..5f0b1a70edb1 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_input.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_input.py @@ -15,7 +15,9 @@ class RunCommandInput(Model): """Capture Virtual Machine parameters. - :param command_id: The run command id. + All required parameters must be populated in order to send to Azure. + + :param command_id: Required. The run command id. :type command_id: str :param script: Optional. The script to be executed. When this value is given, the given script will override the default script of the command. @@ -35,8 +37,8 @@ class RunCommandInput(Model): 'parameters': {'key': 'parameters', 'type': '[RunCommandInputParameter]'}, } - def __init__(self, command_id, script=None, parameters=None): - super(RunCommandInput, self).__init__() - self.command_id = command_id - self.script = script - self.parameters = parameters + def __init__(self, **kwargs): + super(RunCommandInput, self).__init__(**kwargs) + self.command_id = kwargs.get('command_id', None) + self.script = kwargs.get('script', None) + self.parameters = kwargs.get('parameters', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_input_parameter.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_input_parameter.py index 6eb4db622454..cd76ad81bfa2 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_input_parameter.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_input_parameter.py @@ -15,9 +15,11 @@ class RunCommandInputParameter(Model): """Describes the properties of a run command parameter. - :param name: The run command parameter name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The run command parameter name. :type name: str - :param value: The run command parameter value. + :param value: Required. The run command parameter value. :type value: str """ @@ -31,7 +33,7 @@ class RunCommandInputParameter(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, name, value): - super(RunCommandInputParameter, self).__init__() - self.name = name - self.value = value + def __init__(self, **kwargs): + super(RunCommandInputParameter, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_input_parameter_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_input_parameter_py3.py new file mode 100644 index 000000000000..6013f038a1c3 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_input_parameter_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class RunCommandInputParameter(Model): + """Describes the properties of a run command parameter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The run command parameter name. + :type name: str + :param value: Required. The run command parameter value. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str, value: str, **kwargs) -> None: + super(RunCommandInputParameter, self).__init__(**kwargs) + self.name = name + self.value = value diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_input_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_input_py3.py new file mode 100644 index 000000000000..f988ee06ecc8 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_input_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RunCommandInput(Model): + """Capture Virtual Machine parameters. + + All required parameters must be populated in order to send to Azure. + + :param command_id: Required. The run command id. + :type command_id: str + :param script: Optional. The script to be executed. When this value is + given, the given script will override the default script of the command. + :type script: list[str] + :param parameters: The run command parameters. + :type parameters: + list[~azure.mgmt.compute.v2017_12_01.models.RunCommandInputParameter] + """ + + _validation = { + 'command_id': {'required': True}, + } + + _attribute_map = { + 'command_id': {'key': 'commandId', 'type': 'str'}, + 'script': {'key': 'script', 'type': '[str]'}, + 'parameters': {'key': 'parameters', 'type': '[RunCommandInputParameter]'}, + } + + def __init__(self, *, command_id: str, script=None, parameters=None, **kwargs) -> None: + super(RunCommandInput, self).__init__(**kwargs) + self.command_id = command_id + self.script = script + self.parameters = parameters diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_parameter_definition.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_parameter_definition.py index 1292feb3e9bd..e09f774d8241 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_parameter_definition.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_parameter_definition.py @@ -15,9 +15,11 @@ class RunCommandParameterDefinition(Model): """Describes the properties of a run command parameter. - :param name: The run command parameter name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The run command parameter name. :type name: str - :param type: The run command parameter type. + :param type: Required. The run command parameter type. :type type: str :param default_value: The run command parameter default value. :type default_value: str @@ -38,9 +40,9 @@ class RunCommandParameterDefinition(Model): 'required': {'key': 'required', 'type': 'bool'}, } - def __init__(self, name, type, default_value=None, required=False): - super(RunCommandParameterDefinition, self).__init__() - self.name = name - self.type = type - self.default_value = default_value - self.required = required + def __init__(self, **kwargs): + super(RunCommandParameterDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.default_value = kwargs.get('default_value', None) + self.required = kwargs.get('required', False) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_parameter_definition_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_parameter_definition_py3.py new file mode 100644 index 000000000000..e5fbc708f965 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_parameter_definition_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class RunCommandParameterDefinition(Model): + """Describes the properties of a run command parameter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The run command parameter name. + :type name: str + :param type: Required. The run command parameter type. + :type type: str + :param default_value: The run command parameter default value. + :type default_value: str + :param required: The run command parameter required. Default value: False + . + :type required: bool + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + 'required': {'key': 'required', 'type': 'bool'}, + } + + def __init__(self, *, name: str, type: str, default_value: str=None, required: bool=False, **kwargs) -> None: + super(RunCommandParameterDefinition, self).__init__(**kwargs) + self.name = name + self.type = type + self.default_value = default_value + self.required = required diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_result.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_result.py index 1596bb314545..955299b65293 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_result.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_result.py @@ -49,6 +49,6 @@ class RunCommandResult(OperationStatusResponse): 'output': {'key': 'properties.output', 'type': 'object'}, } - def __init__(self, output=None): - super(RunCommandResult, self).__init__() - self.output = output + def __init__(self, **kwargs): + super(RunCommandResult, self).__init__(**kwargs) + self.output = kwargs.get('output', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_result_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_result_py3.py new file mode 100644 index 000000000000..1525914ddecc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/run_command_result_py3.py @@ -0,0 +1,54 @@ +# 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 .operation_status_response import OperationStatusResponse + + +class RunCommandResult(OperationStatusResponse): + """Run command operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation ID + :vartype name: str + :ivar status: Operation status + :vartype status: str + :ivar start_time: Start time of the operation + :vartype start_time: datetime + :ivar end_time: End time of the operation + :vartype end_time: datetime + :ivar error: Api error + :vartype error: ~azure.mgmt.compute.v2017_12_01.models.ApiError + :param output: Operation output data (raw JSON) + :type output: object + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + 'output': {'key': 'properties.output', 'type': 'object'}, + } + + def __init__(self, *, output=None, **kwargs) -> None: + super(RunCommandResult, self).__init__(, **kwargs) + self.output = output diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sku.py index 16755dc57b65..5c07709435e0 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sku.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sku.py @@ -31,8 +31,8 @@ class Sku(Model): 'capacity': {'key': 'capacity', 'type': 'long'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(Sku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sku_py3.py new file mode 100644 index 000000000000..f6bc74afaadc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sku_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class Sku(Model): + """Describes a virtual machine scale set sku. + + :param name: The sku name. + :type name: str + :param tier: Specifies the tier of virtual machines in a scale set.

    Possible Values:

    **Standard**

    **Basic** + :type tier: str + :param capacity: Specifies the number of virtual machines in the scale + set. + :type capacity: long + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'long'}, + } + + def __init__(self, *, name: str=None, tier: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/ssh_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/ssh_configuration.py index feb6577831c2..ffad7bb65963 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/ssh_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/ssh_configuration.py @@ -25,6 +25,6 @@ class SshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[SshPublicKey]'}, } - def __init__(self, public_keys=None): - super(SshConfiguration, self).__init__() - self.public_keys = public_keys + def __init__(self, **kwargs): + super(SshConfiguration, self).__init__(**kwargs) + self.public_keys = kwargs.get('public_keys', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/ssh_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/ssh_configuration_py3.py new file mode 100644 index 000000000000..cb23de2268e7 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/ssh_configuration_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SshConfiguration(Model): + """SSH configuration for Linux based VMs running on Azure. + + :param public_keys: The list of SSH public keys used to authenticate with + linux based VMs. + :type public_keys: + list[~azure.mgmt.compute.v2017_12_01.models.SshPublicKey] + """ + + _attribute_map = { + 'public_keys': {'key': 'publicKeys', 'type': '[SshPublicKey]'}, + } + + def __init__(self, *, public_keys=None, **kwargs) -> None: + super(SshConfiguration, self).__init__(**kwargs) + self.public_keys = public_keys diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/ssh_public_key.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/ssh_public_key.py index 2fe6756641cb..122e0d3b9fdd 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/ssh_public_key.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/ssh_public_key.py @@ -33,7 +33,7 @@ class SshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, path=None, key_data=None): - super(SshPublicKey, self).__init__() - self.path = path - self.key_data = key_data + def __init__(self, **kwargs): + super(SshPublicKey, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.key_data = kwargs.get('key_data', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/ssh_public_key_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/ssh_public_key_py3.py new file mode 100644 index 000000000000..b16ee085b36b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/ssh_public_key_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class SshPublicKey(Model): + """Contains information about SSH certificate public key and the path on the + Linux VM where the public key is placed. + + :param 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 + :type path: str + :param 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/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + :type key_data: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'key_data': {'key': 'keyData', 'type': 'str'}, + } + + def __init__(self, *, path: str=None, key_data: str=None, **kwargs) -> None: + super(SshPublicKey, self).__init__(**kwargs) + self.path = path + self.key_data = key_data diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/storage_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/storage_profile.py index b93c93e0343b..1eb78c236281 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/storage_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/storage_profile.py @@ -40,8 +40,8 @@ class StorageProfile(Model): 'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'}, } - def __init__(self, image_reference=None, os_disk=None, data_disks=None): - super(StorageProfile, self).__init__() - self.image_reference = image_reference - self.os_disk = os_disk - self.data_disks = data_disks + def __init__(self, **kwargs): + super(StorageProfile, self).__init__(**kwargs) + self.image_reference = kwargs.get('image_reference', None) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/storage_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/storage_profile_py3.py new file mode 100644 index 000000000000..aeccf45c2b79 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/storage_profile_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class StorageProfile(Model): + """Specifies the storage settings for the virtual machine disks. + + :param 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. + :type image_reference: + ~azure.mgmt.compute.v2017_12_01.models.ImageReference + :param os_disk: Specifies information about the operating system disk used + by the virtual machine.

    For more information about disks, see + [About disks and VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type os_disk: ~azure.mgmt.compute.v2017_12_01.models.OSDisk + :param data_disks: Specifies the parameters that are used to add a data + disk to a virtual machine.

    For more information about disks, see + [About disks and VHDs for Azure virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type data_disks: list[~azure.mgmt.compute.v2017_12_01.models.DataDisk] + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'OSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'}, + } + + def __init__(self, *, image_reference=None, os_disk=None, data_disks=None, **kwargs) -> None: + super(StorageProfile, self).__init__(**kwargs) + self.image_reference = image_reference + self.os_disk = os_disk + self.data_disks = data_disks diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sub_resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sub_resource.py index b32875f54c8e..11e092cc6ff5 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sub_resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sub_resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sub_resource_py3.py new file mode 100644 index 000000000000..29e5afee38f9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class SubResource(Model): + """SubResource. + + :param id: Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sub_resource_read_only.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sub_resource_read_only.py index 308c52a8420b..4a0ec466c0d4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sub_resource_read_only.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sub_resource_read_only.py @@ -30,6 +30,6 @@ class SubResourceReadOnly(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self): - super(SubResourceReadOnly, self).__init__() + def __init__(self, **kwargs): + super(SubResourceReadOnly, self).__init__(**kwargs) self.id = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sub_resource_read_only_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sub_resource_read_only_py3.py new file mode 100644 index 000000000000..cb918e9a2ac6 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/sub_resource_read_only_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class SubResourceReadOnly(Model): + """SubResourceReadOnly. + + 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) -> None: + super(SubResourceReadOnly, self).__init__(**kwargs) + self.id = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/throttled_requests_input.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/throttled_requests_input.py new file mode 100644 index 000000000000..5eac2a5540ac --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/throttled_requests_input.py @@ -0,0 +1,52 @@ +# 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 .log_analytics_input_base import LogAnalyticsInputBase + + +class ThrottledRequestsInput(LogAnalyticsInputBase): + """Api request input for LogAnalytics getThrottledRequests Api. + + All required parameters must be populated in order to send to Azure. + + :param blob_container_sas_uri: Required. SAS Uri of the logging blob + container to which LogAnalytics Api writes output logs to. + :type blob_container_sas_uri: str + :param from_time: Required. From time of the query + :type from_time: datetime + :param to_time: Required. To time of the query + :type to_time: datetime + :param group_by_throttle_policy: Group query result by Throttle Policy + applied. + :type group_by_throttle_policy: bool + :param group_by_operation_name: Group query result by by Operation Name. + :type group_by_operation_name: bool + :param group_by_resource_name: Group query result by Resource Name. + :type group_by_resource_name: bool + """ + + _validation = { + 'blob_container_sas_uri': {'required': True}, + 'from_time': {'required': True}, + 'to_time': {'required': True}, + } + + _attribute_map = { + 'blob_container_sas_uri': {'key': 'blobContainerSasUri', 'type': 'str'}, + 'from_time': {'key': 'fromTime', 'type': 'iso-8601'}, + 'to_time': {'key': 'toTime', 'type': 'iso-8601'}, + 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, + 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, + 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ThrottledRequestsInput, self).__init__(**kwargs) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/throttled_requests_input_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/throttled_requests_input_py3.py new file mode 100644 index 000000000000..31ed921240e2 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/throttled_requests_input_py3.py @@ -0,0 +1,52 @@ +# 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 .log_analytics_input_base import LogAnalyticsInputBase + + +class ThrottledRequestsInput(LogAnalyticsInputBase): + """Api request input for LogAnalytics getThrottledRequests Api. + + All required parameters must be populated in order to send to Azure. + + :param blob_container_sas_uri: Required. SAS Uri of the logging blob + container to which LogAnalytics Api writes output logs to. + :type blob_container_sas_uri: str + :param from_time: Required. From time of the query + :type from_time: datetime + :param to_time: Required. To time of the query + :type to_time: datetime + :param group_by_throttle_policy: Group query result by Throttle Policy + applied. + :type group_by_throttle_policy: bool + :param group_by_operation_name: Group query result by by Operation Name. + :type group_by_operation_name: bool + :param group_by_resource_name: Group query result by Resource Name. + :type group_by_resource_name: bool + """ + + _validation = { + 'blob_container_sas_uri': {'required': True}, + 'from_time': {'required': True}, + 'to_time': {'required': True}, + } + + _attribute_map = { + 'blob_container_sas_uri': {'key': 'blobContainerSasUri', 'type': 'str'}, + 'from_time': {'key': 'fromTime', 'type': 'iso-8601'}, + 'to_time': {'key': 'toTime', 'type': 'iso-8601'}, + 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, + 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, + 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + } + + def __init__(self, *, blob_container_sas_uri: str, from_time, to_time, group_by_throttle_policy: bool=None, group_by_operation_name: bool=None, group_by_resource_name: bool=None, **kwargs) -> None: + super(ThrottledRequestsInput, self).__init__(blob_container_sas_uri=blob_container_sas_uri, from_time=from_time, to_time=to_time, group_by_throttle_policy=group_by_throttle_policy, group_by_operation_name=group_by_operation_name, group_by_resource_name=group_by_resource_name, **kwargs) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/update_resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/update_resource.py index 404aae42f184..b1d2898ff082 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/update_resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/update_resource.py @@ -23,6 +23,6 @@ class UpdateResource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, tags=None): - super(UpdateResource, self).__init__() - self.tags = tags + def __init__(self, **kwargs): + super(UpdateResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/update_resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/update_resource_py3.py new file mode 100644 index 000000000000..c06c17c124d9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/update_resource_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class UpdateResource(Model): + """The Update Resource model definition. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(UpdateResource, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/upgrade_policy.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/upgrade_policy.py index bf742ab56bd5..209ab85eda51 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/upgrade_policy.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/upgrade_policy.py @@ -38,8 +38,8 @@ class UpgradePolicy(Model): 'automatic_os_upgrade': {'key': 'automaticOSUpgrade', 'type': 'bool'}, } - def __init__(self, mode=None, rolling_upgrade_policy=None, automatic_os_upgrade=None): - super(UpgradePolicy, self).__init__() - self.mode = mode - self.rolling_upgrade_policy = rolling_upgrade_policy - self.automatic_os_upgrade = automatic_os_upgrade + def __init__(self, **kwargs): + super(UpgradePolicy, self).__init__(**kwargs) + self.mode = kwargs.get('mode', None) + self.rolling_upgrade_policy = kwargs.get('rolling_upgrade_policy', None) + self.automatic_os_upgrade = kwargs.get('automatic_os_upgrade', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/upgrade_policy_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/upgrade_policy_py3.py new file mode 100644 index 000000000000..3441201b6197 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/upgrade_policy_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class UpgradePolicy(Model): + """Describes an upgrade policy - automatic, manual, or rolling. + + :param mode: Specifies the mode of an upgrade to virtual machines in the + scale set.

    Possible values are:

    **Manual** - You + control the application of updates to virtual machines in the scale set. + You do this by using the manualUpgrade action.

    **Automatic** - + All virtual machines in the scale set are automatically updated at the + same time. Possible values include: 'Automatic', 'Manual', 'Rolling' + :type mode: str or ~azure.mgmt.compute.v2017_12_01.models.UpgradeMode + :param rolling_upgrade_policy: The configuration parameters used while + performing a rolling upgrade. + :type rolling_upgrade_policy: + ~azure.mgmt.compute.v2017_12_01.models.RollingUpgradePolicy + :param automatic_os_upgrade: Whether OS upgrades should automatically be + applied to scale set instances in a rolling fashion when a newer version + of the image becomes available. + :type automatic_os_upgrade: bool + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'UpgradeMode'}, + 'rolling_upgrade_policy': {'key': 'rollingUpgradePolicy', 'type': 'RollingUpgradePolicy'}, + 'automatic_os_upgrade': {'key': 'automaticOSUpgrade', 'type': 'bool'}, + } + + def __init__(self, *, mode=None, rolling_upgrade_policy=None, automatic_os_upgrade: bool=None, **kwargs) -> None: + super(UpgradePolicy, self).__init__(**kwargs) + self.mode = mode + self.rolling_upgrade_policy = rolling_upgrade_policy + self.automatic_os_upgrade = automatic_os_upgrade diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/usage.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/usage.py index fefe3ad8f688..4c4b15393951 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/usage.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/usage.py @@ -18,14 +18,16 @@ class Usage(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar unit: An enum describing the unit of usage measurement. Default - value: "Count" . + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of usage measurement. + Default value: "Count" . :vartype unit: str - :param current_value: The current usage of the resource. + :param current_value: Required. The current usage of the resource. :type current_value: int - :param limit: The maximum permitted usage of the resource. + :param limit: Required. The maximum permitted usage of the resource. :type limit: long - :param name: The name of the type of usage. + :param name: Required. The name of the type of usage. :type name: ~azure.mgmt.compute.v2017_12_01.models.UsageName """ @@ -45,8 +47,8 @@ class Usage(Model): unit = "Count" - def __init__(self, current_value, limit, name): - super(Usage, self).__init__() - self.current_value = current_value - self.limit = limit - self.name = name + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/usage_name.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/usage_name.py index 799c1f896da3..e2560936493e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/usage_name.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/usage_name.py @@ -26,7 +26,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(UsageName, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/usage_name_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/usage_name_py3.py new file mode 100644 index 000000000000..ad0b77459f75 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class UsageName(Model): + """The Usage Names. + + :param value: The name of the resource. + :type value: str + :param localized_value: The localized name of the resource. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/usage_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/usage_py3.py new file mode 100644 index 000000000000..ff0b928775bb --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/usage_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class Usage(Model): + """Describes Compute Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of usage measurement. + Default value: "Count" . + :vartype unit: str + :param current_value: Required. The current usage of the resource. + :type current_value: int + :param limit: Required. The maximum permitted usage of the resource. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.compute.v2017_12_01.models.UsageName + """ + + _validation = { + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__(self, *, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/vault_certificate.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/vault_certificate.py index 8d4d05955de4..b173def6f820 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/vault_certificate.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/vault_certificate.py @@ -40,7 +40,7 @@ class VaultCertificate(Model): 'certificate_store': {'key': 'certificateStore', 'type': 'str'}, } - def __init__(self, certificate_url=None, certificate_store=None): - super(VaultCertificate, self).__init__() - self.certificate_url = certificate_url - self.certificate_store = certificate_store + def __init__(self, **kwargs): + super(VaultCertificate, self).__init__(**kwargs) + self.certificate_url = kwargs.get('certificate_url', None) + self.certificate_store = kwargs.get('certificate_store', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/vault_certificate_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/vault_certificate_py3.py new file mode 100644 index 000000000000..eda5ba1c3f1d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/vault_certificate_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VaultCertificate(Model): + """Describes a single certificate reference in a Key Vault, and where the + certificate should reside on the VM. + + :param 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](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + In this case, your certificate needs to be It is the Base64 encoding of + the following JSON Object which is encoded in UTF-8:

    {
    + "data":"",
    "dataType":"pfx",
    + "password":""
    } + :type certificate_url: str + :param 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 .crt + for the X509 certificate file and .prv for private + key. Both of these files are .pem formatted. + :type certificate_store: str + """ + + _attribute_map = { + 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, + 'certificate_store': {'key': 'certificateStore', 'type': 'str'}, + } + + def __init__(self, *, certificate_url: str=None, certificate_store: str=None, **kwargs) -> None: + super(VaultCertificate, self).__init__(**kwargs) + self.certificate_url = certificate_url + self.certificate_store = certificate_store diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/vault_secret_group.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/vault_secret_group.py index 77065b97be1c..dcd6fef1eb5a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/vault_secret_group.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/vault_secret_group.py @@ -29,7 +29,7 @@ class VaultSecretGroup(Model): 'vault_certificates': {'key': 'vaultCertificates', 'type': '[VaultCertificate]'}, } - def __init__(self, source_vault=None, vault_certificates=None): - super(VaultSecretGroup, self).__init__() - self.source_vault = source_vault - self.vault_certificates = vault_certificates + def __init__(self, **kwargs): + super(VaultSecretGroup, self).__init__(**kwargs) + self.source_vault = kwargs.get('source_vault', None) + self.vault_certificates = kwargs.get('vault_certificates', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/vault_secret_group_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/vault_secret_group_py3.py new file mode 100644 index 000000000000..3fbeeacf9f28 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/vault_secret_group_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class VaultSecretGroup(Model): + """Describes a set of certificates which are all in the same Key Vault. + + :param source_vault: The relative URL of the Key Vault containing all of + the certificates in VaultCertificates. + :type source_vault: ~azure.mgmt.compute.v2017_12_01.models.SubResource + :param vault_certificates: The list of key vault references in SourceVault + which contain certificates. + :type vault_certificates: + list[~azure.mgmt.compute.v2017_12_01.models.VaultCertificate] + """ + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SubResource'}, + 'vault_certificates': {'key': 'vaultCertificates', 'type': '[VaultCertificate]'}, + } + + def __init__(self, *, source_vault=None, vault_certificates=None, **kwargs) -> None: + super(VaultSecretGroup, self).__init__(**kwargs) + self.source_vault = source_vault + self.vault_certificates = vault_certificates diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_hard_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_hard_disk.py index af1725d302af..5e3ad9dea7d4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_hard_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_hard_disk.py @@ -23,6 +23,6 @@ class VirtualHardDisk(Model): 'uri': {'key': 'uri', 'type': 'str'}, } - def __init__(self, uri=None): - super(VirtualHardDisk, self).__init__() - self.uri = uri + def __init__(self, **kwargs): + super(VirtualHardDisk, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_hard_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_hard_disk_py3.py new file mode 100644 index 000000000000..9c069b95f084 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_hard_disk_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class VirtualHardDisk(Model): + """Describes the uri of a disk. + + :param uri: Specifies the virtual hard disk's uri. + :type uri: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__(self, *, uri: str=None, **kwargs) -> None: + super(VirtualHardDisk, self).__init__(**kwargs) + self.uri = uri diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine.py index a6f3058fbffa..5810c1a09641 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine.py @@ -18,13 +18,15 @@ class VirtualMachine(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -130,19 +132,19 @@ class VirtualMachine(Resource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, location, tags=None, plan=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type=None, identity=None, zones=None): - super(VirtualMachine, self).__init__(location=location, tags=tags) - self.plan = plan - self.hardware_profile = hardware_profile - self.storage_profile = storage_profile - self.os_profile = os_profile - self.network_profile = network_profile - self.diagnostics_profile = diagnostics_profile - self.availability_set = availability_set + def __init__(self, **kwargs): + super(VirtualMachine, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.os_profile = kwargs.get('os_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.availability_set = kwargs.get('availability_set', None) self.provisioning_state = None self.instance_view = None - self.license_type = license_type + self.license_type = kwargs.get('license_type', None) self.vm_id = None self.resources = None - self.identity = identity - self.zones = zones + self.identity = kwargs.get('identity', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_agent_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_agent_instance_view.py index 7d215da7e0b7..1fba0ceeb672 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_agent_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_agent_instance_view.py @@ -32,8 +32,8 @@ class VirtualMachineAgentInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, vm_agent_version=None, extension_handlers=None, statuses=None): - super(VirtualMachineAgentInstanceView, self).__init__() - self.vm_agent_version = vm_agent_version - self.extension_handlers = extension_handlers - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineAgentInstanceView, self).__init__(**kwargs) + self.vm_agent_version = kwargs.get('vm_agent_version', None) + self.extension_handlers = kwargs.get('extension_handlers', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_agent_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_agent_instance_view_py3.py new file mode 100644 index 000000000000..be36f320d710 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_agent_instance_view_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineAgentInstanceView(Model): + """The instance view of the VM Agent running on the virtual machine. + + :param vm_agent_version: The VM Agent full version. + :type vm_agent_version: str + :param extension_handlers: The virtual machine extension handler instance + view. + :type extension_handlers: + list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtensionHandlerInstanceView] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2017_12_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'vm_agent_version': {'key': 'vmAgentVersion', 'type': 'str'}, + 'extension_handlers': {'key': 'extensionHandlers', 'type': '[VirtualMachineExtensionHandlerInstanceView]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, vm_agent_version: str=None, extension_handlers=None, statuses=None, **kwargs) -> None: + super(VirtualMachineAgentInstanceView, self).__init__(**kwargs) + self.vm_agent_version = vm_agent_version + self.extension_handlers = extension_handlers + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_capture_parameters.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_capture_parameters.py index b406f387ffed..4e6ffbea7a4f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_capture_parameters.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_capture_parameters.py @@ -15,12 +15,15 @@ class VirtualMachineCaptureParameters(Model): """Capture Virtual Machine parameters. - :param vhd_prefix: The captured virtual hard disk's name prefix. + All required parameters must be populated in order to send to Azure. + + :param vhd_prefix: Required. The captured virtual hard disk's name prefix. :type vhd_prefix: str - :param destination_container_name: The destination container name. + :param destination_container_name: Required. The destination container + name. :type destination_container_name: str - :param overwrite_vhds: Specifies whether to overwrite the destination - virtual hard disk, in case of conflict. + :param overwrite_vhds: Required. Specifies whether to overwrite the + destination virtual hard disk, in case of conflict. :type overwrite_vhds: bool """ @@ -36,8 +39,8 @@ class VirtualMachineCaptureParameters(Model): 'overwrite_vhds': {'key': 'overwriteVhds', 'type': 'bool'}, } - def __init__(self, vhd_prefix, destination_container_name, overwrite_vhds): - super(VirtualMachineCaptureParameters, self).__init__() - self.vhd_prefix = vhd_prefix - self.destination_container_name = destination_container_name - self.overwrite_vhds = overwrite_vhds + def __init__(self, **kwargs): + super(VirtualMachineCaptureParameters, self).__init__(**kwargs) + self.vhd_prefix = kwargs.get('vhd_prefix', None) + self.destination_container_name = kwargs.get('destination_container_name', None) + self.overwrite_vhds = kwargs.get('overwrite_vhds', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_capture_parameters_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_capture_parameters_py3.py new file mode 100644 index 000000000000..1866cdc23300 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_capture_parameters_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineCaptureParameters(Model): + """Capture Virtual Machine parameters. + + All required parameters must be populated in order to send to Azure. + + :param vhd_prefix: Required. The captured virtual hard disk's name prefix. + :type vhd_prefix: str + :param destination_container_name: Required. The destination container + name. + :type destination_container_name: str + :param overwrite_vhds: Required. Specifies whether to overwrite the + destination virtual hard disk, in case of conflict. + :type overwrite_vhds: bool + """ + + _validation = { + 'vhd_prefix': {'required': True}, + 'destination_container_name': {'required': True}, + 'overwrite_vhds': {'required': True}, + } + + _attribute_map = { + 'vhd_prefix': {'key': 'vhdPrefix', 'type': 'str'}, + 'destination_container_name': {'key': 'destinationContainerName', 'type': 'str'}, + 'overwrite_vhds': {'key': 'overwriteVhds', 'type': 'bool'}, + } + + def __init__(self, *, vhd_prefix: str, destination_container_name: str, overwrite_vhds: bool, **kwargs) -> None: + super(VirtualMachineCaptureParameters, self).__init__(**kwargs) + self.vhd_prefix = vhd_prefix + self.destination_container_name = destination_container_name + self.overwrite_vhds = overwrite_vhds diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_capture_result.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_capture_result.py index 95e26a427e83..2b0df7406a34 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_capture_result.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_capture_result.py @@ -26,6 +26,6 @@ class VirtualMachineCaptureResult(SubResource): 'output': {'key': 'properties.output', 'type': 'object'}, } - def __init__(self, id=None, output=None): - super(VirtualMachineCaptureResult, self).__init__(id=id) - self.output = output + def __init__(self, **kwargs): + super(VirtualMachineCaptureResult, self).__init__(**kwargs) + self.output = kwargs.get('output', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_capture_result_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_capture_result_py3.py new file mode 100644 index 000000000000..da449b8e9154 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_capture_result_py3.py @@ -0,0 +1,31 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineCaptureResult(SubResource): + """Resource Id. + + :param id: Resource Id + :type id: str + :param output: Operation output data (raw JSON) + :type output: object + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'output': {'key': 'properties.output', 'type': 'object'}, + } + + def __init__(self, *, id: str=None, output=None, **kwargs) -> None: + super(VirtualMachineCaptureResult, self).__init__(id=id, **kwargs) + self.output = output diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension.py index 34b30adde9b8..c227f6dd6ea5 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension.py @@ -18,13 +18,15 @@ class VirtualMachineExtension(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -82,14 +84,14 @@ class VirtualMachineExtension(Resource): 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineExtensionInstanceView'}, } - def __init__(self, location, tags=None, force_update_tag=None, publisher=None, virtual_machine_extension_type=None, type_handler_version=None, auto_upgrade_minor_version=None, settings=None, protected_settings=None, instance_view=None): - super(VirtualMachineExtension, self).__init__(location=location, tags=tags) - self.force_update_tag = force_update_tag - self.publisher = publisher - self.virtual_machine_extension_type = virtual_machine_extension_type - self.type_handler_version = type_handler_version - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings + def __init__(self, **kwargs): + super(VirtualMachineExtension, self).__init__(**kwargs) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.virtual_machine_extension_type = kwargs.get('virtual_machine_extension_type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) self.provisioning_state = None - self.instance_view = instance_view + self.instance_view = kwargs.get('instance_view', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_handler_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_handler_instance_view.py index b365cc40e803..251e292c2889 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_handler_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_handler_instance_view.py @@ -30,8 +30,8 @@ class VirtualMachineExtensionHandlerInstanceView(Model): 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, } - def __init__(self, type=None, type_handler_version=None, status=None): - super(VirtualMachineExtensionHandlerInstanceView, self).__init__() - self.type = type - self.type_handler_version = type_handler_version - self.status = status + def __init__(self, **kwargs): + super(VirtualMachineExtensionHandlerInstanceView, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.status = kwargs.get('status', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_handler_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_handler_instance_view_py3.py new file mode 100644 index 000000000000..865aa252c7c3 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_handler_instance_view_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineExtensionHandlerInstanceView(Model): + """The instance view of a virtual machine extension handler. + + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param status: The extension handler status. + :type status: ~azure.mgmt.compute.v2017_12_01.models.InstanceViewStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, + } + + def __init__(self, *, type: str=None, type_handler_version: str=None, status=None, **kwargs) -> None: + super(VirtualMachineExtensionHandlerInstanceView, self).__init__(**kwargs) + self.type = type + self.type_handler_version = type_handler_version + self.status = status diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_image.py index 7614699a78da..7273e2b84754 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_image.py @@ -18,23 +18,26 @@ class VirtualMachineExtensionImage(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param operating_system: The operating system this extension supports. - :type operating_system: str - :param compute_role: The type of role (IaaS or PaaS) this extension + :param operating_system: Required. The operating system this extension supports. + :type operating_system: str + :param compute_role: Required. The type of role (IaaS or PaaS) this + extension supports. :type compute_role: str - :param handler_schema: The schema defined by publisher, where extension - consumers should provide settings in a matching schema. + :param handler_schema: Required. The schema defined by publisher, where + extension consumers should provide settings in a matching schema. :type handler_schema: str :param vm_scale_set_enabled: Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but @@ -69,10 +72,10 @@ class VirtualMachineExtensionImage(Resource): 'supports_multiple_extensions': {'key': 'properties.supportsMultipleExtensions', 'type': 'bool'}, } - def __init__(self, location, operating_system, compute_role, handler_schema, tags=None, vm_scale_set_enabled=None, supports_multiple_extensions=None): - super(VirtualMachineExtensionImage, self).__init__(location=location, tags=tags) - self.operating_system = operating_system - self.compute_role = compute_role - self.handler_schema = handler_schema - self.vm_scale_set_enabled = vm_scale_set_enabled - self.supports_multiple_extensions = supports_multiple_extensions + def __init__(self, **kwargs): + super(VirtualMachineExtensionImage, self).__init__(**kwargs) + self.operating_system = kwargs.get('operating_system', None) + self.compute_role = kwargs.get('compute_role', None) + self.handler_schema = kwargs.get('handler_schema', None) + self.vm_scale_set_enabled = kwargs.get('vm_scale_set_enabled', None) + self.supports_multiple_extensions = kwargs.get('supports_multiple_extensions', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_image_py3.py new file mode 100644 index 000000000000..217accab02f0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_image_py3.py @@ -0,0 +1,81 @@ +# 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 .resource import Resource + + +class VirtualMachineExtensionImage(Resource): + """Describes a Virtual Machine Extension Image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param operating_system: Required. The operating system this extension + supports. + :type operating_system: str + :param compute_role: Required. The type of role (IaaS or PaaS) this + extension supports. + :type compute_role: str + :param handler_schema: Required. The schema defined by publisher, where + extension consumers should provide settings in a matching schema. + :type handler_schema: str + :param vm_scale_set_enabled: Whether the extension can be used on xRP + VMScaleSets. By default existing extensions are usable on scalesets, but + there might be cases where a publisher wants to explicitly indicate the + extension is only enabled for CRP VMs but not VMSS. + :type vm_scale_set_enabled: bool + :param supports_multiple_extensions: Whether the handler can support + multiple extensions. + :type supports_multiple_extensions: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'operating_system': {'required': True}, + 'compute_role': {'required': True}, + 'handler_schema': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'operating_system': {'key': 'properties.operatingSystem', 'type': 'str'}, + 'compute_role': {'key': 'properties.computeRole', 'type': 'str'}, + 'handler_schema': {'key': 'properties.handlerSchema', 'type': 'str'}, + 'vm_scale_set_enabled': {'key': 'properties.vmScaleSetEnabled', 'type': 'bool'}, + 'supports_multiple_extensions': {'key': 'properties.supportsMultipleExtensions', 'type': 'bool'}, + } + + def __init__(self, *, location: str, operating_system: str, compute_role: str, handler_schema: str, tags=None, vm_scale_set_enabled: bool=None, supports_multiple_extensions: bool=None, **kwargs) -> None: + super(VirtualMachineExtensionImage, self).__init__(location=location, tags=tags, **kwargs) + self.operating_system = operating_system + self.compute_role = compute_role + self.handler_schema = handler_schema + self.vm_scale_set_enabled = vm_scale_set_enabled + self.supports_multiple_extensions = supports_multiple_extensions diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_instance_view.py index ded072d7d0eb..48bd9677fd8b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_instance_view.py @@ -38,10 +38,10 @@ class VirtualMachineExtensionInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, name=None, type=None, type_handler_version=None, substatuses=None, statuses=None): - super(VirtualMachineExtensionInstanceView, self).__init__() - self.name = name - self.type = type - self.type_handler_version = type_handler_version - self.substatuses = substatuses - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineExtensionInstanceView, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.substatuses = kwargs.get('substatuses', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_instance_view_py3.py new file mode 100644 index 000000000000..c0fef4afbf32 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_instance_view_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineExtensionInstanceView(Model): + """The instance view of a virtual machine extension. + + :param name: The virtual machine extension name. + :type name: str + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param substatuses: The resource status information. + :type substatuses: + list[~azure.mgmt.compute.v2017_12_01.models.InstanceViewStatus] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2017_12_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'substatuses': {'key': 'substatuses', 'type': '[InstanceViewStatus]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, name: str=None, type: str=None, type_handler_version: str=None, substatuses=None, statuses=None, **kwargs) -> None: + super(VirtualMachineExtensionInstanceView, self).__init__(**kwargs) + self.name = name + self.type = type + self.type_handler_version = type_handler_version + self.substatuses = substatuses + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_py3.py new file mode 100644 index 000000000000..ae11b2009578 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_extension_py3.py @@ -0,0 +1,97 @@ +# 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 .resource import Resource + + +class VirtualMachineExtension(Resource): + """Describes a Virtual Machine Extension. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param force_update_tag: How the extension handler should be forced to + update even if the extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param virtual_machine_extension_type: Specifies the type of the + extension; an example is "CustomScriptExtension". + :type virtual_machine_extension_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either + protectedSettings or protectedSettingsFromKeyVault or no protected + settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :param instance_view: The virtual machine extension instance view. + :type instance_view: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtensionInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'virtual_machine_extension_type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineExtensionInstanceView'}, + } + + def __init__(self, *, location: str, tags=None, force_update_tag: str=None, publisher: str=None, virtual_machine_extension_type: str=None, type_handler_version: str=None, auto_upgrade_minor_version: bool=None, settings=None, protected_settings=None, instance_view=None, **kwargs) -> None: + super(VirtualMachineExtension, self).__init__(location=location, tags=tags, **kwargs) + self.force_update_tag = force_update_tag + self.publisher = publisher + self.virtual_machine_extension_type = virtual_machine_extension_type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None + self.instance_view = instance_view diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_health_status.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_health_status.py index 9ba6e5509dfe..7ac15a51d78b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_health_status.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_health_status.py @@ -30,6 +30,6 @@ class VirtualMachineHealthStatus(Model): 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, } - def __init__(self): - super(VirtualMachineHealthStatus, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineHealthStatus, self).__init__(**kwargs) self.status = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_health_status_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_health_status_py3.py new file mode 100644 index 000000000000..6d461fe6b6b0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_health_status_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineHealthStatus(Model): + """The health status of the VM. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The health status information for the VM. + :vartype status: ~azure.mgmt.compute.v2017_12_01.models.InstanceViewStatus + """ + + _validation = { + 'status': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'InstanceViewStatus'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineHealthStatus, self).__init__(**kwargs) + self.status = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_identity.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_identity.py index 0eea10fc2e74..52a97e8b7172 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_identity.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_identity.py @@ -50,9 +50,9 @@ class VirtualMachineIdentity(Model): 'identity_ids': {'key': 'identityIds', 'type': '[str]'}, } - def __init__(self, type=None, identity_ids=None): - super(VirtualMachineIdentity, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = type - self.identity_ids = identity_ids + self.type = kwargs.get('type', None) + self.identity_ids = kwargs.get('identity_ids', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_identity_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_identity_py3.py new file mode 100644 index 000000000000..a3790d03854c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_identity_py3.py @@ -0,0 +1,58 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineIdentity(Model): + """Identity for the virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of virtual machine identity. This + property will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the virtual machine. This + property will only be provided for a system assigned identity. + :vartype tenant_id: str + :param type: The type of identity used for the virtual machine. The type + 'SystemAssigned, UserAssigned' includes both an implicitly created + identity and a set of user assigned identities. The type 'None' will + remove any identities from the virtual machine. Possible values include: + 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + :type type: str or + ~azure.mgmt.compute.v2017_12_01.models.ResourceIdentityType + :param identity_ids: The list of user identities associated with the + Virtual Machine. The user identity references will be ARM resource ids in + the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + :type identity_ids: list[str] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'identity_ids': {'key': 'identityIds', 'type': '[str]'}, + } + + def __init__(self, *, type=None, identity_ids=None, **kwargs) -> None: + super(VirtualMachineIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.identity_ids = identity_ids diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_image.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_image.py index 104231ad4ee9..fdbb4661de4f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_image.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_image.py @@ -15,11 +15,13 @@ class VirtualMachineImage(VirtualMachineImageResource): """Describes a Virtual Machine Image. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The name of the resource. + :param name: Required. The name of the resource. :type name: str - :param location: The supported Azure location of the resource. + :param location: Required. The supported Azure location of the resource. :type location: str :param tags: Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your @@ -50,8 +52,8 @@ class VirtualMachineImage(VirtualMachineImageResource): 'data_disk_images': {'key': 'properties.dataDiskImages', 'type': '[DataDiskImage]'}, } - def __init__(self, name, location, id=None, tags=None, plan=None, os_disk_image=None, data_disk_images=None): - super(VirtualMachineImage, self).__init__(id=id, name=name, location=location, tags=tags) - self.plan = plan - self.os_disk_image = os_disk_image - self.data_disk_images = data_disk_images + def __init__(self, **kwargs): + super(VirtualMachineImage, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.os_disk_image = kwargs.get('os_disk_image', None) + self.data_disk_images = kwargs.get('data_disk_images', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_image_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_image_py3.py new file mode 100644 index 000000000000..d1172470ece7 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_image_py3.py @@ -0,0 +1,59 @@ +# 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 .virtual_machine_image_resource import VirtualMachineImageResource + + +class VirtualMachineImage(VirtualMachineImageResource): + """Describes a Virtual Machine Image. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The name of the resource. + :type name: str + :param location: Required. The supported Azure location of the resource. + :type location: str + :param tags: Specifies the tags that are assigned to the virtual machine. + For more information about using tags, see [Using tags to organize your + Azure + resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + :type tags: dict[str, str] + :param plan: + :type plan: ~azure.mgmt.compute.v2017_12_01.models.PurchasePlan + :param os_disk_image: + :type os_disk_image: ~azure.mgmt.compute.v2017_12_01.models.OSDiskImage + :param data_disk_images: + :type data_disk_images: + list[~azure.mgmt.compute.v2017_12_01.models.DataDiskImage] + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'properties.plan', 'type': 'PurchasePlan'}, + 'os_disk_image': {'key': 'properties.osDiskImage', 'type': 'OSDiskImage'}, + 'data_disk_images': {'key': 'properties.dataDiskImages', 'type': '[DataDiskImage]'}, + } + + def __init__(self, *, name: str, location: str, id: str=None, tags=None, plan=None, os_disk_image=None, data_disk_images=None, **kwargs) -> None: + super(VirtualMachineImage, self).__init__(id=id, name=name, location=location, tags=tags, **kwargs) + self.plan = plan + self.os_disk_image = os_disk_image + self.data_disk_images = data_disk_images diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_image_resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_image_resource.py index a7029041061d..8807cc8f391b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_image_resource.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_image_resource.py @@ -15,11 +15,13 @@ class VirtualMachineImageResource(SubResource): """Virtual machine image resource information. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The name of the resource. + :param name: Required. The name of the resource. :type name: str - :param location: The supported Azure location of the resource. + :param location: Required. The supported Azure location of the resource. :type location: str :param tags: Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your @@ -40,8 +42,8 @@ class VirtualMachineImageResource(SubResource): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, name, location, id=None, tags=None): - super(VirtualMachineImageResource, self).__init__(id=id) - self.name = name - self.location = location - self.tags = tags + def __init__(self, **kwargs): + super(VirtualMachineImageResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_image_resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_image_resource_py3.py new file mode 100644 index 000000000000..48a968bf2fbf --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_image_resource_py3.py @@ -0,0 +1,49 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineImageResource(SubResource): + """Virtual machine image resource information. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The name of the resource. + :type name: str + :param location: Required. The supported Azure location of the resource. + :type location: str + :param tags: Specifies the tags that are assigned to the virtual machine. + For more information about using tags, see [Using tags to organize your + Azure + resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + :type tags: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, name: str, location: str, id: str=None, tags=None, **kwargs) -> None: + super(VirtualMachineImageResource, self).__init__(id=id, **kwargs) + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_instance_view.py index de4790894f34..39b258f7735c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_instance_view.py @@ -21,6 +21,13 @@ class VirtualMachineInstanceView(Model): :param platform_fault_domain: Specifies the fault domain of the virtual machine. :type platform_fault_domain: int + :param computer_name: The computer name assigned to the virtual machine. + :type computer_name: str + :param os_name: The Operating System running on the virtual machine. + :type os_name: str + :param os_version: The version of Operating System running on the virtual + machine. + :type os_version: str :param rdp_thumb_print: The Remote desktop certificate thumbprint. :type rdp_thumb_print: str :param vm_agent: The VM Agent running on the virtual machine. @@ -50,6 +57,9 @@ class VirtualMachineInstanceView(Model): _attribute_map = { 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'int'}, 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, + 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'os_version': {'key': 'osVersion', 'type': 'str'}, 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, 'maintenance_redeploy_status': {'key': 'maintenanceRedeployStatus', 'type': 'MaintenanceRedeployStatus'}, @@ -59,14 +69,17 @@ class VirtualMachineInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, platform_update_domain=None, platform_fault_domain=None, rdp_thumb_print=None, vm_agent=None, maintenance_redeploy_status=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None): - super(VirtualMachineInstanceView, self).__init__() - self.platform_update_domain = platform_update_domain - self.platform_fault_domain = platform_fault_domain - self.rdp_thumb_print = rdp_thumb_print - self.vm_agent = vm_agent - self.maintenance_redeploy_status = maintenance_redeploy_status - self.disks = disks - self.extensions = extensions - self.boot_diagnostics = boot_diagnostics - self.statuses = statuses + def __init__(self, **kwargs): + super(VirtualMachineInstanceView, self).__init__(**kwargs) + self.platform_update_domain = kwargs.get('platform_update_domain', None) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.computer_name = kwargs.get('computer_name', None) + self.os_name = kwargs.get('os_name', None) + self.os_version = kwargs.get('os_version', None) + self.rdp_thumb_print = kwargs.get('rdp_thumb_print', None) + self.vm_agent = kwargs.get('vm_agent', None) + self.maintenance_redeploy_status = kwargs.get('maintenance_redeploy_status', None) + self.disks = kwargs.get('disks', None) + self.extensions = kwargs.get('extensions', None) + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_instance_view_py3.py new file mode 100644 index 000000000000..255700c3cccf --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_instance_view_py3.py @@ -0,0 +1,85 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineInstanceView(Model): + """The instance view of a virtual machine. + + :param platform_update_domain: Specifies the update domain of the virtual + machine. + :type platform_update_domain: int + :param platform_fault_domain: Specifies the fault domain of the virtual + machine. + :type platform_fault_domain: int + :param computer_name: The computer name assigned to the virtual machine. + :type computer_name: str + :param os_name: The Operating System running on the virtual machine. + :type os_name: str + :param os_version: The version of Operating System running on the virtual + machine. + :type os_version: str + :param rdp_thumb_print: The Remote desktop certificate thumbprint. + :type rdp_thumb_print: str + :param vm_agent: The VM Agent running on the virtual machine. + :type vm_agent: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineAgentInstanceView + :param maintenance_redeploy_status: The Maintenance Operation status on + the virtual machine. + :type maintenance_redeploy_status: + ~azure.mgmt.compute.v2017_12_01.models.MaintenanceRedeployStatus + :param disks: The virtual machine disk information. + :type disks: list[~azure.mgmt.compute.v2017_12_01.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtensionInstanceView] + :param boot_diagnostics: Boot Diagnostics is a debugging feature which + allows you to view Console Output and Screenshot to diagnose VM status. +

    For Linux Virtual Machines, you can easily view the output of + your console log.

    For both Windows and Linux virtual machines, + Azure also enables you to see a screenshot of the VM from the hypervisor. + :type boot_diagnostics: + ~azure.mgmt.compute.v2017_12_01.models.BootDiagnosticsInstanceView + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2017_12_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'int'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, + 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, + 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, + 'maintenance_redeploy_status': {'key': 'maintenanceRedeployStatus', 'type': 'MaintenanceRedeployStatus'}, + 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnosticsInstanceView'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, platform_update_domain: int=None, platform_fault_domain: int=None, computer_name: str=None, os_name: str=None, os_version: str=None, rdp_thumb_print: str=None, vm_agent=None, maintenance_redeploy_status=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None, **kwargs) -> None: + super(VirtualMachineInstanceView, self).__init__(**kwargs) + self.platform_update_domain = platform_update_domain + self.platform_fault_domain = platform_fault_domain + self.computer_name = computer_name + self.os_name = os_name + self.os_version = os_version + self.rdp_thumb_print = rdp_thumb_print + self.vm_agent = vm_agent + self.maintenance_redeploy_status = maintenance_redeploy_status + self.disks = disks + self.extensions = extensions + self.boot_diagnostics = boot_diagnostics + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_py3.py new file mode 100644 index 000000000000..cfae95db0776 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_py3.py @@ -0,0 +1,150 @@ +# 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 .resource import Resource + + +class VirtualMachine(Resource): + """Describes a Virtual Machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2017_12_01.models.Plan + :param hardware_profile: Specifies the hardware settings for the virtual + machine. + :type hardware_profile: + ~azure.mgmt.compute.v2017_12_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2017_12_01.models.StorageProfile + :param os_profile: Specifies the operating system settings for the virtual + machine. + :type os_profile: ~azure.mgmt.compute.v2017_12_01.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual + machine. + :type network_profile: + ~azure.mgmt.compute.v2017_12_01.models.NetworkProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. +

    Minimum api-version: 2015-06-15. + :type diagnostics_profile: + ~azure.mgmt.compute.v2017_12_01.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set + that the virtual machine should be assigned to. Virtual machines specified + in the same availability set are allocated to different nodes to maximize + availability. For more information about availability sets, see [Manage + the availability of virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + :type availability_set: ~azure.mgmt.compute.v2017_12_01.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used + was licensed on-premises. This element is only used for images that + contain the Windows Server operating system.

    Possible values are: +

    Windows_Client

    Windows_Server

    If this element + is included in a request for an update, the value must match the initial + value. This value cannot be updated.

    For more information, see + [Azure Hybrid Use Benefit for Windows + Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Minimum api-version: 2015-06-15 + :type license_type: str + :ivar vm_id: Specifies the VM unique ID which is a 128-bits identifier + that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read + using platform BIOS commands. + :vartype vm_id: str + :ivar resources: The virtual machine child extension resources. + :vartype resources: + list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtension] + :param identity: The identity of the virtual machine, if configured. + :type identity: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineIdentity + :param zones: The virtual machine zones. + :type zones: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'vm_id': {'readonly': True}, + 'resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineIdentity'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str, tags=None, plan=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type: str=None, identity=None, zones=None, **kwargs) -> None: + super(VirtualMachine, self).__init__(location=location, tags=tags, **kwargs) + self.plan = plan + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.os_profile = os_profile + self.network_profile = network_profile + self.diagnostics_profile = diagnostics_profile + self.availability_set = availability_set + self.provisioning_state = None + self.instance_view = None + self.license_type = license_type + self.vm_id = None + self.resources = None + self.identity = identity + self.zones = zones diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set.py index 658f413ccee9..44cd8f8685ab 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set.py @@ -18,13 +18,15 @@ class VirtualMachineScaleSet(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -55,6 +57,12 @@ class VirtualMachineScaleSet(Resource): :param single_placement_group: When true this limits the scale set to a single placement group, of max size 100 virtual machines. :type single_placement_group: bool + :param zone_balance: Whether to force stictly even Virtual Machine + distribution cross x-zones in case there is zone outage. + :type zone_balance: bool + :param platform_fault_domain_count: Fault Domain count for each placement + group. + :type platform_fault_domain_count: int :param identity: The identity of the virtual machine scale set, if configured. :type identity: @@ -86,19 +94,23 @@ class VirtualMachineScaleSet(Resource): 'overprovision': {'key': 'properties.overprovision', 'type': 'bool'}, 'unique_id': {'key': 'properties.uniqueId', 'type': 'str'}, 'single_placement_group': {'key': 'properties.singlePlacementGroup', 'type': 'bool'}, + 'zone_balance': {'key': 'properties.zoneBalance', 'type': 'bool'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, location, tags=None, sku=None, plan=None, upgrade_policy=None, virtual_machine_profile=None, overprovision=None, single_placement_group=None, identity=None, zones=None): - super(VirtualMachineScaleSet, self).__init__(location=location, tags=tags) - self.sku = sku - self.plan = plan - self.upgrade_policy = upgrade_policy - self.virtual_machine_profile = virtual_machine_profile + def __init__(self, **kwargs): + super(VirtualMachineScaleSet, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.plan = kwargs.get('plan', None) + self.upgrade_policy = kwargs.get('upgrade_policy', None) + self.virtual_machine_profile = kwargs.get('virtual_machine_profile', None) self.provisioning_state = None - self.overprovision = overprovision + self.overprovision = kwargs.get('overprovision', None) self.unique_id = None - self.single_placement_group = single_placement_group - self.identity = identity - self.zones = zones + self.single_placement_group = kwargs.get('single_placement_group', None) + self.zone_balance = kwargs.get('zone_balance', None) + self.platform_fault_domain_count = kwargs.get('platform_fault_domain_count', None) + self.identity = kwargs.get('identity', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_data_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_data_disk.py index f0d8872c4f9a..fc62cb57fc02 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_data_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_data_disk.py @@ -15,19 +15,24 @@ class VirtualMachineScaleSetDataDisk(Model): """Describes a virtual machine scale set data disk. + All required parameters must be populated in order to send to Azure. + :param name: The disk name. :type name: str - :param 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. + :param lun: Required. 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. :type lun: int :param caching: Specifies the caching requirements.

    Possible values are:

    **None**

    **ReadOnly**

    **ReadWrite**

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2017_12_01.models.CachingTypes - :param create_option: The create option. Possible values include: - 'FromImage', 'Empty', 'Attach' + :param write_accelerator_enabled: Specifies whether writeAccelerator + should be enabled or disabled on the disk. + :type write_accelerator_enabled: bool + :param create_option: Required. The create option. Possible values + include: 'FromImage', 'Empty', 'Attach' :type create_option: str or ~azure.mgmt.compute.v2017_12_01.models.DiskCreateOptionTypes :param disk_size_gb: Specifies the size of an empty data disk in @@ -48,16 +53,18 @@ class VirtualMachineScaleSetDataDisk(Model): 'name': {'key': 'name', 'type': 'str'}, 'lun': {'key': 'lun', 'type': 'int'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, - 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + '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'}, } - def __init__(self, lun, create_option, name=None, caching=None, disk_size_gb=None, managed_disk=None): - super(VirtualMachineScaleSetDataDisk, self).__init__() - self.name = name - self.lun = lun - self.caching = caching - self.create_option = create_option - self.disk_size_gb = disk_size_gb - self.managed_disk = managed_disk + def __init__(self, **kwargs): + super(VirtualMachineScaleSetDataDisk, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.lun = kwargs.get('lun', None) + self.caching = kwargs.get('caching', None) + self.write_accelerator_enabled = kwargs.get('write_accelerator_enabled', None) + self.create_option = kwargs.get('create_option', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.managed_disk = kwargs.get('managed_disk', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_data_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_data_disk_py3.py new file mode 100644 index 000000000000..51ebc8cdd38a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_data_disk_py3.py @@ -0,0 +1,70 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetDataDisk(Model): + """Describes a virtual machine scale set data disk. + + All required parameters must be populated in order to send to Azure. + + :param name: The disk name. + :type name: str + :param lun: Required. 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. + :type lun: int + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2017_12_01.models.CachingTypes + :param write_accelerator_enabled: Specifies whether writeAccelerator + should be enabled or disabled on the disk. + :type write_accelerator_enabled: bool + :param create_option: Required. The create option. Possible values + include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2017_12_01.models.DiskCreateOptionTypes + :param disk_size_gb: Specifies the size of an empty data disk in + gigabytes. This element can be used to overwrite the name of the disk in a + virtual machine image.

    This value cannot be larger than 1023 GB + :type disk_size_gb: int + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetManagedDiskParameters + """ + + _validation = { + 'lun': {'required': True}, + 'create_option': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + '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'}, + } + + def __init__(self, *, lun: int, create_option, name: str=None, caching=None, write_accelerator_enabled: bool=None, disk_size_gb: int=None, managed_disk=None, **kwargs) -> None: + super(VirtualMachineScaleSetDataDisk, self).__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 diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_extension.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_extension.py index 68e2be4e922d..24a487547a2a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_extension.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_extension.py @@ -67,14 +67,14 @@ class VirtualMachineScaleSetExtension(SubResourceReadOnly): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, name=None, force_update_tag=None, publisher=None, type=None, type_handler_version=None, auto_upgrade_minor_version=None, settings=None, protected_settings=None): - super(VirtualMachineScaleSetExtension, self).__init__() - self.name = name - 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.settings = settings - self.protected_settings = protected_settings + def __init__(self, **kwargs): + super(VirtualMachineScaleSetExtension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_extension_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_extension_profile.py index b863815a524d..74b124b838a3 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_extension_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_extension_profile.py @@ -25,6 +25,6 @@ class VirtualMachineScaleSetExtensionProfile(Model): 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetExtension]'}, } - def __init__(self, extensions=None): - super(VirtualMachineScaleSetExtensionProfile, self).__init__() - self.extensions = extensions + def __init__(self, **kwargs): + super(VirtualMachineScaleSetExtensionProfile, self).__init__(**kwargs) + self.extensions = kwargs.get('extensions', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_extension_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_extension_profile_py3.py new file mode 100644 index 000000000000..0b0c6773c796 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_extension_profile_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetExtensionProfile(Model): + """Describes a virtual machine scale set extension profile. + + :param extensions: The virtual machine scale set child extension + resources. + :type extensions: + list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetExtension] + """ + + _attribute_map = { + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetExtension]'}, + } + + def __init__(self, *, extensions=None, **kwargs) -> None: + super(VirtualMachineScaleSetExtensionProfile, self).__init__(**kwargs) + self.extensions = extensions diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_extension_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_extension_py3.py new file mode 100644 index 000000000000..2243c6ae1f04 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_extension_py3.py @@ -0,0 +1,80 @@ +# 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 .sub_resource_read_only import SubResourceReadOnly + + +class VirtualMachineScaleSetExtension(SubResourceReadOnly): + """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 + :param name: The name of the extension. + :type name: str + :param 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. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either + protectedSettings or protectedSettingsFromKeyVault or no protected + settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, force_update_tag: str=None, publisher: str=None, type: str=None, type_handler_version: str=None, auto_upgrade_minor_version: bool=None, settings=None, protected_settings=None, **kwargs) -> None: + super(VirtualMachineScaleSetExtension, self).__init__(, **kwargs) + self.name = name + 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.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_identity.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_identity.py index a4f719ab95e0..8bb8f14f50bf 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_identity.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_identity.py @@ -52,9 +52,9 @@ class VirtualMachineScaleSetIdentity(Model): 'identity_ids': {'key': 'identityIds', 'type': '[str]'}, } - def __init__(self, type=None, identity_ids=None): - super(VirtualMachineScaleSetIdentity, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = type - self.identity_ids = identity_ids + self.type = kwargs.get('type', None) + self.identity_ids = kwargs.get('identity_ids', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_identity_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_identity_py3.py new file mode 100644 index 000000000000..3ad52a3f6907 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_identity_py3.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetIdentity(Model): + """Identity for the virtual machine scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of virtual machine scale set + identity. This property will only be provided for a system assigned + identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the virtual machine scale + set. This property will only be provided for a system assigned identity. + :vartype tenant_id: str + :param type: The type of identity used for the virtual machine scale set. + The type 'SystemAssigned, UserAssigned' includes both an implicitly + created identity and a set of user assigned identities. The type 'None' + will remove any identities from the virtual machine scale set. Possible + values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + UserAssigned', 'None' + :type type: str or + ~azure.mgmt.compute.v2017_12_01.models.ResourceIdentityType + :param identity_ids: The list of user identities associated with the + virtual machine scale set. The user identity references will be ARM + resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + :type identity_ids: list[str] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'identity_ids': {'key': 'identityIds', 'type': '[str]'}, + } + + def __init__(self, *, type=None, identity_ids=None, **kwargs) -> None: + super(VirtualMachineScaleSetIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.identity_ids = identity_ids diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_instance_view.py index f8bd8aa459f3..83c16f482f49 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_instance_view.py @@ -41,8 +41,8 @@ class VirtualMachineScaleSetInstanceView(Model): 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, statuses=None): - super(VirtualMachineScaleSetInstanceView, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetInstanceView, self).__init__(**kwargs) self.virtual_machine = None self.extensions = None - self.statuses = statuses + self.statuses = kwargs.get('statuses', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_instance_view_py3.py new file mode 100644 index 000000000000..0fc2b4de9f6a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_instance_view_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetInstanceView(Model): + """The instance view of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar virtual_machine: The instance view status summary for the virtual + machine scale set. + :vartype virtual_machine: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetInstanceViewStatusesSummary + :ivar extensions: The extensions information. + :vartype extensions: + list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetVMExtensionsSummary] + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2017_12_01.models.InstanceViewStatus] + """ + + _validation = { + 'virtual_machine': {'readonly': True}, + 'extensions': {'readonly': True}, + } + + _attribute_map = { + 'virtual_machine': {'key': 'virtualMachine', 'type': 'VirtualMachineScaleSetInstanceViewStatusesSummary'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineScaleSetVMExtensionsSummary]'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, statuses=None, **kwargs) -> None: + super(VirtualMachineScaleSetInstanceView, self).__init__(**kwargs) + self.virtual_machine = None + self.extensions = None + self.statuses = statuses diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_instance_view_statuses_summary.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_instance_view_statuses_summary.py index 6b27b5490248..b0386bd7d17c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_instance_view_statuses_summary.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_instance_view_statuses_summary.py @@ -32,6 +32,6 @@ class VirtualMachineScaleSetInstanceViewStatusesSummary(Model): 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, } - def __init__(self): - super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__(**kwargs) self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_instance_view_statuses_summary_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_instance_view_statuses_summary_py3.py new file mode 100644 index 000000000000..e6bf881e6b21 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_instance_view_statuses_summary_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetInstanceViewStatusesSummary(Model): + """Instance view statuses summary for virtual machines of a virtual machine + scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar statuses_summary: The extensions information. + :vartype statuses_summary: + list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineStatusCodeCount] + """ + + _validation = { + 'statuses_summary': {'readonly': True}, + } + + _attribute_map = { + 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetInstanceViewStatusesSummary, self).__init__(**kwargs) + self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_ip_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_ip_configuration.py index 28dc981a1136..71b991e178c2 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_ip_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_ip_configuration.py @@ -15,9 +15,11 @@ class VirtualMachineScaleSetIPConfiguration(SubResource): """Describes a virtual machine scale set network profile's IP configuration. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The IP configuration name. + :param name: Required. The IP configuration name. :type name: str :param subnet: Specifies the identifier of the subnet. :type subnet: ~azure.mgmt.compute.v2017_12_01.models.ApiEntityReference @@ -69,13 +71,13 @@ class VirtualMachineScaleSetIPConfiguration(SubResource): 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, } - def __init__(self, name, id=None, subnet=None, primary=None, public_ip_address_configuration=None, private_ip_address_version=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_pools=None): - super(VirtualMachineScaleSetIPConfiguration, self).__init__(id=id) - self.name = name - 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.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools + def __init__(self, **kwargs): + super(VirtualMachineScaleSetIPConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.public_ip_address_configuration = kwargs.get('public_ip_address_configuration', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_pools = kwargs.get('load_balancer_inbound_nat_pools', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_ip_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_ip_configuration_py3.py new file mode 100644 index 000000000000..f1a96384fd52 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_ip_configuration_py3.py @@ -0,0 +1,83 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineScaleSetIPConfiguration(SubResource): + """Describes a virtual machine scale set network profile's IP configuration. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The IP configuration name. + :type name: str + :param subnet: Specifies the identifier of the subnet. + :type subnet: ~azure.mgmt.compute.v2017_12_01.models.ApiEntityReference + :param primary: Specifies the primary network interface in case the + virtual machine has more than 1 network interface. + :type primary: bool + :param public_ip_address_configuration: The publicIPAddressConfiguration. + :type public_ip_address_configuration: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetPublicIPAddressConfiguration + :param 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'. + Possible values include: 'IPv4', 'IPv6' + :type private_ip_address_version: str or + ~azure.mgmt.compute.v2017_12_01.models.IPVersion + :param 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. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.compute.v2017_12_01.models.SubResource] + :param 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 load balancer. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.compute.v2017_12_01.models.SubResource] + :param 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 load balancer + :type load_balancer_inbound_nat_pools: + list[~azure.mgmt.compute.v2017_12_01.models.SubResource] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'ApiEntityReference'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address_configuration': {'key': 'properties.publicIPAddressConfiguration', 'type': 'VirtualMachineScaleSetPublicIPAddressConfiguration'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, + } + + def __init__(self, *, name: str, id: str=None, subnet=None, primary: bool=None, public_ip_address_configuration=None, private_ip_address_version=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_pools=None, **kwargs) -> None: + super(VirtualMachineScaleSetIPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + 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.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters.py index f7511a92c221..44d6a698cc43 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters.py @@ -23,9 +23,9 @@ class VirtualMachineScaleSetManagedDiskParameters(Model): """ _attribute_map = { - 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, } - def __init__(self, storage_account_type=None): - super(VirtualMachineScaleSetManagedDiskParameters, self).__init__() - self.storage_account_type = storage_account_type + def __init__(self, **kwargs): + super(VirtualMachineScaleSetManagedDiskParameters, self).__init__(**kwargs) + self.storage_account_type = kwargs.get('storage_account_type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters_py3.py new file mode 100644 index 000000000000..b385ed7af268 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters_py3.py @@ -0,0 +1,31 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetManagedDiskParameters(Model): + """Describes the parameters of a ScaleSet managed disk. + + :param storage_account_type: Specifies the storage account type for the + managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible + values include: 'Standard_LRS', 'Premium_LRS' + :type storage_account_type: str or + ~azure.mgmt.compute.v2017_12_01.models.StorageAccountTypes + """ + + _attribute_map = { + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + } + + def __init__(self, *, storage_account_type=None, **kwargs) -> None: + super(VirtualMachineScaleSetManagedDiskParameters, self).__init__(**kwargs) + self.storage_account_type = storage_account_type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_configuration.py index 9cb1df9486c6..bae6d7497689 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_configuration.py @@ -16,9 +16,11 @@ class VirtualMachineScaleSetNetworkConfiguration(SubResource): """Describes a virtual machine scale set network profile's network configurations. + All required parameters must be populated in order to send to Azure. + :param id: Resource Id :type id: str - :param name: The network configuration name. + :param name: Required. The network configuration name. :type name: str :param primary: Specifies the primary network interface in case the virtual machine has more than 1 network interface. @@ -33,8 +35,8 @@ class VirtualMachineScaleSetNetworkConfiguration(SubResource): interfaces. :type dns_settings: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings - :param ip_configurations: Specifies the IP configurations of the network - interface. + :param ip_configurations: Required. Specifies the IP configurations of the + network interface. :type ip_configurations: list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetIPConfiguration] :param enable_ip_forwarding: Whether IP forwarding enabled on this NIC. @@ -57,12 +59,12 @@ class VirtualMachineScaleSetNetworkConfiguration(SubResource): 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, } - def __init__(self, name, ip_configurations, id=None, primary=None, enable_accelerated_networking=None, network_security_group=None, dns_settings=None, enable_ip_forwarding=None): - super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(id=id) - self.name = name - self.primary = primary - self.enable_accelerated_networking = enable_accelerated_networking - self.network_security_group = network_security_group - self.dns_settings = dns_settings - self.ip_configurations = ip_configurations - self.enable_ip_forwarding = enable_ip_forwarding + def __init__(self, **kwargs): + super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.primary = kwargs.get('primary', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_configuration_dns_settings.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_configuration_dns_settings.py index fa83c5a0b792..04e1c619383f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_configuration_dns_settings.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_configuration_dns_settings.py @@ -24,6 +24,6 @@ class VirtualMachineScaleSetNetworkConfigurationDnsSettings(Model): 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, } - def __init__(self, dns_servers=None): - super(VirtualMachineScaleSetNetworkConfigurationDnsSettings, self).__init__() - self.dns_servers = dns_servers + def __init__(self, **kwargs): + super(VirtualMachineScaleSetNetworkConfigurationDnsSettings, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_configuration_dns_settings_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_configuration_dns_settings_py3.py new file mode 100644 index 000000000000..5607f74d3c6a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_configuration_dns_settings_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetNetworkConfigurationDnsSettings(Model): + """Describes a virtual machines scale sets network configuration's DNS + settings. + + :param dns_servers: List of DNS servers IP addresses + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__(self, *, dns_servers=None, **kwargs) -> None: + super(VirtualMachineScaleSetNetworkConfigurationDnsSettings, self).__init__(**kwargs) + self.dns_servers = dns_servers diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_configuration_py3.py new file mode 100644 index 000000000000..78d8564906c3 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_configuration_py3.py @@ -0,0 +1,70 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineScaleSetNetworkConfiguration(SubResource): + """Describes a virtual machine scale set network profile's network + configurations. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Id + :type id: str + :param name: Required. The network configuration name. + :type name: str + :param primary: Specifies the primary network interface in case the + virtual machine has more than 1 network interface. + :type primary: bool + :param enable_accelerated_networking: Specifies whether the network + interface is accelerated networking-enabled. + :type enable_accelerated_networking: bool + :param network_security_group: The network security group. + :type network_security_group: + ~azure.mgmt.compute.v2017_12_01.models.SubResource + :param dns_settings: The dns settings to be applied on the network + interfaces. + :type dns_settings: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings + :param ip_configurations: Required. Specifies the IP configurations of the + network interface. + :type ip_configurations: + list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetIPConfiguration] + :param enable_ip_forwarding: Whether IP forwarding enabled on this NIC. + :type enable_ip_forwarding: bool + """ + + _validation = { + 'name': {'required': True}, + 'ip_configurations': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetNetworkConfigurationDnsSettings'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetIPConfiguration]'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + } + + def __init__(self, *, name: str, ip_configurations, id: str=None, primary: bool=None, enable_accelerated_networking: bool=None, network_security_group=None, dns_settings=None, enable_ip_forwarding: bool=None, **kwargs) -> None: + super(VirtualMachineScaleSetNetworkConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.network_security_group = network_security_group + self.dns_settings = dns_settings + self.ip_configurations = ip_configurations + self.enable_ip_forwarding = enable_ip_forwarding diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_profile.py index bcd3c4502484..93f2208693cd 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_profile.py @@ -32,7 +32,7 @@ class VirtualMachineScaleSetNetworkProfile(Model): 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetNetworkConfiguration]'}, } - def __init__(self, health_probe=None, network_interface_configurations=None): - super(VirtualMachineScaleSetNetworkProfile, self).__init__() - self.health_probe = health_probe - self.network_interface_configurations = network_interface_configurations + def __init__(self, **kwargs): + super(VirtualMachineScaleSetNetworkProfile, self).__init__(**kwargs) + self.health_probe = kwargs.get('health_probe', None) + self.network_interface_configurations = kwargs.get('network_interface_configurations', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_profile_py3.py new file mode 100644 index 000000000000..db829a6e5f08 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_network_profile_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetNetworkProfile(Model): + """Describes a virtual machine scale set network profile. + + :param 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}'. + :type health_probe: + ~azure.mgmt.compute.v2017_12_01.models.ApiEntityReference + :param network_interface_configurations: The list of network + configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetNetworkConfiguration] + """ + + _attribute_map = { + 'health_probe': {'key': 'healthProbe', 'type': 'ApiEntityReference'}, + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetNetworkConfiguration]'}, + } + + def __init__(self, *, health_probe=None, network_interface_configurations=None, **kwargs) -> None: + super(VirtualMachineScaleSetNetworkProfile, self).__init__(**kwargs) + self.health_probe = health_probe + self.network_interface_configurations = network_interface_configurations diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_disk.py index 9e3448b6f8c9..24fa8103eef7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_disk.py @@ -15,6 +15,8 @@ class VirtualMachineScaleSetOSDisk(Model): """Describes a virtual machine scale set operating system disk. + All required parameters must be populated in order to send to Azure. + :param name: The disk name. :type name: str :param caching: Specifies the caching requirements.

    Possible @@ -22,13 +24,16 @@ class VirtualMachineScaleSetOSDisk(Model):

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2017_12_01.models.CachingTypes - :param create_option: Specifies how the virtual machines in the scale set - should be created.

    The only allowed value is: **FromImage** - \\u2013 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. Possible - values include: 'FromImage', 'Empty', 'Attach' + :param write_accelerator_enabled: Specifies whether writeAccelerator + should be enabled or disabled on the disk. + :type write_accelerator_enabled: bool + :param create_option: Required. Specifies how the virtual machines in the + scale set should be created.

    The only allowed value is: + **FromImage** \\u2013 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. + Possible values include: 'FromImage', 'Empty', 'Attach' :type create_option: str or ~azure.mgmt.compute.v2017_12_01.models.DiskCreateOptionTypes :param os_type: This property allows you to specify the type of the OS @@ -55,19 +60,21 @@ class VirtualMachineScaleSetOSDisk(Model): _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, - 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, + 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, + 'create_option': {'key': 'createOption', 'type': 'str'}, 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, } - def __init__(self, create_option, name=None, caching=None, os_type=None, image=None, vhd_containers=None, managed_disk=None): - super(VirtualMachineScaleSetOSDisk, self).__init__() - self.name = name - self.caching = caching - self.create_option = create_option - self.os_type = os_type - self.image = image - self.vhd_containers = vhd_containers - self.managed_disk = managed_disk + def __init__(self, **kwargs): + super(VirtualMachineScaleSetOSDisk, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.caching = kwargs.get('caching', None) + self.write_accelerator_enabled = kwargs.get('write_accelerator_enabled', None) + self.create_option = kwargs.get('create_option', None) + self.os_type = kwargs.get('os_type', None) + self.image = kwargs.get('image', None) + self.vhd_containers = kwargs.get('vhd_containers', None) + self.managed_disk = kwargs.get('managed_disk', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_disk_py3.py new file mode 100644 index 000000000000..cd6f8e0254fd --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_disk_py3.py @@ -0,0 +1,80 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetOSDisk(Model): + """Describes a virtual machine scale set operating system disk. + + All required parameters must be populated in order to send to Azure. + + :param name: The disk name. + :type name: str + :param caching: Specifies the caching requirements.

    Possible + values are:

    **None**

    **ReadOnly**

    **ReadWrite** +

    Default: **None for Standard storage. ReadOnly for Premium + storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2017_12_01.models.CachingTypes + :param write_accelerator_enabled: Specifies whether writeAccelerator + should be enabled or disabled on the disk. + :type write_accelerator_enabled: bool + :param create_option: Required. Specifies how the virtual machines in the + scale set should be created.

    The only allowed value is: + **FromImage** \\u2013 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. + Possible values include: 'FromImage', 'Empty', 'Attach' + :type create_option: str or + ~azure.mgmt.compute.v2017_12_01.models.DiskCreateOptionTypes + :param 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**. Possible values include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2017_12_01.models.OperatingSystemTypes + :param image: Specifies information about the unmanaged user image to base + the scale set on. + :type image: ~azure.mgmt.compute.v2017_12_01.models.VirtualHardDisk + :param vhd_containers: Specifies the container urls that are used to store + operating system disks for the scale set. + :type vhd_containers: list[str] + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetManagedDiskParameters + """ + + _validation = { + 'create_option': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, + 'create_option': {'key': 'createOption', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, + } + + def __init__(self, *, create_option, name: str=None, caching=None, write_accelerator_enabled: bool=None, os_type=None, image=None, vhd_containers=None, managed_disk=None, **kwargs) -> None: + super(VirtualMachineScaleSetOSDisk, self).__init__(**kwargs) + self.name = name + self.caching = caching + self.write_accelerator_enabled = write_accelerator_enabled + self.create_option = create_option + self.os_type = os_type + self.image = image + self.vhd_containers = vhd_containers + self.managed_disk = managed_disk diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_profile.py index d40f97afa495..7699d4e3fda1 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_profile.py @@ -86,12 +86,12 @@ class VirtualMachineScaleSetOSProfile(Model): 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, } - def __init__(self, computer_name_prefix=None, admin_username=None, admin_password=None, custom_data=None, windows_configuration=None, linux_configuration=None, secrets=None): - super(VirtualMachineScaleSetOSProfile, self).__init__() - 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 + def __init__(self, **kwargs): + super(VirtualMachineScaleSetOSProfile, self).__init__(**kwargs) + self.computer_name_prefix = kwargs.get('computer_name_prefix', None) + self.admin_username = kwargs.get('admin_username', None) + self.admin_password = kwargs.get('admin_password', None) + self.custom_data = kwargs.get('custom_data', None) + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + self.secrets = kwargs.get('secrets', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_profile_py3.py new file mode 100644 index 000000000000..1c4bd36214ed --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_profile_py3.py @@ -0,0 +1,97 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetOSProfile(Model): + """Describes a virtual machine scale set OS profile. + + :param 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. + :type computer_name_prefix: str + :param admin_username: Specifies the name of the administrator account. +

    **Windows-only restriction:** Cannot end in "."

    + **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".

    **Minimum-length (Linux):** 1 + character

    **Max-length (Linux):** 64 characters

    + **Max-length (Windows):** 20 characters

  • For root access to + the Linux VM, see [Using root privileges on Linux virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + For a list of built-in system users on Linux that should not be used in + this field, see [Selecting User Names for Linux on + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type admin_username: str + :param admin_password: Specifies the password of the administrator + account.

    **Minimum-length (Windows):** 8 characters

    + **Minimum-length (Linux):** 6 characters

    **Max-length + (Windows):** 123 characters

    **Max-length (Linux):** 72 characters +

    **Complexity requirements:** 3 out of 4 conditions below need to + be fulfilled
    Has lower characters
    Has upper characters
    Has a + digit
    Has a special character (Regex match [\\W_])

    + **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + "iloveyou!"

    For resetting the password, see [How to reset the + Remote Desktop service or its login password in a Windows + VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    For resetting root password, see [Manage users, SSH, and check or + repair disks on Azure Linux VMs using the VMAccess + Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + :type admin_password: str + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + :type custom_data: str + :param windows_configuration: Specifies Windows operating system settings + on the virtual machine. + :type windows_configuration: + ~azure.mgmt.compute.v2017_12_01.models.WindowsConfiguration + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) +

    For running non-endorsed distributions, see [Information for + Non-Endorsed + Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + :type linux_configuration: + ~azure.mgmt.compute.v2017_12_01.models.LinuxConfiguration + :param secrets: Specifies set of certificates that should be installed + onto the virtual machines in the scale set. + :type secrets: + list[~azure.mgmt.compute.v2017_12_01.models.VaultSecretGroup] + """ + + _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]'}, + } + + def __init__(self, *, computer_name_prefix: str=None, admin_username: str=None, admin_password: str=None, custom_data: str=None, windows_configuration=None, linux_configuration=None, secrets=None, **kwargs) -> None: + super(VirtualMachineScaleSetOSProfile, self).__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 diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_public_ip_address_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_public_ip_address_configuration.py index 5d3be81c1d29..3a65fd0c337c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_public_ip_address_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_public_ip_address_configuration.py @@ -16,7 +16,9 @@ class VirtualMachineScaleSetPublicIPAddressConfiguration(Model): """Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. - :param name: The publicIP address configuration name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The publicIP address configuration name. :type name: str :param idle_timeout_in_minutes: The idle timeout of the public IP address. :type idle_timeout_in_minutes: int @@ -36,8 +38,8 @@ class VirtualMachineScaleSetPublicIPAddressConfiguration(Model): 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'}, } - def __init__(self, name, idle_timeout_in_minutes=None, dns_settings=None): - super(VirtualMachineScaleSetPublicIPAddressConfiguration, self).__init__() - self.name = name - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.dns_settings = dns_settings + def __init__(self, **kwargs): + super(VirtualMachineScaleSetPublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.dns_settings = kwargs.get('dns_settings', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_public_ip_address_configuration_dns_settings.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_public_ip_address_configuration_dns_settings.py index b247010d8c4a..2fe562244372 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_public_ip_address_configuration_dns_settings.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_public_ip_address_configuration_dns_settings.py @@ -16,9 +16,11 @@ class VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings(Model): """Describes a virtual machines scale sets network configuration's DNS settings. - :param 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 + All required parameters must be populated in order to send to Azure. + + :param domain_name_label: Required. 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 :type domain_name_label: str """ @@ -30,6 +32,6 @@ class VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings(Model): 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, } - def __init__(self, domain_name_label): - super(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings, self).__init__() - self.domain_name_label = domain_name_label + def __init__(self, **kwargs): + super(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings, self).__init__(**kwargs) + self.domain_name_label = kwargs.get('domain_name_label', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_public_ip_address_configuration_dns_settings_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_public_ip_address_configuration_dns_settings_py3.py new file mode 100644 index 000000000000..326a36708ff4 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_public_ip_address_configuration_dns_settings_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings(Model): + """Describes a virtual machines scale sets network configuration's DNS + settings. + + All required parameters must be populated in order to send to Azure. + + :param domain_name_label: Required. 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 + :type domain_name_label: str + """ + + _validation = { + 'domain_name_label': {'required': True}, + } + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + } + + def __init__(self, *, domain_name_label: str, **kwargs) -> None: + super(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings, self).__init__(**kwargs) + self.domain_name_label = domain_name_label diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_public_ip_address_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_public_ip_address_configuration_py3.py new file mode 100644 index 000000000000..89dbbd54a4b6 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_public_ip_address_configuration_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetPublicIPAddressConfiguration(Model): + """Describes a virtual machines scale set IP Configuration's PublicIPAddress + configuration. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The publicIP address configuration name. + :type name: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param dns_settings: The dns settings to be applied on the publicIP + addresses . + :type dns_settings: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'}, + } + + def __init__(self, *, name: str, idle_timeout_in_minutes: int=None, dns_settings=None, **kwargs) -> None: + super(VirtualMachineScaleSetPublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = name + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.dns_settings = dns_settings diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_py3.py new file mode 100644 index 000000000000..6894911e1e4b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_py3.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 .resource import Resource + + +class VirtualMachineScaleSet(Resource): + """Describes a Virtual Machine Scale Set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The virtual machine scale set sku. + :type sku: ~azure.mgmt.compute.v2017_12_01.models.Sku + :param plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2017_12_01.models.Plan + :param upgrade_policy: The upgrade policy. + :type upgrade_policy: ~azure.mgmt.compute.v2017_12_01.models.UpgradePolicy + :param virtual_machine_profile: The virtual machine profile. + :type virtual_machine_profile: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetVMProfile + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :param overprovision: Specifies whether the Virtual Machine Scale Set + should be overprovisioned. + :type overprovision: bool + :ivar unique_id: Specifies the ID which uniquely identifies a Virtual + Machine Scale Set. + :vartype unique_id: str + :param single_placement_group: When true this limits the scale set to a + single placement group, of max size 100 virtual machines. + :type single_placement_group: bool + :param zone_balance: Whether to force stictly even Virtual Machine + distribution cross x-zones in case there is zone outage. + :type zone_balance: bool + :param platform_fault_domain_count: Fault Domain count for each placement + group. + :type platform_fault_domain_count: int + :param identity: The identity of the virtual machine scale set, if + configured. + :type identity: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetIdentity + :param zones: The virtual machine scale set zones. + :type zones: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'unique_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'upgrade_policy': {'key': 'properties.upgradePolicy', 'type': 'UpgradePolicy'}, + 'virtual_machine_profile': {'key': 'properties.virtualMachineProfile', 'type': 'VirtualMachineScaleSetVMProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'overprovision': {'key': 'properties.overprovision', 'type': 'bool'}, + 'unique_id': {'key': 'properties.uniqueId', 'type': 'str'}, + 'single_placement_group': {'key': 'properties.singlePlacementGroup', 'type': 'bool'}, + 'zone_balance': {'key': 'properties.zoneBalance', 'type': 'bool'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str, tags=None, sku=None, plan=None, upgrade_policy=None, virtual_machine_profile=None, overprovision: bool=None, single_placement_group: bool=None, zone_balance: bool=None, platform_fault_domain_count: int=None, identity=None, zones=None, **kwargs) -> None: + super(VirtualMachineScaleSet, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.plan = plan + self.upgrade_policy = upgrade_policy + self.virtual_machine_profile = virtual_machine_profile + self.provisioning_state = None + self.overprovision = overprovision + self.unique_id = None + self.single_placement_group = single_placement_group + self.zone_balance = zone_balance + self.platform_fault_domain_count = platform_fault_domain_count + self.identity = identity + self.zones = zones diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_sku.py index 79eeba82a041..50bf8810caf6 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_sku.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_sku.py @@ -39,8 +39,8 @@ class VirtualMachineScaleSetSku(Model): 'capacity': {'key': 'capacity', 'type': 'VirtualMachineScaleSetSkuCapacity'}, } - def __init__(self): - super(VirtualMachineScaleSetSku, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetSku, self).__init__(**kwargs) self.resource_type = None self.sku = None self.capacity = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_sku_capacity.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_sku_capacity.py index e3121118c089..b2ce642033c1 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_sku_capacity.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_sku_capacity.py @@ -44,8 +44,8 @@ class VirtualMachineScaleSetSkuCapacity(Model): 'scale_type': {'key': 'scaleType', 'type': 'VirtualMachineScaleSetSkuScaleType'}, } - def __init__(self): - super(VirtualMachineScaleSetSkuCapacity, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetSkuCapacity, self).__init__(**kwargs) self.minimum = None self.maximum = None self.default_capacity = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_sku_capacity_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_sku_capacity_py3.py new file mode 100644 index 000000000000..35ecf5ec52f2 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_sku_capacity_py3.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetSkuCapacity(Model): + """Describes scaling information of a sku. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar minimum: The minimum capacity. + :vartype minimum: long + :ivar maximum: The maximum capacity that can be set. + :vartype maximum: long + :ivar default_capacity: The default capacity. + :vartype default_capacity: long + :ivar scale_type: The scale type applicable to the sku. Possible values + include: 'Automatic', 'None' + :vartype scale_type: str or + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetSkuScaleType + """ + + _validation = { + 'minimum': {'readonly': True}, + 'maximum': {'readonly': True}, + 'default_capacity': {'readonly': True}, + 'scale_type': {'readonly': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'long'}, + 'maximum': {'key': 'maximum', 'type': 'long'}, + 'default_capacity': {'key': 'defaultCapacity', 'type': 'long'}, + 'scale_type': {'key': 'scaleType', 'type': 'VirtualMachineScaleSetSkuScaleType'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetSkuCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default_capacity = None + self.scale_type = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_sku_py3.py new file mode 100644 index 000000000000..54ff1a125be4 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_sku_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetSku(Model): + """Describes an available virtual machine scale set sku. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_type: The type of resource the sku applies to. + :vartype resource_type: str + :ivar sku: The Sku. + :vartype sku: ~azure.mgmt.compute.v2017_12_01.models.Sku + :ivar capacity: Specifies the number of virtual machines in the scale set. + :vartype capacity: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetSkuCapacity + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'sku': {'readonly': True}, + 'capacity': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'capacity': {'key': 'capacity', 'type': 'VirtualMachineScaleSetSkuCapacity'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetSku, self).__init__(**kwargs) + self.resource_type = None + self.sku = None + self.capacity = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_storage_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_storage_profile.py index 15b60d455a7b..63c914868fd1 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_storage_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_storage_profile.py @@ -42,8 +42,8 @@ class VirtualMachineScaleSetStorageProfile(Model): 'data_disks': {'key': 'dataDisks', 'type': '[VirtualMachineScaleSetDataDisk]'}, } - def __init__(self, image_reference=None, os_disk=None, data_disks=None): - super(VirtualMachineScaleSetStorageProfile, self).__init__() - self.image_reference = image_reference - self.os_disk = os_disk - self.data_disks = data_disks + def __init__(self, **kwargs): + super(VirtualMachineScaleSetStorageProfile, self).__init__(**kwargs) + self.image_reference = kwargs.get('image_reference', None) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_storage_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_storage_profile_py3.py new file mode 100644 index 000000000000..403ef780b839 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_storage_profile_py3.py @@ -0,0 +1,49 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetStorageProfile(Model): + """Describes a virtual machine scale set storage profile. + + :param 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. + :type image_reference: + ~azure.mgmt.compute.v2017_12_01.models.ImageReference + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type os_disk: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetOSDisk + :param 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](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + :type data_disks: + list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetDataDisk] + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'VirtualMachineScaleSetOSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[VirtualMachineScaleSetDataDisk]'}, + } + + def __init__(self, *, image_reference=None, os_disk=None, data_disks=None, **kwargs) -> None: + super(VirtualMachineScaleSetStorageProfile, self).__init__(**kwargs) + self.image_reference = image_reference + self.os_disk = os_disk + self.data_disks = data_disks diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update.py index b9015ef6b2cc..c2d51bd050ae 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update.py @@ -50,12 +50,12 @@ class VirtualMachineScaleSetUpdate(UpdateResource): 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, } - def __init__(self, tags=None, sku=None, plan=None, upgrade_policy=None, virtual_machine_profile=None, overprovision=None, single_placement_group=None, identity=None): - super(VirtualMachineScaleSetUpdate, self).__init__(tags=tags) - self.sku = sku - self.plan = plan - self.upgrade_policy = upgrade_policy - self.virtual_machine_profile = virtual_machine_profile - self.overprovision = overprovision - self.single_placement_group = single_placement_group - self.identity = identity + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdate, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.plan = kwargs.get('plan', None) + self.upgrade_policy = kwargs.get('upgrade_policy', None) + self.virtual_machine_profile = kwargs.get('virtual_machine_profile', None) + self.overprovision = kwargs.get('overprovision', None) + self.single_placement_group = kwargs.get('single_placement_group', None) + self.identity = kwargs.get('identity', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_ip_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_ip_configuration.py index f1f67a4a24a2..576e62097dc5 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_ip_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_ip_configuration.py @@ -59,13 +59,13 @@ class VirtualMachineScaleSetUpdateIPConfiguration(SubResource): 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, } - def __init__(self, id=None, name=None, subnet=None, primary=None, public_ip_address_configuration=None, private_ip_address_version=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_pools=None): - super(VirtualMachineScaleSetUpdateIPConfiguration, self).__init__(id=id) - self.name = name - 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.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdateIPConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.public_ip_address_configuration = kwargs.get('public_ip_address_configuration', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_pools = kwargs.get('load_balancer_inbound_nat_pools', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_ip_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_ip_configuration_py3.py new file mode 100644 index 000000000000..73d1bef780ad --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_ip_configuration_py3.py @@ -0,0 +1,71 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineScaleSetUpdateIPConfiguration(SubResource): + """Describes a virtual machine scale set network profile's IP configuration. + + :param id: Resource Id + :type id: str + :param name: The IP configuration name. + :type name: str + :param subnet: The subnet. + :type subnet: ~azure.mgmt.compute.v2017_12_01.models.ApiEntityReference + :param primary: Specifies the primary IP Configuration in case the network + interface has more than one IP Configuration. + :type primary: bool + :param public_ip_address_configuration: The publicIPAddressConfiguration. + :type public_ip_address_configuration: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetUpdatePublicIPAddressConfiguration + :param 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'. + Possible values include: 'IPv4', 'IPv6' + :type private_ip_address_version: str or + ~azure.mgmt.compute.v2017_12_01.models.IPVersion + :param application_gateway_backend_address_pools: The application gateway + backend address pools. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.compute.v2017_12_01.models.SubResource] + :param load_balancer_backend_address_pools: The load balancer backend + address pools. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.compute.v2017_12_01.models.SubResource] + :param load_balancer_inbound_nat_pools: The load balancer inbound nat + pools. + :type load_balancer_inbound_nat_pools: + list[~azure.mgmt.compute.v2017_12_01.models.SubResource] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'ApiEntityReference'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address_configuration': {'key': 'properties.publicIPAddressConfiguration', 'type': 'VirtualMachineScaleSetUpdatePublicIPAddressConfiguration'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[SubResource]'}, + 'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'}, + } + + def __init__(self, *, id: str=None, name: str=None, subnet=None, primary: bool=None, public_ip_address_configuration=None, private_ip_address_version=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_pools=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdateIPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + 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.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_network_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_network_configuration.py index b4500daaf9ce..723195aacb02 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_network_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_network_configuration.py @@ -50,12 +50,12 @@ class VirtualMachineScaleSetUpdateNetworkConfiguration(SubResource): 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, } - def __init__(self, id=None, name=None, primary=None, enable_accelerated_networking=None, network_security_group=None, dns_settings=None, ip_configurations=None, enable_ip_forwarding=None): - super(VirtualMachineScaleSetUpdateNetworkConfiguration, self).__init__(id=id) - self.name = name - self.primary = primary - self.enable_accelerated_networking = enable_accelerated_networking - self.network_security_group = network_security_group - self.dns_settings = dns_settings - self.ip_configurations = ip_configurations - self.enable_ip_forwarding = enable_ip_forwarding + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdateNetworkConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.primary = kwargs.get('primary', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_network_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_network_configuration_py3.py new file mode 100644 index 000000000000..9d4109287ec2 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_network_configuration_py3.py @@ -0,0 +1,61 @@ +# 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 .sub_resource import SubResource + + +class VirtualMachineScaleSetUpdateNetworkConfiguration(SubResource): + """Describes a virtual machine scale set network profile's network + configurations. + + :param id: Resource Id + :type id: str + :param name: The network configuration name. + :type name: str + :param primary: Whether this is a primary NIC on a virtual machine. + :type primary: bool + :param enable_accelerated_networking: Specifies whether the network + interface is accelerated networking-enabled. + :type enable_accelerated_networking: bool + :param network_security_group: The network security group. + :type network_security_group: + ~azure.mgmt.compute.v2017_12_01.models.SubResource + :param dns_settings: The dns settings to be applied on the network + interfaces. + :type dns_settings: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings + :param ip_configurations: The virtual machine scale set IP Configuration. + :type ip_configurations: + list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetUpdateIPConfiguration] + :param enable_ip_forwarding: Whether IP forwarding enabled on this NIC. + :type enable_ip_forwarding: bool + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetNetworkConfigurationDnsSettings'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetUpdateIPConfiguration]'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + } + + def __init__(self, *, id: str=None, name: str=None, primary: bool=None, enable_accelerated_networking: bool=None, network_security_group=None, dns_settings=None, ip_configurations=None, enable_ip_forwarding: bool=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdateNetworkConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.network_security_group = network_security_group + self.dns_settings = dns_settings + self.ip_configurations = ip_configurations + self.enable_ip_forwarding = enable_ip_forwarding diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_network_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_network_profile.py index d0d2a7eb0a3b..8cb5ce297e89 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_network_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_network_profile.py @@ -25,6 +25,6 @@ class VirtualMachineScaleSetUpdateNetworkProfile(Model): 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetUpdateNetworkConfiguration]'}, } - def __init__(self, network_interface_configurations=None): - super(VirtualMachineScaleSetUpdateNetworkProfile, self).__init__() - self.network_interface_configurations = network_interface_configurations + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdateNetworkProfile, self).__init__(**kwargs) + self.network_interface_configurations = kwargs.get('network_interface_configurations', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_network_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_network_profile_py3.py new file mode 100644 index 000000000000..db9170b1e1e9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_network_profile_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetUpdateNetworkProfile(Model): + """Describes a virtual machine scale set network profile. + + :param network_interface_configurations: The list of network + configurations. + :type network_interface_configurations: + list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetUpdateNetworkConfiguration] + """ + + _attribute_map = { + 'network_interface_configurations': {'key': 'networkInterfaceConfigurations', 'type': '[VirtualMachineScaleSetUpdateNetworkConfiguration]'}, + } + + def __init__(self, *, network_interface_configurations=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdateNetworkProfile, self).__init__(**kwargs) + self.network_interface_configurations = network_interface_configurations diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_os_disk.py index 406be35982ff..82ba18002869 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_os_disk.py @@ -19,6 +19,9 @@ class VirtualMachineScaleSetUpdateOSDisk(Model): :param caching: The caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' :type caching: str or ~azure.mgmt.compute.v2017_12_01.models.CachingTypes + :param write_accelerator_enabled: Specifies whether writeAccelerator + should be enabled or disabled on the disk. + :type write_accelerator_enabled: bool :param image: The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine. If SourceImage is provided, the destination VirtualHardDisk should not exist. @@ -32,14 +35,16 @@ class VirtualMachineScaleSetUpdateOSDisk(Model): _attribute_map = { 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, } - def __init__(self, caching=None, image=None, vhd_containers=None, managed_disk=None): - super(VirtualMachineScaleSetUpdateOSDisk, self).__init__() - self.caching = caching - self.image = image - self.vhd_containers = vhd_containers - self.managed_disk = managed_disk + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdateOSDisk, self).__init__(**kwargs) + self.caching = kwargs.get('caching', None) + self.write_accelerator_enabled = kwargs.get('write_accelerator_enabled', None) + self.image = kwargs.get('image', None) + self.vhd_containers = kwargs.get('vhd_containers', None) + self.managed_disk = kwargs.get('managed_disk', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_os_disk_py3.py new file mode 100644 index 000000000000..c6639ba8daf1 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_os_disk_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetUpdateOSDisk(Model): + """Describes virtual machine scale set operating system disk Update Object. + This should be used for Updating VMSS OS Disk. + + :param caching: The caching type. Possible values include: 'None', + 'ReadOnly', 'ReadWrite' + :type caching: str or ~azure.mgmt.compute.v2017_12_01.models.CachingTypes + :param write_accelerator_enabled: Specifies whether writeAccelerator + should be enabled or disabled on the disk. + :type write_accelerator_enabled: bool + :param image: The Source User Image VirtualHardDisk. This VirtualHardDisk + will be copied before using it to attach to the Virtual Machine. If + SourceImage is provided, the destination VirtualHardDisk should not exist. + :type image: ~azure.mgmt.compute.v2017_12_01.models.VirtualHardDisk + :param vhd_containers: The list of virtual hard disk container uris. + :type vhd_containers: list[str] + :param managed_disk: The managed disk parameters. + :type managed_disk: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetManagedDiskParameters + """ + + _attribute_map = { + 'caching': {'key': 'caching', 'type': 'CachingTypes'}, + 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, + 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, + 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, + 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, + } + + def __init__(self, *, caching=None, write_accelerator_enabled: bool=None, image=None, vhd_containers=None, managed_disk=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdateOSDisk, self).__init__(**kwargs) + self.caching = caching + self.write_accelerator_enabled = write_accelerator_enabled + self.image = image + self.vhd_containers = vhd_containers + self.managed_disk = managed_disk diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_os_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_os_profile.py index 2edfd5970e8a..ce463ac6d721 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_os_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_os_profile.py @@ -35,9 +35,9 @@ class VirtualMachineScaleSetUpdateOSProfile(Model): 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, } - def __init__(self, custom_data=None, windows_configuration=None, linux_configuration=None, secrets=None): - super(VirtualMachineScaleSetUpdateOSProfile, self).__init__() - self.custom_data = custom_data - self.windows_configuration = windows_configuration - self.linux_configuration = linux_configuration - self.secrets = secrets + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdateOSProfile, self).__init__(**kwargs) + self.custom_data = kwargs.get('custom_data', None) + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) + self.secrets = kwargs.get('secrets', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_os_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_os_profile_py3.py new file mode 100644 index 000000000000..24a5688fdbd4 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_os_profile_py3.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 msrest.serialization import Model + + +class VirtualMachineScaleSetUpdateOSProfile(Model): + """Describes a virtual machine scale set OS profile. + + :param custom_data: A base-64 encoded string of custom data. + :type custom_data: str + :param windows_configuration: The Windows Configuration of the OS profile. + :type windows_configuration: + ~azure.mgmt.compute.v2017_12_01.models.WindowsConfiguration + :param linux_configuration: The Linux Configuration of the OS profile. + :type linux_configuration: + ~azure.mgmt.compute.v2017_12_01.models.LinuxConfiguration + :param secrets: The List of certificates for addition to the VM. + :type secrets: + list[~azure.mgmt.compute.v2017_12_01.models.VaultSecretGroup] + """ + + _attribute_map = { + 'custom_data': {'key': 'customData', 'type': 'str'}, + 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'WindowsConfiguration'}, + 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'LinuxConfiguration'}, + 'secrets': {'key': 'secrets', 'type': '[VaultSecretGroup]'}, + } + + def __init__(self, *, custom_data: str=None, windows_configuration=None, linux_configuration=None, secrets=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdateOSProfile, self).__init__(**kwargs) + self.custom_data = custom_data + self.windows_configuration = windows_configuration + self.linux_configuration = linux_configuration + self.secrets = secrets diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_public_ip_address_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_public_ip_address_configuration.py index e622641d2d69..f4ef4083f27f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_public_ip_address_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_public_ip_address_configuration.py @@ -32,8 +32,8 @@ class VirtualMachineScaleSetUpdatePublicIPAddressConfiguration(Model): 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'}, } - def __init__(self, name=None, idle_timeout_in_minutes=None, dns_settings=None): - super(VirtualMachineScaleSetUpdatePublicIPAddressConfiguration, self).__init__() - self.name = name - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.dns_settings = dns_settings + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdatePublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.dns_settings = kwargs.get('dns_settings', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_public_ip_address_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_public_ip_address_configuration_py3.py new file mode 100644 index 000000000000..68dff9172cd6 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_public_ip_address_configuration_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetUpdatePublicIPAddressConfiguration(Model): + """Describes a virtual machines scale set IP Configuration's PublicIPAddress + configuration. + + :param name: The publicIP address configuration name. + :type name: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param dns_settings: The dns settings to be applied on the publicIP + addresses . + :type dns_settings: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'}, + } + + def __init__(self, *, name: str=None, idle_timeout_in_minutes: int=None, dns_settings=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdatePublicIPAddressConfiguration, self).__init__(**kwargs) + self.name = name + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.dns_settings = dns_settings diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_py3.py new file mode 100644 index 000000000000..a4654e1b277c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_py3.py @@ -0,0 +1,61 @@ +# 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 .update_resource import UpdateResource + + +class VirtualMachineScaleSetUpdate(UpdateResource): + """Describes a Virtual Machine Scale Set. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The virtual machine scale set sku. + :type sku: ~azure.mgmt.compute.v2017_12_01.models.Sku + :param plan: The purchase plan when deploying a virtual machine scale set + from VM Marketplace images. + :type plan: ~azure.mgmt.compute.v2017_12_01.models.Plan + :param upgrade_policy: The upgrade policy. + :type upgrade_policy: ~azure.mgmt.compute.v2017_12_01.models.UpgradePolicy + :param virtual_machine_profile: The virtual machine profile. + :type virtual_machine_profile: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetUpdateVMProfile + :param overprovision: Specifies whether the Virtual Machine Scale Set + should be overprovisioned. + :type overprovision: bool + :param single_placement_group: When true this limits the scale set to a + single placement group, of max size 100 virtual machines. + :type single_placement_group: bool + :param identity: The identity of the virtual machine scale set, if + configured. + :type identity: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetIdentity + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'upgrade_policy': {'key': 'properties.upgradePolicy', 'type': 'UpgradePolicy'}, + 'virtual_machine_profile': {'key': 'properties.virtualMachineProfile', 'type': 'VirtualMachineScaleSetUpdateVMProfile'}, + 'overprovision': {'key': 'properties.overprovision', 'type': 'bool'}, + 'single_placement_group': {'key': 'properties.singlePlacementGroup', 'type': 'bool'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, + } + + def __init__(self, *, tags=None, sku=None, plan=None, upgrade_policy=None, virtual_machine_profile=None, overprovision: bool=None, single_placement_group: bool=None, identity=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdate, self).__init__(tags=tags, **kwargs) + self.sku = sku + self.plan = plan + self.upgrade_policy = upgrade_policy + self.virtual_machine_profile = virtual_machine_profile + self.overprovision = overprovision + self.single_placement_group = single_placement_group + self.identity = identity diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_storage_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_storage_profile.py index 41d135b8de63..24718c0f5731 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_storage_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_storage_profile.py @@ -32,8 +32,8 @@ class VirtualMachineScaleSetUpdateStorageProfile(Model): 'data_disks': {'key': 'dataDisks', 'type': '[VirtualMachineScaleSetDataDisk]'}, } - def __init__(self, image_reference=None, os_disk=None, data_disks=None): - super(VirtualMachineScaleSetUpdateStorageProfile, self).__init__() - self.image_reference = image_reference - self.os_disk = os_disk - self.data_disks = data_disks + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdateStorageProfile, self).__init__(**kwargs) + self.image_reference = kwargs.get('image_reference', None) + self.os_disk = kwargs.get('os_disk', None) + self.data_disks = kwargs.get('data_disks', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_storage_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_storage_profile_py3.py new file mode 100644 index 000000000000..d2ace5b6fd53 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_storage_profile_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetUpdateStorageProfile(Model): + """Describes a virtual machine scale set storage profile. + + :param image_reference: The image reference. + :type image_reference: + ~azure.mgmt.compute.v2017_12_01.models.ImageReference + :param os_disk: The OS disk. + :type os_disk: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetUpdateOSDisk + :param data_disks: The data disks. + :type data_disks: + list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetDataDisk] + """ + + _attribute_map = { + 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, + 'os_disk': {'key': 'osDisk', 'type': 'VirtualMachineScaleSetUpdateOSDisk'}, + 'data_disks': {'key': 'dataDisks', 'type': '[VirtualMachineScaleSetDataDisk]'}, + } + + def __init__(self, *, image_reference=None, os_disk=None, data_disks=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdateStorageProfile, self).__init__(**kwargs) + self.image_reference = image_reference + self.os_disk = os_disk + self.data_disks = data_disks diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_vm_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_vm_profile.py index 5c6f7c8817e8..40c07f8708cd 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_vm_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_vm_profile.py @@ -45,11 +45,11 @@ class VirtualMachineScaleSetUpdateVMProfile(Model): 'license_type': {'key': 'licenseType', 'type': 'str'}, } - def __init__(self, os_profile=None, storage_profile=None, network_profile=None, diagnostics_profile=None, extension_profile=None, license_type=None): - super(VirtualMachineScaleSetUpdateVMProfile, self).__init__() - self.os_profile = os_profile - self.storage_profile = storage_profile - self.network_profile = network_profile - self.diagnostics_profile = diagnostics_profile - self.extension_profile = extension_profile - self.license_type = license_type + def __init__(self, **kwargs): + super(VirtualMachineScaleSetUpdateVMProfile, self).__init__(**kwargs) + self.os_profile = kwargs.get('os_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.extension_profile = kwargs.get('extension_profile', None) + self.license_type = kwargs.get('license_type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_vm_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_vm_profile_py3.py new file mode 100644 index 000000000000..c1f00a811741 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_update_vm_profile_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetUpdateVMProfile(Model): + """Describes a virtual machine scale set virtual machine profile. + + :param os_profile: The virtual machine scale set OS profile. + :type os_profile: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetUpdateOSProfile + :param storage_profile: The virtual machine scale set storage profile. + :type storage_profile: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetUpdateStorageProfile + :param network_profile: The virtual machine scale set network profile. + :type network_profile: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetUpdateNetworkProfile + :param diagnostics_profile: The virtual machine scale set diagnostics + profile. + :type diagnostics_profile: + ~azure.mgmt.compute.v2017_12_01.models.DiagnosticsProfile + :param extension_profile: The virtual machine scale set extension profile. + :type extension_profile: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetExtensionProfile + :param license_type: The license type, which is for bring your own license + scenario. + :type license_type: str + """ + + _attribute_map = { + 'os_profile': {'key': 'osProfile', 'type': 'VirtualMachineScaleSetUpdateOSProfile'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'VirtualMachineScaleSetUpdateStorageProfile'}, + 'network_profile': {'key': 'networkProfile', 'type': 'VirtualMachineScaleSetUpdateNetworkProfile'}, + 'diagnostics_profile': {'key': 'diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'extension_profile': {'key': 'extensionProfile', 'type': 'VirtualMachineScaleSetExtensionProfile'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + } + + def __init__(self, *, os_profile=None, storage_profile=None, network_profile=None, diagnostics_profile=None, extension_profile=None, license_type: str=None, **kwargs) -> None: + super(VirtualMachineScaleSetUpdateVMProfile, self).__init__(**kwargs) + self.os_profile = os_profile + self.storage_profile = storage_profile + self.network_profile = network_profile + self.diagnostics_profile = diagnostics_profile + self.extension_profile = extension_profile + self.license_type = license_type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm.py index 1a71ab9e6841..0bde411429e5 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm.py @@ -18,13 +18,15 @@ class VirtualMachineScaleSetVM(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -134,20 +136,20 @@ class VirtualMachineScaleSetVM(Resource): 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, } - def __init__(self, location, tags=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type=None, plan=None): - super(VirtualMachineScaleSetVM, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVM, self).__init__(**kwargs) self.instance_id = None self.sku = None self.latest_model_applied = None self.vm_id = None self.instance_view = None - self.hardware_profile = hardware_profile - self.storage_profile = storage_profile - self.os_profile = os_profile - self.network_profile = network_profile - self.diagnostics_profile = diagnostics_profile - self.availability_set = availability_set + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.os_profile = kwargs.get('os_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.availability_set = kwargs.get('availability_set', None) self.provisioning_state = None - self.license_type = license_type - self.plan = plan + self.license_type = kwargs.get('license_type', None) + self.plan = kwargs.get('plan', None) self.resources = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_extensions_summary.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_extensions_summary.py index f0ab9c5f39dd..ff1707059ddb 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_extensions_summary.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_extensions_summary.py @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMExtensionsSummary(Model): 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, } - def __init__(self): - super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__(**kwargs) self.name = None self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_extensions_summary_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_extensions_summary_py3.py new file mode 100644 index 000000000000..011a808042fc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_extensions_summary_py3.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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMExtensionsSummary(Model): + """Extensions summary for virtual machines of a virtual machine scale set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The extension name. + :vartype name: str + :ivar statuses_summary: The extensions information. + :vartype statuses_summary: + list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineStatusCodeCount] + """ + + _validation = { + 'name': {'readonly': True}, + 'statuses_summary': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineScaleSetVMExtensionsSummary, self).__init__(**kwargs) + self.name = None + self.statuses_summary = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_ids.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_ids.py index 681ab449f3f2..772c66dad326 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_ids.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_ids.py @@ -25,6 +25,6 @@ class VirtualMachineScaleSetVMInstanceIDs(Model): 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, } - def __init__(self, instance_ids=None): - super(VirtualMachineScaleSetVMInstanceIDs, self).__init__() - self.instance_ids = instance_ids + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMInstanceIDs, self).__init__(**kwargs) + self.instance_ids = kwargs.get('instance_ids', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_ids_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_ids_py3.py new file mode 100644 index 000000000000..658a8ccb87d5 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_ids_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineScaleSetVMInstanceIDs(Model): + """Specifies a list of virtual machine instance IDs from the VM scale set. + + :param instance_ids: The virtual machine scale set instance ids. Omitting + the virtual machine scale set instance ids will result in the operation + being performed on all virtual machines in the virtual machine scale set. + :type instance_ids: list[str] + """ + + _attribute_map = { + 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, + } + + def __init__(self, *, instance_ids=None, **kwargs) -> None: + super(VirtualMachineScaleSetVMInstanceIDs, self).__init__(**kwargs) + self.instance_ids = instance_ids diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_required_ids.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_required_ids.py index 2a35798001fa..ece250dd4fd4 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_required_ids.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_required_ids.py @@ -15,7 +15,9 @@ class VirtualMachineScaleSetVMInstanceRequiredIDs(Model): """Specifies a list of virtual machine instance IDs from the VM scale set. - :param instance_ids: The virtual machine scale set instance ids. + All required parameters must be populated in order to send to Azure. + + :param instance_ids: Required. The virtual machine scale set instance ids. :type instance_ids: list[str] """ @@ -27,6 +29,6 @@ class VirtualMachineScaleSetVMInstanceRequiredIDs(Model): 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, } - def __init__(self, instance_ids): - super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__() - self.instance_ids = instance_ids + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__(**kwargs) + self.instance_ids = kwargs.get('instance_ids', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_required_ids_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_required_ids_py3.py new file mode 100644 index 000000000000..f32c6181467d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_required_ids_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMInstanceRequiredIDs(Model): + """Specifies a list of virtual machine instance IDs from the VM scale set. + + All required parameters must be populated in order to send to Azure. + + :param instance_ids: Required. The virtual machine scale set instance ids. + :type instance_ids: list[str] + """ + + _validation = { + 'instance_ids': {'required': True}, + } + + _attribute_map = { + 'instance_ids': {'key': 'instanceIds', 'type': '[str]'}, + } + + def __init__(self, *, instance_ids, **kwargs) -> None: + super(VirtualMachineScaleSetVMInstanceRequiredIDs, self).__init__(**kwargs) + self.instance_ids = instance_ids diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_view.py index 3505681c6e14..b5b91ca14be9 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_view.py @@ -27,6 +27,10 @@ class VirtualMachineScaleSetVMInstanceView(Model): :param vm_agent: The VM Agent running on the virtual machine. :type vm_agent: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineAgentInstanceView + :param maintenance_redeploy_status: The Maintenance Operation status on + the virtual machine. + :type maintenance_redeploy_status: + ~azure.mgmt.compute.v2017_12_01.models.MaintenanceRedeployStatus :param disks: The disks information. :type disks: list[~azure.mgmt.compute.v2017_12_01.models.DiskInstanceView] :param extensions: The extensions information. @@ -59,6 +63,7 @@ class VirtualMachineScaleSetVMInstanceView(Model): 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, + 'maintenance_redeploy_status': {'key': 'maintenanceRedeployStatus', 'type': 'MaintenanceRedeployStatus'}, 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, 'vm_health': {'key': 'vmHealth', 'type': 'VirtualMachineHealthStatus'}, @@ -67,15 +72,16 @@ class VirtualMachineScaleSetVMInstanceView(Model): 'placement_group_id': {'key': 'placementGroupId', 'type': 'str'}, } - def __init__(self, platform_update_domain=None, platform_fault_domain=None, rdp_thumb_print=None, vm_agent=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None, placement_group_id=None): - super(VirtualMachineScaleSetVMInstanceView, self).__init__() - self.platform_update_domain = platform_update_domain - self.platform_fault_domain = platform_fault_domain - self.rdp_thumb_print = rdp_thumb_print - self.vm_agent = vm_agent - self.disks = disks - self.extensions = extensions + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMInstanceView, self).__init__(**kwargs) + self.platform_update_domain = kwargs.get('platform_update_domain', None) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.rdp_thumb_print = kwargs.get('rdp_thumb_print', None) + self.vm_agent = kwargs.get('vm_agent', None) + self.maintenance_redeploy_status = kwargs.get('maintenance_redeploy_status', None) + self.disks = kwargs.get('disks', None) + self.extensions = kwargs.get('extensions', None) self.vm_health = None - self.boot_diagnostics = boot_diagnostics - self.statuses = statuses - self.placement_group_id = placement_group_id + self.boot_diagnostics = kwargs.get('boot_diagnostics', None) + self.statuses = kwargs.get('statuses', None) + self.placement_group_id = kwargs.get('placement_group_id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_view_py3.py new file mode 100644 index 000000000000..61fbe15427fa --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_view_py3.py @@ -0,0 +1,87 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMInstanceView(Model): + """The instance view of a virtual machine scale set VM. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param platform_update_domain: The Update Domain count. + :type platform_update_domain: int + :param platform_fault_domain: The Fault Domain count. + :type platform_fault_domain: int + :param rdp_thumb_print: The Remote desktop certificate thumbprint. + :type rdp_thumb_print: str + :param vm_agent: The VM Agent running on the virtual machine. + :type vm_agent: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineAgentInstanceView + :param maintenance_redeploy_status: The Maintenance Operation status on + the virtual machine. + :type maintenance_redeploy_status: + ~azure.mgmt.compute.v2017_12_01.models.MaintenanceRedeployStatus + :param disks: The disks information. + :type disks: list[~azure.mgmt.compute.v2017_12_01.models.DiskInstanceView] + :param extensions: The extensions information. + :type extensions: + list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtensionInstanceView] + :ivar vm_health: The health status for the VM. + :vartype vm_health: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineHealthStatus + :param boot_diagnostics: Boot Diagnostics is a debugging feature which + allows you to view Console Output and Screenshot to diagnose VM status. +

    For Linux Virtual Machines, you can easily view the output of + your console log.

    For both Windows and Linux virtual machines, + Azure also enables you to see a screenshot of the VM from the hypervisor. + :type boot_diagnostics: + ~azure.mgmt.compute.v2017_12_01.models.BootDiagnosticsInstanceView + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2017_12_01.models.InstanceViewStatus] + :param placement_group_id: The placement group in which the VM is running. + If the VM is deallocated it will not have a placementGroupId. + :type placement_group_id: str + """ + + _validation = { + 'vm_health': {'readonly': True}, + } + + _attribute_map = { + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'int'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, + 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, + 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, + 'maintenance_redeploy_status': {'key': 'maintenanceRedeployStatus', 'type': 'MaintenanceRedeployStatus'}, + 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, + 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, + 'vm_health': {'key': 'vmHealth', 'type': 'VirtualMachineHealthStatus'}, + 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnosticsInstanceView'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + 'placement_group_id': {'key': 'placementGroupId', 'type': 'str'}, + } + + def __init__(self, *, platform_update_domain: int=None, platform_fault_domain: int=None, rdp_thumb_print: str=None, vm_agent=None, maintenance_redeploy_status=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None, placement_group_id: str=None, **kwargs) -> None: + super(VirtualMachineScaleSetVMInstanceView, self).__init__(**kwargs) + self.platform_update_domain = platform_update_domain + self.platform_fault_domain = platform_fault_domain + self.rdp_thumb_print = rdp_thumb_print + self.vm_agent = vm_agent + self.maintenance_redeploy_status = maintenance_redeploy_status + self.disks = disks + self.extensions = extensions + self.vm_health = None + self.boot_diagnostics = boot_diagnostics + self.statuses = statuses + self.placement_group_id = placement_group_id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_profile.py index 3759373a5bf0..bdb4ae6c5d27 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_profile.py @@ -62,12 +62,12 @@ class VirtualMachineScaleSetVMProfile(Model): 'priority': {'key': 'priority', 'type': 'str'}, } - def __init__(self, os_profile=None, storage_profile=None, network_profile=None, diagnostics_profile=None, extension_profile=None, license_type=None, priority=None): - super(VirtualMachineScaleSetVMProfile, self).__init__() - self.os_profile = os_profile - self.storage_profile = storage_profile - self.network_profile = network_profile - self.diagnostics_profile = diagnostics_profile - self.extension_profile = extension_profile - self.license_type = license_type - self.priority = priority + def __init__(self, **kwargs): + super(VirtualMachineScaleSetVMProfile, self).__init__(**kwargs) + self.os_profile = kwargs.get('os_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.extension_profile = kwargs.get('extension_profile', None) + self.license_type = kwargs.get('license_type', None) + self.priority = kwargs.get('priority', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_profile_py3.py new file mode 100644 index 000000000000..fcc00ea650e7 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_profile_py3.py @@ -0,0 +1,73 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineScaleSetVMProfile(Model): + """Describes a virtual machine scale set virtual machine profile. + + :param os_profile: Specifies the operating system settings for the virtual + machines in the scale set. + :type os_profile: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetOSProfile + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetStorageProfile + :param network_profile: Specifies properties of the network interfaces of + the virtual machines in the scale set. + :type network_profile: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetNetworkProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. +

    Minimum api-version: 2015-06-15. + :type diagnostics_profile: + ~azure.mgmt.compute.v2017_12_01.models.DiagnosticsProfile + :param extension_profile: Specifies a collection of settings for + extensions installed on virtual machines in the scale set. + :type extension_profile: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetExtensionProfile + :param license_type: Specifies that the image or disk that is being used + was licensed on-premises. This element is only used for images that + contain the Windows Server operating system.

    Possible values are: +

    Windows_Client

    Windows_Server

    If this element + is included in a request for an update, the value must match the initial + value. This value cannot be updated.

    For more information, see + [Azure Hybrid Use Benefit for Windows + Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Minimum api-version: 2015-06-15 + :type license_type: str + :param priority: Specifies the priority for the virtual machines in the + scale set.

    Minimum api-version: 2017-10-30-preview. Possible + values include: 'Regular', 'Low' + :type priority: str or + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachinePriorityTypes + """ + + _attribute_map = { + 'os_profile': {'key': 'osProfile', 'type': 'VirtualMachineScaleSetOSProfile'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'VirtualMachineScaleSetStorageProfile'}, + 'network_profile': {'key': 'networkProfile', 'type': 'VirtualMachineScaleSetNetworkProfile'}, + 'diagnostics_profile': {'key': 'diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'extension_profile': {'key': 'extensionProfile', 'type': 'VirtualMachineScaleSetExtensionProfile'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'str'}, + } + + def __init__(self, *, os_profile=None, storage_profile=None, network_profile=None, diagnostics_profile=None, extension_profile=None, license_type: str=None, priority=None, **kwargs) -> None: + super(VirtualMachineScaleSetVMProfile, self).__init__(**kwargs) + self.os_profile = os_profile + self.storage_profile = storage_profile + self.network_profile = network_profile + self.diagnostics_profile = diagnostics_profile + self.extension_profile = extension_profile + self.license_type = license_type + self.priority = priority diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_py3.py new file mode 100644 index 000000000000..1f8c9ce7d927 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_py3.py @@ -0,0 +1,155 @@ +# 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 .resource import Resource + + +class VirtualMachineScaleSetVM(Resource): + """Describes a virtual machine scale set virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar instance_id: The virtual machine instance ID. + :vartype instance_id: str + :ivar sku: The virtual machine SKU. + :vartype sku: ~azure.mgmt.compute.v2017_12_01.models.Sku + :ivar latest_model_applied: Specifies whether the latest model has been + applied to the virtual machine. + :vartype latest_model_applied: bool + :ivar vm_id: Azure VM unique ID. + :vartype vm_id: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineInstanceView + :param hardware_profile: Specifies the hardware settings for the virtual + machine. + :type hardware_profile: + ~azure.mgmt.compute.v2017_12_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2017_12_01.models.StorageProfile + :param os_profile: Specifies the operating system settings for the virtual + machine. + :type os_profile: ~azure.mgmt.compute.v2017_12_01.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual + machine. + :type network_profile: + ~azure.mgmt.compute.v2017_12_01.models.NetworkProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. +

    Minimum api-version: 2015-06-15. + :type diagnostics_profile: + ~azure.mgmt.compute.v2017_12_01.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set + that the virtual machine should be assigned to. Virtual machines specified + in the same availability set are allocated to different nodes to maximize + availability. For more information about availability sets, see [Manage + the availability of virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + :type availability_set: ~azure.mgmt.compute.v2017_12_01.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :param license_type: Specifies that the image or disk that is being used + was licensed on-premises. This element is only used for images that + contain the Windows Server operating system.

    Possible values are: +

    Windows_Client

    Windows_Server

    If this element + is included in a request for an update, the value must match the initial + value. This value cannot be updated.

    For more information, see + [Azure Hybrid Use Benefit for Windows + Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Minimum api-version: 2015-06-15 + :type license_type: str + :param plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2017_12_01.models.Plan + :ivar resources: The virtual machine child extension resources. + :vartype resources: + list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtension] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'instance_id': {'readonly': True}, + 'sku': {'readonly': True}, + 'latest_model_applied': {'readonly': True}, + 'vm_id': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'instance_id': {'key': 'instanceId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'latest_model_applied': {'key': 'properties.latestModelApplied', 'type': 'bool'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'resources': {'key': 'resources', 'type': '[VirtualMachineExtension]'}, + } + + def __init__(self, *, location: str, tags=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type: str=None, plan=None, **kwargs) -> None: + super(VirtualMachineScaleSetVM, self).__init__(location=location, tags=tags, **kwargs) + self.instance_id = None + self.sku = None + self.latest_model_applied = None + self.vm_id = None + self.instance_view = None + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.os_profile = os_profile + self.network_profile = network_profile + self.diagnostics_profile = diagnostics_profile + self.availability_set = availability_set + self.provisioning_state = None + self.license_type = license_type + self.plan = plan + self.resources = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_size.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_size.py index 3f4fa7f06b70..0fef3efd6c8e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_size.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_size.py @@ -43,11 +43,11 @@ class VirtualMachineSize(Model): 'max_data_disk_count': {'key': 'maxDataDiskCount', 'type': 'int'}, } - def __init__(self, name=None, number_of_cores=None, os_disk_size_in_mb=None, resource_disk_size_in_mb=None, memory_in_mb=None, max_data_disk_count=None): - super(VirtualMachineSize, self).__init__() - self.name = name - self.number_of_cores = number_of_cores - self.os_disk_size_in_mb = os_disk_size_in_mb - self.resource_disk_size_in_mb = resource_disk_size_in_mb - self.memory_in_mb = memory_in_mb - self.max_data_disk_count = max_data_disk_count + def __init__(self, **kwargs): + super(VirtualMachineSize, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.number_of_cores = kwargs.get('number_of_cores', None) + self.os_disk_size_in_mb = kwargs.get('os_disk_size_in_mb', None) + self.resource_disk_size_in_mb = kwargs.get('resource_disk_size_in_mb', None) + self.memory_in_mb = kwargs.get('memory_in_mb', None) + self.max_data_disk_count = kwargs.get('max_data_disk_count', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_size_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_size_py3.py new file mode 100644 index 000000000000..9f99ba20ce42 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_size_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class VirtualMachineSize(Model): + """Describes the properties of a VM size. + + :param name: The name of the virtual machine size. + :type name: str + :param number_of_cores: The number of cores supported by the virtual + machine size. + :type number_of_cores: int + :param os_disk_size_in_mb: The OS disk size, in MB, allowed by the virtual + machine size. + :type os_disk_size_in_mb: int + :param resource_disk_size_in_mb: The resource disk size, in MB, allowed by + the virtual machine size. + :type resource_disk_size_in_mb: int + :param memory_in_mb: The amount of memory, in MB, supported by the virtual + machine size. + :type memory_in_mb: int + :param max_data_disk_count: The maximum number of data disks that can be + attached to the virtual machine size. + :type max_data_disk_count: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'number_of_cores': {'key': 'numberOfCores', 'type': 'int'}, + 'os_disk_size_in_mb': {'key': 'osDiskSizeInMB', 'type': 'int'}, + 'resource_disk_size_in_mb': {'key': 'resourceDiskSizeInMB', 'type': 'int'}, + 'memory_in_mb': {'key': 'memoryInMB', 'type': 'int'}, + 'max_data_disk_count': {'key': 'maxDataDiskCount', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, number_of_cores: int=None, os_disk_size_in_mb: int=None, resource_disk_size_in_mb: int=None, memory_in_mb: int=None, max_data_disk_count: int=None, **kwargs) -> None: + super(VirtualMachineSize, self).__init__(**kwargs) + self.name = name + self.number_of_cores = number_of_cores + self.os_disk_size_in_mb = os_disk_size_in_mb + self.resource_disk_size_in_mb = resource_disk_size_in_mb + self.memory_in_mb = memory_in_mb + self.max_data_disk_count = max_data_disk_count diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_status_code_count.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_status_code_count.py index 177515706064..7df7b702acd7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_status_code_count.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_status_code_count.py @@ -35,7 +35,7 @@ class VirtualMachineStatusCodeCount(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self): - super(VirtualMachineStatusCodeCount, self).__init__() + def __init__(self, **kwargs): + super(VirtualMachineStatusCodeCount, self).__init__(**kwargs) self.code = None self.count = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_status_code_count_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_status_code_count_py3.py new file mode 100644 index 000000000000..c38800073a95 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_status_code_count_py3.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 msrest.serialization import Model + + +class VirtualMachineStatusCodeCount(Model): + """The status code and count of the virtual machine scale set instance view + status summary. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The instance view status code. + :vartype code: str + :ivar count: The number of instances having a particular status code. + :vartype count: int + """ + + _validation = { + 'code': {'readonly': True}, + 'count': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineStatusCodeCount, self).__init__(**kwargs) + self.code = None + self.count = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_update.py new file mode 100644 index 000000000000..6c929e30f167 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_update.py @@ -0,0 +1,126 @@ +# 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 .update_resource import UpdateResource + + +class VirtualMachineUpdate(UpdateResource): + """Describes a Virtual Machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2017_12_01.models.Plan + :param hardware_profile: Specifies the hardware settings for the virtual + machine. + :type hardware_profile: + ~azure.mgmt.compute.v2017_12_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2017_12_01.models.StorageProfile + :param os_profile: Specifies the operating system settings for the virtual + machine. + :type os_profile: ~azure.mgmt.compute.v2017_12_01.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual + machine. + :type network_profile: + ~azure.mgmt.compute.v2017_12_01.models.NetworkProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. +

    Minimum api-version: 2015-06-15. + :type diagnostics_profile: + ~azure.mgmt.compute.v2017_12_01.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set + that the virtual machine should be assigned to. Virtual machines specified + in the same availability set are allocated to different nodes to maximize + availability. For more information about availability sets, see [Manage + the availability of virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + :type availability_set: ~azure.mgmt.compute.v2017_12_01.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used + was licensed on-premises. This element is only used for images that + contain the Windows Server operating system.

    Possible values are: +

    Windows_Client

    Windows_Server

    If this element + is included in a request for an update, the value must match the initial + value. This value cannot be updated.

    For more information, see + [Azure Hybrid Use Benefit for Windows + Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Minimum api-version: 2015-06-15 + :type license_type: str + :ivar vm_id: Specifies the VM unique ID which is a 128-bits identifier + that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read + using platform BIOS commands. + :vartype vm_id: str + :param identity: The identity of the virtual machine, if configured. + :type identity: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineIdentity + :param zones: The virtual machine zones. + :type zones: list[str] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'vm_id': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineIdentity'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(VirtualMachineUpdate, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.os_profile = kwargs.get('os_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.availability_set = kwargs.get('availability_set', None) + self.provisioning_state = None + self.instance_view = None + self.license_type = kwargs.get('license_type', None) + self.vm_id = None + self.identity = kwargs.get('identity', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_update_py3.py new file mode 100644 index 000000000000..750c42bc1893 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_update_py3.py @@ -0,0 +1,126 @@ +# 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 .update_resource import UpdateResource + + +class VirtualMachineUpdate(UpdateResource): + """Describes a Virtual Machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2017_12_01.models.Plan + :param hardware_profile: Specifies the hardware settings for the virtual + machine. + :type hardware_profile: + ~azure.mgmt.compute.v2017_12_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2017_12_01.models.StorageProfile + :param os_profile: Specifies the operating system settings for the virtual + machine. + :type os_profile: ~azure.mgmt.compute.v2017_12_01.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual + machine. + :type network_profile: + ~azure.mgmt.compute.v2017_12_01.models.NetworkProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. +

    Minimum api-version: 2015-06-15. + :type diagnostics_profile: + ~azure.mgmt.compute.v2017_12_01.models.DiagnosticsProfile + :param availability_set: Specifies information about the availability set + that the virtual machine should be assigned to. Virtual machines specified + in the same availability set are allocated to different nodes to maximize + availability. For more information about availability sets, see [Manage + the availability of virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +

    For more information on Azure planned maintainance, see [Planned + maintenance for virtual machines in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + :type availability_set: ~azure.mgmt.compute.v2017_12_01.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used + was licensed on-premises. This element is only used for images that + contain the Windows Server operating system.

    Possible values are: +

    Windows_Client

    Windows_Server

    If this element + is included in a request for an update, the value must match the initial + value. This value cannot be updated.

    For more information, see + [Azure Hybrid Use Benefit for Windows + Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

    Minimum api-version: 2015-06-15 + :type license_type: str + :ivar vm_id: Specifies the VM unique ID which is a 128-bits identifier + that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read + using platform BIOS commands. + :vartype vm_id: str + :param identity: The identity of the virtual machine, if configured. + :type identity: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineIdentity + :param zones: The virtual machine zones. + :type zones: list[str] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'vm_id': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineIdentity'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, tags=None, plan=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type: str=None, identity=None, zones=None, **kwargs) -> None: + super(VirtualMachineUpdate, self).__init__(tags=tags, **kwargs) + self.plan = plan + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.os_profile = os_profile + self.network_profile = network_profile + self.diagnostics_profile = diagnostics_profile + self.availability_set = availability_set + self.provisioning_state = None + self.instance_view = None + self.license_type = license_type + self.vm_id = None + self.identity = identity + self.zones = zones diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/win_rm_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/win_rm_configuration.py index 413e1b5b4d09..d8ac60610714 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/win_rm_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/win_rm_configuration.py @@ -24,6 +24,6 @@ class WinRMConfiguration(Model): 'listeners': {'key': 'listeners', 'type': '[WinRMListener]'}, } - def __init__(self, listeners=None): - super(WinRMConfiguration, self).__init__() - self.listeners = listeners + def __init__(self, **kwargs): + super(WinRMConfiguration, self).__init__(**kwargs) + self.listeners = kwargs.get('listeners', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/win_rm_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/win_rm_configuration_py3.py new file mode 100644 index 000000000000..6a75a94247b6 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/win_rm_configuration_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WinRMConfiguration(Model): + """Describes Windows Remote Management configuration of the VM. + + :param listeners: The list of Windows Remote Management listeners + :type listeners: + list[~azure.mgmt.compute.v2017_12_01.models.WinRMListener] + """ + + _attribute_map = { + 'listeners': {'key': 'listeners', 'type': '[WinRMListener]'}, + } + + def __init__(self, *, listeners=None, **kwargs) -> None: + super(WinRMConfiguration, self).__init__(**kwargs) + self.listeners = listeners diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/win_rm_listener.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/win_rm_listener.py index ba753dd9a79b..223d34368cfa 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/win_rm_listener.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/win_rm_listener.py @@ -36,7 +36,7 @@ class WinRMListener(Model): 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, } - def __init__(self, protocol=None, certificate_url=None): - super(WinRMListener, self).__init__() - self.protocol = protocol - self.certificate_url = certificate_url + def __init__(self, **kwargs): + super(WinRMListener, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.certificate_url = kwargs.get('certificate_url', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/win_rm_listener_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/win_rm_listener_py3.py new file mode 100644 index 000000000000..e6e57e1197e9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/win_rm_listener_py3.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 msrest.serialization import Model + + +class WinRMListener(Model): + """Describes Protocol and thumbprint of Windows Remote Management listener. + + :param protocol: Specifies the protocol of listener.

    Possible + values are:
    **http**

    **https**. Possible values include: + 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.compute.v2017_12_01.models.ProtocolTypes + :param 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](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + In this case, your certificate needs to be It is the Base64 encoding of + the following JSON Object which is encoded in UTF-8:

    {
    + "data":"",
    "dataType":"pfx",
    + "password":""
    } + :type certificate_url: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'ProtocolTypes'}, + 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, + } + + def __init__(self, *, protocol=None, certificate_url: str=None, **kwargs) -> None: + super(WinRMListener, self).__init__(**kwargs) + self.protocol = protocol + self.certificate_url = certificate_url diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/windows_configuration.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/windows_configuration.py index b53cac462ac3..4b4016a17154 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/windows_configuration.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/windows_configuration.py @@ -45,10 +45,10 @@ class WindowsConfiguration(Model): 'win_rm': {'key': 'winRM', 'type': 'WinRMConfiguration'}, } - def __init__(self, provision_vm_agent=None, enable_automatic_updates=None, time_zone=None, additional_unattend_content=None, win_rm=None): - super(WindowsConfiguration, self).__init__() - 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.win_rm = win_rm + def __init__(self, **kwargs): + super(WindowsConfiguration, self).__init__(**kwargs) + self.provision_vm_agent = kwargs.get('provision_vm_agent', None) + self.enable_automatic_updates = kwargs.get('enable_automatic_updates', None) + self.time_zone = kwargs.get('time_zone', None) + self.additional_unattend_content = kwargs.get('additional_unattend_content', None) + self.win_rm = kwargs.get('win_rm', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/windows_configuration_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/windows_configuration_py3.py new file mode 100644 index 000000000000..8f7e37c98e4c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/windows_configuration_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class WindowsConfiguration(Model): + """Specifies Windows operating system settings on the virtual machine. + + :param 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. + :type provision_vm_agent: bool + :param enable_automatic_updates: Indicates whether virtual machine is + enabled for automatic updates. + :type enable_automatic_updates: bool + :param time_zone: Specifies the time zone of the virtual machine. e.g. + "Pacific Standard Time" + :type time_zone: str + :param 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. + :type additional_unattend_content: + list[~azure.mgmt.compute.v2017_12_01.models.AdditionalUnattendContent] + :param win_rm: Specifies the Windows Remote Management listeners. This + enables remote Windows PowerShell. + :type win_rm: ~azure.mgmt.compute.v2017_12_01.models.WinRMConfiguration + """ + + _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]'}, + 'win_rm': {'key': 'winRM', 'type': 'WinRMConfiguration'}, + } + + def __init__(self, *, provision_vm_agent: bool=None, enable_automatic_updates: bool=None, time_zone: str=None, additional_unattend_content=None, win_rm=None, **kwargs) -> None: + super(WindowsConfiguration, self).__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.win_rm = win_rm diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/__init__.py index a60ef67c1486..bd63cedf0141 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/__init__.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/__init__.py @@ -9,6 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- +from .operations import Operations from .availability_sets_operations import AvailabilitySetsOperations from .virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations from .virtual_machine_extensions_operations import VirtualMachineExtensionsOperations @@ -21,9 +22,11 @@ from .virtual_machine_scale_set_extensions_operations import VirtualMachineScaleSetExtensionsOperations from .virtual_machine_scale_set_rolling_upgrades_operations import VirtualMachineScaleSetRollingUpgradesOperations from .virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations +from .log_analytics_operations import LogAnalyticsOperations from .virtual_machine_run_commands_operations import VirtualMachineRunCommandsOperations __all__ = [ + 'Operations', 'AvailabilitySetsOperations', 'VirtualMachineExtensionImagesOperations', 'VirtualMachineExtensionsOperations', @@ -36,5 +39,6 @@ 'VirtualMachineScaleSetExtensionsOperations', 'VirtualMachineScaleSetRollingUpgradesOperations', 'VirtualMachineScaleSetVMsOperations', + 'LogAnalyticsOperations', 'VirtualMachineRunCommandsOperations', ] diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/availability_sets_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/availability_sets_operations.py index 1417ab1beeff..5e2cc0d7f116 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/availability_sets_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/availability_sets_operations.py @@ -22,7 +22,7 @@ class AvailabilitySetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-12-01". """ @@ -60,7 +60,7 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -105,6 +105,77 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} + + def update( + self, resource_group_name, availability_set_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update an availability set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param availability_set_name: The name of the availability set. + :type availability_set_name: str + :param parameters: Parameters supplied to the Update Availability Set + operation. + :type parameters: + ~azure.mgmt.compute.v2017_12_01.models.AvailabilitySetUpdate + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AvailabilitySet or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.compute.v2017_12_01.models.AvailabilitySet or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AvailabilitySetUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AvailabilitySet', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} def delete( self, resource_group_name, availability_set_name, custom_headers=None, raw=False, **operation_config): @@ -125,7 +196,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -166,6 +237,7 @@ def delete( return client_raw_response return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} def get( self, resource_group_name, availability_set_name, custom_headers=None, raw=False, **operation_config): @@ -186,7 +258,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -227,6 +299,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -248,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -294,6 +367,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets'} def list_available_sizes( self, resource_group_name, availability_set_name, custom_headers=None, raw=False, **operation_config): @@ -318,7 +392,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes' + url = self.list_available_sizes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), @@ -365,3 +439,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_available_sizes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/images_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/images_operations.py index f5522fbf933b..34a376803fc1 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/images_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/images_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ImagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, image_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'imageName': self._serialize.url("image_name", image_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, image_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, image_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update an image. :param resource_group_name: The name of the resource group. @@ -102,13 +102,16 @@ def create_or_update( :param parameters: Parameters supplied to the Create Image operation. :type parameters: ~azure.mgmt.compute.v2017_12_01.models.Image :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Image or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Image or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.Image] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.Image]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -119,30 +122,110 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result + + def get_long_running_output(response): + deserialized = self._deserialize('Image', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} + + + def _update_initial( + self, resource_group_name, image_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ImageUpdate') # Construct and send request - def long_running_send(): - return raw_result.response + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - def get_long_running_status(status_link, headers=None): + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) + deserialized = None - def get_long_running_output(response): + if response.status_code == 200: + deserialized = self._deserialize('Image', response) + if response.status_code == 201: + deserialized = self._deserialize('Image', response) - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + + def update( + self, resource_group_name, image_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Update an image. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param image_name: The name of the image. + :type image_name: str + :param parameters: Parameters supplied to the Update Image operation. + :type parameters: ~azure.mgmt.compute.v2017_12_01.models.ImageUpdate + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Image or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.Image] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.Image]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + image_name=image_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): deserialized = self._deserialize('Image', response) if raw: @@ -151,18 +234,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} def _delete_initial( self, resource_group_name, image_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'imageName': self._serialize.url("image_name", image_name, 'str'), @@ -205,7 +290,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, image_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, image_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -213,13 +298,16 @@ def delete( :param image_name: The name of the image. :type image_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -229,30 +317,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -261,12 +327,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} def get( self, resource_group_name, image_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -289,7 +357,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'imageName': self._serialize.url("image_name", image_name, 'str'), @@ -332,6 +400,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -353,7 +422,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -399,6 +468,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -420,7 +490,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -465,3 +535,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/log_analytics_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/log_analytics_operations.py new file mode 100644 index 000000000000..939b62a0e59f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/log_analytics_operations.py @@ -0,0 +1,242 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class LogAnalyticsOperations(object): + """LogAnalyticsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-12-01" + + self.config = config + + + def _export_request_rate_by_interval_initial( + self, parameters, location, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.export_request_rate_by_interval.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'RequestRateByIntervalInput') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LogAnalyticsOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def export_request_rate_by_interval( + self, parameters, location, custom_headers=None, raw=False, polling=True, **operation_config): + """Export logs that show Api requests made by this subscription in the + given time window to show throttling activities. + + :param parameters: Parameters supplied to the LogAnalytics + getRequestRateByInterval Api. + :type parameters: + ~azure.mgmt.compute.v2017_12_01.models.RequestRateByIntervalInput + :param location: The location upon which virtual-machine-sizes is + queried. + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + LogAnalyticsOperationResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.LogAnalyticsOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.LogAnalyticsOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._export_request_rate_by_interval_initial( + parameters=parameters, + location=location, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('LogAnalyticsOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + export_request_rate_by_interval.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval'} + + + def _export_throttled_requests_initial( + self, parameters, location, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.export_throttled_requests.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ThrottledRequestsInput') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LogAnalyticsOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def export_throttled_requests( + self, parameters, location, custom_headers=None, raw=False, polling=True, **operation_config): + """Export logs that show total throttled Api requests for this + subscription in the given time window. + + :param parameters: Parameters supplied to the LogAnalytics + getThrottledRequests Api. + :type parameters: + ~azure.mgmt.compute.v2017_12_01.models.ThrottledRequestsInput + :param location: The location upon which virtual-machine-sizes is + queried. + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + LogAnalyticsOperationResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.LogAnalyticsOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.LogAnalyticsOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._export_throttled_requests_initial( + parameters=parameters, + location=location, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('LogAnalyticsOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + export_throttled_requests.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/operations.py new file mode 100644 index 000000000000..5681f620623e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/operations.py @@ -0,0 +1,99 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-12-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of compute operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ComputeOperationValue + :rtype: + ~azure.mgmt.compute.v2017_12_01.models.ComputeOperationValuePaged[~azure.mgmt.compute.v2017_12_01.models.ComputeOperationValue] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ComputeOperationValuePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ComputeOperationValuePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Compute/operations'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/usage_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/usage_operations.py index 315f76a92077..11805c1bafdb 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/usage_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/usage_operations.py @@ -22,7 +22,7 @@ class UsageOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-12-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -105,3 +105,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_extension_images_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_extension_images_operations.py index 781cc274f9bc..a4f70c5e6e2e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_extension_images_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_extension_images_operations.py @@ -22,7 +22,7 @@ class VirtualMachineExtensionImagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-12-01". """ @@ -61,7 +61,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}' + url = self.get.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -104,6 +104,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}'} def list_types( self, location, publisher_name, custom_headers=None, raw=False, **operation_config): @@ -125,7 +126,7 @@ def list_types( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types' + url = self.list_types.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -166,6 +167,7 @@ def list_types( return client_raw_response return deserialized + list_types.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types'} def list_versions( self, location, publisher_name, type, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): @@ -195,7 +197,7 @@ def list_versions( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions' + url = self.list_versions.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -243,3 +245,4 @@ def list_versions( return client_raw_response return deserialized + list_versions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_extensions_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_extensions_operations.py index bc308915044d..dce894b5633a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_extensions_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_extensions_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineExtensionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -93,7 +93,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -108,13 +108,16 @@ def create_or_update( :type extension_parameters: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtension :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineExtension or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachineExtension + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtension] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtension]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -126,30 +129,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineExtension', response) if raw: @@ -158,18 +139,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} def _delete_initial( self, resource_group_name, vm_name, vm_extension_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -213,7 +196,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_name, vm_extension_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, vm_extension_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -224,13 +207,16 @@ def delete( :param vm_extension_name: The name of the virtual machine extension. :type vm_extension_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -241,30 +227,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -273,12 +237,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} def get( self, resource_group_name, vm_name, vm_extension_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -304,7 +270,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -348,3 +314,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_images_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_images_operations.py index 75a15cca5d76..e53a3fccdfe0 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_images_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_images_operations.py @@ -22,7 +22,7 @@ class VirtualMachineImagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-12-01". """ @@ -62,7 +62,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}' + url = self.get.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -106,6 +106,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}'} def list( self, location, publisher_name, offer, skus, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): @@ -138,7 +139,7 @@ def list( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -187,6 +188,7 @@ def list( return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions'} def list_offers( self, location, publisher_name, custom_headers=None, raw=False, **operation_config): @@ -209,7 +211,7 @@ def list_offers( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers' + url = self.list_offers.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -250,6 +252,7 @@ def list_offers( return client_raw_response return deserialized + list_offers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers'} def list_publishers( self, location, custom_headers=None, raw=False, **operation_config): @@ -270,7 +273,7 @@ def list_publishers( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers' + url = self.list_publishers.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -310,6 +313,7 @@ def list_publishers( return client_raw_response return deserialized + list_publishers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers'} def list_skus( self, location, publisher_name, offer, custom_headers=None, raw=False, **operation_config): @@ -334,7 +338,7 @@ def list_skus( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus' + url = self.list_skus.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'publisherName': self._serialize.url("publisher_name", publisher_name, 'str'), @@ -376,3 +380,4 @@ def list_skus( return client_raw_response return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_run_commands_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_run_commands_operations.py index d53322624535..b150d3aac5e3 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_run_commands_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_run_commands_operations.py @@ -22,7 +22,7 @@ class VirtualMachineRunCommandsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-12-01". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -103,6 +103,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands'} def get( self, location, command_id, custom_headers=None, raw=False, **operation_config): @@ -123,7 +124,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}' + url = self.get.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'commandId': self._serialize.url("command_id", command_id, 'str'), @@ -164,3 +165,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_set_extensions_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_set_extensions_operations.py index 03742a236b33..3804ba43e51b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_set_extensions_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_set_extensions_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineScaleSetExtensionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, vm_scale_set_name, vmss_extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -93,7 +93,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, vm_scale_set_name, vmss_extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, vmss_extension_name, extension_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -108,13 +108,17 @@ def create_or_update( :type extension_parameters: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetExtension :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineScaleSetExtension or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualMachineScaleSetExtension or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetExtension] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetExtension]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -126,30 +130,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineScaleSetExtension', response) if raw: @@ -158,18 +140,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} def _delete_initial( self, resource_group_name, vm_scale_set_name, vmss_extension_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -213,7 +197,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_scale_set_name, vmss_extension_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, vmss_extension_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -224,13 +208,16 @@ def delete( :param vmss_extension_name: The name of the VM scale set extension. :type vmss_extension_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -241,30 +228,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -273,12 +238,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} def get( self, resource_group_name, vm_scale_set_name, vmss_extension_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -306,7 +273,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -350,6 +317,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'} def list( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -374,7 +342,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -421,3 +389,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_set_rolling_upgrades_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_set_rolling_upgrades_operations.py index e794229c13f0..064485bea0c8 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_set_rolling_upgrades_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _cancel_initial( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel' + url = self.cancel.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -86,7 +86,7 @@ def _cancel_initial( return deserialized def cancel( - self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, polling=True, **operation_config): """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -94,13 +94,16 @@ def cancel( :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._cancel_initial( @@ -110,30 +113,8 @@ def cancel( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -142,18 +123,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel'} def _start_os_upgrade_initial( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade' + url = self.start_os_upgrade.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -196,7 +179,7 @@ def _start_os_upgrade_initial( return deserialized def start_os_upgrade( - self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, polling=True, **operation_config): """Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not @@ -207,13 +190,16 @@ def start_os_upgrade( :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_os_upgrade_initial( @@ -223,30 +209,8 @@ def start_os_upgrade( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -255,12 +219,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start_os_upgrade.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade'} def get_latest( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -283,7 +249,7 @@ def get_latest( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest' + url = self.get_latest.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -324,3 +290,4 @@ def get_latest( return client_raw_response return deserialized + get_latest.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_set_vms_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_set_vms_operations.py index 632fd503651f..6682590a3781 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_set_vms_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_set_vms_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _reimage_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage' + url = self.reimage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -87,7 +87,7 @@ def _reimage_initial( return deserialized def reimage( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. @@ -98,13 +98,16 @@ def reimage( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._reimage_initial( @@ -115,30 +118,8 @@ def reimage( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -147,18 +128,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage'} def _reimage_all_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall' + url = self.reimage_all.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -202,7 +185,7 @@ def _reimage_all_initial( return deserialized def reimage_all( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. @@ -214,13 +197,16 @@ def reimage_all( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._reimage_all_initial( @@ -231,30 +217,8 @@ def reimage_all( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -263,18 +227,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reimage_all.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall'} def _deallocate_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate' + url = self.deallocate.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -318,7 +284,7 @@ def _deallocate_initial( return deserialized def deallocate( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is @@ -331,13 +297,16 @@ def deallocate( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._deallocate_initial( @@ -348,30 +317,8 @@ def deallocate( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -380,18 +327,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate'} def _update_initial( self, resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -441,7 +390,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -456,13 +405,17 @@ def update( :type parameters: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetVM :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineScaleSetVM or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualMachineScaleSetVM or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetVM] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetVM]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -474,30 +427,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineScaleSetVM', response) if raw: @@ -506,18 +437,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} def _delete_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -561,7 +494,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -571,13 +504,16 @@ def delete( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -588,30 +524,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -620,12 +534,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} def get( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): @@ -649,7 +565,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -691,6 +607,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'} def get_instance_view( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): @@ -715,7 +632,7 @@ def get_instance_view( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView' + url = self.get_instance_view.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -757,6 +674,7 @@ def get_instance_view( return client_raw_response return deserialized + get_instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView'} def list( self, resource_group_name, virtual_machine_scale_set_name, filter=None, select=None, expand=None, custom_headers=None, raw=False, **operation_config): @@ -786,7 +704,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -839,12 +757,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines'} def _power_off_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff' + url = self.power_off.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -888,7 +807,7 @@ def _power_off_initial( return deserialized def power_off( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid @@ -901,13 +820,16 @@ def power_off( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._power_off_initial( @@ -918,30 +840,8 @@ def power_off( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -950,18 +850,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff'} def _restart_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart' + url = self.restart.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1005,7 +907,7 @@ def _restart_initial( return deserialized def restart( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1015,13 +917,16 @@ def restart( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._restart_initial( @@ -1032,30 +937,8 @@ def restart( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1064,18 +947,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart'} def _start_initial( self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1119,7 +1004,7 @@ def _start_initial( return deserialized def start( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1129,13 +1014,16 @@ def start( :param instance_id: The instance ID of the virtual machine. :type instance_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -1146,30 +1034,202 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start'} + + + def _redeploy_initial( + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.redeploy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - def long_running_send(): - return raw_result.response + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) - def get_long_running_status(status_link, headers=None): + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def redeploy( + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Redeploys a virtual machine in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] + :raises: :class:`CloudError` + """ + raw_result = self._redeploy_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) def get_long_running_output(response): + deserialized = self._deserialize('OperationStatusResponse', response) - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + redeploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy'} + + + def _perform_maintenance_initial( + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.perform_maintenance.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def perform_maintenance( + self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Performs maintenance on a virtual machine in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] + :raises: :class:`CloudError` + """ + raw_result = self._perform_maintenance_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1178,9 +1238,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + perform_maintenance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_sets_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_sets_operations.py index 87c7283ce3f0..d90905df725b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_sets_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_sets_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachineScaleSetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, vm_scale_set_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, vm_scale_set_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -104,13 +104,16 @@ def create_or_update( :type parameters: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSet :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineScaleSet or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachineScaleSet + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSet] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSet]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -121,30 +124,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineScaleSet', response) if raw: @@ -153,18 +134,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def _update_initial( self, resource_group_name, vm_scale_set_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -211,7 +194,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, vm_scale_set_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -223,13 +206,16 @@ def update( :type parameters: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetUpdate :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineScaleSet or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachineScaleSet + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSet] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSet]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -240,30 +226,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineScaleSet', response) if raw: @@ -272,18 +236,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def _delete_initial( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -326,7 +292,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -334,13 +300,16 @@ def delete( :param vm_scale_set_name: The name of the VM scale set. :type vm_scale_set_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -350,30 +319,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -382,12 +329,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def get( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -408,7 +357,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -449,6 +398,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'} def _deallocate_initial( @@ -458,7 +408,7 @@ def _deallocate_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate' + url = self.deallocate.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -508,7 +458,7 @@ def _deallocate_initial( return deserialized def deallocate( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set @@ -524,13 +474,16 @@ def deallocate( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._deallocate_initial( @@ -541,30 +494,8 @@ def deallocate( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -573,12 +504,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate'} def _delete_instances_initial( @@ -586,7 +519,7 @@ def _delete_instances_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceRequiredIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete' + url = self.delete_instances.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -633,7 +566,7 @@ def _delete_instances_initial( return deserialized def delete_instances( - self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -643,13 +576,16 @@ def delete_instances( :param instance_ids: The virtual machine scale set instance ids. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_instances_initial( @@ -660,30 +596,8 @@ def delete_instances( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -692,12 +606,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_instances.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete'} def get_instance_view( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -720,7 +636,7 @@ def get_instance_view( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView' + url = self.get_instance_view.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -761,6 +677,7 @@ def get_instance_view( return client_raw_response return deserialized + get_instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -782,7 +699,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -828,6 +745,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -850,7 +768,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -895,6 +813,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets'} def list_skus( self, resource_group_name, vm_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -919,7 +838,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus' + url = self.list_skus.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -966,6 +885,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus'} def _power_off_initial( @@ -975,7 +895,7 @@ def _power_off_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff' + url = self.power_off.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1025,7 +945,7 @@ def _power_off_initial( return deserialized def power_off( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid @@ -1041,13 +961,16 @@ def power_off( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._power_off_initial( @@ -1058,30 +981,8 @@ def power_off( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1090,12 +991,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff'} def _restart_initial( @@ -1105,7 +1008,7 @@ def _restart_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart' + url = self.restart.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1155,7 +1058,7 @@ def _restart_initial( return deserialized def restart( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1168,13 +1071,16 @@ def restart( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._restart_initial( @@ -1185,30 +1091,8 @@ def restart( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1217,12 +1101,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart'} def _start_initial( @@ -1232,7 +1118,7 @@ def _start_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1282,7 +1168,7 @@ def _start_initial( return deserialized def start( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1295,13 +1181,16 @@ def start( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -1312,30 +1201,228 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start'} + + + def _redeploy_initial( + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + vm_instance_ids = None + if instance_ids is not None: + vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) + + # Construct URL + url = self.redeploy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if vm_instance_ids is not None: + body_content = self._serialize.body(vm_instance_ids, 'VirtualMachineScaleSetVMInstanceIDs') + else: + body_content = None # Construct and send request - def long_running_send(): - return raw_result.response + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - def get_long_running_status(status_link, headers=None): + deserialized = None - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) + if response.status_code == 200: + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def redeploy( + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Redeploy one or more virtual machines in a VM scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_ids: The virtual machine scale set instance ids. + Omitting the virtual machine scale set instance ids will result in the + operation being performed on all virtual machines in the virtual + machine scale set. + :type instance_ids: list[str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] + :raises: :class:`CloudError` + """ + raw_result = self._redeploy_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_ids=instance_ids, + custom_headers=custom_headers, + raw=True, + **operation_config + ) def get_long_running_output(response): + deserialized = self._deserialize('OperationStatusResponse', response) - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + redeploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy'} + + + def _perform_maintenance_initial( + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + vm_instance_ids = None + if instance_ids is not None: + vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) + + # Construct URL + url = self.perform_maintenance.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if vm_instance_ids is not None: + body_content = self._serialize.body(vm_instance_ids, 'VirtualMachineScaleSetVMInstanceIDs') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def perform_maintenance( + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Perform maintenance on one or more virtual machines in a VM scale set. + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_ids: The virtual machine scale set instance ids. + Omitting the virtual machine scale set instance ids will result in the + operation being performed on all virtual machines in the virtual + machine scale set. + :type instance_ids: list[str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] + :raises: :class:`CloudError` + """ + raw_result = self._perform_maintenance_initial( + resource_group_name=resource_group_name, + vm_scale_set_name=vm_scale_set_name, + instance_ids=instance_ids, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1344,12 +1431,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + perform_maintenance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance'} def _update_instances_initial( @@ -1357,7 +1446,7 @@ def _update_instances_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceRequiredIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade' + url = self.update_instances.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1404,7 +1493,7 @@ def _update_instances_initial( return deserialized def update_instances( - self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, polling=True, **operation_config): """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. @@ -1415,13 +1504,16 @@ def update_instances( :param instance_ids: The virtual machine scale set instance ids. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._update_instances_initial( @@ -1432,30 +1524,8 @@ def update_instances( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1464,12 +1534,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_instances.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade'} def _reimage_initial( @@ -1479,7 +1551,7 @@ def _reimage_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage' + url = self.reimage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1529,7 +1601,7 @@ def _reimage_initial( return deserialized def reimage( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. @@ -1543,13 +1615,16 @@ def reimage( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._reimage_initial( @@ -1560,30 +1635,8 @@ def reimage( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1592,12 +1645,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reimage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage'} def _reimage_all_initial( @@ -1607,7 +1662,7 @@ def _reimage_all_initial( vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall' + url = self.reimage_all.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), @@ -1657,7 +1712,7 @@ def _reimage_all_initial( return deserialized def reimage_all( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. @@ -1671,13 +1726,16 @@ def reimage_all( machine scale set. :type instance_ids: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._reimage_all_initial( @@ -1688,30 +1746,8 @@ def reimage_all( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1720,9 +1756,78 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reimage_all.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall'} + + def force_recovery_service_fabric_platform_update_domain_walk( + self, resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers=None, raw=False, **operation_config): + """Manual platform update domain walk to update virtual machines in a + service fabric virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param platform_update_domain: The platform update domain for which a + manual recovery walk is requested + :type platform_update_domain: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RecoveryWalkResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.compute.v2017_12_01.models.RecoveryWalkResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.force_recovery_service_fabric_platform_update_domain_walk.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['platformUpdateDomain'] = self._serialize.query("platform_update_domain", platform_update_domain, 'int') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RecoveryWalkResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + force_recovery_service_fabric_platform_update_domain_walk.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_sizes_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_sizes_operations.py index 7a079fe03bb8..fac51386b9b6 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_sizes_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_sizes_operations.py @@ -22,7 +22,7 @@ class VirtualMachineSizesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-12-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -105,3 +105,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machines_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machines_operations.py index d6213c43ff20..bcb4e2034ef2 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machines_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machines_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualMachinesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _capture_initial( self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture' + url = self.capture.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -90,7 +90,7 @@ def _capture_initial( return deserialized def capture( - self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -103,13 +103,17 @@ def capture( :type parameters: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineCaptureParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachineCaptureResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualMachineCaptureResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineCaptureResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineCaptureResult]] :raises: :class:`CloudError` """ raw_result = self._capture_initial( @@ -120,30 +124,8 @@ def capture( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualMachineCaptureResult', response) if raw: @@ -152,18 +134,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture'} def _create_or_update_initial( self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -212,7 +196,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -224,13 +208,16 @@ def create_or_update( :type parameters: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachine :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualMachine or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachine or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachine] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.VirtualMachine]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -241,30 +228,112 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result + + def get_long_running_output(response): + deserialized = self._deserialize('VirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} + + + def _update_initial( + self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'VirtualMachineUpdate') # Construct and send request - def long_running_send(): - return raw_result.response + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - def get_long_running_status(status_link, headers=None): + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) + deserialized = None - def get_long_running_output(response): + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachine', response) + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachine', response) - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to update a virtual machine. + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param parameters: Parameters supplied to the Update Virtual Machine + operation. + :type parameters: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineUpdate + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachine or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachine] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.VirtualMachine]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + vm_name=vm_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): deserialized = self._deserialize('VirtualMachine', response) if raw: @@ -273,18 +342,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} def _delete_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -327,7 +398,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -335,13 +406,16 @@ def delete( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -351,30 +425,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -383,12 +435,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} def get( self, resource_group_name, vm_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -414,7 +468,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -457,6 +511,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} def instance_view( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): @@ -478,7 +533,7 @@ def instance_view( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView' + url = self.instance_view.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -519,12 +574,13 @@ def instance_view( return client_raw_response return deserialized + instance_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView'} def _convert_to_managed_disks_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks' + url = self.convert_to_managed_disks.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -567,7 +623,7 @@ def _convert_to_managed_disks_initial( return deserialized def convert_to_managed_disks( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. @@ -577,13 +633,16 @@ def convert_to_managed_disks( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._convert_to_managed_disks_initial( @@ -593,30 +652,8 @@ def convert_to_managed_disks( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -625,18 +662,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + convert_to_managed_disks.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks'} def _deallocate_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate' + url = self.deallocate.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -679,7 +718,7 @@ def _deallocate_initial( return deserialized def deallocate( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. @@ -689,13 +728,16 @@ def deallocate( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._deallocate_initial( @@ -705,30 +747,8 @@ def deallocate( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -737,12 +757,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + deallocate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate'} def generalize( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): @@ -763,7 +785,7 @@ def generalize( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize' + url = self.generalize.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -804,6 +826,7 @@ def generalize( return client_raw_response return deserialized + generalize.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -827,7 +850,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -873,6 +896,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -894,7 +918,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -939,6 +963,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines'} def list_available_sizes( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): @@ -963,7 +988,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes' + url = self.list_available_sizes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1010,12 +1035,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_available_sizes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes'} def _power_off_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff' + url = self.power_off.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1058,7 +1084,7 @@ def _power_off_initial( return deserialized def power_off( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. @@ -1068,13 +1094,16 @@ def power_off( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._power_off_initial( @@ -1084,30 +1113,8 @@ def power_off( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1116,18 +1123,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + power_off.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff'} def _restart_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart' + url = self.restart.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1170,7 +1179,7 @@ def _restart_initial( return deserialized def restart( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1178,13 +1187,16 @@ def restart( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._restart_initial( @@ -1194,30 +1206,8 @@ def restart( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1226,18 +1216,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart'} def _start_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1280,7 +1272,7 @@ def _start_initial( return deserialized def start( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1288,13 +1280,16 @@ def start( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -1304,30 +1299,8 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1336,18 +1309,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start'} def _redeploy_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy' + url = self.redeploy.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1390,7 +1365,7 @@ def _redeploy_initial( return deserialized def redeploy( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to redeploy a virtual machine. :param resource_group_name: The name of the resource group. @@ -1398,13 +1373,16 @@ def redeploy( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._redeploy_initial( @@ -1414,30 +1392,8 @@ def redeploy( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1446,18 +1402,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + redeploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy'} def _perform_maintenance_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance' + url = self.perform_maintenance.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1500,7 +1458,7 @@ def _perform_maintenance_initial( return deserialized def perform_maintenance( - self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1508,13 +1466,16 @@ def perform_maintenance( :param vm_name: The name of the virtual machine. :type vm_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - OperationStatusResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] :raises: :class:`CloudError` """ raw_result = self._perform_maintenance_initial( @@ -1524,30 +1485,8 @@ def perform_maintenance( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('OperationStatusResponse', response) if raw: @@ -1556,18 +1495,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + perform_maintenance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance'} def _run_command_initial( self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand' + url = self.run_command.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'vmName': self._serialize.url("vm_name", vm_name, 'str'), @@ -1614,7 +1555,7 @@ def _run_command_initial( return deserialized def run_command( - self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1625,13 +1566,16 @@ def run_command( :type parameters: ~azure.mgmt.compute.v2017_12_01.models.RunCommandInput :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RunCommandResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RunCommandResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.RunCommandResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.RunCommandResult]] :raises: :class:`CloudError` """ raw_result = self._run_command_initial( @@ -1642,30 +1586,8 @@ def run_command( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RunCommandResult', response) if raw: @@ -1674,9 +1596,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py new file mode 100644 index 000000000000..88ded2f640de --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py @@ -0,0 +1,18 @@ +# 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 .compute_management_client import ComputeManagementClient +from .version import VERSION + +__all__ = ['ComputeManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/compute_management_client.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/compute_management_client.py new file mode 100644 index 000000000000..382bad2d0135 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/compute_management_client.py @@ -0,0 +1,90 @@ +# 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 msrest.service_client import ServiceClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.disks_operations import DisksOperations +from .operations.snapshots_operations import SnapshotsOperations +from . import models + + +class ComputeManagementClientConfiguration(AzureConfiguration): + """Configuration for ComputeManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(ComputeManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-compute/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class ComputeManagementClient(object): + """Compute Client + + :ivar config: Configuration for client. + :vartype config: ComputeManagementClientConfiguration + + :ivar disks: Disks operations + :vartype disks: azure.mgmt.compute.v2018_04_01.operations.DisksOperations + :ivar snapshots: Snapshots operations + :vartype snapshots: azure.mgmt.compute.v2018_04_01.operations.SnapshotsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ComputeManagementClientConfiguration(credentials, subscription_id, base_url) + self._client = ServiceClient(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-04-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.disks = DisksOperations( + self._client, self.config, self._serialize, self._deserialize) + self.snapshots = SnapshotsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/__init__.py new file mode 100644 index 000000000000..e9b76b3dc97d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/__init__.py @@ -0,0 +1,92 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from .resource_py3 import Resource + from .disk_sku_py3 import DiskSku + from .resource_update_py3 import ResourceUpdate + from .image_disk_reference_py3 import ImageDiskReference + from .creation_data_py3 import CreationData + from .source_vault_py3 import SourceVault + from .key_vault_and_secret_reference_py3 import KeyVaultAndSecretReference + from .key_vault_and_key_reference_py3 import KeyVaultAndKeyReference + from .encryption_settings_py3 import EncryptionSettings + from .disk_py3 import Disk + from .disk_update_py3 import DiskUpdate + from .snapshot_sku_py3 import SnapshotSku + from .grant_access_data_py3 import GrantAccessData + from .access_uri_py3 import AccessUri + from .snapshot_py3 import Snapshot + from .snapshot_update_py3 import SnapshotUpdate + from .api_error_base_py3 import ApiErrorBase + from .inner_error_py3 import InnerError + from .api_error_py3 import ApiError + from .operation_status_response_py3 import OperationStatusResponse +except (SyntaxError, ImportError): + from .resource import Resource + from .disk_sku import DiskSku + from .resource_update import ResourceUpdate + from .image_disk_reference import ImageDiskReference + from .creation_data import CreationData + from .source_vault import SourceVault + from .key_vault_and_secret_reference import KeyVaultAndSecretReference + from .key_vault_and_key_reference import KeyVaultAndKeyReference + from .encryption_settings import EncryptionSettings + from .disk import Disk + from .disk_update import DiskUpdate + from .snapshot_sku import SnapshotSku + from .grant_access_data import GrantAccessData + from .access_uri import AccessUri + from .snapshot import Snapshot + from .snapshot_update import SnapshotUpdate + from .api_error_base import ApiErrorBase + from .inner_error import InnerError + from .api_error import ApiError + from .operation_status_response import OperationStatusResponse +from .disk_paged import DiskPaged +from .snapshot_paged import SnapshotPaged +from .compute_management_client_enums import ( + StorageAccountTypes, + OperatingSystemTypes, + DiskCreateOption, + SnapshotStorageAccountTypes, + AccessLevel, +) + +__all__ = [ + 'Resource', + 'DiskSku', + 'ResourceUpdate', + 'ImageDiskReference', + 'CreationData', + 'SourceVault', + 'KeyVaultAndSecretReference', + 'KeyVaultAndKeyReference', + 'EncryptionSettings', + 'Disk', + 'DiskUpdate', + 'SnapshotSku', + 'GrantAccessData', + 'AccessUri', + 'Snapshot', + 'SnapshotUpdate', + 'ApiErrorBase', + 'InnerError', + 'ApiError', + 'OperationStatusResponse', + 'DiskPaged', + 'SnapshotPaged', + 'StorageAccountTypes', + 'OperatingSystemTypes', + 'DiskCreateOption', + 'SnapshotStorageAccountTypes', + 'AccessLevel', +] diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/access_uri.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/access_uri.py new file mode 100644 index 000000000000..9ee6b01de1e1 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/access_uri.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class AccessUri(Model): + """A disk access SAS uri. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar access_sas: A SAS uri for accessing a disk. + :vartype access_sas: str + """ + + _validation = { + 'access_sas': {'readonly': True}, + } + + _attribute_map = { + 'access_sas': {'key': 'properties.output.accessSAS', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccessUri, self).__init__(**kwargs) + self.access_sas = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/access_uri_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/access_uri_py3.py new file mode 100644 index 000000000000..bb9e56aa4221 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/access_uri_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class AccessUri(Model): + """A disk access SAS uri. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar access_sas: A SAS uri for accessing a disk. + :vartype access_sas: str + """ + + _validation = { + 'access_sas': {'readonly': True}, + } + + _attribute_map = { + 'access_sas': {'key': 'properties.output.accessSAS', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AccessUri, self).__init__(**kwargs) + self.access_sas = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error.py new file mode 100644 index 000000000000..6c3ce23571f7 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApiError(Model): + """Api error. + + :param details: The Api error details + :type details: list[~azure.mgmt.compute.v2018_04_01.models.ApiErrorBase] + :param innererror: The Api inner error + :type innererror: ~azure.mgmt.compute.v2018_04_01.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiError, self).__init__(**kwargs) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_base.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_base.py new file mode 100644 index 000000000000..655c08638905 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_base.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ApiErrorBase(Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiErrorBase, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_base_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_base_py3.py new file mode 100644 index 000000000000..5ba95aa0283e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_base_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ApiErrorBase(Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ApiErrorBase, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_py3.py new file mode 100644 index 000000000000..ad665ba38599 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApiError(Model): + """Api error. + + :param details: The Api error details + :type details: list[~azure.mgmt.compute.v2018_04_01.models.ApiErrorBase] + :param innererror: The Api inner error + :type innererror: ~azure.mgmt.compute.v2018_04_01.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, details=None, innererror=None, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ApiError, self).__init__(**kwargs) + self.details = details + self.innererror = innererror + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/compute_management_client_enums.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/compute_management_client_enums.py new file mode 100644 index 000000000000..94796a92c793 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/compute_management_client_enums.py @@ -0,0 +1,47 @@ +# 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 enum import Enum + + +class StorageAccountTypes(str, Enum): + + standard_lrs = "Standard_LRS" + premium_lrs = "Premium_LRS" + + +class OperatingSystemTypes(str, Enum): + + windows = "Windows" + linux = "Linux" + + +class DiskCreateOption(str, Enum): + + empty = "Empty" + attach = "Attach" + from_image = "FromImage" + import_enum = "Import" + copy = "Copy" + restore = "Restore" + + +class SnapshotStorageAccountTypes(str, Enum): + + standard_lrs = "Standard_LRS" + premium_lrs = "Premium_LRS" + standard_zrs = "Standard_ZRS" + + +class AccessLevel(str, Enum): + + none = "None" + read = "Read" diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/creation_data.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/creation_data.py new file mode 100644 index 000000000000..a7abd1cfe8c8 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/creation_data.py @@ -0,0 +1,58 @@ +# 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 msrest.serialization import Model + + +class CreationData(Model): + """Data used when creating a disk. + + All required parameters must be populated in order to send to Azure. + + :param create_option: Required. This enumerates the possible sources of a + disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', + 'Import', 'Copy', 'Restore' + :type create_option: str or + ~azure.mgmt.compute.v2018_04_01.models.DiskCreateOption + :param storage_account_id: If createOption is Import, the Azure Resource + Manager identifier of the storage account containing the blob to import as + a disk. Required only if the blob is in a different subscription + :type storage_account_id: str + :param image_reference: Disk source information. + :type image_reference: + ~azure.mgmt.compute.v2018_04_01.models.ImageDiskReference + :param source_uri: If createOption is Import, this is the URI of a blob to + be imported into a managed disk. + :type source_uri: str + :param source_resource_id: If createOption is Copy, this is the ARM id of + the source snapshot or disk. + :type source_resource_id: str + """ + + _validation = { + 'create_option': {'required': True}, + } + + _attribute_map = { + 'create_option': {'key': 'createOption', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'image_reference': {'key': 'imageReference', 'type': 'ImageDiskReference'}, + 'source_uri': {'key': 'sourceUri', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CreationData, self).__init__(**kwargs) + self.create_option = kwargs.get('create_option', None) + self.storage_account_id = kwargs.get('storage_account_id', None) + self.image_reference = kwargs.get('image_reference', None) + self.source_uri = kwargs.get('source_uri', None) + self.source_resource_id = kwargs.get('source_resource_id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/creation_data_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/creation_data_py3.py new file mode 100644 index 000000000000..c4486c7da81b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/creation_data_py3.py @@ -0,0 +1,58 @@ +# 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 msrest.serialization import Model + + +class CreationData(Model): + """Data used when creating a disk. + + All required parameters must be populated in order to send to Azure. + + :param create_option: Required. This enumerates the possible sources of a + disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', + 'Import', 'Copy', 'Restore' + :type create_option: str or + ~azure.mgmt.compute.v2018_04_01.models.DiskCreateOption + :param storage_account_id: If createOption is Import, the Azure Resource + Manager identifier of the storage account containing the blob to import as + a disk. Required only if the blob is in a different subscription + :type storage_account_id: str + :param image_reference: Disk source information. + :type image_reference: + ~azure.mgmt.compute.v2018_04_01.models.ImageDiskReference + :param source_uri: If createOption is Import, this is the URI of a blob to + be imported into a managed disk. + :type source_uri: str + :param source_resource_id: If createOption is Copy, this is the ARM id of + the source snapshot or disk. + :type source_resource_id: str + """ + + _validation = { + 'create_option': {'required': True}, + } + + _attribute_map = { + 'create_option': {'key': 'createOption', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'image_reference': {'key': 'imageReference', 'type': 'ImageDiskReference'}, + 'source_uri': {'key': 'sourceUri', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + } + + def __init__(self, *, create_option, storage_account_id: str=None, image_reference=None, source_uri: str=None, source_resource_id: str=None, **kwargs) -> None: + super(CreationData, self).__init__(**kwargs) + self.create_option = create_option + self.storage_account_id = storage_account_id + self.image_reference = image_reference + self.source_uri = source_uri + self.source_resource_id = source_resource_id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk.py new file mode 100644 index 000000000000..eed027e0056f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk.py @@ -0,0 +1,100 @@ +# 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 .resource import Resource + + +class Disk(Resource): + """Disk 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 Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar managed_by: A relative URI containing the ID of the VM that has the + disk attached. + :vartype managed_by: str + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku + :param zones: The Logical zone list for Disk. + :type zones: list[str] + :ivar time_created: The time when the disk was created. + :vartype time_created: datetime + :param os_type: The Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2018_04_01.models.OperatingSystemTypes + :param creation_data: Required. Disk source information. CreationData + information cannot be changed after the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2018_04_01.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2018_04_01.models.EncryptionSettings + :ivar provisioning_state: The disk provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'managed_by': {'readonly': True}, + 'time_created': {'readonly': True}, + 'creation_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Disk, self).__init__(**kwargs) + self.managed_by = None + self.sku = kwargs.get('sku', None) + self.zones = kwargs.get('zones', None) + self.time_created = None + self.os_type = kwargs.get('os_type', None) + self.creation_data = kwargs.get('creation_data', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings = kwargs.get('encryption_settings', None) + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_paged.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_paged.py new file mode 100644 index 000000000000..aa6febc82f16 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class DiskPaged(Paged): + """ + A paging container for iterating over a list of :class:`Disk ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Disk]'} + } + + def __init__(self, *args, **kwargs): + + super(DiskPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_py3.py new file mode 100644 index 000000000000..34dd0febdc77 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_py3.py @@ -0,0 +1,100 @@ +# 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 .resource import Resource + + +class Disk(Resource): + """Disk 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 Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar managed_by: A relative URI containing the ID of the VM that has the + disk attached. + :vartype managed_by: str + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku + :param zones: The Logical zone list for Disk. + :type zones: list[str] + :ivar time_created: The time when the disk was created. + :vartype time_created: datetime + :param os_type: The Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2018_04_01.models.OperatingSystemTypes + :param creation_data: Required. Disk source information. CreationData + information cannot be changed after the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2018_04_01.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2018_04_01.models.EncryptionSettings + :ivar provisioning_state: The disk provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'managed_by': {'readonly': True}, + 'time_created': {'readonly': True}, + 'creation_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, creation_data, tags=None, sku=None, zones=None, os_type=None, disk_size_gb: int=None, encryption_settings=None, **kwargs) -> None: + super(Disk, self).__init__(location=location, tags=tags, **kwargs) + self.managed_by = None + self.sku = sku + self.zones = zones + self.time_created = None + self.os_type = os_type + self.creation_data = creation_data + self.disk_size_gb = disk_size_gb + self.encryption_settings = encryption_settings + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_sku.py new file mode 100644 index 000000000000..f0bbc41f21e1 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_sku.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 msrest.serialization import Model + + +class DiskSku(Model): + """The disks sku name. Can be Standard_LRS or Premium_LRS. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The sku name. Possible values include: 'Standard_LRS', + 'Premium_LRS' + :type name: str or + ~azure.mgmt.compute.v2018_04_01.models.StorageAccountTypes + :ivar tier: The sku tier. Default value: "Standard" . + :vartype tier: str + """ + + _validation = { + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DiskSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_sku_py3.py new file mode 100644 index 000000000000..99a2821b0aeb --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_sku_py3.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 msrest.serialization import Model + + +class DiskSku(Model): + """The disks sku name. Can be Standard_LRS or Premium_LRS. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The sku name. Possible values include: 'Standard_LRS', + 'Premium_LRS' + :type name: str or + ~azure.mgmt.compute.v2018_04_01.models.StorageAccountTypes + :ivar tier: The sku tier. Default value: "Standard" . + :vartype tier: str + """ + + _validation = { + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(DiskSku, self).__init__(**kwargs) + self.name = name + self.tier = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_update.py new file mode 100644 index 000000000000..7364769892bf --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_update.py @@ -0,0 +1,49 @@ +# 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 .resource_update import ResourceUpdate + + +class DiskUpdate(ResourceUpdate): + """Disk update resource. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku + :param os_type: the Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2018_04_01.models.OperatingSystemTypes + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2018_04_01.models.EncryptionSettings + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + } + + def __init__(self, **kwargs): + super(DiskUpdate, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings = kwargs.get('encryption_settings', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_update_py3.py new file mode 100644 index 000000000000..0764da0e7f0c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_update_py3.py @@ -0,0 +1,49 @@ +# 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 .resource_update import ResourceUpdate + + +class DiskUpdate(ResourceUpdate): + """Disk update resource. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku + :param os_type: the Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2018_04_01.models.OperatingSystemTypes + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2018_04_01.models.EncryptionSettings + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + } + + def __init__(self, *, tags=None, sku=None, os_type=None, disk_size_gb: int=None, encryption_settings=None, **kwargs) -> None: + super(DiskUpdate, self).__init__(tags=tags, sku=sku, **kwargs) + self.os_type = os_type + self.disk_size_gb = disk_size_gb + self.encryption_settings = encryption_settings diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/encryption_settings.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/encryption_settings.py new file mode 100644 index 000000000000..5a17496c81b2 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/encryption_settings.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EncryptionSettings(Model): + """Encryption settings for disk or snapshot. + + :param enabled: Set this flag to true and provide DiskEncryptionKey and + optional KeyEncryptionKey to enable encryption. Set this flag to false and + remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If + EncryptionSettings is null in the request object, the existing settings + remain unchanged. + :type enabled: bool + :param disk_encryption_key: Key Vault Secret Url and vault id of the disk + encryption key + :type disk_encryption_key: + ~azure.mgmt.compute.v2018_04_01.models.KeyVaultAndSecretReference + :param key_encryption_key: Key Vault Key Url and vault id of the key + encryption key + :type key_encryption_key: + ~azure.mgmt.compute.v2018_04_01.models.KeyVaultAndKeyReference + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultAndSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultAndKeyReference'}, + } + + def __init__(self, **kwargs): + super(EncryptionSettings, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.disk_encryption_key = kwargs.get('disk_encryption_key', None) + self.key_encryption_key = kwargs.get('key_encryption_key', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/encryption_settings_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/encryption_settings_py3.py new file mode 100644 index 000000000000..f3ac5a66cb84 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/encryption_settings_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EncryptionSettings(Model): + """Encryption settings for disk or snapshot. + + :param enabled: Set this flag to true and provide DiskEncryptionKey and + optional KeyEncryptionKey to enable encryption. Set this flag to false and + remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If + EncryptionSettings is null in the request object, the existing settings + remain unchanged. + :type enabled: bool + :param disk_encryption_key: Key Vault Secret Url and vault id of the disk + encryption key + :type disk_encryption_key: + ~azure.mgmt.compute.v2018_04_01.models.KeyVaultAndSecretReference + :param key_encryption_key: Key Vault Key Url and vault id of the key + encryption key + :type key_encryption_key: + ~azure.mgmt.compute.v2018_04_01.models.KeyVaultAndKeyReference + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultAndSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultAndKeyReference'}, + } + + def __init__(self, *, enabled: bool=None, disk_encryption_key=None, key_encryption_key=None, **kwargs) -> None: + super(EncryptionSettings, self).__init__(**kwargs) + self.enabled = enabled + self.disk_encryption_key = disk_encryption_key + self.key_encryption_key = key_encryption_key diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/grant_access_data.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/grant_access_data.py new file mode 100644 index 000000000000..30f3229efa0b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/grant_access_data.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 msrest.serialization import Model + + +class GrantAccessData(Model): + """Data used for requesting a SAS. + + All required parameters must be populated in order to send to Azure. + + :param access: Required. Possible values include: 'None', 'Read' + :type access: str or ~azure.mgmt.compute.v2018_04_01.models.AccessLevel + :param duration_in_seconds: Required. Time duration in seconds until the + SAS access expires. + :type duration_in_seconds: int + """ + + _validation = { + 'access': {'required': True}, + 'duration_in_seconds': {'required': True}, + } + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(GrantAccessData, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.duration_in_seconds = kwargs.get('duration_in_seconds', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/grant_access_data_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/grant_access_data_py3.py new file mode 100644 index 000000000000..0e6cf91e26cf --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/grant_access_data_py3.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 msrest.serialization import Model + + +class GrantAccessData(Model): + """Data used for requesting a SAS. + + All required parameters must be populated in order to send to Azure. + + :param access: Required. Possible values include: 'None', 'Read' + :type access: str or ~azure.mgmt.compute.v2018_04_01.models.AccessLevel + :param duration_in_seconds: Required. Time duration in seconds until the + SAS access expires. + :type duration_in_seconds: int + """ + + _validation = { + 'access': {'required': True}, + 'duration_in_seconds': {'required': True}, + } + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'int'}, + } + + def __init__(self, *, access, duration_in_seconds: int, **kwargs) -> None: + super(GrantAccessData, self).__init__(**kwargs) + self.access = access + self.duration_in_seconds = duration_in_seconds diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/image_disk_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/image_disk_reference.py new file mode 100644 index 000000000000..247d532379fc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/image_disk_reference.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 msrest.serialization import Model + + +class ImageDiskReference(Model): + """The source image used for creating the disk. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. A relative uri containing either a Platform Imgage + Repository or user image reference. + :type id: str + :param lun: If the disk is created from an image's data disk, this is an + index that indicates which of the data disks in the image to use. For OS + disks, this field is null. + :type lun: int + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ImageDiskReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.lun = kwargs.get('lun', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/image_disk_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/image_disk_reference_py3.py new file mode 100644 index 000000000000..191563557acb --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/image_disk_reference_py3.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 msrest.serialization import Model + + +class ImageDiskReference(Model): + """The source image used for creating the disk. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. A relative uri containing either a Platform Imgage + Repository or user image reference. + :type id: str + :param lun: If the disk is created from an image's data disk, this is an + index that indicates which of the data disks in the image to use. For OS + disks, this field is null. + :type lun: int + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__(self, *, id: str, lun: int=None, **kwargs) -> None: + super(ImageDiskReference, self).__init__(**kwargs) + self.id = id + self.lun = lun diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/inner_error.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/inner_error.py new file mode 100644 index 000000000000..6324249d7c19 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/inner_error.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class InnerError(Model): + """Inner error details. + + :param exceptiontype: The exception type. + :type exceptiontype: str + :param errordetail: The internal error message or exception dump. + :type errordetail: str + """ + + _attribute_map = { + 'exceptiontype': {'key': 'exceptiontype', 'type': 'str'}, + 'errordetail': {'key': 'errordetail', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = kwargs.get('exceptiontype', None) + self.errordetail = kwargs.get('errordetail', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/inner_error_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/inner_error_py3.py new file mode 100644 index 000000000000..ccec30d7b53f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/inner_error_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class InnerError(Model): + """Inner error details. + + :param exceptiontype: The exception type. + :type exceptiontype: str + :param errordetail: The internal error message or exception dump. + :type errordetail: str + """ + + _attribute_map = { + 'exceptiontype': {'key': 'exceptiontype', 'type': 'str'}, + 'errordetail': {'key': 'errordetail', 'type': 'str'}, + } + + def __init__(self, *, exceptiontype: str=None, errordetail: str=None, **kwargs) -> None: + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = exceptiontype + self.errordetail = errordetail diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_key_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_key_reference.py new file mode 100644 index 000000000000..12c3b3b5516d --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_key_reference.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 msrest.serialization import Model + + +class KeyVaultAndKeyReference(Model): + """Key Vault Key Url and vault id of KeK, KeK is optional and when provided is + used to unwrap the encryptionKey. + + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the + key or secret + :type source_vault: ~azure.mgmt.compute.v2018_04_01.models.SourceVault + :param key_url: Required. Url pointing to a key or secret in KeyVault + :type key_url: str + """ + + _validation = { + 'source_vault': {'required': True}, + 'key_url': {'required': True}, + } + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultAndKeyReference, self).__init__(**kwargs) + self.source_vault = kwargs.get('source_vault', None) + self.key_url = kwargs.get('key_url', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_key_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_key_reference_py3.py new file mode 100644 index 000000000000..ba330572235f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_key_reference_py3.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 msrest.serialization import Model + + +class KeyVaultAndKeyReference(Model): + """Key Vault Key Url and vault id of KeK, KeK is optional and when provided is + used to unwrap the encryptionKey. + + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the + key or secret + :type source_vault: ~azure.mgmt.compute.v2018_04_01.models.SourceVault + :param key_url: Required. Url pointing to a key or secret in KeyVault + :type key_url: str + """ + + _validation = { + 'source_vault': {'required': True}, + 'key_url': {'required': True}, + } + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + } + + def __init__(self, *, source_vault, key_url: str, **kwargs) -> None: + super(KeyVaultAndKeyReference, self).__init__(**kwargs) + self.source_vault = source_vault + self.key_url = key_url diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_secret_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_secret_reference.py new file mode 100644 index 000000000000..0e13cba0e3fd --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_secret_reference.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 msrest.serialization import Model + + +class KeyVaultAndSecretReference(Model): + """Key Vault Secret Url and vault id of the encryption key . + + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the + key or secret + :type source_vault: ~azure.mgmt.compute.v2018_04_01.models.SourceVault + :param secret_url: Required. Url pointing to a key or secret in KeyVault + :type secret_url: str + """ + + _validation = { + 'source_vault': {'required': True}, + 'secret_url': {'required': True}, + } + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'secret_url': {'key': 'secretUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultAndSecretReference, self).__init__(**kwargs) + self.source_vault = kwargs.get('source_vault', None) + self.secret_url = kwargs.get('secret_url', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_secret_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_secret_reference_py3.py new file mode 100644 index 000000000000..d342cfb37a14 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_secret_reference_py3.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 msrest.serialization import Model + + +class KeyVaultAndSecretReference(Model): + """Key Vault Secret Url and vault id of the encryption key . + + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the + key or secret + :type source_vault: ~azure.mgmt.compute.v2018_04_01.models.SourceVault + :param secret_url: Required. Url pointing to a key or secret in KeyVault + :type secret_url: str + """ + + _validation = { + 'source_vault': {'required': True}, + 'secret_url': {'required': True}, + } + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'secret_url': {'key': 'secretUrl', 'type': 'str'}, + } + + def __init__(self, *, source_vault, secret_url: str, **kwargs) -> None: + super(KeyVaultAndSecretReference, self).__init__(**kwargs) + self.source_vault = source_vault + self.secret_url = secret_url diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/operation_status_response.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/operation_status_response.py new file mode 100644 index 000000000000..3fc201f5913a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/operation_status_response.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class OperationStatusResponse(Model): + """Operation status response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation ID + :vartype name: str + :ivar status: Operation status + :vartype status: str + :ivar start_time: Start time of the operation + :vartype start_time: datetime + :ivar end_time: End time of the operation + :vartype end_time: datetime + :ivar error: Api error + :vartype error: ~azure.mgmt.compute.v2018_04_01.models.ApiError + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__(self, **kwargs): + super(OperationStatusResponse, self).__init__(**kwargs) + self.name = None + self.status = None + self.start_time = None + self.end_time = None + self.error = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/operation_status_response_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/operation_status_response_py3.py new file mode 100644 index 000000000000..914868a01954 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/operation_status_response_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class OperationStatusResponse(Model): + """Operation status response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation ID + :vartype name: str + :ivar status: Operation status + :vartype status: str + :ivar start_time: Start time of the operation + :vartype start_time: datetime + :ivar end_time: End time of the operation + :vartype end_time: datetime + :ivar error: Api error + :vartype error: ~azure.mgmt.compute.v2018_04_01.models.ApiError + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationStatusResponse, self).__init__(**kwargs) + self.name = None + self.status = None + self.start_time = None + self.end_time = None + self.error = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource.py new file mode 100644 index 000000000000..5dd7d481c685 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_py3.py new file mode 100644 index 000000000000..2f3702caf609 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_py3.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_update.py new file mode 100644 index 000000000000..1ab6fb273f49 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_update.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class ResourceUpdate(Model): + """The Resource model definition. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + } + + def __init__(self, **kwargs): + super(ResourceUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_update_py3.py new file mode 100644 index 000000000000..1074982f9341 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_update_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class ResourceUpdate(Model): + """The Resource model definition. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + } + + def __init__(self, *, tags=None, sku=None, **kwargs) -> None: + super(ResourceUpdate, self).__init__(**kwargs) + self.tags = tags + self.sku = sku diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot.py new file mode 100644 index 000000000000..31299f475824 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot.py @@ -0,0 +1,95 @@ +# 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 .resource import Resource + + +class Snapshot(Resource): + """Snapshot 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 Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar managed_by: Unused. Always Null. + :vartype managed_by: str + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.SnapshotSku + :ivar time_created: The time when the disk was created. + :vartype time_created: datetime + :param os_type: The Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2018_04_01.models.OperatingSystemTypes + :param creation_data: Required. Disk source information. CreationData + information cannot be changed after the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2018_04_01.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2018_04_01.models.EncryptionSettings + :ivar provisioning_state: The disk provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'managed_by': {'readonly': True}, + 'time_created': {'readonly': True}, + 'creation_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SnapshotSku'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Snapshot, self).__init__(**kwargs) + self.managed_by = None + self.sku = kwargs.get('sku', None) + self.time_created = None + self.os_type = kwargs.get('os_type', None) + self.creation_data = kwargs.get('creation_data', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings = kwargs.get('encryption_settings', None) + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_paged.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_paged.py new file mode 100644 index 000000000000..5ff7a760fa0c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class SnapshotPaged(Paged): + """ + A paging container for iterating over a list of :class:`Snapshot ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Snapshot]'} + } + + def __init__(self, *args, **kwargs): + + super(SnapshotPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_py3.py new file mode 100644 index 000000000000..ac1163f8980f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_py3.py @@ -0,0 +1,95 @@ +# 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 .resource import Resource + + +class Snapshot(Resource): + """Snapshot 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 Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar managed_by: Unused. Always Null. + :vartype managed_by: str + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.SnapshotSku + :ivar time_created: The time when the disk was created. + :vartype time_created: datetime + :param os_type: The Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2018_04_01.models.OperatingSystemTypes + :param creation_data: Required. Disk source information. CreationData + information cannot be changed after the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2018_04_01.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2018_04_01.models.EncryptionSettings + :ivar provisioning_state: The disk provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'managed_by': {'readonly': True}, + 'time_created': {'readonly': True}, + 'creation_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SnapshotSku'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, creation_data, tags=None, sku=None, os_type=None, disk_size_gb: int=None, encryption_settings=None, **kwargs) -> None: + super(Snapshot, self).__init__(location=location, tags=tags, **kwargs) + self.managed_by = None + self.sku = sku + self.time_created = None + self.os_type = os_type + self.creation_data = creation_data + self.disk_size_gb = disk_size_gb + self.encryption_settings = encryption_settings + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_sku.py new file mode 100644 index 000000000000..91efbc68afa5 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_sku.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 msrest.serialization import Model + + +class SnapshotSku(Model): + """The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The sku name. Possible values include: 'Standard_LRS', + 'Premium_LRS', 'Standard_ZRS' + :type name: str or + ~azure.mgmt.compute.v2018_04_01.models.SnapshotStorageAccountTypes + :ivar tier: The sku tier. Default value: "Standard" . + :vartype tier: str + """ + + _validation = { + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SnapshotSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_sku_py3.py new file mode 100644 index 000000000000..9975abf7d694 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_sku_py3.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 msrest.serialization import Model + + +class SnapshotSku(Model): + """The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The sku name. Possible values include: 'Standard_LRS', + 'Premium_LRS', 'Standard_ZRS' + :type name: str or + ~azure.mgmt.compute.v2018_04_01.models.SnapshotStorageAccountTypes + :ivar tier: The sku tier. Default value: "Standard" . + :vartype tier: str + """ + + _validation = { + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(SnapshotSku, self).__init__(**kwargs) + self.name = name + self.tier = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_update.py new file mode 100644 index 000000000000..6483ca6dd981 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_update.py @@ -0,0 +1,49 @@ +# 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 .resource_update import ResourceUpdate + + +class SnapshotUpdate(ResourceUpdate): + """Snapshot update resource. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku + :param os_type: the Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2018_04_01.models.OperatingSystemTypes + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2018_04_01.models.EncryptionSettings + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + } + + def __init__(self, **kwargs): + super(SnapshotUpdate, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings = kwargs.get('encryption_settings', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_update_py3.py new file mode 100644 index 000000000000..f4d48cddbd67 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_update_py3.py @@ -0,0 +1,49 @@ +# 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 .resource_update import ResourceUpdate + + +class SnapshotUpdate(ResourceUpdate): + """Snapshot update resource. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku + :param os_type: the Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2018_04_01.models.OperatingSystemTypes + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2018_04_01.models.EncryptionSettings + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + } + + def __init__(self, *, tags=None, sku=None, os_type=None, disk_size_gb: int=None, encryption_settings=None, **kwargs) -> None: + super(SnapshotUpdate, self).__init__(tags=tags, sku=sku, **kwargs) + self.os_type = os_type + self.disk_size_gb = disk_size_gb + self.encryption_settings = encryption_settings diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/source_vault.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/source_vault.py new file mode 100644 index 000000000000..9b16302ebbfb --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/source_vault.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SourceVault(Model): + """The vault id is an Azure Resource Manager Resoure id in the form + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}. + + :param id: Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceVault, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/source_vault_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/source_vault_py3.py new file mode 100644 index 000000000000..13eea5461390 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/source_vault_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SourceVault(Model): + """The vault id is an Azure Resource Manager Resoure id in the form + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}. + + :param id: Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SourceVault, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/__init__.py new file mode 100644 index 000000000000..aceddf83543c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/__init__.py @@ -0,0 +1,18 @@ +# 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 .disks_operations import DisksOperations +from .snapshots_operations import SnapshotsOperations + +__all__ = [ + 'DisksOperations', + 'SnapshotsOperations', +] diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/disks_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/disks_operations.py new file mode 100644 index 000000000000..c066a2195933 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/disks_operations.py @@ -0,0 +1,752 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DisksOperations(object): + """DisksOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-04-01" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(disk, 'Disk') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Disk', response) + if response.status_code == 202: + deserialized = self._deserialize('Disk', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. + The name can't be changed after the disk is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The maximum name + length is 80 characters. + :type disk_name: str + :param disk: Disk object supplied in the body of the Put disk + operation. + :type disk: ~azure.mgmt.compute.v2018_04_01.models.Disk + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Disk or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.Disk] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.Disk]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + disk=disk, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Disk', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} + + + def _update_initial( + self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(disk, 'DiskUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Disk', response) + if response.status_code == 202: + deserialized = self._deserialize('Disk', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates (patches) a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. + The name can't be changed after the disk is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The maximum name + length is 80 characters. + :type disk_name: str + :param disk: Disk object supplied in the body of the Patch disk + operation. + :type disk: ~azure.mgmt.compute.v2018_04_01.models.DiskUpdate + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Disk or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.Disk] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.Disk]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + disk=disk, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Disk', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} + + def get( + self, resource_group_name, disk_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. + The name can't be changed after the disk is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The maximum name + length is 80 characters. + :type disk_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Disk or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.compute.v2018_04_01.models.Disk or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Disk', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} + + + def _delete_initial( + self, resource_group_name, disk_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, disk_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. + The name can't be changed after the disk is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The maximum name + length is 80 characters. + :type disk_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.OperationStatusResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.OperationStatusResponse]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the disks under a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Disk + :rtype: + ~azure.mgmt.compute.v2018_04_01.models.DiskPaged[~azure.mgmt.compute.v2018_04_01.models.Disk] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DiskPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DiskPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the disks under a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Disk + :rtype: + ~azure.mgmt.compute.v2018_04_01.models.DiskPaged[~azure.mgmt.compute.v2018_04_01.models.Disk] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DiskPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DiskPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks'} + + + def _grant_access_initial( + self, resource_group_name, disk_name, access, duration_in_seconds, custom_headers=None, raw=False, **operation_config): + grant_access_data = models.GrantAccessData(access=access, duration_in_seconds=duration_in_seconds) + + # Construct URL + url = self.grant_access.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(grant_access_data, 'GrantAccessData') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AccessUri', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def grant_access( + self, resource_group_name, disk_name, access, duration_in_seconds, custom_headers=None, raw=False, polling=True, **operation_config): + """Grants access to a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. + The name can't be changed after the disk is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The maximum name + length is 80 characters. + :type disk_name: str + :param access: Possible values include: 'None', 'Read' + :type access: str or + ~azure.mgmt.compute.v2018_04_01.models.AccessLevel + :param duration_in_seconds: Time duration in seconds until the SAS + access expires. + :type duration_in_seconds: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AccessUri or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.AccessUri] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.AccessUri]] + :raises: :class:`CloudError` + """ + raw_result = self._grant_access_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + access=access, + duration_in_seconds=duration_in_seconds, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AccessUri', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + grant_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess'} + + + def _revoke_access_initial( + self, resource_group_name, disk_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.revoke_access.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def revoke_access( + self, resource_group_name, disk_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Revokes access to a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. + The name can't be changed after the disk is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The maximum name + length is 80 characters. + :type disk_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.OperationStatusResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.OperationStatusResponse]] + :raises: :class:`CloudError` + """ + raw_result = self._revoke_access_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + revoke_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/snapshots_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/snapshots_operations.py new file mode 100644 index 000000000000..b6c4d1bf4b74 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/snapshots_operations.py @@ -0,0 +1,752 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class SnapshotsOperations(object): + """SnapshotsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-04-01" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(snapshot, 'Snapshot') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', response) + if response.status_code == 202: + deserialized = self._deserialize('Snapshot', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. + The name can't be changed after the snapshot is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The max name length + is 80 characters. + :type snapshot_name: str + :param snapshot: Snapshot object supplied in the body of the Put disk + operation. + :type snapshot: ~azure.mgmt.compute.v2018_04_01.models.Snapshot + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Snapshot or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.Snapshot] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.Snapshot]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + snapshot=snapshot, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Snapshot', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} + + + def _update_initial( + self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(snapshot, 'SnapshotUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', response) + if response.status_code == 202: + deserialized = self._deserialize('Snapshot', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates (patches) a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. + The name can't be changed after the snapshot is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The max name length + is 80 characters. + :type snapshot_name: str + :param snapshot: Snapshot object supplied in the body of the Patch + snapshot operation. + :type snapshot: ~azure.mgmt.compute.v2018_04_01.models.SnapshotUpdate + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Snapshot or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.Snapshot] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.Snapshot]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + snapshot=snapshot, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Snapshot', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} + + def get( + self, resource_group_name, snapshot_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. + The name can't be changed after the snapshot is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The max name length + is 80 characters. + :type snapshot_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Snapshot or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.compute.v2018_04_01.models.Snapshot or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} + + + def _delete_initial( + self, resource_group_name, snapshot_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, snapshot_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. + The name can't be changed after the snapshot is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The max name length + is 80 characters. + :type snapshot_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.OperationStatusResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.OperationStatusResponse]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists snapshots under a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Snapshot + :rtype: + ~azure.mgmt.compute.v2018_04_01.models.SnapshotPaged[~azure.mgmt.compute.v2018_04_01.models.Snapshot] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SnapshotPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SnapshotPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists snapshots under a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Snapshot + :rtype: + ~azure.mgmt.compute.v2018_04_01.models.SnapshotPaged[~azure.mgmt.compute.v2018_04_01.models.Snapshot] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SnapshotPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SnapshotPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots'} + + + def _grant_access_initial( + self, resource_group_name, snapshot_name, access, duration_in_seconds, custom_headers=None, raw=False, **operation_config): + grant_access_data = models.GrantAccessData(access=access, duration_in_seconds=duration_in_seconds) + + # Construct URL + url = self.grant_access.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(grant_access_data, 'GrantAccessData') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AccessUri', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def grant_access( + self, resource_group_name, snapshot_name, access, duration_in_seconds, custom_headers=None, raw=False, polling=True, **operation_config): + """Grants access to a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. + The name can't be changed after the snapshot is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The max name length + is 80 characters. + :type snapshot_name: str + :param access: Possible values include: 'None', 'Read' + :type access: str or + ~azure.mgmt.compute.v2018_04_01.models.AccessLevel + :param duration_in_seconds: Time duration in seconds until the SAS + access expires. + :type duration_in_seconds: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AccessUri or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.AccessUri] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.AccessUri]] + :raises: :class:`CloudError` + """ + raw_result = self._grant_access_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + access=access, + duration_in_seconds=duration_in_seconds, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AccessUri', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + grant_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess'} + + + def _revoke_access_initial( + self, resource_group_name, snapshot_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.revoke_access.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def revoke_access( + self, resource_group_name, snapshot_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Revokes access to a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. + The name can't be changed after the snapshot is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The max name length + is 80 characters. + :type snapshot_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.OperationStatusResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.OperationStatusResponse]] + :raises: :class:`CloudError` + """ + raw_result = self._revoke_access_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + revoke_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/version.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/version.py new file mode 100644 index 000000000000..b04095332b31 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "2018-04-01" + diff --git a/azure-mgmt-compute/azure/mgmt/compute/version.py b/azure-mgmt-compute/azure/mgmt/compute/version.py index 011c8e67b080..998a9d6e51b8 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/version.py +++ b/azure-mgmt-compute/azure/mgmt/compute/version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "3.1.0rc3" +VERSION = "4.0.0rc1" diff --git a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_change_account_type.yaml b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_change_account_type.yaml index 54ebca411edc..6cf70600eed0 100644 --- a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_change_account_type.yaml +++ b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_change_account_type.yaml @@ -8,27 +8,28 @@ interactions: Connection: [keep-alive] Content-Length: ['99'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_change_account_typedfe7139e/providers/Microsoft.Compute/disks/myDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_change_account_typedfe7139e/providers/Microsoft.Compute/disks/myDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"properties\": {\r\n \"creationData\": {\r\n \"\ createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\": 20,\r\n \"provisioningState\"\ : \"Updating\",\r\n \"isArmResource\": true\r\n },\r\n \"location\":\ \ \"westus\",\r\n \"name\": \"myDisk\"\r\n}"} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/d84355b7-f9d8-468f-b2e6-ad12ae055b2b?api-version=2017-03-30'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/55d2dbb5-98b1-492c-a444-10d921fb6266?api-version=2018-04-01'] cache-control: [no-cache] content-length: ['224'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:51:03 GMT'] + date: ['Wed, 21 Mar 2018 21:20:20 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/d84355b7-f9d8-468f-b2e6-ad12ae055b2b?monitor=true&api-version=2017-03-30'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/55d2dbb5-98b1-492c-a444-10d921fb6266?monitor=true&api-version=2018-04-01'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/CreateUpdateDisks3Min;999,Microsoft.Compute/CreateUpdateDisks30Min;3999'] x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 202, message: Accepted} @@ -38,33 +39,32 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/d84355b7-f9d8-468f-b2e6-ad12ae055b2b?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/55d2dbb5-98b1-492c-a444-10d921fb6266?api-version=2018-04-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T00:51:04.3808302+00:00\",\r\ - \n \"endTime\": \"2017-11-22T00:51:04.5214488+00:00\",\r\n \"status\": \"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:20:20.8967553+00:00\",\r\ + \n \"endTime\": \"2018-03-21T21:20:21.0529939+00:00\",\r\n \"status\": \"\ Succeeded\",\r\n \"properties\": {\r\n \"output\": {\"sku\":{\"name\"\ :\"Standard_LRS\",\"tier\":\"Standard\"},\"properties\":{\"creationData\"\ - :{\"createOption\":\"Empty\"},\"diskSizeGB\":20,\"timeCreated\":\"2017-11-22T00:51:04.3964515+00:00\"\ + :{\"createOption\":\"Empty\"},\"diskSizeGB\":20,\"timeCreated\":\"2018-03-21T21:20:20.8967553+00:00\"\ ,\"provisioningState\":\"Succeeded\",\"diskState\":\"Unattached\"},\"type\"\ :\"Microsoft.Compute/disks\",\"location\":\"westus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_change_account_typedfe7139e/providers/Microsoft.Compute/disks/myDisk\"\ - ,\"name\":\"myDisk\"}\r\n },\r\n \"name\": \"d84355b7-f9d8-468f-b2e6-ad12ae055b2b\"\ + ,\"name\":\"myDisk\"}\r\n },\r\n \"name\": \"55d2dbb5-98b1-492c-a444-10d921fb6266\"\ \r\n}"} headers: cache-control: [no-cache] content-length: ['693'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:51:34 GMT'] + date: ['Wed, 21 Mar 2018 21:20:51 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;49998,Microsoft.Compute/GetOperation30Min;249998'] status: {code: 200, message: OK} - request: @@ -73,17 +73,15 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_change_account_typedfe7139e/providers/Microsoft.Compute/disks/myDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_change_account_typedfe7139e/providers/Microsoft.Compute/disks/myDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"\ tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n \"creationData\"\ : {\r\n \"createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\":\ - \ 20,\r\n \"timeCreated\": \"2017-11-22T00:51:04.3964515+00:00\",\r\n \ + \ 20,\r\n \"timeCreated\": \"2018-03-21T21:20:20.8967553+00:00\",\r\n \ \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ \r\n },\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"\ westus\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_change_account_typedfe7139e/providers/Microsoft.Compute/disks/myDisk\"\ @@ -92,13 +90,14 @@ interactions: cache-control: [no-cache] content-length: ['572'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:51:34 GMT'] + date: ['Wed, 21 Mar 2018 21:20:51 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4998,Microsoft.Compute/LowCostGet30Min;19998'] status: {code: 200, message: OK} - request: @@ -108,16 +107,16 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_change_account_typedfe7139e/providers/Microsoft.Compute/disks/myDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_change_account_typedfe7139e/providers/Microsoft.Compute/disks/myDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"\ tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n \"creationData\"\ : {\r\n \"createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\":\ - \ 20,\r\n \"timeCreated\": \"2017-11-22T00:51:04.3964515+00:00\",\r\n \ + \ 20,\r\n \"timeCreated\": \"2018-03-21T21:20:20.8967553+00:00\",\r\n \ \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ \r\n },\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"\ westus\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_change_account_typedfe7139e/providers/Microsoft.Compute/disks/myDisk\"\ @@ -126,13 +125,14 @@ interactions: cache-control: [no-cache] content-length: ['572'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:51:37 GMT'] + date: ['Wed, 21 Mar 2018 21:20:51 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4997,Microsoft.Compute/LowCostGet30Min;19997'] status: {code: 200, message: OK} - request: @@ -144,11 +144,11 @@ interactions: Connection: [keep-alive] Content-Length: ['132'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_change_account_typedfe7139e/providers/Microsoft.Compute/disks/myDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_change_account_typedfe7139e/providers/Microsoft.Compute/disks/myDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\"\r\n },\r\n\ \ \"properties\": {\r\n \"creationData\": {\r\n \"createOption\"\ @@ -156,16 +156,17 @@ interactions: : \"Updating\",\r\n \"isArmResource\": true\r\n },\r\n \"location\":\ \ \"westus\",\r\n \"name\": \"myDisk\"\r\n}"} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/3e92f299-74c7-4770-938b-783b3fef6098?api-version=2017-03-30'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/9bdec6fc-4a76-4492-9227-84ddde7f64a2?api-version=2018-04-01'] cache-control: [no-cache] content-length: ['270'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:51:39 GMT'] + date: ['Wed, 21 Mar 2018 21:20:52 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/3e92f299-74c7-4770-938b-783b3fef6098?monitor=true&api-version=2017-03-30'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/9bdec6fc-4a76-4492-9227-84ddde7f64a2?monitor=true&api-version=2018-04-01'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/CreateUpdateDisks3Min;998,Microsoft.Compute/CreateUpdateDisks30Min;3998'] x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 202, message: Accepted} @@ -175,33 +176,32 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/3e92f299-74c7-4770-938b-783b3fef6098?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/9bdec6fc-4a76-4492-9227-84ddde7f64a2?api-version=2018-04-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T00:51:41.4878522+00:00\",\r\ - \n \"endTime\": \"2017-11-22T00:51:41.6597321+00:00\",\r\n \"status\": \"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:20:53.723007+00:00\",\r\n\ + \ \"endTime\": \"2018-03-21T21:20:53.8948486+00:00\",\r\n \"status\": \"\ Succeeded\",\r\n \"properties\": {\r\n \"output\": {\"sku\":{\"name\"\ :\"Standard_LRS\",\"tier\":\"Standard\"},\"properties\":{\"creationData\"\ - :{\"createOption\":\"Empty\"},\"diskSizeGB\":20,\"timeCreated\":\"2017-11-22T00:51:04.3964515+00:00\"\ + :{\"createOption\":\"Empty\"},\"diskSizeGB\":20,\"timeCreated\":\"2018-03-21T21:20:20.8967553+00:00\"\ ,\"provisioningState\":\"Succeeded\",\"diskState\":\"Unattached\"},\"type\"\ :\"Microsoft.Compute/disks\",\"location\":\"westus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_change_account_typedfe7139e/providers/Microsoft.Compute/disks/myDisk\"\ - ,\"name\":\"myDisk\"}\r\n },\r\n \"name\": \"3e92f299-74c7-4770-938b-783b3fef6098\"\ + ,\"name\":\"myDisk\"}\r\n },\r\n \"name\": \"9bdec6fc-4a76-4492-9227-84ddde7f64a2\"\ \r\n}"} headers: cache-control: [no-cache] - content-length: ['693'] + content-length: ['692'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:52:11 GMT'] + date: ['Wed, 21 Mar 2018 21:21:24 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;49996,Microsoft.Compute/GetOperation30Min;249996'] status: {code: 200, message: OK} - request: @@ -210,17 +210,15 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_change_account_typedfe7139e/providers/Microsoft.Compute/disks/myDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_change_account_typedfe7139e/providers/Microsoft.Compute/disks/myDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"\ tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n \"creationData\"\ : {\r\n \"createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\":\ - \ 20,\r\n \"timeCreated\": \"2017-11-22T00:51:04.3964515+00:00\",\r\n \ + \ 20,\r\n \"timeCreated\": \"2018-03-21T21:20:20.8967553+00:00\",\r\n \ \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ \r\n },\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"\ westus\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_change_account_typedfe7139e/providers/Microsoft.Compute/disks/myDisk\"\ @@ -229,13 +227,14 @@ interactions: cache-control: [no-cache] content-length: ['572'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:52:12 GMT'] + date: ['Wed, 21 Mar 2018 21:21:25 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4995,Microsoft.Compute/LowCostGet30Min;19995'] status: {code: 200, message: OK} version: 1 diff --git a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_create_snapshot.yaml b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_create_snapshot.yaml index e02c23913d54..384688282841 100644 --- a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_create_snapshot.yaml +++ b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_create_snapshot.yaml @@ -8,29 +8,30 @@ interactions: Connection: [keep-alive] Content-Length: ['99'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/disks/myDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/disks/myDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"properties\": {\r\n \"creationData\": {\r\n \"\ createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\": 20,\r\n \"provisioningState\"\ : \"Updating\",\r\n \"isArmResource\": true\r\n },\r\n \"location\":\ \ \"westus\",\r\n \"name\": \"myDisk\"\r\n}"} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/b849bcb0-c8c7-4c1f-95b7-a17cdd59dc91?api-version=2017-03-30'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/a54172a2-e9c3-4968-98ce-7e557d23e31f?api-version=2018-04-01'] cache-control: [no-cache] content-length: ['224'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:52:36 GMT'] + date: ['Wed, 21 Mar 2018 21:21:48 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/b849bcb0-c8c7-4c1f-95b7-a17cdd59dc91?monitor=true&api-version=2017-03-30'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/a54172a2-e9c3-4968-98ce-7e557d23e31f?monitor=true&api-version=2018-04-01'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/CreateUpdateDisks3Min;997,Microsoft.Compute/CreateUpdateDisks30Min;3997'] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 202, message: Accepted} - request: body: null @@ -38,33 +39,32 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/b849bcb0-c8c7-4c1f-95b7-a17cdd59dc91?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/a54172a2-e9c3-4968-98ce-7e557d23e31f?api-version=2018-04-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T00:52:38.150623+00:00\",\r\n\ - \ \"endTime\": \"2017-11-22T00:52:38.353765+00:00\",\r\n \"status\": \"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:21:48.5691741+00:00\",\r\ + \n \"endTime\": \"2018-03-21T21:21:48.7441701+00:00\",\r\n \"status\": \"\ Succeeded\",\r\n \"properties\": {\r\n \"output\": {\"sku\":{\"name\"\ :\"Standard_LRS\",\"tier\":\"Standard\"},\"properties\":{\"creationData\"\ - :{\"createOption\":\"Empty\"},\"diskSizeGB\":20,\"timeCreated\":\"2017-11-22T00:52:38.150623+00:00\"\ + :{\"createOption\":\"Empty\"},\"diskSizeGB\":20,\"timeCreated\":\"2018-03-21T21:21:48.584802+00:00\"\ ,\"provisioningState\":\"Succeeded\",\"diskState\":\"Unattached\"},\"type\"\ :\"Microsoft.Compute/disks\",\"location\":\"westus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/disks/myDisk\"\ - ,\"name\":\"myDisk\"}\r\n },\r\n \"name\": \"b849bcb0-c8c7-4c1f-95b7-a17cdd59dc91\"\ + ,\"name\":\"myDisk\"}\r\n },\r\n \"name\": \"a54172a2-e9c3-4968-98ce-7e557d23e31f\"\ \r\n}"} headers: cache-control: [no-cache] - content-length: ['686'] + content-length: ['688'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:53:07 GMT'] + date: ['Wed, 21 Mar 2018 21:22:18 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;49992,Microsoft.Compute/GetOperation30Min;249992'] status: {code: 200, message: OK} - request: @@ -73,17 +73,15 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/disks/myDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/disks/myDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"\ tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n \"creationData\"\ : {\r\n \"createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\":\ - \ 20,\r\n \"timeCreated\": \"2017-11-22T00:52:38.150623+00:00\",\r\n \ + \ 20,\r\n \"timeCreated\": \"2018-03-21T21:21:48.584802+00:00\",\r\n \ \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ \r\n },\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"\ westus\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/disks/myDisk\"\ @@ -92,13 +90,14 @@ interactions: cache-control: [no-cache] content-length: ['567'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:53:08 GMT'] + date: ['Wed, 21 Mar 2018 21:22:20 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4993,Microsoft.Compute/LowCostGet30Min;19993'] status: {code: 200, message: OK} - request: @@ -108,16 +107,16 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/disks/myDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/disks/myDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"\ tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n \"creationData\"\ : {\r\n \"createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\":\ - \ 20,\r\n \"timeCreated\": \"2017-11-22T00:52:38.150623+00:00\",\r\n \ + \ 20,\r\n \"timeCreated\": \"2018-03-21T21:21:48.584802+00:00\",\r\n \ \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ \r\n },\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"\ westus\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/disks/myDisk\"\ @@ -126,13 +125,14 @@ interactions: cache-control: [no-cache] content-length: ['567'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:53:09 GMT'] + date: ['Wed, 21 Mar 2018 21:22:19 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4992,Microsoft.Compute/LowCostGet30Min;19992'] status: {code: 200, message: OK} - request: @@ -144,28 +144,29 @@ interactions: Connection: [keep-alive] Content-Length: ['257'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/snapshots/mySnapshot?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/snapshots/mySnapshot?api-version=2018-04-01 response: body: {string: "{\r\n \"properties\": {\r\n \"creationData\": {\r\n \"\ createOption\": \"Copy\",\r\n \"sourceUri\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/disks/myDisk\"\ \r\n },\r\n \"provisioningState\": \"Updating\",\r\n \"isArmResource\"\ : true\r\n },\r\n \"location\": \"westus\"\r\n}"} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/8458eaaa-4ad2-4644-8cdf-c70fc789cefe?api-version=2017-03-30'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/cf2c9798-a0a8-4c4c-9156-52cb76f4514d?api-version=2018-04-01'] cache-control: [no-cache] content-length: ['363'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:53:11 GMT'] + date: ['Wed, 21 Mar 2018 21:22:21 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/8458eaaa-4ad2-4644-8cdf-c70fc789cefe?monitor=true&api-version=2017-03-30'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/cf2c9798-a0a8-4c4c-9156-52cb76f4514d?monitor=true&api-version=2018-04-01'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/HighCostHydrate3Min;239,Microsoft.Compute/HighCostHydrate30Min;1199'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/HighCostSnapshotCreateHydrate3Min;239,Microsoft.Compute/HighCostSnapshotCreateHydrate30Min;1199'] x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 202, message: Accepted} - request: @@ -174,34 +175,33 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/8458eaaa-4ad2-4644-8cdf-c70fc789cefe?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/cf2c9798-a0a8-4c4c-9156-52cb76f4514d?api-version=2018-04-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T00:53:12.3830329+00:00\",\r\ - \n \"endTime\": \"2017-11-22T00:53:13.2736756+00:00\",\r\n \"status\": \"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:22:21.7211275+00:00\",\r\ + \n \"endTime\": \"2018-03-21T21:22:32.6168462+00:00\",\r\n \"status\": \"\ Succeeded\",\r\n \"properties\": {\r\n \"output\": {\"sku\":{\"name\"\ :\"Standard_LRS\",\"tier\":\"Standard\"},\"properties\":{\"creationData\"\ :{\"createOption\":\"Copy\",\"sourceResourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/disks/myDisk\"\ - },\"diskSizeGB\":20,\"timeCreated\":\"2017-11-22T00:53:12.3830329+00:00\"\ + },\"diskSizeGB\":20,\"timeCreated\":\"2018-03-21T21:22:21.7523604+00:00\"\ ,\"provisioningState\":\"Succeeded\",\"diskState\":\"Unattached\"},\"type\"\ :\"Microsoft.Compute/snapshots\",\"location\":\"westus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/snapshots/mySnapshot\"\ - ,\"name\":\"mySnapshot\"}\r\n },\r\n \"name\": \"8458eaaa-4ad2-4644-8cdf-c70fc789cefe\"\ + ,\"name\":\"mySnapshot\"}\r\n },\r\n \"name\": \"cf2c9798-a0a8-4c4c-9156-52cb76f4514d\"\ \r\n}"} headers: cache-control: [no-cache] content-length: ['886'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:53:41 GMT'] + date: ['Wed, 21 Mar 2018 21:22:51 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;49989,Microsoft.Compute/GetOperation30Min;249989'] status: {code: 200, message: OK} - request: @@ -210,18 +210,16 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/snapshots/mySnapshot?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/snapshots/mySnapshot?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"\ tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n \"creationData\"\ : {\r\n \"createOption\": \"Copy\",\r\n \"sourceResourceId\": \"\ /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/disks/myDisk\"\ - \r\n },\r\n \"diskSizeGB\": 20,\r\n \"timeCreated\": \"2017-11-22T00:53:12.3830329+00:00\"\ + \r\n },\r\n \"diskSizeGB\": 20,\r\n \"timeCreated\": \"2018-03-21T21:22:21.7523604+00:00\"\ ,\r\n \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ \r\n },\r\n \"type\": \"Microsoft.Compute/snapshots\",\r\n \"location\"\ : \"westus\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_snapshot9571120e/providers/Microsoft.Compute/snapshots/mySnapshot\"\ @@ -230,13 +228,14 @@ interactions: cache-control: [no-cache] content-length: ['774'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:53:42 GMT'] + date: ['Wed, 21 Mar 2018 21:22:52 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4990,Microsoft.Compute/LowCostGet30Min;19990'] status: {code: 200, message: OK} version: 1 diff --git a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_create_virtual_machine_scale_set.yaml b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_create_virtual_machine_scale_set.yaml index 6771e9d97659..c28ec4666097 100644 --- a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_create_virtual_machine_scale_set.yaml +++ b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_create_virtual_machine_scale_set.yaml @@ -9,35 +9,36 @@ interactions: Connection: [keep-alive] Content-Length: ['183'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 networkmanagementclient/1.6.0 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 networkmanagementclient/2.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Network/virtualNetworks/pyvmirnet5cc18eb?api-version=2017-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Network/virtualNetworks/pyvmirnet5cc18eb?api-version=2017-11-01 response: body: {string: "{\r\n \"name\": \"pyvmirnet5cc18eb\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Network/virtualNetworks/pyvmirnet5cc18eb\"\ - ,\r\n \"etag\": \"W/\\\"81a76709-caa0-4848-a65f-291f8cfe62e1\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"9553c743-9fdb-4205-bd0f-028f2977494c\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ - \ \"resourceGuid\": \"ec15070d-206e-463f-9551-a7bc93843bfd\",\r\n \"\ + \ \"resourceGuid\": \"c8348c82-b60a-4280-8f04-e77fe75371ca\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\"\ : \"pyvmirsub5cc18eb\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Network/virtualNetworks/pyvmirnet5cc18eb/subnets/pyvmirsub5cc18eb\"\ - ,\r\n \"etag\": \"W/\\\"81a76709-caa0-4848-a65f-291f8cfe62e1\\\"\"\ + ,\r\n \"etag\": \"W/\\\"9553c743-9fdb-4205-bd0f-028f2977494c\\\"\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\"\ ,\r\n \"addressPrefix\": \"10.0.0.0/24\"\r\n }\r\n }\r\ \n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\"\ : false,\r\n \"enableVmProtection\": false\r\n }\r\n}"} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/384d6639-fba6-40c9-b6ee-7c97866c363d?api-version=2017-09-01'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/7ec1374f-127d-4872-9cce-55b6da1a011e?api-version=2017-11-01'] cache-control: [no-cache] content-length: ['1198'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:53:52 GMT'] + date: ['Wed, 21 Mar 2018 21:22:58 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 201, message: Created} - request: @@ -46,25 +47,49 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 networkmanagementclient/1.6.0 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 networkmanagementclient/2.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/384d6639-fba6-40c9-b6ee-7c97866c363d?api-version=2017-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/7ec1374f-127d-4872-9cce-55b6da1a011e?api-version=2017-11-01 + response: + body: {string: "{\r\n \"status\": \"InProgress\"\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['30'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 21:23:03 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 networkmanagementclient/2.0.0rc1 Azure-SDK-For-Python] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/7ec1374f-127d-4872-9cce-55b6da1a011e?api-version=2017-11-01 response: body: {string: "{\r\n \"status\": \"Succeeded\"\r\n}"} headers: cache-control: [no-cache] content-length: ['29'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:53:55 GMT'] + date: ['Wed, 21 Mar 2018 21:23:13 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null @@ -72,22 +97,20 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 networkmanagementclient/1.6.0 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 networkmanagementclient/2.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Network/virtualNetworks/pyvmirnet5cc18eb?api-version=2017-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Network/virtualNetworks/pyvmirnet5cc18eb?api-version=2017-11-01 response: body: {string: "{\r\n \"name\": \"pyvmirnet5cc18eb\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Network/virtualNetworks/pyvmirnet5cc18eb\"\ - ,\r\n \"etag\": \"W/\\\"92b5e7d2-4346-4cff-a273-613e0f99adfc\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"12cf6389-de57-43c9-9a9e-aa913105cb3b\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"ec15070d-206e-463f-9551-a7bc93843bfd\",\r\n \"\ + \ \"resourceGuid\": \"c8348c82-b60a-4280-8f04-e77fe75371ca\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\"\ : \"pyvmirsub5cc18eb\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Network/virtualNetworks/pyvmirnet5cc18eb/subnets/pyvmirsub5cc18eb\"\ - ,\r\n \"etag\": \"W/\\\"92b5e7d2-4346-4cff-a273-613e0f99adfc\\\"\"\ + ,\r\n \"etag\": \"W/\\\"12cf6389-de57-43c9-9a9e-aa913105cb3b\\\"\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"addressPrefix\": \"10.0.0.0/24\"\r\n }\r\n }\r\ \n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\"\ @@ -96,14 +119,15 @@ interactions: cache-control: [no-cache] content-length: ['1200'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:53:56 GMT'] - etag: [W/"92b5e7d2-4346-4cff-a273-613e0f99adfc"] + date: ['Wed, 21 Mar 2018 21:23:14 GMT'] + etag: [W/"12cf6389-de57-43c9-9a9e-aa913105cb3b"] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null @@ -112,28 +136,29 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 networkmanagementclient/1.6.0 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 networkmanagementclient/2.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Network/virtualNetworks/pyvmirnet5cc18eb/subnets/pyvmirsub5cc18eb?api-version=2017-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Network/virtualNetworks/pyvmirnet5cc18eb/subnets/pyvmirsub5cc18eb?api-version=2017-11-01 response: body: {string: "{\r\n \"name\": \"pyvmirsub5cc18eb\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Network/virtualNetworks/pyvmirnet5cc18eb/subnets/pyvmirsub5cc18eb\"\ - ,\r\n \"etag\": \"W/\\\"92b5e7d2-4346-4cff-a273-613e0f99adfc\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"12cf6389-de57-43c9-9a9e-aa913105cb3b\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\"\r\n }\r\n}"} headers: cache-control: [no-cache] content-length: ['425'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:53:57 GMT'] - etag: [W/"92b5e7d2-4346-4cff-a273-613e0f99adfc"] + date: ['Wed, 21 Mar 2018 21:23:14 GMT'] + etag: [W/"12cf6389-de57-43c9-9a9e-aa913105cb3b"] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: 'b''b\''b\\\''{"location": "westus", "sku": {"name": "Standard_A1", "tier": @@ -151,8 +176,8 @@ interactions: Connection: [keep-alive] Content-Length: ['867'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Compute/virtualMachineScaleSets/pyvmirvm5cc18eb?api-version=2017-12-01 @@ -177,23 +202,24 @@ interactions: ipConfigurations\":[{\"name\":\"PyTestInfixipconfig\",\"properties\":{\"subnet\"\ :{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Network/virtualNetworks/pyvmirnet5cc18eb/subnets/pyvmirsub5cc18eb\"\ },\"privateIPAddressVersion\":\"IPv4\"}}]}}]}\r\n },\r\n \"provisioningState\"\ - : \"Creating\",\r\n \"overprovision\": true,\r\n \"uniqueId\": \"48cfcd11-6231-4973-bf7e-a07fd845700c\"\ + : \"Creating\",\r\n \"overprovision\": true,\r\n \"uniqueId\": \"99f64c31-94c4-4439-9a46-e72f275a6b94\"\ \r\n },\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets\",\r\n\ \ \"location\": \"westus\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Compute/virtualMachineScaleSets/pyvmirvm5cc18eb\"\ ,\r\n \"name\": \"pyvmirvm5cc18eb\"\r\n}"} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/a020d366-f304-4dc9-ade0-73de1cfa61e2?api-version=2017-12-01'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d26b2f56-d553-4d9c-9cb1-a8816f379e8f?api-version=2017-12-01'] cache-control: [no-cache] content-length: ['1926'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:54:05 GMT'] + date: ['Wed, 21 Mar 2018 21:23:17 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/CreateVMScaleSet3Min;39,Microsoft.Compute/CreateVMScaleSet30Min;199,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1190,Microsoft.Compute/VmssQueuedVMOperations;1790'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/CreateVMScaleSet3Min;39,Microsoft.Compute/CreateVMScaleSet30Min;199,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1193,Microsoft.Compute/VmssQueuedVMOperations;4793'] x-ms-ratelimit-remaining-subscription-writes: ['1199'] - x-ms-request-charge: ['10'] + x-ms-request-charge: ['7'] status: {code: 201, message: Created} - request: body: null @@ -201,57 +227,27 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/a020d366-f304-4dc9-ade0-73de1cfa61e2?api-version=2017-12-01 - response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T00:54:06.5290802+00:00\",\r\ - \n \"status\": \"InProgress\",\r\n \"name\": \"a020d366-f304-4dc9-ade0-73de1cfa61e2\"\ - \r\n}"} - headers: - cache-control: [no-cache] - content-length: ['134'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:54:36 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;2158,Microsoft.Compute/GetOperation30Min;17998'] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/a020d366-f304-4dc9-ade0-73de1cfa61e2?api-version=2017-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d26b2f56-d553-4d9c-9cb1-a8816f379e8f?api-version=2017-12-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T00:54:06.5290802+00:00\",\r\ - \n \"status\": \"InProgress\",\r\n \"name\": \"a020d366-f304-4dc9-ade0-73de1cfa61e2\"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:23:16.7295202+00:00\",\r\ + \n \"status\": \"InProgress\",\r\n \"name\": \"d26b2f56-d553-4d9c-9cb1-a8816f379e8f\"\ \r\n}"} headers: cache-control: [no-cache] content-length: ['134'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:55:07 GMT'] + date: ['Wed, 21 Mar 2018 21:23:54 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;2155,Microsoft.Compute/GetOperation30Min;17995'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;11997,Microsoft.Compute/GetOperation30Min;23997'] status: {code: 200, message: OK} - request: body: null @@ -259,28 +255,27 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/a020d366-f304-4dc9-ade0-73de1cfa61e2?api-version=2017-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d26b2f56-d553-4d9c-9cb1-a8816f379e8f?api-version=2017-12-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T00:54:06.5290802+00:00\",\r\ - \n \"status\": \"InProgress\",\r\n \"name\": \"a020d366-f304-4dc9-ade0-73de1cfa61e2\"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:23:16.7295202+00:00\",\r\ + \n \"status\": \"InProgress\",\r\n \"name\": \"d26b2f56-d553-4d9c-9cb1-a8816f379e8f\"\ \r\n}"} headers: cache-control: [no-cache] content-length: ['134'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:55:37 GMT'] + date: ['Wed, 21 Mar 2018 21:24:28 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;2152,Microsoft.Compute/GetOperation30Min;17992'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;11994,Microsoft.Compute/GetOperation30Min;23994'] status: {code: 200, message: OK} - request: body: null @@ -288,28 +283,27 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/a020d366-f304-4dc9-ade0-73de1cfa61e2?api-version=2017-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d26b2f56-d553-4d9c-9cb1-a8816f379e8f?api-version=2017-12-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T00:54:06.5290802+00:00\",\r\ - \n \"status\": \"InProgress\",\r\n \"name\": \"a020d366-f304-4dc9-ade0-73de1cfa61e2\"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:23:16.7295202+00:00\",\r\ + \n \"status\": \"InProgress\",\r\n \"name\": \"d26b2f56-d553-4d9c-9cb1-a8816f379e8f\"\ \r\n}"} headers: cache-control: [no-cache] content-length: ['134'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:56:07 GMT'] + date: ['Wed, 21 Mar 2018 21:25:00 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;2149,Microsoft.Compute/GetOperation30Min;17989'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;11991,Microsoft.Compute/GetOperation30Min;23991'] status: {code: 200, message: OK} - request: body: null @@ -317,28 +311,27 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/a020d366-f304-4dc9-ade0-73de1cfa61e2?api-version=2017-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d26b2f56-d553-4d9c-9cb1-a8816f379e8f?api-version=2017-12-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T00:54:06.5290802+00:00\",\r\ - \n \"endTime\": \"2017-11-22T00:56:35.36403+00:00\",\r\n \"status\": \"\ - Succeeded\",\r\n \"name\": \"a020d366-f304-4dc9-ade0-73de1cfa61e2\"\r\n}"} + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:23:16.7295202+00:00\",\r\ + \n \"endTime\": \"2018-03-21T21:25:25.2924465+00:00\",\r\n \"status\": \"\ + Succeeded\",\r\n \"name\": \"d26b2f56-d553-4d9c-9cb1-a8816f379e8f\"\r\n}"} headers: cache-control: [no-cache] - content-length: ['182'] + content-length: ['184'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:56:39 GMT'] + date: ['Wed, 21 Mar 2018 21:25:31 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;2146,Microsoft.Compute/GetOperation30Min;17986'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;11988,Microsoft.Compute/GetOperation30Min;23988'] status: {code: 200, message: OK} - request: body: null @@ -346,10 +339,8 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Compute/virtualMachineScaleSets/pyvmirvm5cc18eb?api-version=2017-12-01 response: @@ -373,7 +364,7 @@ interactions: ipConfigurations\":[{\"name\":\"PyTestInfixipconfig\",\"properties\":{\"subnet\"\ :{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Network/virtualNetworks/pyvmirnet5cc18eb/subnets/pyvmirsub5cc18eb\"\ },\"privateIPAddressVersion\":\"IPv4\"}}]}}]}\r\n },\r\n \"provisioningState\"\ - : \"Succeeded\",\r\n \"overprovision\": true,\r\n \"uniqueId\": \"48cfcd11-6231-4973-bf7e-a07fd845700c\"\ + : \"Succeeded\",\r\n \"overprovision\": true,\r\n \"uniqueId\": \"99f64c31-94c4-4439-9a46-e72f275a6b94\"\ \r\n },\r\n \"type\": \"Microsoft.Compute/virtualMachineScaleSets\",\r\n\ \ \"location\": \"westus\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_virtual_machine_scale_set5cc18eb/providers/Microsoft.Compute/virtualMachineScaleSets/pyvmirvm5cc18eb\"\ ,\r\n \"name\": \"pyvmirvm5cc18eb\"\r\n}"} @@ -381,13 +372,14 @@ interactions: cache-control: [no-cache] content-length: ['1927'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 00:56:39 GMT'] + date: ['Wed, 21 Mar 2018 21:25:32 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetVMScaleSet3Min;239,Microsoft.Compute/GetVMScaleSet30Min;1181'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetVMScaleSet3Min;194,Microsoft.Compute/GetVMScaleSet30Min;1490'] status: {code: 200, message: OK} version: 1 diff --git a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_create_vm_implicit_md.yaml b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_create_vm_implicit_md.yaml index 3ac7e099dc53..6b2ccd00b537 100644 --- a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_create_vm_implicit_md.yaml +++ b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_create_vm_implicit_md.yaml @@ -9,35 +9,36 @@ interactions: Connection: [keep-alive] Content-Length: ['183'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 networkmanagementclient/1.6.0 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 networkmanagementclient/2.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/virtualNetworks/pyvmirnet9bd146b?api-version=2017-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/virtualNetworks/pyvmirnet9bd146b?api-version=2017-11-01 response: body: {string: "{\r\n \"name\": \"pyvmirnet9bd146b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/virtualNetworks/pyvmirnet9bd146b\"\ - ,\r\n \"etag\": \"W/\\\"821cf348-ad8c-4316-927a-9e60850d0206\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"cd48b2c7-db52-4e2a-a3b1-c9b9a41818a4\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ - \ \"resourceGuid\": \"981354c0-3d35-4c3e-9c62-f1d9a4a8fb66\",\r\n \"\ + \ \"resourceGuid\": \"721e8a4f-fa1a-4df6-b067-ff820fa80094\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\"\ : \"pyvmirsub9bd146b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/virtualNetworks/pyvmirnet9bd146b/subnets/pyvmirsub9bd146b\"\ - ,\r\n \"etag\": \"W/\\\"821cf348-ad8c-4316-927a-9e60850d0206\\\"\"\ + ,\r\n \"etag\": \"W/\\\"cd48b2c7-db52-4e2a-a3b1-c9b9a41818a4\\\"\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\"\ ,\r\n \"addressPrefix\": \"10.0.0.0/24\"\r\n }\r\n }\r\ \n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\"\ : false,\r\n \"enableVmProtection\": false\r\n }\r\n}"} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/e6237d4e-7856-4721-afa9-55301c2b6984?api-version=2017-09-01'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/8b83e3c1-6c2e-4362-a615-195f8678872b?api-version=2017-11-01'] cache-control: [no-cache] content-length: ['1176'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:10:42 GMT'] + date: ['Wed, 21 Mar 2018 21:25:39 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 201, message: Created} - request: @@ -46,25 +47,49 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 networkmanagementclient/1.6.0 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 networkmanagementclient/2.0.0rc1 Azure-SDK-For-Python] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/8b83e3c1-6c2e-4362-a615-195f8678872b?api-version=2017-11-01 + response: + body: {string: "{\r\n \"status\": \"InProgress\"\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['30'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 21:25:42 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 networkmanagementclient/2.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/e6237d4e-7856-4721-afa9-55301c2b6984?api-version=2017-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/8b83e3c1-6c2e-4362-a615-195f8678872b?api-version=2017-11-01 response: body: {string: "{\r\n \"status\": \"Succeeded\"\r\n}"} headers: cache-control: [no-cache] content-length: ['29'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:10:46 GMT'] + date: ['Wed, 21 Mar 2018 21:25:53 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null @@ -72,22 +97,20 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 networkmanagementclient/1.6.0 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 networkmanagementclient/2.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/virtualNetworks/pyvmirnet9bd146b?api-version=2017-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/virtualNetworks/pyvmirnet9bd146b?api-version=2017-11-01 response: body: {string: "{\r\n \"name\": \"pyvmirnet9bd146b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/virtualNetworks/pyvmirnet9bd146b\"\ - ,\r\n \"etag\": \"W/\\\"70cc4907-7355-40d2-8c47-7f337261575d\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"7a52a48a-c497-4504-89c5-ae8d4322f00c\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"981354c0-3d35-4c3e-9c62-f1d9a4a8fb66\",\r\n \"\ + \ \"resourceGuid\": \"721e8a4f-fa1a-4df6-b067-ff820fa80094\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\"\ : \"pyvmirsub9bd146b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/virtualNetworks/pyvmirnet9bd146b/subnets/pyvmirsub9bd146b\"\ - ,\r\n \"etag\": \"W/\\\"70cc4907-7355-40d2-8c47-7f337261575d\\\"\"\ + ,\r\n \"etag\": \"W/\\\"7a52a48a-c497-4504-89c5-ae8d4322f00c\\\"\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"addressPrefix\": \"10.0.0.0/24\"\r\n }\r\n }\r\ \n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\"\ @@ -96,14 +119,15 @@ interactions: cache-control: [no-cache] content-length: ['1178'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:10:47 GMT'] - etag: [W/"70cc4907-7355-40d2-8c47-7f337261575d"] + date: ['Wed, 21 Mar 2018 21:25:54 GMT'] + etag: [W/"7a52a48a-c497-4504-89c5-ae8d4322f00c"] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null @@ -112,34 +136,35 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 networkmanagementclient/1.6.0 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 networkmanagementclient/2.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/virtualNetworks/pyvmirnet9bd146b/subnets/pyvmirsub9bd146b?api-version=2017-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/virtualNetworks/pyvmirnet9bd146b/subnets/pyvmirsub9bd146b?api-version=2017-11-01 response: body: {string: "{\r\n \"name\": \"pyvmirsub9bd146b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/virtualNetworks/pyvmirnet9bd146b/subnets/pyvmirsub9bd146b\"\ - ,\r\n \"etag\": \"W/\\\"70cc4907-7355-40d2-8c47-7f337261575d\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"7a52a48a-c497-4504-89c5-ae8d4322f00c\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\"\r\n }\r\n}"} headers: cache-control: [no-cache] content-length: ['414'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:10:47 GMT'] - etag: [W/"70cc4907-7355-40d2-8c47-7f337261575d"] + date: ['Wed, 21 Mar 2018 21:25:54 GMT'] + etag: [W/"7a52a48a-c497-4504-89c5-ae8d4322f00c"] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: 'b''b\''b\\\''{"location": "westus", "properties": {"ipConfigurations": [{"properties": {"privateIPAllocationMethod": "Dynamic", "subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/virtualNetworks/pyvmirnet9bd146b/subnets/pyvmirsub9bd146b", "properties": {"addressPrefix": "10.0.0.0/24", "provisioningState": "Succeeded"}, - "name": "pyvmirsub9bd146b", "etag": "W/\\\\\\\\"70cc4907-7355-40d2-8c47-7f337261575d\\\\\\\\""}}, + "name": "pyvmirsub9bd146b", "etag": "W/\\\\\\\\"7a52a48a-c497-4504-89c5-ae8d4322f00c\\\\\\\\""}}, "name": "pyarmconfig"}]}}\\\''\''''' headers: Accept: [application/json] @@ -147,39 +172,40 @@ interactions: Connection: [keep-alive] Content-Length: ['537'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 networkmanagementclient/1.6.0 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 networkmanagementclient/2.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/networkInterfaces/pyvmirnic9bd146b?api-version=2017-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/networkInterfaces/pyvmirnic9bd146b?api-version=2017-11-01 response: body: {string: "{\r\n \"name\": \"pyvmirnic9bd146b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/networkInterfaces/pyvmirnic9bd146b\"\ - ,\r\n \"etag\": \"W/\\\"851c1bb0-373a-4b2a-9fbf-aa02ea350b98\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"44f68a36-a34f-4277-b8ed-8b35fe70cede\\\"\",\r\n \ \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\"\ - : \"Succeeded\",\r\n \"resourceGuid\": \"40f70833-6991-46a5-9193-849a3fc5637d\"\ + : \"Succeeded\",\r\n \"resourceGuid\": \"4425d357-8ee6-4b76-9529-af00523230eb\"\ ,\r\n \"ipConfigurations\": [\r\n {\r\n \"name\": \"pyarmconfig\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/networkInterfaces/pyvmirnic9bd146b/ipConfigurations/pyarmconfig\"\ - ,\r\n \"etag\": \"W/\\\"851c1bb0-373a-4b2a-9fbf-aa02ea350b98\\\"\"\ + ,\r\n \"etag\": \"W/\\\"44f68a36-a34f-4277-b8ed-8b35fe70cede\\\"\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\"\ : \"Dynamic\",\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/virtualNetworks/pyvmirnet9bd146b/subnets/pyvmirsub9bd146b\"\ \r\n },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\"\ : \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n\ \ \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"\ - internalDomainNameSuffix\": \"ybkbhgbvhu5ezhdc4hm0jkh1mg.dx.internal.cloudapp.net\"\ + internalDomainNameSuffix\": \"j4fb22q05l1e1mdh54ba5kaase.dx.internal.cloudapp.net\"\ \r\n },\r\n \"enableAcceleratedNetworking\": false,\r\n \"enableIPForwarding\"\ - : false\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n\ - }"} + : false,\r\n \"virtualNetworkTapProvisioningState\": \"NotProvisioned\"\ + \r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}"} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/53c51640-6f49-4230-81a9-e1dd898c9ccb?api-version=2017-09-01'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/5c21cc45-f78d-424c-97ec-87dfbb1b0afa?api-version=2017-11-01'] cache-control: [no-cache] - content-length: ['1643'] + content-length: ['1704'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:10:48 GMT'] + date: ['Wed, 21 Mar 2018 21:25:56 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 201, message: Created} - request: @@ -188,25 +214,24 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 networkmanagementclient/1.6.0 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 networkmanagementclient/2.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/53c51640-6f49-4230-81a9-e1dd898c9ccb?api-version=2017-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/5c21cc45-f78d-424c-97ec-87dfbb1b0afa?api-version=2017-11-01 response: body: {string: "{\r\n \"status\": \"Succeeded\"\r\n}"} headers: cache-control: [no-cache] content-length: ['29'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:11:19 GMT'] + date: ['Wed, 21 Mar 2018 21:26:26 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null @@ -214,42 +239,41 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 networkmanagementclient/1.6.0 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 networkmanagementclient/2.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/networkInterfaces/pyvmirnic9bd146b?api-version=2017-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/networkInterfaces/pyvmirnic9bd146b?api-version=2017-11-01 response: body: {string: "{\r\n \"name\": \"pyvmirnic9bd146b\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/networkInterfaces/pyvmirnic9bd146b\"\ - ,\r\n \"etag\": \"W/\\\"851c1bb0-373a-4b2a-9fbf-aa02ea350b98\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"44f68a36-a34f-4277-b8ed-8b35fe70cede\\\"\",\r\n \ \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\"\ - : \"Succeeded\",\r\n \"resourceGuid\": \"40f70833-6991-46a5-9193-849a3fc5637d\"\ + : \"Succeeded\",\r\n \"resourceGuid\": \"4425d357-8ee6-4b76-9529-af00523230eb\"\ ,\r\n \"ipConfigurations\": [\r\n {\r\n \"name\": \"pyarmconfig\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/networkInterfaces/pyvmirnic9bd146b/ipConfigurations/pyarmconfig\"\ - ,\r\n \"etag\": \"W/\\\"851c1bb0-373a-4b2a-9fbf-aa02ea350b98\\\"\"\ + ,\r\n \"etag\": \"W/\\\"44f68a36-a34f-4277-b8ed-8b35fe70cede\\\"\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\"\ : \"Dynamic\",\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Network/virtualNetworks/pyvmirnet9bd146b/subnets/pyvmirsub9bd146b\"\ \r\n },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\"\ : \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n\ \ \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"\ - internalDomainNameSuffix\": \"ybkbhgbvhu5ezhdc4hm0jkh1mg.dx.internal.cloudapp.net\"\ + internalDomainNameSuffix\": \"j4fb22q05l1e1mdh54ba5kaase.dx.internal.cloudapp.net\"\ \r\n },\r\n \"enableAcceleratedNetworking\": false,\r\n \"enableIPForwarding\"\ - : false\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n\ - }"} + : false,\r\n \"virtualNetworkTapProvisioningState\": \"NotProvisioned\"\ + \r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}"} headers: cache-control: [no-cache] - content-length: ['1643'] + content-length: ['1704'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:11:19 GMT'] - etag: [W/"851c1bb0-373a-4b2a-9fbf-aa02ea350b98"] + date: ['Wed, 21 Mar 2018 21:26:27 GMT'] + etag: [W/"44f68a36-a34f-4277-b8ed-8b35fe70cede"] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: 'b''b\''b\\\''{"location": "westus", "properties": {"hardwareProfile": {"vmSize": @@ -263,13 +287,13 @@ interactions: Connection: [keep-alive] Content-Length: ['610'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/virtualMachines/pyvmirvm9bd146b?api-version=2017-12-01 response: - body: {string: "{\r\n \"properties\": {\r\n \"vmId\": \"e335260d-2e02-4917-a9d0-c521572577b0\"\ + body: {string: "{\r\n \"properties\": {\r\n \"vmId\": \"5ce62867-146c-4f5d-8558-f5b42bcec93e\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_A0\"\r\n \ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"Canonical\",\r\n \"offer\": \"UbuntuServer\"\ @@ -287,16 +311,17 @@ interactions: id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/virtualMachines/pyvmirvm9bd146b\"\ ,\r\n \"name\": \"pyvmirvm9bd146b\"\r\n}"} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d68288f8-9e78-431b-9a82-8cbcd516e09f?api-version=2017-12-01'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d5847ed1-0136-4c26-8089-7d8cf783159e?api-version=2017-12-01'] cache-control: [no-cache] content-length: ['1365'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:11:22 GMT'] + date: ['Wed, 21 Mar 2018 21:26:29 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/CreateUpdateVM3Min;299,Microsoft.Compute/CreateUpdateVM30Min;1498'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/PutVM3Min;239,Microsoft.Compute/PutVM30Min;1199'] x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 201, message: Created} - request: @@ -305,28 +330,27 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d68288f8-9e78-431b-9a82-8cbcd516e09f?api-version=2017-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d5847ed1-0136-4c26-8089-7d8cf783159e?api-version=2017-12-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T20:11:23.6053958+00:00\",\r\ - \n \"status\": \"InProgress\",\r\n \"name\": \"d68288f8-9e78-431b-9a82-8cbcd516e09f\"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:26:29.5622701+00:00\",\r\ + \n \"status\": \"InProgress\",\r\n \"name\": \"d5847ed1-0136-4c26-8089-7d8cf783159e\"\ \r\n}"} headers: cache-control: [no-cache] content-length: ['134'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:11:53 GMT'] + date: ['Wed, 21 Mar 2018 21:26:46 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;2158,Microsoft.Compute/GetOperation30Min;17983'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;11988,Microsoft.Compute/GetOperation30Min;23985'] status: {code: 200, message: OK} - request: body: null @@ -334,28 +358,27 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d68288f8-9e78-431b-9a82-8cbcd516e09f?api-version=2017-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d5847ed1-0136-4c26-8089-7d8cf783159e?api-version=2017-12-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T20:11:23.6053958+00:00\",\r\ - \n \"status\": \"InProgress\",\r\n \"name\": \"d68288f8-9e78-431b-9a82-8cbcd516e09f\"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:26:29.5622701+00:00\",\r\ + \n \"status\": \"InProgress\",\r\n \"name\": \"d5847ed1-0136-4c26-8089-7d8cf783159e\"\ \r\n}"} headers: cache-control: [no-cache] content-length: ['134'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:12:24 GMT'] + date: ['Wed, 21 Mar 2018 21:27:16 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;2155,Microsoft.Compute/GetOperation30Min;17980'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;11989,Microsoft.Compute/GetOperation30Min;23983'] status: {code: 200, message: OK} - request: body: null @@ -363,28 +386,27 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d68288f8-9e78-431b-9a82-8cbcd516e09f?api-version=2017-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d5847ed1-0136-4c26-8089-7d8cf783159e?api-version=2017-12-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T20:11:23.6053958+00:00\",\r\ - \n \"status\": \"InProgress\",\r\n \"name\": \"d68288f8-9e78-431b-9a82-8cbcd516e09f\"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:26:29.5622701+00:00\",\r\ + \n \"status\": \"InProgress\",\r\n \"name\": \"d5847ed1-0136-4c26-8089-7d8cf783159e\"\ \r\n}"} headers: cache-control: [no-cache] content-length: ['134'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:12:54 GMT'] + date: ['Wed, 21 Mar 2018 21:27:47 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;2152,Microsoft.Compute/GetOperation30Min;17977'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;11988,Microsoft.Compute/GetOperation30Min;23979'] status: {code: 200, message: OK} - request: body: null @@ -392,28 +414,27 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d68288f8-9e78-431b-9a82-8cbcd516e09f?api-version=2017-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d5847ed1-0136-4c26-8089-7d8cf783159e?api-version=2017-12-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T20:11:23.6053958+00:00\",\r\ - \n \"status\": \"InProgress\",\r\n \"name\": \"d68288f8-9e78-431b-9a82-8cbcd516e09f\"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:26:29.5622701+00:00\",\r\ + \n \"status\": \"InProgress\",\r\n \"name\": \"d5847ed1-0136-4c26-8089-7d8cf783159e\"\ \r\n}"} headers: cache-control: [no-cache] content-length: ['134'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:13:26 GMT'] + date: ['Wed, 21 Mar 2018 21:28:19 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;2149,Microsoft.Compute/GetOperation30Min;17974'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;11987,Microsoft.Compute/GetOperation30Min;23976'] status: {code: 200, message: OK} - request: body: null @@ -421,28 +442,27 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d68288f8-9e78-431b-9a82-8cbcd516e09f?api-version=2017-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/d5847ed1-0136-4c26-8089-7d8cf783159e?api-version=2017-12-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T20:11:23.6053958+00:00\",\r\ - \n \"endTime\": \"2017-11-22T20:13:36.3448342+00:00\",\r\n \"status\": \"\ - Succeeded\",\r\n \"name\": \"d68288f8-9e78-431b-9a82-8cbcd516e09f\"\r\n}"} + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:26:29.5622701+00:00\",\r\ + \n \"endTime\": \"2018-03-21T21:28:25.4692465+00:00\",\r\n \"status\": \"\ + Succeeded\",\r\n \"name\": \"d5847ed1-0136-4c26-8089-7d8cf783159e\"\r\n}"} headers: cache-control: [no-cache] content-length: ['184'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:13:57 GMT'] + date: ['Wed, 21 Mar 2018 21:28:49 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;2146,Microsoft.Compute/GetOperation30Min;17971'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;11986,Microsoft.Compute/GetOperation30Min;23974'] status: {code: 200, message: OK} - request: body: null @@ -450,23 +470,21 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/virtualMachines/pyvmirvm9bd146b?api-version=2017-12-01 response: - body: {string: "{\r\n \"properties\": {\r\n \"vmId\": \"e335260d-2e02-4917-a9d0-c521572577b0\"\ + body: {string: "{\r\n \"properties\": {\r\n \"vmId\": \"5ce62867-146c-4f5d-8558-f5b42bcec93e\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_A0\"\r\n \ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"Canonical\",\r\n \"offer\": \"UbuntuServer\"\ ,\r\n \"sku\": \"16.04.0-LTS\",\r\n \"version\": \"latest\"\r\ \n },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \ - \ \"name\": \"pyvmirvm9bd146b_OsDisk_1_e2cdd66aeeae4da480408fda24c9f861\"\ + \ \"name\": \"pyvmirvm9bd146b_OsDisk_1_3b3324871ff040749a0ae88c34f31d3c\"\ ,\r\n \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"Standard_LRS\"\ - ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/disks/pyvmirvm9bd146b_OsDisk_1_e2cdd66aeeae4da480408fda24c9f861\"\ + ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/disks/pyvmirvm9bd146b_OsDisk_1_3b3324871ff040749a0ae88c34f31d3c\"\ \r\n },\r\n \"diskSizeGB\": 30\r\n },\r\n \"dataDisks\"\ : []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"test\"\ ,\r\n \"adminUsername\": \"Foo12\",\r\n \"linuxConfiguration\":\ @@ -481,14 +499,15 @@ interactions: cache-control: [no-cache] content-length: ['1708'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:13:58 GMT'] + date: ['Wed, 21 Mar 2018 21:28:50 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4997,Microsoft.Compute/LowCostGet30Min;39944'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4796,Microsoft.Compute/LowCostGet30Min;38356'] status: {code: 200, message: OK} - request: body: '{"location": "westus", "properties": {"creationData": {"createOption": @@ -499,29 +518,30 @@ interactions: Connection: [keep-alive] Content-Length: ['99'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/disks/mySecondDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/disks/mySecondDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"properties\": {\r\n \"creationData\": {\r\n \"\ createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\": 20,\r\n \"provisioningState\"\ : \"Updating\",\r\n \"isArmResource\": true\r\n },\r\n \"location\":\ \ \"westus\",\r\n \"name\": \"mySecondDisk\"\r\n}"} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/43391144-c5bf-4ee2-a4cb-217138436832?api-version=2017-03-30'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/3c8b20e3-95c7-471c-9ddf-e0163b353a8a?api-version=2018-04-01'] cache-control: [no-cache] content-length: ['230'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:13:59 GMT'] + date: ['Wed, 21 Mar 2018 21:28:52 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/43391144-c5bf-4ee2-a4cb-217138436832?monitor=true&api-version=2017-03-30'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/3c8b20e3-95c7-471c-9ddf-e0163b353a8a?monitor=true&api-version=2018-04-01'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/CreateUpdateDisks3Min;999,Microsoft.Compute/CreateUpdateDisks30Min;3996'] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/CreateUpdateDisks3Min;998,Microsoft.Compute/CreateUpdateDisks30Min;3995'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 202, message: Accepted} - request: body: null @@ -529,34 +549,33 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/43391144-c5bf-4ee2-a4cb-217138436832?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/3c8b20e3-95c7-471c-9ddf-e0163b353a8a?api-version=2018-04-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T20:14:01.1867405+00:00\",\r\ - \n \"endTime\": \"2017-11-22T20:14:01.3898915+00:00\",\r\n \"status\": \"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:28:52.4669731+00:00\",\r\ + \n \"endTime\": \"2018-03-21T21:28:52.5919892+00:00\",\r\n \"status\": \"\ Succeeded\",\r\n \"properties\": {\r\n \"output\": {\"sku\":{\"name\"\ :\"Standard_LRS\",\"tier\":\"Standard\"},\"properties\":{\"creationData\"\ - :{\"createOption\":\"Empty\"},\"diskSizeGB\":20,\"timeCreated\":\"2017-11-22T20:14:01.1867405+00:00\"\ + :{\"createOption\":\"Empty\"},\"diskSizeGB\":20,\"timeCreated\":\"2018-03-21T21:28:52.4669731+00:00\"\ ,\"provisioningState\":\"Succeeded\",\"diskState\":\"Unattached\"},\"type\"\ :\"Microsoft.Compute/disks\",\"location\":\"westus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/disks/mySecondDisk\"\ - ,\"name\":\"mySecondDisk\"}\r\n },\r\n \"name\": \"43391144-c5bf-4ee2-a4cb-217138436832\"\ + ,\"name\":\"mySecondDisk\"}\r\n },\r\n \"name\": \"3c8b20e3-95c7-471c-9ddf-e0163b353a8a\"\ \r\n}"} headers: cache-control: [no-cache] content-length: ['706'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:14:30 GMT'] + date: ['Wed, 21 Mar 2018 21:29:22 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;49998,Microsoft.Compute/GetOperation30Min;249994'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;49996,Microsoft.Compute/GetOperation30Min;249978'] status: {code: 200, message: OK} - request: body: null @@ -564,17 +583,15 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/disks/mySecondDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/disks/mySecondDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"\ tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n \"creationData\"\ : {\r\n \"createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\":\ - \ 20,\r\n \"timeCreated\": \"2017-11-22T20:14:01.1867405+00:00\",\r\n \ + \ 20,\r\n \"timeCreated\": \"2018-03-21T21:28:52.4669731+00:00\",\r\n \ \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ \r\n },\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"\ westus\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/disks/mySecondDisk\"\ @@ -583,22 +600,23 @@ interactions: cache-control: [no-cache] content-length: ['585'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:14:30 GMT'] + date: ['Wed, 21 Mar 2018 21:29:23 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4996,Microsoft.Compute/LowCostGet30Min;19993'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4998,Microsoft.Compute/LowCostGet30Min;19988'] status: {code: 200, message: OK} - request: body: 'b''b\''b\\\''{"location": "westus", "properties": {"hardwareProfile": {"vmSize": "Standard_A0"}, "storageProfile": {"imageReference": {"publisher": "Canonical", "offer": "UbuntuServer", "sku": "16.04.0-LTS", "version": "latest"}, "osDisk": - {"osType": "Linux", "name": "pyvmirvm9bd146b_OsDisk_1_e2cdd66aeeae4da480408fda24c9f861", + {"osType": "Linux", "name": "pyvmirvm9bd146b_OsDisk_1_3b3324871ff040749a0ae88c34f31d3c", "caching": "ReadWrite", "createOption": "FromImage", "diskSizeGB": 30, "managedDisk": - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/disks/pyvmirvm9bd146b_OsDisk_1_e2cdd66aeeae4da480408fda24c9f861", + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/disks/pyvmirvm9bd146b_OsDisk_1_3b3324871ff040749a0ae88c34f31d3c", "storageAccountType": "Standard_LRS"}}, "dataDisks": [{"lun": 12, "name": "mySecondDisk", "createOption": "Attach", "managedDisk": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/disks/mySecondDisk"}}]}, "osProfile": {"computerName": "test", "adminUsername": "Foo12", "linuxConfiguration": @@ -610,22 +628,22 @@ interactions: Connection: [keep-alive] Content-Length: ['1332'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/virtualMachines/pyvmirvm9bd146b?api-version=2017-12-01 response: - body: {string: "{\r\n \"properties\": {\r\n \"vmId\": \"e335260d-2e02-4917-a9d0-c521572577b0\"\ + body: {string: "{\r\n \"properties\": {\r\n \"vmId\": \"5ce62867-146c-4f5d-8558-f5b42bcec93e\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_A0\"\r\n \ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"Canonical\",\r\n \"offer\": \"UbuntuServer\"\ ,\r\n \"sku\": \"16.04.0-LTS\",\r\n \"version\": \"latest\"\r\ \n },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \ - \ \"name\": \"pyvmirvm9bd146b_OsDisk_1_e2cdd66aeeae4da480408fda24c9f861\"\ + \ \"name\": \"pyvmirvm9bd146b_OsDisk_1_3b3324871ff040749a0ae88c34f31d3c\"\ ,\r\n \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"Standard_LRS\"\ - ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/disks/pyvmirvm9bd146b_OsDisk_1_e2cdd66aeeae4da480408fda24c9f861\"\ + ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/disks/pyvmirvm9bd146b_OsDisk_1_3b3324871ff040749a0ae88c34f31d3c\"\ \r\n },\r\n \"diskSizeGB\": 30\r\n },\r\n \"dataDisks\"\ : [\r\n {\r\n \"lun\": 12,\r\n \"name\": \"mySecondDisk\"\ ,\r\n \"createOption\": \"Attach\",\r\n \"caching\": \"\ @@ -642,18 +660,19 @@ interactions: id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/virtualMachines/pyvmirvm9bd146b\"\ ,\r\n \"name\": \"pyvmirvm9bd146b\"\r\n}"} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/91a290c5-af63-49f3-bfa9-78bd73fa64dd?api-version=2017-12-01'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/c42aedf4-1614-47dc-81f3-37696396bda2?api-version=2017-12-01'] cache-control: [no-cache] content-length: ['2175'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:14:33 GMT'] + date: ['Wed, 21 Mar 2018 21:29:25 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/CreateUpdateVM3Min;299,Microsoft.Compute/CreateUpdateVM30Min;1497'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/PutVM3Min;239,Microsoft.Compute/PutVM30Min;1198'] x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 200, message: OK} - request: @@ -662,28 +681,27 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/91a290c5-af63-49f3-bfa9-78bd73fa64dd?api-version=2017-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/c42aedf4-1614-47dc-81f3-37696396bda2?api-version=2017-12-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T20:14:34.6439819+00:00\",\r\ - \n \"endTime\": \"2017-11-22T20:14:49.2851651+00:00\",\r\n \"status\": \"\ - Succeeded\",\r\n \"name\": \"91a290c5-af63-49f3-bfa9-78bd73fa64dd\"\r\n}"} + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:29:25.1285754+00:00\",\r\ + \n \"endTime\": \"2018-03-21T21:29:32.6769305+00:00\",\r\n \"status\": \"\ + Succeeded\",\r\n \"name\": \"c42aedf4-1614-47dc-81f3-37696396bda2\"\r\n}"} headers: cache-control: [no-cache] content-length: ['184'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:15:03 GMT'] + date: ['Wed, 21 Mar 2018 21:29:55 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;2150,Microsoft.Compute/GetOperation30Min;17969'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;11985,Microsoft.Compute/GetOperation30Min;23970'] status: {code: 200, message: OK} - request: body: null @@ -691,23 +709,21 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.14 - msrest_azure/0.4.14 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/virtualMachines/pyvmirvm9bd146b?api-version=2017-12-01 response: - body: {string: "{\r\n \"properties\": {\r\n \"vmId\": \"e335260d-2e02-4917-a9d0-c521572577b0\"\ + body: {string: "{\r\n \"properties\": {\r\n \"vmId\": \"5ce62867-146c-4f5d-8558-f5b42bcec93e\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_A0\"\r\n \ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"Canonical\",\r\n \"offer\": \"UbuntuServer\"\ ,\r\n \"sku\": \"16.04.0-LTS\",\r\n \"version\": \"latest\"\r\ \n },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \ - \ \"name\": \"pyvmirvm9bd146b_OsDisk_1_e2cdd66aeeae4da480408fda24c9f861\"\ + \ \"name\": \"pyvmirvm9bd146b_OsDisk_1_3b3324871ff040749a0ae88c34f31d3c\"\ ,\r\n \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"Standard_LRS\"\ - ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/disks/pyvmirvm9bd146b_OsDisk_1_e2cdd66aeeae4da480408fda24c9f861\"\ + ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_create_vm_implicit_md9bd146b/providers/Microsoft.Compute/disks/pyvmirvm9bd146b_OsDisk_1_3b3324871ff040749a0ae88c34f31d3c\"\ \r\n },\r\n \"diskSizeGB\": 30\r\n },\r\n \"dataDisks\"\ : [\r\n {\r\n \"lun\": 12,\r\n \"name\": \"mySecondDisk\"\ ,\r\n \"createOption\": \"Attach\",\r\n \"caching\": \"\ @@ -727,13 +743,14 @@ interactions: cache-control: [no-cache] content-length: ['2176'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 20:15:04 GMT'] + date: ['Wed, 21 Mar 2018 21:29:55 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4993,Microsoft.Compute/LowCostGet30Min;39948'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4792,Microsoft.Compute/LowCostGet30Min;38352'] status: {code: 200, message: OK} version: 1 diff --git a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_empty_md.yaml b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_empty_md.yaml index 8007440f7f5b..f0c05fbb0216 100644 --- a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_empty_md.yaml +++ b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_empty_md.yaml @@ -8,29 +8,30 @@ interactions: Connection: [keep-alive] Content-Length: ['99'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_empty_md20c90f2a/providers/Microsoft.Compute/disks/my_disk_name?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_empty_md20c90f2a/providers/Microsoft.Compute/disks/my_disk_name?api-version=2018-04-01 response: body: {string: "{\r\n \"properties\": {\r\n \"creationData\": {\r\n \"\ createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\": 20,\r\n \"provisioningState\"\ : \"Updating\",\r\n \"isArmResource\": true\r\n },\r\n \"location\":\ \ \"westus\",\r\n \"name\": \"my_disk_name\"\r\n}"} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/ea5a0895-10a7-47a7-bd22-fe48b1d9cc5f?api-version=2017-03-30'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/d4c4e808-18e8-4b91-a1e2-59512b3ff60d?api-version=2018-04-01'] cache-control: [no-cache] content-length: ['230'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:00:51 GMT'] + date: ['Wed, 21 Mar 2018 21:30:03 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/ea5a0895-10a7-47a7-bd22-fe48b1d9cc5f?monitor=true&api-version=2017-03-30'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/d4c4e808-18e8-4b91-a1e2-59512b3ff60d?monitor=true&api-version=2018-04-01'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/CreateUpdateDisks3Min;998,Microsoft.Compute/CreateUpdateDisks30Min;3994'] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 202, message: Accepted} - request: body: null @@ -38,34 +39,33 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/ea5a0895-10a7-47a7-bd22-fe48b1d9cc5f?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/d4c4e808-18e8-4b91-a1e2-59512b3ff60d?api-version=2018-04-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T01:00:52.3320217+00:00\",\r\ - \n \"endTime\": \"2017-11-22T01:00:52.4570237+00:00\",\r\n \"status\": \"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:30:04.0463126+00:00\",\r\ + \n \"endTime\": \"2018-03-21T21:30:04.2962841+00:00\",\r\n \"status\": \"\ Succeeded\",\r\n \"properties\": {\r\n \"output\": {\"sku\":{\"name\"\ :\"Standard_LRS\",\"tier\":\"Standard\"},\"properties\":{\"creationData\"\ - :{\"createOption\":\"Empty\"},\"diskSizeGB\":20,\"timeCreated\":\"2017-11-22T01:00:52.3320217+00:00\"\ + :{\"createOption\":\"Empty\"},\"diskSizeGB\":20,\"timeCreated\":\"2018-03-21T21:30:04.0463126+00:00\"\ ,\"provisioningState\":\"Succeeded\",\"diskState\":\"Unattached\"},\"type\"\ :\"Microsoft.Compute/disks\",\"location\":\"westus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_empty_md20c90f2a/providers/Microsoft.Compute/disks/my_disk_name\"\ - ,\"name\":\"my_disk_name\"}\r\n },\r\n \"name\": \"ea5a0895-10a7-47a7-bd22-fe48b1d9cc5f\"\ + ,\"name\":\"my_disk_name\"}\r\n },\r\n \"name\": \"d4c4e808-18e8-4b91-a1e2-59512b3ff60d\"\ \r\n}"} headers: cache-control: [no-cache] content-length: ['694'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:01:21 GMT'] + date: ['Wed, 21 Mar 2018 21:30:34 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;49996,Microsoft.Compute/GetOperation30Min;249983'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;49996,Microsoft.Compute/GetOperation30Min;249976'] status: {code: 200, message: OK} - request: body: null @@ -73,17 +73,15 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_empty_md20c90f2a/providers/Microsoft.Compute/disks/my_disk_name?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_empty_md20c90f2a/providers/Microsoft.Compute/disks/my_disk_name?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"\ tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n \"creationData\"\ : {\r\n \"createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\":\ - \ 20,\r\n \"timeCreated\": \"2017-11-22T01:00:52.3320217+00:00\",\r\n \ + \ 20,\r\n \"timeCreated\": \"2018-03-21T21:30:04.0463126+00:00\",\r\n \ \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ \r\n },\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"\ westus\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_empty_md20c90f2a/providers/Microsoft.Compute/disks/my_disk_name\"\ @@ -92,13 +90,14 @@ interactions: cache-control: [no-cache] content-length: ['573'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:01:22 GMT'] + date: ['Wed, 21 Mar 2018 21:30:34 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4996,Microsoft.Compute/LowCostGet30Min;19986'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4995,Microsoft.Compute/LowCostGet30Min;19985'] status: {code: 200, message: OK} version: 1 diff --git a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_list_disks.yaml b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_list_disks.yaml index 3585ad8e614c..6ae508a69dfb 100644 --- a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_list_disks.yaml +++ b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_list_disks.yaml @@ -6,21 +6,22 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_list_disks403a1004/providers/Microsoft.Compute/disks?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_list_disks403a1004/providers/Microsoft.Compute/disks?api-version=2018-04-01 response: body: {string: '{"value":[]}'} headers: cache-control: [no-cache] content-length: ['12'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:01:30 GMT'] + date: ['Wed, 21 Mar 2018 21:30:41 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} version: 1 diff --git a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_list_disks_fake.yaml b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_list_disks_fake.yaml index 86adf9b756a9..1defa202893b 100644 --- a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_list_disks_fake.yaml +++ b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_list_disks_fake.yaml @@ -6,11 +6,11 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fakename/providers/Microsoft.Compute/disks?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fakename/providers/Microsoft.Compute/disks?api-version=2018-04-01 response: body: {string: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''fakename'' could not be found."}}'} @@ -18,10 +18,11 @@ interactions: cache-control: [no-cache] content-length: ['100'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:01:34 GMT'] + date: ['Wed, 21 Mar 2018 21:30:45 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] x-ms-failure-cause: [gateway] status: {code: 404, message: Not Found} version: 1 diff --git a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_md_from_md_id.yaml b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_md_from_md_id.yaml index 8cd5c95b5830..15b78c41d850 100644 --- a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_md_from_md_id.yaml +++ b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_md_from_md_id.yaml @@ -8,29 +8,30 @@ interactions: Connection: [keep-alive] Content-Length: ['99'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/myImageDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/myImageDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"properties\": {\r\n \"creationData\": {\r\n \"\ createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\": 20,\r\n \"provisioningState\"\ : \"Updating\",\r\n \"isArmResource\": true\r\n },\r\n \"location\":\ \ \"westus\",\r\n \"name\": \"myImageDisk\"\r\n}"} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/5ba9936a-fe4e-4486-babe-5006e6d89620?api-version=2017-03-30'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/90a1fad3-dead-4667-b592-ae439b1477c8?api-version=2018-04-01'] cache-control: [no-cache] content-length: ['229'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:01:41 GMT'] + date: ['Wed, 21 Mar 2018 21:30:52 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/5ba9936a-fe4e-4486-babe-5006e6d89620?monitor=true&api-version=2017-03-30'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/90a1fad3-dead-4667-b592-ae439b1477c8?monitor=true&api-version=2018-04-01'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/CreateUpdateDisks3Min;997,Microsoft.Compute/CreateUpdateDisks30Min;3993'] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 202, message: Accepted} - request: body: null @@ -38,34 +39,33 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/5ba9936a-fe4e-4486-babe-5006e6d89620?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/90a1fad3-dead-4667-b592-ae439b1477c8?api-version=2018-04-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T01:01:42.7827449+00:00\",\r\ - \n \"endTime\": \"2017-11-22T01:01:42.9702653+00:00\",\r\n \"status\": \"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:30:52.136535+00:00\",\r\n\ + \ \"endTime\": \"2018-03-21T21:30:52.292763+00:00\",\r\n \"status\": \"\ Succeeded\",\r\n \"properties\": {\r\n \"output\": {\"sku\":{\"name\"\ :\"Standard_LRS\",\"tier\":\"Standard\"},\"properties\":{\"creationData\"\ - :{\"createOption\":\"Empty\"},\"diskSizeGB\":20,\"timeCreated\":\"2017-11-22T01:01:42.7827449+00:00\"\ + :{\"createOption\":\"Empty\"},\"diskSizeGB\":20,\"timeCreated\":\"2018-03-21T21:30:52.1521389+00:00\"\ ,\"provisioningState\":\"Succeeded\",\"diskState\":\"Unattached\"},\"type\"\ :\"Microsoft.Compute/disks\",\"location\":\"westus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/myImageDisk\"\ - ,\"name\":\"myImageDisk\"}\r\n },\r\n \"name\": \"5ba9936a-fe4e-4486-babe-5006e6d89620\"\ + ,\"name\":\"myImageDisk\"}\r\n },\r\n \"name\": \"90a1fad3-dead-4667-b592-ae439b1477c8\"\ \r\n}"} headers: cache-control: [no-cache] - content-length: ['697'] + content-length: ['695'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:02:12 GMT'] + date: ['Wed, 21 Mar 2018 21:31:21 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;49993,Microsoft.Compute/GetOperation30Min;249980'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;49994,Microsoft.Compute/GetOperation30Min;249974'] status: {code: 200, message: OK} - request: body: null @@ -73,17 +73,15 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/myImageDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/myImageDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"\ tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n \"creationData\"\ : {\r\n \"createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\":\ - \ 20,\r\n \"timeCreated\": \"2017-11-22T01:01:42.7827449+00:00\",\r\n \ + \ 20,\r\n \"timeCreated\": \"2018-03-21T21:30:52.1521389+00:00\",\r\n \ \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ \r\n },\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"\ westus\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/myImageDisk\"\ @@ -92,14 +90,15 @@ interactions: cache-control: [no-cache] content-length: ['576'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:02:13 GMT'] + date: ['Wed, 21 Mar 2018 21:31:23 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4992,Microsoft.Compute/LowCostGet30Min;19982'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4991,Microsoft.Compute/LowCostGet30Min;19981'] status: {code: 200, message: OK} - request: body: null @@ -108,16 +107,16 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/myImageDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/myImageDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"\ tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n \"creationData\"\ : {\r\n \"createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\":\ - \ 20,\r\n \"timeCreated\": \"2017-11-22T01:01:42.7827449+00:00\",\r\n \ + \ 20,\r\n \"timeCreated\": \"2018-03-21T21:30:52.1521389+00:00\",\r\n \ \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ \r\n },\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"\ westus\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/myImageDisk\"\ @@ -126,14 +125,15 @@ interactions: cache-control: [no-cache] content-length: ['576'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:02:13 GMT'] + date: ['Wed, 21 Mar 2018 21:31:23 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4991,Microsoft.Compute/LowCostGet30Min;19981'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4990,Microsoft.Compute/LowCostGet30Min;19980'] status: {code: 200, message: OK} - request: body: 'b''b\''b\\\''{"location": "westus", "properties": {"creationData": {"createOption": @@ -144,11 +144,11 @@ interactions: Connection: [keep-alive] Content-Length: ['267'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/my_disk_name?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/my_disk_name?api-version=2018-04-01 response: body: {string: "{\r\n \"properties\": {\r\n \"creationData\": {\r\n \"\ createOption\": \"Copy\",\r\n \"sourceResourceId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/myImageDisk\"\ @@ -156,18 +156,19 @@ interactions: : true\r\n },\r\n \"location\": \"westus\",\r\n \"name\": \"my_disk_name\"\ \r\n}"} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/be812eb0-3e15-4e1e-b87e-e6961827d4e6?api-version=2017-03-30'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/fb849fb2-8666-453a-be4d-1117e1e7646d?api-version=2018-04-01'] cache-control: [no-cache] content-length: ['400'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:02:16 GMT'] + date: ['Wed, 21 Mar 2018 21:31:25 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/be812eb0-3e15-4e1e-b87e-e6961827d4e6?monitor=true&api-version=2017-03-30'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/fb849fb2-8666-453a-be4d-1117e1e7646d?monitor=true&api-version=2018-04-01'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/CreateUpdateDisks3Min;996,Microsoft.Compute/CreateUpdateDisks30Min;3992'] - x-ms-ratelimit-remaining-subscription-writes: ['1197'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 202, message: Accepted} - request: body: null @@ -175,35 +176,34 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/be812eb0-3e15-4e1e-b87e-e6961827d4e6?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/fb849fb2-8666-453a-be4d-1117e1e7646d?api-version=2018-04-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T01:02:17.3496419+00:00\",\r\ - \n \"endTime\": \"2017-11-22T01:02:18.08402+00:00\",\r\n \"status\": \"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:31:25.4940287+00:00\",\r\ + \n \"endTime\": \"2018-03-21T21:31:26.1754808+00:00\",\r\n \"status\": \"\ Succeeded\",\r\n \"properties\": {\r\n \"output\": {\"sku\":{\"name\"\ :\"Standard_LRS\",\"tier\":\"Standard\"},\"properties\":{\"creationData\"\ :{\"createOption\":\"Copy\",\"sourceResourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/myImageDisk\"\ - },\"diskSizeGB\":20,\"timeCreated\":\"2017-11-22T01:02:17.3652583+00:00\"\ + },\"diskSizeGB\":20,\"timeCreated\":\"2018-03-21T21:31:25.4940287+00:00\"\ ,\"provisioningState\":\"Succeeded\",\"diskState\":\"Unattached\"},\"type\"\ :\"Microsoft.Compute/disks\",\"location\":\"westus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/my_disk_name\"\ - ,\"name\":\"my_disk_name\"}\r\n },\r\n \"name\": \"be812eb0-3e15-4e1e-b87e-e6961827d4e6\"\ + ,\"name\":\"my_disk_name\"}\r\n },\r\n \"name\": \"fb849fb2-8666-453a-be4d-1117e1e7646d\"\ \r\n}"} headers: cache-control: [no-cache] - content-length: ['881'] + content-length: ['883'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:02:46 GMT'] + date: ['Wed, 21 Mar 2018 21:31:55 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;49990,Microsoft.Compute/GetOperation30Min;249977'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;49991,Microsoft.Compute/GetOperation30Min;249971'] status: {code: 200, message: OK} - request: body: null @@ -211,18 +211,16 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/my_disk_name?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/my_disk_name?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"\ tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n \"creationData\"\ : {\r\n \"createOption\": \"Copy\",\r\n \"sourceResourceId\": \"\ /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/myImageDisk\"\ - \r\n },\r\n \"diskSizeGB\": 20,\r\n \"timeCreated\": \"2017-11-22T01:02:17.3652583+00:00\"\ + \r\n },\r\n \"diskSizeGB\": 20,\r\n \"timeCreated\": \"2018-03-21T21:31:25.4940287+00:00\"\ ,\r\n \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ \r\n },\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"\ westus\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_md_id7177110b/providers/Microsoft.Compute/disks/my_disk_name\"\ @@ -231,13 +229,14 @@ interactions: cache-control: [no-cache] content-length: ['771'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:02:47 GMT'] + date: ['Wed, 21 Mar 2018 21:31:56 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4988,Microsoft.Compute/LowCostGet30Min;19978'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4987,Microsoft.Compute/LowCostGet30Min;19977'] status: {code: 200, message: OK} version: 1 diff --git a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_md_from_storage_blob.yaml b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_md_from_storage_blob.yaml index 213592f89684..756a9cf61e78 100644 --- a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_md_from_storage_blob.yaml +++ b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_md_from_storage_blob.yaml @@ -13,20 +13,20 @@ interactions: accept-language: [en-US] x-ms-client-request-id: [661f000a-5d38-11e7-865b-ecb1d756380e] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_storage_blobf5ab1401/providers/Microsoft.Compute/disks/my_disk_name?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_storage_blobf5ab1401/providers/Microsoft.Compute/disks/my_disk_name?api-version=2018-04-01 response: body: {string: "{\r\n \"properties\": {\r\n \"creationData\": {\r\n \"createOption\": \"Import\",\r\n \"sourceUri\": \"https://mystorageaccount.blob.core.windows.net/inputtestdatadonotdelete/ubuntu.vhd\"\r\n \ },\r\n \"provisioningState\": \"Updating\",\r\n \"isArmResource\": true\r\n },\r\n \"location\": \"westus\"\r\n}"} headers: - Azure-AsyncOperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/0f24271a-d4a7-44a3-b2bd-adbd304fef23?api-version=2017-03-30'] + Azure-AsyncOperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/0f24271a-d4a7-44a3-b2bd-adbd304fef23?api-version=2018-04-01'] Cache-Control: [no-cache] Content-Length: ['290'] Content-Type: [application/json; charset=utf-8] Date: ['Fri, 30 Jun 2017 02:04:07 GMT'] Expires: ['-1'] - Location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/0f24271a-d4a7-44a3-b2bd-adbd304fef23?monitor=true&api-version=2017-03-30'] + Location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/0f24271a-d4a7-44a3-b2bd-adbd304fef23?monitor=true&api-version=2018-04-01'] Pragma: [no-cache] Server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] Strict-Transport-Security: [max-age=31536000; includeSubDomains] @@ -48,7 +48,7 @@ interactions: accept-language: [en-US] x-ms-client-request-id: [661f000a-5d38-11e7-865b-ecb1d756380e] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/0f24271a-d4a7-44a3-b2bd-adbd304fef23?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/0f24271a-d4a7-44a3-b2bd-adbd304fef23?api-version=2018-04-01 response: body: {string: "{\r\n \"startTime\": \"2017-06-30T02:04:06.8961345+00:00\",\r\n \ \"endTime\": \"2017-06-30T02:04:07.7398687+00:00\",\r\n \"status\": \"Succeeded\",\r\n @@ -83,7 +83,7 @@ interactions: accept-language: [en-US] x-ms-client-request-id: [661f000a-5d38-11e7-865b-ecb1d756380e] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_storage_blobf5ab1401/providers/Microsoft.Compute/disks/my_disk_name?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_md_from_storage_blobf5ab1401/providers/Microsoft.Compute/disks/my_disk_name?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n \"creationData\": {\r\n diff --git a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_resize_md.yaml b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_resize_md.yaml index 7a3ee9a657df..f14b47b95d35 100644 --- a/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_resize_md.yaml +++ b/azure-mgmt-compute/tests/recordings/test_mgmt_managed_disks.test_resize_md.yaml @@ -8,27 +8,28 @@ interactions: Connection: [keep-alive] Content-Length: ['99'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_resize_md30640f8d/providers/Microsoft.Compute/disks/myDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_resize_md30640f8d/providers/Microsoft.Compute/disks/myDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"properties\": {\r\n \"creationData\": {\r\n \"\ createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\": 20,\r\n \"provisioningState\"\ : \"Updating\",\r\n \"isArmResource\": true\r\n },\r\n \"location\":\ \ \"westus\",\r\n \"name\": \"myDisk\"\r\n}"} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/a271d952-55ce-406e-bd54-a8a382fbe35c?api-version=2017-03-30'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/24116125-9ce7-48e8-83fa-f13627f8c73c?api-version=2018-04-01'] cache-control: [no-cache] content-length: ['224'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:03:09 GMT'] + date: ['Wed, 21 Mar 2018 21:32:11 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/a271d952-55ce-406e-bd54-a8a382fbe35c?monitor=true&api-version=2017-03-30'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/24116125-9ce7-48e8-83fa-f13627f8c73c?monitor=true&api-version=2018-04-01'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/CreateUpdateDisks3Min;995,Microsoft.Compute/CreateUpdateDisks30Min;3990'] x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 202, message: Accepted} @@ -38,34 +39,33 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/a271d952-55ce-406e-bd54-a8a382fbe35c?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/24116125-9ce7-48e8-83fa-f13627f8c73c?api-version=2018-04-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T01:03:10.1774863+00:00\",\r\ - \n \"endTime\": \"2017-11-22T01:03:10.2868607+00:00\",\r\n \"status\": \"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:32:11.8178207+00:00\",\r\ + \n \"endTime\": \"2018-03-21T21:32:11.9740591+00:00\",\r\n \"status\": \"\ Succeeded\",\r\n \"properties\": {\r\n \"output\": {\"sku\":{\"name\"\ :\"Standard_LRS\",\"tier\":\"Standard\"},\"properties\":{\"creationData\"\ - :{\"createOption\":\"Empty\"},\"diskSizeGB\":20,\"timeCreated\":\"2017-11-22T01:03:10.1774863+00:00\"\ + :{\"createOption\":\"Empty\"},\"diskSizeGB\":20,\"timeCreated\":\"2018-03-21T21:32:11.8178207+00:00\"\ ,\"provisioningState\":\"Succeeded\",\"diskState\":\"Unattached\"},\"type\"\ :\"Microsoft.Compute/disks\",\"location\":\"westus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_resize_md30640f8d/providers/Microsoft.Compute/disks/myDisk\"\ - ,\"name\":\"myDisk\"}\r\n },\r\n \"name\": \"a271d952-55ce-406e-bd54-a8a382fbe35c\"\ + ,\"name\":\"myDisk\"}\r\n },\r\n \"name\": \"24116125-9ce7-48e8-83fa-f13627f8c73c\"\ \r\n}"} headers: cache-control: [no-cache] content-length: ['683'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:03:39 GMT'] + date: ['Wed, 21 Mar 2018 21:32:42 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;49990,Microsoft.Compute/GetOperation30Min;249975'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;49990,Microsoft.Compute/GetOperation30Min;249968'] status: {code: 200, message: OK} - request: body: null @@ -73,17 +73,15 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_resize_md30640f8d/providers/Microsoft.Compute/disks/myDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_resize_md30640f8d/providers/Microsoft.Compute/disks/myDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"\ tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n \"creationData\"\ : {\r\n \"createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\":\ - \ 20,\r\n \"timeCreated\": \"2017-11-22T01:03:10.1774863+00:00\",\r\n \ + \ 20,\r\n \"timeCreated\": \"2018-03-21T21:32:11.8178207+00:00\",\r\n \ \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ \r\n },\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"\ westus\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_resize_md30640f8d/providers/Microsoft.Compute/disks/myDisk\"\ @@ -92,14 +90,15 @@ interactions: cache-control: [no-cache] content-length: ['562'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:03:40 GMT'] + date: ['Wed, 21 Mar 2018 21:32:42 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4985,Microsoft.Compute/LowCostGet30Min;19973'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4985,Microsoft.Compute/LowCostGet30Min;19972'] status: {code: 200, message: OK} - request: body: null @@ -108,16 +107,16 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_resize_md30640f8d/providers/Microsoft.Compute/disks/myDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_resize_md30640f8d/providers/Microsoft.Compute/disks/myDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"\ tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n \"creationData\"\ : {\r\n \"createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\":\ - \ 20,\r\n \"timeCreated\": \"2017-11-22T01:03:10.1774863+00:00\",\r\n \ + \ 20,\r\n \"timeCreated\": \"2018-03-21T21:32:11.8178207+00:00\",\r\n \ \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ \r\n },\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"\ westus\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_resize_md30640f8d/providers/Microsoft.Compute/disks/myDisk\"\ @@ -126,14 +125,15 @@ interactions: cache-control: [no-cache] content-length: ['562'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:03:42 GMT'] + date: ['Wed, 21 Mar 2018 21:32:43 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4984,Microsoft.Compute/LowCostGet30Min;19972'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4984,Microsoft.Compute/LowCostGet30Min;19971'] status: {code: 200, message: OK} - request: body: '{"location": "westus", "sku": {"name": "Standard_LRS"}, "properties": {"creationData": @@ -144,11 +144,11 @@ interactions: Connection: [keep-alive] Content-Length: ['132'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_resize_md30640f8d/providers/Microsoft.Compute/disks/myDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_resize_md30640f8d/providers/Microsoft.Compute/disks/myDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\"\r\n },\r\n\ \ \"properties\": {\r\n \"creationData\": {\r\n \"createOption\"\ @@ -156,17 +156,18 @@ interactions: : \"Updating\",\r\n \"isArmResource\": true\r\n },\r\n \"location\":\ \ \"westus\",\r\n \"name\": \"myDisk\"\r\n}"} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/8b50b3bd-655f-4f3a-aead-cfb090c48cf8?api-version=2017-03-30'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/1ec43e68-ba46-486b-b034-81f5fbd4189d?api-version=2018-04-01'] cache-control: [no-cache] content-length: ['270'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:03:42 GMT'] + date: ['Wed, 21 Mar 2018 21:32:44 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/8b50b3bd-655f-4f3a-aead-cfb090c48cf8?monitor=true&api-version=2017-03-30'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/1ec43e68-ba46-486b-b034-81f5fbd4189d?monitor=true&api-version=2018-04-01'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/CreateUpdateDisks3Min;995,Microsoft.Compute/CreateUpdateDisks30Min;3989'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/CreateUpdateDisks3Min;994,Microsoft.Compute/CreateUpdateDisks30Min;3989'] x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 202, message: Accepted} - request: @@ -175,34 +176,33 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/8b50b3bd-655f-4f3a-aead-cfb090c48cf8?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/DiskOperations/1ec43e68-ba46-486b-b034-81f5fbd4189d?api-version=2018-04-01 response: - body: {string: "{\r\n \"startTime\": \"2017-11-22T01:03:44.1589359+00:00\",\r\ - \n \"endTime\": \"2017-11-22T01:03:44.268335+00:00\",\r\n \"status\": \"\ + body: {string: "{\r\n \"startTime\": \"2018-03-21T21:32:45.0010506+00:00\",\r\ + \n \"endTime\": \"2018-03-21T21:32:45.1307564+00:00\",\r\n \"status\": \"\ Succeeded\",\r\n \"properties\": {\r\n \"output\": {\"sku\":{\"name\"\ :\"Standard_LRS\",\"tier\":\"Standard\"},\"properties\":{\"creationData\"\ - :{\"createOption\":\"Empty\"},\"diskSizeGB\":25,\"timeCreated\":\"2017-11-22T01:03:10.1774863+00:00\"\ + :{\"createOption\":\"Empty\"},\"diskSizeGB\":25,\"timeCreated\":\"2018-03-21T21:32:11.8178207+00:00\"\ ,\"provisioningState\":\"Succeeded\",\"diskState\":\"Unattached\"},\"type\"\ :\"Microsoft.Compute/disks\",\"location\":\"westus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_resize_md30640f8d/providers/Microsoft.Compute/disks/myDisk\"\ - ,\"name\":\"myDisk\"}\r\n },\r\n \"name\": \"8b50b3bd-655f-4f3a-aead-cfb090c48cf8\"\ + ,\"name\":\"myDisk\"}\r\n },\r\n \"name\": \"1ec43e68-ba46-486b-b034-81f5fbd4189d\"\ \r\n}"} headers: cache-control: [no-cache] - content-length: ['682'] + content-length: ['683'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:04:13 GMT'] + date: ['Wed, 21 Mar 2018 21:33:15 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;49988,Microsoft.Compute/GetOperation30Min;249971'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/GetOperation3Min;49987,Microsoft.Compute/GetOperation30Min;249964'] status: {code: 200, message: OK} - request: body: null @@ -210,17 +210,15 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19 - msrest_azure/0.4.16 computemanagementclient/3.0.1 Azure-SDK-For-Python] - accept-language: [en-US] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.20 computemanagementclient/4.0.0rc1 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_resize_md30640f8d/providers/Microsoft.Compute/disks/myDisk?api-version=2017-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_resize_md30640f8d/providers/Microsoft.Compute/disks/myDisk?api-version=2018-04-01 response: body: {string: "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"\ tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n \"creationData\"\ : {\r\n \"createOption\": \"Empty\"\r\n },\r\n \"diskSizeGB\":\ - \ 25,\r\n \"timeCreated\": \"2017-11-22T01:03:10.1774863+00:00\",\r\n \ + \ 25,\r\n \"timeCreated\": \"2018-03-21T21:32:11.8178207+00:00\",\r\n \ \ \"provisioningState\": \"Succeeded\",\r\n \"diskState\": \"Unattached\"\ \r\n },\r\n \"type\": \"Microsoft.Compute/disks\",\r\n \"location\": \"\ westus\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_managed_disks_test_resize_md30640f8d/providers/Microsoft.Compute/disks/myDisk\"\ @@ -229,13 +227,14 @@ interactions: cache-control: [no-cache] content-length: ['562'] content-type: [application/json; charset=utf-8] - date: ['Wed, 22 Nov 2017 01:04:14 GMT'] + date: ['Wed, 21 Mar 2018 21:33:15 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4984,Microsoft.Compute/LowCostGet30Min;19970'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-resource: ['Microsoft.Compute/LowCostGet3Min;4983,Microsoft.Compute/LowCostGet30Min;19969'] status: {code: 200, message: OK} version: 1