diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/_vmware_cloud_simple_client.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/_vmware_cloud_simple_client.py index a3e375652686..135b8bd42d45 100644 --- a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/_vmware_cloud_simple_client.py +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/_vmware_cloud_simple_client.py @@ -18,6 +18,7 @@ from .operations import DedicatedCloudServicesOperations from .operations import SkusAvailabilityOperations from .operations import PrivateCloudsOperations +from .operations import CustomizationPoliciesOperations from .operations import ResourcePoolsOperations from .operations import VirtualMachineTemplatesOperations from .operations import VirtualNetworksOperations @@ -42,6 +43,8 @@ class VMwareCloudSimpleClient(SDKClient): :vartype skus_availability: azure.mgmt.vmwarecloudsimple.operations.SkusAvailabilityOperations :ivar private_clouds: PrivateClouds operations :vartype private_clouds: azure.mgmt.vmwarecloudsimple.operations.PrivateCloudsOperations + :ivar customization_policies: CustomizationPolicies operations + :vartype customization_policies: azure.mgmt.vmwarecloudsimple.operations.CustomizationPoliciesOperations :ivar resource_pools: ResourcePools operations :vartype resource_pools: azure.mgmt.vmwarecloudsimple.operations.ResourcePoolsOperations :ivar virtual_machine_templates: VirtualMachineTemplates operations @@ -84,6 +87,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.private_clouds = PrivateCloudsOperations( self._client, self.config, self._serialize, self._deserialize) + self.customization_policies = CustomizationPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) self.resource_pools = ResourcePoolsOperations( self._client, self.config, self._serialize, self._deserialize) self.virtual_machine_templates = VirtualMachineTemplatesOperations( diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/__init__.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/__init__.py index d1e9407cd7b9..eb93537f80f8 100644 --- a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/__init__.py +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/__init__.py @@ -16,8 +16,18 @@ from ._models_py3 import AvailableOperationDisplayPropertyServiceSpecificationMetricsList from ._models_py3 import CSRPError, CSRPErrorException from ._models_py3 import CSRPErrorBody + from ._models_py3 import CustomizationHostName + from ._models_py3 import CustomizationIdentity + from ._models_py3 import CustomizationIdentityUserData + from ._models_py3 import CustomizationIPAddress + from ._models_py3 import CustomizationIPSettings + from ._models_py3 import CustomizationNicSetting + from ._models_py3 import CustomizationPolicy + from ._models_py3 import CustomizationSpecification from ._models_py3 import DedicatedCloudNode from ._models_py3 import DedicatedCloudService + from ._models_py3 import GuestOSCustomization + from ._models_py3 import GuestOSNICCustomization from ._models_py3 import OperationError from ._models_py3 import OperationResource from ._models_py3 import PatchPayload @@ -41,8 +51,18 @@ from ._models import AvailableOperationDisplayPropertyServiceSpecificationMetricsList from ._models import CSRPError, CSRPErrorException from ._models import CSRPErrorBody + from ._models import CustomizationHostName + from ._models import CustomizationIdentity + from ._models import CustomizationIdentityUserData + from ._models import CustomizationIPAddress + from ._models import CustomizationIPSettings + from ._models import CustomizationNicSetting + from ._models import CustomizationPolicy + from ._models import CustomizationSpecification from ._models import DedicatedCloudNode from ._models import DedicatedCloudService + from ._models import GuestOSCustomization + from ._models import GuestOSNICCustomization from ._models import OperationError from ._models import OperationResource from ._models import PatchPayload @@ -60,6 +80,7 @@ from ._models import VirtualNetwork from ._models import VirtualNic from ._paged_models import AvailableOperationPaged +from ._paged_models import CustomizationPolicyPaged from ._paged_models import DedicatedCloudNodePaged from ._paged_models import DedicatedCloudServicePaged from ._paged_models import PrivateCloudPaged @@ -90,8 +111,18 @@ 'AvailableOperationDisplayPropertyServiceSpecificationMetricsList', 'CSRPError', 'CSRPErrorException', 'CSRPErrorBody', + 'CustomizationHostName', + 'CustomizationIdentity', + 'CustomizationIdentityUserData', + 'CustomizationIPAddress', + 'CustomizationIPSettings', + 'CustomizationNicSetting', + 'CustomizationPolicy', + 'CustomizationSpecification', 'DedicatedCloudNode', 'DedicatedCloudService', + 'GuestOSCustomization', + 'GuestOSNICCustomization', 'OperationError', 'OperationResource', 'PatchPayload', @@ -113,6 +144,7 @@ 'DedicatedCloudServicePaged', 'SkuAvailabilityPaged', 'PrivateCloudPaged', + 'CustomizationPolicyPaged', 'ResourcePoolPaged', 'VirtualMachineTemplatePaged', 'VirtualNetworkPaged', diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_models.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_models.py index a76f1d648bef..b9ca82f10531 100644 --- a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_models.py +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_models.py @@ -212,6 +212,226 @@ def __init__(self, **kwargs): self.target = kwargs.get('target', None) +class CustomizationHostName(Model): + """Host name model. + + :param name: Hostname + :type name: str + :param type: Type of host name. Possible values include: 'USER_DEFINED', + 'PREFIX_BASED', 'FIXED', 'VIRTUAL_MACHINE_NAME', 'CUSTOM_NAME' + :type type: str or ~azure.mgmt.vmwarecloudsimple.models.enum + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomizationHostName, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class CustomizationIdentity(Model): + """CustomizationIdentity. + + :param data: Windows Text Identity. Prepared data + :type data: str + :param host_name: Virtual machine host name settings + :type host_name: + ~azure.mgmt.vmwarecloudsimple.models.CustomizationHostName + :param type: Identity type. Possible values include: 'WINDOWS_TEXT', + 'WINDOWS', 'LINUX' + :type type: str or ~azure.mgmt.vmwarecloudsimple.models.enum + :param user_data: Windows Identity. User data customization + :type user_data: + ~azure.mgmt.vmwarecloudsimple.models.CustomizationIdentityUserData + """ + + _attribute_map = { + 'data': {'key': 'data', 'type': 'str'}, + 'host_name': {'key': 'hostName', 'type': 'CustomizationHostName'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_data': {'key': 'userData', 'type': 'CustomizationIdentityUserData'}, + } + + def __init__(self, **kwargs): + super(CustomizationIdentity, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.host_name = kwargs.get('host_name', None) + self.type = kwargs.get('type', None) + self.user_data = kwargs.get('user_data', None) + + +class CustomizationIdentityUserData(Model): + """Windows Identity. User data customization. + + :param is_password_predefined: Is password predefined in customization + policy. Default value: False . + :type is_password_predefined: bool + """ + + _attribute_map = { + 'is_password_predefined': {'key': 'isPasswordPredefined', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CustomizationIdentityUserData, self).__init__(**kwargs) + self.is_password_predefined = kwargs.get('is_password_predefined', False) + + +class CustomizationIPAddress(Model): + """CustomizationIPAddress. + + :param argument: Argument when Custom ip type is selected + :type argument: str + :param ip_address: Defined Ip Address when Fixed ip type is selected + :type ip_address: str + :param type: Customization Specification ip type. Possible values include: + 'CUSTOM', 'DHCP_IP', 'FIXED_IP', 'USER_DEFINED' + :type type: str or ~azure.mgmt.vmwarecloudsimple.models.enum + """ + + _attribute_map = { + 'argument': {'key': 'argument', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomizationIPAddress, self).__init__(**kwargs) + self.argument = kwargs.get('argument', None) + self.ip_address = kwargs.get('ip_address', None) + self.type = kwargs.get('type', None) + + +class CustomizationIPSettings(Model): + """CustomizationIPSettings. + + :param gateway: The list of gateways + :type gateway: list[str] + :param ip: Ip address customization settings + :type ip: ~azure.mgmt.vmwarecloudsimple.models.CustomizationIPAddress + :param subnet_mask: Adapter subnet mask + :type subnet_mask: str + """ + + _attribute_map = { + 'gateway': {'key': 'gateway', 'type': '[str]'}, + 'ip': {'key': 'ip', 'type': 'CustomizationIPAddress'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomizationIPSettings, self).__init__(**kwargs) + self.gateway = kwargs.get('gateway', None) + self.ip = kwargs.get('ip', None) + self.subnet_mask = kwargs.get('subnet_mask', None) + + +class CustomizationNicSetting(Model): + """CustomizationNicSetting. + + :param adapter: The list of adapters' settings + :type adapter: + ~azure.mgmt.vmwarecloudsimple.models.CustomizationIPSettings + :param mac_address: NIC mac address + :type mac_address: str + """ + + _attribute_map = { + 'adapter': {'key': 'adapter', 'type': 'CustomizationIPSettings'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomizationNicSetting, self).__init__(**kwargs) + self.adapter = kwargs.get('adapter', None) + self.mac_address = kwargs.get('mac_address', None) + + +class CustomizationPolicy(Model): + """The virtual machine customization policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Customization policy azure id + :type id: str + :param location: Azure region + :type location: str + :ivar name: Customization policy name + :vartype name: str + :param description: Policy description + :type description: str + :param private_cloud_id: The Private cloud id + :type private_cloud_id: str + :param specification: Detailed customization policy specification + :type specification: + ~azure.mgmt.vmwarecloudsimple.models.CustomizationSpecification + :param customization_policy_properties_type: The type of customization + (Linux or Windows). Possible values include: 'LINUX', 'WINDOWS' + :type customization_policy_properties_type: str or + ~azure.mgmt.vmwarecloudsimple.models.enum + :param version: Policy version + :type version: str + :ivar type: + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'private_cloud_id': {'key': 'properties.privateCloudId', 'type': 'str'}, + 'specification': {'key': 'properties.specification', 'type': 'CustomizationSpecification'}, + 'customization_policy_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomizationPolicy, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.location = kwargs.get('location', None) + self.name = None + self.description = kwargs.get('description', None) + self.private_cloud_id = kwargs.get('private_cloud_id', None) + self.specification = kwargs.get('specification', None) + self.customization_policy_properties_type = kwargs.get('customization_policy_properties_type', None) + self.version = kwargs.get('version', None) + self.type = None + + +class CustomizationSpecification(Model): + """The specification for Customization Policy. + + :param identity: Customization Identity. It contains data about user and + hostname + :type identity: ~azure.mgmt.vmwarecloudsimple.models.CustomizationIdentity + :param nic_settings: Network interface settings + :type nic_settings: + list[~azure.mgmt.vmwarecloudsimple.models.CustomizationNicSetting] + """ + + _attribute_map = { + 'identity': {'key': 'identity', 'type': 'CustomizationIdentity'}, + 'nic_settings': {'key': 'nicSettings', 'type': '[CustomizationNicSetting]'}, + } + + def __init__(self, **kwargs): + super(CustomizationSpecification, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.nic_settings = kwargs.get('nic_settings', None) + + class DedicatedCloudNode(Model): """Dedicated cloud node model. @@ -270,7 +490,7 @@ class DedicatedCloudNode(Model): _validation = { 'id': {'readonly': True}, 'location': {'required': True}, - 'name': {'readonly': True, 'pattern': r'^[-a-zA-Z0-9]+$'}, + 'name': {'readonly': True, 'pattern': r'^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$'}, 'availability_zone_id': {'required': True}, 'availability_zone_name': {'readonly': True}, 'cloud_rack_name': {'readonly': True}, @@ -361,10 +581,10 @@ class DedicatedCloudService(Model): 'onBoardingFailed', 'onBoarding' :vartype is_account_onboarded: str or ~azure.mgmt.vmwarecloudsimple.models.OnboardingStatus - :param nodes: total nodes purchased - :type nodes: int - :param service_url: link to a service management web portal - :type service_url: str + :ivar nodes: total nodes purchased + :vartype nodes: int + :ivar service_url: link to a service management web portal + :vartype service_url: str :param tags: The list of tags :type tags: dict[str, str] :ivar type: {resourceProviderNamespace}/{resourceType} @@ -374,9 +594,11 @@ class DedicatedCloudService(Model): _validation = { 'id': {'readonly': True}, 'location': {'required': True}, - 'name': {'readonly': True, 'pattern': r'^[-a-zA-Z0-9]+$'}, + 'name': {'readonly': True, 'pattern': r'^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$'}, 'gateway_subnet': {'required': True}, 'is_account_onboarded': {'readonly': True}, + 'nodes': {'readonly': True}, + 'service_url': {'readonly': True}, 'type': {'readonly': True}, } @@ -399,12 +621,85 @@ def __init__(self, **kwargs): self.name = None self.gateway_subnet = kwargs.get('gateway_subnet', None) self.is_account_onboarded = None - self.nodes = kwargs.get('nodes', None) - self.service_url = kwargs.get('service_url', None) + self.nodes = None + self.service_url = None self.tags = kwargs.get('tags', None) self.type = None +class GuestOSCustomization(Model): + """Guest OS Customization properties. + + :param dns_servers: List of dns servers to use + :type dns_servers: list[str] + :param host_name: Virtual Machine hostname + :type host_name: str + :param password: Password for login + :type password: str + :param policy_id: id of customization policy + :type policy_id: str + :param username: Username for login + :type username: str + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GuestOSCustomization, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + self.host_name = kwargs.get('host_name', None) + self.password = kwargs.get('password', None) + self.policy_id = kwargs.get('policy_id', None) + self.username = kwargs.get('username', None) + + +class GuestOSNICCustomization(Model): + """Guest OS nic customization. + + :param allocation: IP address allocation method. Possible values include: + 'static', 'dynamic' + :type allocation: str or ~azure.mgmt.vmwarecloudsimple.models.enum + :param dns_servers: List of dns servers to use + :type dns_servers: list[str] + :param gateway: Gateway addresses assigned to nic + :type gateway: list[str] + :param ip_address: Static ip address for nic + :type ip_address: str + :param mask: Network mask for nic + :type mask: str + :param primary_wins_server: primary WINS server for Windows + :type primary_wins_server: str + :param secondary_wins_server: secondary WINS server for Windows + :type secondary_wins_server: str + """ + + _attribute_map = { + 'allocation': {'key': 'allocation', 'type': 'str'}, + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'gateway': {'key': 'gateway', 'type': '[str]'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'mask': {'key': 'mask', 'type': 'str'}, + 'primary_wins_server': {'key': 'primaryWinsServer', 'type': 'str'}, + 'secondary_wins_server': {'key': 'secondaryWinsServer', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GuestOSNICCustomization, self).__init__(**kwargs) + self.allocation = kwargs.get('allocation', None) + self.dns_servers = kwargs.get('dns_servers', None) + self.gateway = kwargs.get('gateway', None) + self.ip_address = kwargs.get('ip_address', None) + self.mask = kwargs.get('mask', None) + self.primary_wins_server = kwargs.get('primary_wins_server', None) + self.secondary_wins_server = kwargs.get('secondary_wins_server', None) + + class OperationError(Model): """Operation error model. @@ -928,6 +1223,9 @@ class VirtualMachine(Model): :ivar controllers: The list of Virtual Disks' Controllers :vartype controllers: list[~azure.mgmt.vmwarecloudsimple.models.VirtualDiskController] + :param customization: Virtual machine properties + :type customization: + ~azure.mgmt.vmwarecloudsimple.models.GuestOSCustomization :param disks: The list of Virtual Disks :type disks: list[~azure.mgmt.vmwarecloudsimple.models.VirtualDisk] :ivar dnsname: The DNS name of Virtual Machine in VCenter @@ -946,7 +1244,8 @@ class VirtualMachine(Model): :type nics: list[~azure.mgmt.vmwarecloudsimple.models.VirtualNic] :param number_of_cores: Required. The number of CPU cores :type number_of_cores: int - :param password: Password for login + :param password: Password for login. Deprecated - use customization + property :type password: str :param private_cloud_id: Required. Private Cloud Id :type private_cloud_id: str @@ -963,7 +1262,8 @@ class VirtualMachine(Model): ~azure.mgmt.vmwarecloudsimple.models.VirtualMachineStatus :param template_id: Virtual Machine Template Id :type template_id: str - :param username: Username for login + :param username: Username for login. Deprecated - use customization + property :type username: str :param v_sphere_networks: The list of Virtual VSphere Networks :type v_sphere_networks: list[str] @@ -980,7 +1280,7 @@ class VirtualMachine(Model): _validation = { 'id': {'readonly': True}, 'location': {'required': True}, - 'name': {'readonly': True, 'pattern': r'^[-a-zA-Z0-9]+$'}, + 'name': {'readonly': True, 'pattern': r'^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$'}, 'amount_of_ram': {'required': True}, 'controllers': {'readonly': True}, 'dnsname': {'readonly': True}, @@ -1003,6 +1303,7 @@ class VirtualMachine(Model): 'name': {'key': 'name', 'type': 'str'}, 'amount_of_ram': {'key': 'properties.amountOfRam', 'type': 'int'}, 'controllers': {'key': 'properties.controllers', 'type': '[VirtualDiskController]'}, + 'customization': {'key': 'properties.customization', 'type': 'GuestOSCustomization'}, 'disks': {'key': 'properties.disks', 'type': '[VirtualDisk]'}, 'dnsname': {'key': 'properties.dnsname', 'type': 'str'}, 'expose_to_guest_vm': {'key': 'properties.exposeToGuestVM', 'type': 'bool'}, @@ -1033,6 +1334,7 @@ def __init__(self, **kwargs): self.name = None self.amount_of_ram = kwargs.get('amount_of_ram', None) self.controllers = None + self.customization = kwargs.get('customization', None) self.disks = kwargs.get('disks', None) self.dnsname = None self.expose_to_guest_vm = kwargs.get('expose_to_guest_vm', None) @@ -1232,6 +1534,9 @@ class VirtualNic(Model): All required parameters must be populated in order to send to Azure. + :param customization: guest OS customization for nic + :type customization: + ~azure.mgmt.vmwarecloudsimple.models.GuestOSNICCustomization :param ip_addresses: NIC ip address :type ip_addresses: list[str] :param mac_address: NIC MAC address @@ -1256,6 +1561,7 @@ class VirtualNic(Model): } _attribute_map = { + 'customization': {'key': 'customization', 'type': 'GuestOSNICCustomization'}, 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, 'mac_address': {'key': 'macAddress', 'type': 'str'}, 'network': {'key': 'network', 'type': 'VirtualNetwork'}, @@ -1267,6 +1573,7 @@ class VirtualNic(Model): def __init__(self, **kwargs): super(VirtualNic, self).__init__(**kwargs) + self.customization = kwargs.get('customization', None) self.ip_addresses = kwargs.get('ip_addresses', None) self.mac_address = kwargs.get('mac_address', None) self.network = kwargs.get('network', None) diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_models_py3.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_models_py3.py index 38389072b99d..901e80b0ed60 100644 --- a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_models_py3.py @@ -212,6 +212,226 @@ def __init__(self, *, target: str=None, **kwargs) -> None: self.target = target +class CustomizationHostName(Model): + """Host name model. + + :param name: Hostname + :type name: str + :param type: Type of host name. Possible values include: 'USER_DEFINED', + 'PREFIX_BASED', 'FIXED', 'VIRTUAL_MACHINE_NAME', 'CUSTOM_NAME' + :type type: str or ~azure.mgmt.vmwarecloudsimple.models.enum + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, type=None, **kwargs) -> None: + super(CustomizationHostName, self).__init__(**kwargs) + self.name = name + self.type = type + + +class CustomizationIdentity(Model): + """CustomizationIdentity. + + :param data: Windows Text Identity. Prepared data + :type data: str + :param host_name: Virtual machine host name settings + :type host_name: + ~azure.mgmt.vmwarecloudsimple.models.CustomizationHostName + :param type: Identity type. Possible values include: 'WINDOWS_TEXT', + 'WINDOWS', 'LINUX' + :type type: str or ~azure.mgmt.vmwarecloudsimple.models.enum + :param user_data: Windows Identity. User data customization + :type user_data: + ~azure.mgmt.vmwarecloudsimple.models.CustomizationIdentityUserData + """ + + _attribute_map = { + 'data': {'key': 'data', 'type': 'str'}, + 'host_name': {'key': 'hostName', 'type': 'CustomizationHostName'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_data': {'key': 'userData', 'type': 'CustomizationIdentityUserData'}, + } + + def __init__(self, *, data: str=None, host_name=None, type=None, user_data=None, **kwargs) -> None: + super(CustomizationIdentity, self).__init__(**kwargs) + self.data = data + self.host_name = host_name + self.type = type + self.user_data = user_data + + +class CustomizationIdentityUserData(Model): + """Windows Identity. User data customization. + + :param is_password_predefined: Is password predefined in customization + policy. Default value: False . + :type is_password_predefined: bool + """ + + _attribute_map = { + 'is_password_predefined': {'key': 'isPasswordPredefined', 'type': 'bool'}, + } + + def __init__(self, *, is_password_predefined: bool=False, **kwargs) -> None: + super(CustomizationIdentityUserData, self).__init__(**kwargs) + self.is_password_predefined = is_password_predefined + + +class CustomizationIPAddress(Model): + """CustomizationIPAddress. + + :param argument: Argument when Custom ip type is selected + :type argument: str + :param ip_address: Defined Ip Address when Fixed ip type is selected + :type ip_address: str + :param type: Customization Specification ip type. Possible values include: + 'CUSTOM', 'DHCP_IP', 'FIXED_IP', 'USER_DEFINED' + :type type: str or ~azure.mgmt.vmwarecloudsimple.models.enum + """ + + _attribute_map = { + 'argument': {'key': 'argument', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, argument: str=None, ip_address: str=None, type=None, **kwargs) -> None: + super(CustomizationIPAddress, self).__init__(**kwargs) + self.argument = argument + self.ip_address = ip_address + self.type = type + + +class CustomizationIPSettings(Model): + """CustomizationIPSettings. + + :param gateway: The list of gateways + :type gateway: list[str] + :param ip: Ip address customization settings + :type ip: ~azure.mgmt.vmwarecloudsimple.models.CustomizationIPAddress + :param subnet_mask: Adapter subnet mask + :type subnet_mask: str + """ + + _attribute_map = { + 'gateway': {'key': 'gateway', 'type': '[str]'}, + 'ip': {'key': 'ip', 'type': 'CustomizationIPAddress'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + } + + def __init__(self, *, gateway=None, ip=None, subnet_mask: str=None, **kwargs) -> None: + super(CustomizationIPSettings, self).__init__(**kwargs) + self.gateway = gateway + self.ip = ip + self.subnet_mask = subnet_mask + + +class CustomizationNicSetting(Model): + """CustomizationNicSetting. + + :param adapter: The list of adapters' settings + :type adapter: + ~azure.mgmt.vmwarecloudsimple.models.CustomizationIPSettings + :param mac_address: NIC mac address + :type mac_address: str + """ + + _attribute_map = { + 'adapter': {'key': 'adapter', 'type': 'CustomizationIPSettings'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, *, adapter=None, mac_address: str=None, **kwargs) -> None: + super(CustomizationNicSetting, self).__init__(**kwargs) + self.adapter = adapter + self.mac_address = mac_address + + +class CustomizationPolicy(Model): + """The virtual machine customization policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Customization policy azure id + :type id: str + :param location: Azure region + :type location: str + :ivar name: Customization policy name + :vartype name: str + :param description: Policy description + :type description: str + :param private_cloud_id: The Private cloud id + :type private_cloud_id: str + :param specification: Detailed customization policy specification + :type specification: + ~azure.mgmt.vmwarecloudsimple.models.CustomizationSpecification + :param customization_policy_properties_type: The type of customization + (Linux or Windows). Possible values include: 'LINUX', 'WINDOWS' + :type customization_policy_properties_type: str or + ~azure.mgmt.vmwarecloudsimple.models.enum + :param version: Policy version + :type version: str + :ivar type: + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'private_cloud_id': {'key': 'properties.privateCloudId', 'type': 'str'}, + 'specification': {'key': 'properties.specification', 'type': 'CustomizationSpecification'}, + 'customization_policy_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, description: str=None, private_cloud_id: str=None, specification=None, customization_policy_properties_type=None, version: str=None, **kwargs) -> None: + super(CustomizationPolicy, self).__init__(**kwargs) + self.id = id + self.location = location + self.name = None + self.description = description + self.private_cloud_id = private_cloud_id + self.specification = specification + self.customization_policy_properties_type = customization_policy_properties_type + self.version = version + self.type = None + + +class CustomizationSpecification(Model): + """The specification for Customization Policy. + + :param identity: Customization Identity. It contains data about user and + hostname + :type identity: ~azure.mgmt.vmwarecloudsimple.models.CustomizationIdentity + :param nic_settings: Network interface settings + :type nic_settings: + list[~azure.mgmt.vmwarecloudsimple.models.CustomizationNicSetting] + """ + + _attribute_map = { + 'identity': {'key': 'identity', 'type': 'CustomizationIdentity'}, + 'nic_settings': {'key': 'nicSettings', 'type': '[CustomizationNicSetting]'}, + } + + def __init__(self, *, identity=None, nic_settings=None, **kwargs) -> None: + super(CustomizationSpecification, self).__init__(**kwargs) + self.identity = identity + self.nic_settings = nic_settings + + class DedicatedCloudNode(Model): """Dedicated cloud node model. @@ -270,7 +490,7 @@ class DedicatedCloudNode(Model): _validation = { 'id': {'readonly': True}, 'location': {'required': True}, - 'name': {'readonly': True, 'pattern': r'^[-a-zA-Z0-9]+$'}, + 'name': {'readonly': True, 'pattern': r'^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$'}, 'availability_zone_id': {'required': True}, 'availability_zone_name': {'readonly': True}, 'cloud_rack_name': {'readonly': True}, @@ -361,10 +581,10 @@ class DedicatedCloudService(Model): 'onBoardingFailed', 'onBoarding' :vartype is_account_onboarded: str or ~azure.mgmt.vmwarecloudsimple.models.OnboardingStatus - :param nodes: total nodes purchased - :type nodes: int - :param service_url: link to a service management web portal - :type service_url: str + :ivar nodes: total nodes purchased + :vartype nodes: int + :ivar service_url: link to a service management web portal + :vartype service_url: str :param tags: The list of tags :type tags: dict[str, str] :ivar type: {resourceProviderNamespace}/{resourceType} @@ -374,9 +594,11 @@ class DedicatedCloudService(Model): _validation = { 'id': {'readonly': True}, 'location': {'required': True}, - 'name': {'readonly': True, 'pattern': r'^[-a-zA-Z0-9]+$'}, + 'name': {'readonly': True, 'pattern': r'^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$'}, 'gateway_subnet': {'required': True}, 'is_account_onboarded': {'readonly': True}, + 'nodes': {'readonly': True}, + 'service_url': {'readonly': True}, 'type': {'readonly': True}, } @@ -392,19 +614,92 @@ class DedicatedCloudService(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, location: str, gateway_subnet: str, nodes: int=None, service_url: str=None, tags=None, **kwargs) -> None: + def __init__(self, *, location: str, gateway_subnet: str, tags=None, **kwargs) -> None: super(DedicatedCloudService, self).__init__(**kwargs) self.id = None self.location = location self.name = None self.gateway_subnet = gateway_subnet self.is_account_onboarded = None - self.nodes = nodes - self.service_url = service_url + self.nodes = None + self.service_url = None self.tags = tags self.type = None +class GuestOSCustomization(Model): + """Guest OS Customization properties. + + :param dns_servers: List of dns servers to use + :type dns_servers: list[str] + :param host_name: Virtual Machine hostname + :type host_name: str + :param password: Password for login + :type password: str + :param policy_id: id of customization policy + :type policy_id: str + :param username: Username for login + :type username: str + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + } + + def __init__(self, *, dns_servers=None, host_name: str=None, password: str=None, policy_id: str=None, username: str=None, **kwargs) -> None: + super(GuestOSCustomization, self).__init__(**kwargs) + self.dns_servers = dns_servers + self.host_name = host_name + self.password = password + self.policy_id = policy_id + self.username = username + + +class GuestOSNICCustomization(Model): + """Guest OS nic customization. + + :param allocation: IP address allocation method. Possible values include: + 'static', 'dynamic' + :type allocation: str or ~azure.mgmt.vmwarecloudsimple.models.enum + :param dns_servers: List of dns servers to use + :type dns_servers: list[str] + :param gateway: Gateway addresses assigned to nic + :type gateway: list[str] + :param ip_address: Static ip address for nic + :type ip_address: str + :param mask: Network mask for nic + :type mask: str + :param primary_wins_server: primary WINS server for Windows + :type primary_wins_server: str + :param secondary_wins_server: secondary WINS server for Windows + :type secondary_wins_server: str + """ + + _attribute_map = { + 'allocation': {'key': 'allocation', 'type': 'str'}, + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'gateway': {'key': 'gateway', 'type': '[str]'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'mask': {'key': 'mask', 'type': 'str'}, + 'primary_wins_server': {'key': 'primaryWinsServer', 'type': 'str'}, + 'secondary_wins_server': {'key': 'secondaryWinsServer', 'type': 'str'}, + } + + def __init__(self, *, allocation=None, dns_servers=None, gateway=None, ip_address: str=None, mask: str=None, primary_wins_server: str=None, secondary_wins_server: str=None, **kwargs) -> None: + super(GuestOSNICCustomization, self).__init__(**kwargs) + self.allocation = allocation + self.dns_servers = dns_servers + self.gateway = gateway + self.ip_address = ip_address + self.mask = mask + self.primary_wins_server = primary_wins_server + self.secondary_wins_server = secondary_wins_server + + class OperationError(Model): """Operation error model. @@ -928,6 +1223,9 @@ class VirtualMachine(Model): :ivar controllers: The list of Virtual Disks' Controllers :vartype controllers: list[~azure.mgmt.vmwarecloudsimple.models.VirtualDiskController] + :param customization: Virtual machine properties + :type customization: + ~azure.mgmt.vmwarecloudsimple.models.GuestOSCustomization :param disks: The list of Virtual Disks :type disks: list[~azure.mgmt.vmwarecloudsimple.models.VirtualDisk] :ivar dnsname: The DNS name of Virtual Machine in VCenter @@ -946,7 +1244,8 @@ class VirtualMachine(Model): :type nics: list[~azure.mgmt.vmwarecloudsimple.models.VirtualNic] :param number_of_cores: Required. The number of CPU cores :type number_of_cores: int - :param password: Password for login + :param password: Password for login. Deprecated - use customization + property :type password: str :param private_cloud_id: Required. Private Cloud Id :type private_cloud_id: str @@ -963,7 +1262,8 @@ class VirtualMachine(Model): ~azure.mgmt.vmwarecloudsimple.models.VirtualMachineStatus :param template_id: Virtual Machine Template Id :type template_id: str - :param username: Username for login + :param username: Username for login. Deprecated - use customization + property :type username: str :param v_sphere_networks: The list of Virtual VSphere Networks :type v_sphere_networks: list[str] @@ -980,7 +1280,7 @@ class VirtualMachine(Model): _validation = { 'id': {'readonly': True}, 'location': {'required': True}, - 'name': {'readonly': True, 'pattern': r'^[-a-zA-Z0-9]+$'}, + 'name': {'readonly': True, 'pattern': r'^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$'}, 'amount_of_ram': {'required': True}, 'controllers': {'readonly': True}, 'dnsname': {'readonly': True}, @@ -1003,6 +1303,7 @@ class VirtualMachine(Model): 'name': {'key': 'name', 'type': 'str'}, 'amount_of_ram': {'key': 'properties.amountOfRam', 'type': 'int'}, 'controllers': {'key': 'properties.controllers', 'type': '[VirtualDiskController]'}, + 'customization': {'key': 'properties.customization', 'type': 'GuestOSCustomization'}, 'disks': {'key': 'properties.disks', 'type': '[VirtualDisk]'}, 'dnsname': {'key': 'properties.dnsname', 'type': 'str'}, 'expose_to_guest_vm': {'key': 'properties.exposeToGuestVM', 'type': 'bool'}, @@ -1026,13 +1327,14 @@ class VirtualMachine(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, location: str, amount_of_ram: int, number_of_cores: int, private_cloud_id: str, disks=None, expose_to_guest_vm: bool=None, nics=None, password: str=None, resource_pool=None, template_id: str=None, username: str=None, v_sphere_networks=None, tags=None, **kwargs) -> None: + def __init__(self, *, location: str, amount_of_ram: int, number_of_cores: int, private_cloud_id: str, customization=None, disks=None, expose_to_guest_vm: bool=None, nics=None, password: str=None, resource_pool=None, template_id: str=None, username: str=None, v_sphere_networks=None, tags=None, **kwargs) -> None: super(VirtualMachine, self).__init__(**kwargs) self.id = None self.location = location self.name = None self.amount_of_ram = amount_of_ram self.controllers = None + self.customization = customization self.disks = disks self.dnsname = None self.expose_to_guest_vm = expose_to_guest_vm @@ -1232,6 +1534,9 @@ class VirtualNic(Model): All required parameters must be populated in order to send to Azure. + :param customization: guest OS customization for nic + :type customization: + ~azure.mgmt.vmwarecloudsimple.models.GuestOSNICCustomization :param ip_addresses: NIC ip address :type ip_addresses: list[str] :param mac_address: NIC MAC address @@ -1256,6 +1561,7 @@ class VirtualNic(Model): } _attribute_map = { + 'customization': {'key': 'customization', 'type': 'GuestOSNICCustomization'}, 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, 'mac_address': {'key': 'macAddress', 'type': 'str'}, 'network': {'key': 'network', 'type': 'VirtualNetwork'}, @@ -1265,8 +1571,9 @@ class VirtualNic(Model): 'virtual_nic_name': {'key': 'virtualNicName', 'type': 'str'}, } - def __init__(self, *, network, nic_type, ip_addresses=None, mac_address: str=None, power_on_boot: bool=None, virtual_nic_id: str=None, **kwargs) -> None: + def __init__(self, *, network, nic_type, customization=None, ip_addresses=None, mac_address: str=None, power_on_boot: bool=None, virtual_nic_id: str=None, **kwargs) -> None: super(VirtualNic, self).__init__(**kwargs) + self.customization = customization self.ip_addresses = ip_addresses self.mac_address = mac_address self.network = network diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_paged_models.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_paged_models.py index 28104bcd671e..85ebed5b98bc 100644 --- a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_paged_models.py +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_paged_models.py @@ -77,6 +77,19 @@ class PrivateCloudPaged(Paged): def __init__(self, *args, **kwargs): super(PrivateCloudPaged, self).__init__(*args, **kwargs) +class CustomizationPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`CustomizationPolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CustomizationPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(CustomizationPolicyPaged, self).__init__(*args, **kwargs) class ResourcePoolPaged(Paged): """ A paging container for iterating over a list of :class:`ResourcePool ` object diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/__init__.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/__init__.py index 04cf6300813b..a0f5a61c136e 100644 --- a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/__init__.py +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/__init__.py @@ -14,6 +14,7 @@ from ._dedicated_cloud_services_operations import DedicatedCloudServicesOperations from ._skus_availability_operations import SkusAvailabilityOperations from ._private_clouds_operations import PrivateCloudsOperations +from ._customization_policies_operations import CustomizationPoliciesOperations from ._resource_pools_operations import ResourcePoolsOperations from ._virtual_machine_templates_operations import VirtualMachineTemplatesOperations from ._virtual_networks_operations import VirtualNetworksOperations @@ -26,6 +27,7 @@ 'DedicatedCloudServicesOperations', 'SkusAvailabilityOperations', 'PrivateCloudsOperations', + 'CustomizationPoliciesOperations', 'ResourcePoolsOperations', 'VirtualMachineTemplatesOperations', 'VirtualNetworksOperations', diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_customization_policies_operations.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_customization_policies_operations.py new file mode 100644 index 000000000000..fad8014ceaf7 --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_customization_policies_operations.py @@ -0,0 +1,182 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 .. import models + + +class CustomizationPoliciesOperations(object): + """CustomizationPoliciesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list( + self, region_id, pc_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Implements get of customization policies list. + + Returns list of customization policies in region for private cloud. + + :param region_id: The region Id (westus, eastus) + :type region_id: str + :param pc_name: The private cloud name + :type pc_name: str + :param filter: The filter to apply on the list operation. only type is + allowed here as a filter e.g. $filter=type eq 'xxxx' + :type filter: 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 CustomizationPolicy + :rtype: + ~azure.mgmt.vmwarecloudsimple.models.CustomizationPolicyPaged[~azure.mgmt.vmwarecloudsimple.models.CustomizationPolicy] + :raises: + :class:`CSRPErrorException` + """ + def prepare_request(next_link=None): + 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'), + 'regionId': self._serialize.url("region_id", region_id, 'str'), + 'pcName': self._serialize.url("pc_name", pc_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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CSRPErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.CustomizationPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/customizationPolicies'} + + def get( + self, region_id, pc_name, customization_policy_name, custom_headers=None, raw=False, **operation_config): + """Implements get of customization policy. + + Returns customization policy by its name. + + :param region_id: The region Id (westus, eastus) + :type region_id: str + :param pc_name: The private cloud name + :type pc_name: str + :param customization_policy_name: customization policy name + :type customization_policy_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: CustomizationPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmwarecloudsimple.models.CustomizationPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CSRPErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'regionId': self._serialize.url("region_id", region_id, 'str'), + 'pcName': self._serialize.url("pc_name", pc_name, 'str'), + 'customizationPolicyName': self._serialize.url("customization_policy_name", customization_policy_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CSRPErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CustomizationPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/customizationPolicies/{customizationPolicyName}'} diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_dedicated_cloud_nodes_operations.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_dedicated_cloud_nodes_operations.py index e6d940404bb9..b60f73cf4bb6 100644 --- a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_dedicated_cloud_nodes_operations.py +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_dedicated_cloud_nodes_operations.py @@ -227,7 +227,7 @@ def get( 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'), - 'dedicatedCloudNodeName': self._serialize.url("dedicated_cloud_node_name", dedicated_cloud_node_name, 'str', pattern=r'^[-a-zA-Z0-9]+$') + 'dedicatedCloudNodeName': self._serialize.url("dedicated_cloud_node_name", dedicated_cloud_node_name, 'str', pattern=r'^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$') } url = self._client.format_url(url, **path_format_arguments) @@ -271,7 +271,7 @@ def _create_or_update_initial( 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'), - 'dedicatedCloudNodeName': self._serialize.url("dedicated_cloud_node_name", dedicated_cloud_node_name, 'str', pattern=r'^[-a-zA-Z0-9]+$') + 'dedicatedCloudNodeName': self._serialize.url("dedicated_cloud_node_name", dedicated_cloud_node_name, 'str', pattern=r'^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$') } url = self._client.format_url(url, **path_format_arguments) @@ -405,7 +405,7 @@ def delete( 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'), - 'dedicatedCloudNodeName': self._serialize.url("dedicated_cloud_node_name", dedicated_cloud_node_name, 'str', pattern=r'^[-a-zA-Z0-9]+$') + 'dedicatedCloudNodeName': self._serialize.url("dedicated_cloud_node_name", dedicated_cloud_node_name, 'str', pattern=r'^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$') } url = self._client.format_url(url, **path_format_arguments) @@ -467,7 +467,7 @@ def update( 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'), - 'dedicatedCloudNodeName': self._serialize.url("dedicated_cloud_node_name", dedicated_cloud_node_name, 'str', pattern=r'^[-a-zA-Z0-9]+$') + 'dedicatedCloudNodeName': self._serialize.url("dedicated_cloud_node_name", dedicated_cloud_node_name, 'str', pattern=r'^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$') } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_dedicated_cloud_services_operations.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_dedicated_cloud_services_operations.py index de6a56d3617c..2d3b9e0c4b48 100644 --- a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_dedicated_cloud_services_operations.py +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_dedicated_cloud_services_operations.py @@ -294,7 +294,7 @@ def create_or_update( 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'), - 'dedicatedCloudServiceName': self._serialize.url("dedicated_cloud_service_name", dedicated_cloud_service_name, 'str', pattern=r'^[-a-zA-Z0-9]+$') + 'dedicatedCloudServiceName': self._serialize.url("dedicated_cloud_service_name", dedicated_cloud_service_name, 'str', pattern=r'^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$') } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_virtual_machines_operations.py index d03d240726fd..f3fc6613b902 100644 --- a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_virtual_machines_operations.py @@ -271,7 +271,7 @@ def _create_or_update_initial( 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'), - 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str', pattern=r'^[-a-zA-Z0-9]+$') + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str', pattern=r'^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$') } url = self._client.format_url(url, **path_format_arguments)