diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_batch_management_client.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_batch_management_client.py index 93830a182c23..3ae9cb636e1d 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_batch_management_client.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_batch_management_client.py @@ -19,6 +19,8 @@ from .operations import LocationOperations from .operations import Operations from .operations import CertificateOperations +from .operations import PrivateLinkResourceOperations +from .operations import PrivateEndpointConnectionOperations from .operations import PoolOperations from . import models @@ -41,6 +43,10 @@ class BatchManagementClient(SDKClient): :vartype operations: azure.mgmt.batch.operations.Operations :ivar certificate: Certificate operations :vartype certificate: azure.mgmt.batch.operations.CertificateOperations + :ivar private_link_resource: PrivateLinkResource operations + :vartype private_link_resource: azure.mgmt.batch.operations.PrivateLinkResourceOperations + :ivar private_endpoint_connection: PrivateEndpointConnection operations + :vartype private_endpoint_connection: azure.mgmt.batch.operations.PrivateEndpointConnectionOperations :ivar pool: Pool operations :vartype pool: azure.mgmt.batch.operations.PoolOperations @@ -60,7 +66,7 @@ def __init__( super(BatchManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-08-01' + self.api_version = '2020-03-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -76,5 +82,9 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.certificate = CertificateOperations( self._client, self.config, self._serialize, self._deserialize) + self.private_link_resource = PrivateLinkResourceOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connection = PrivateEndpointConnectionOperations( + self._client, self.config, self._serialize, self._deserialize) self.pool = PoolOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/__init__.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/__init__.py index 0e44daa97447..014217ccf675 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/__init__.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/__init__.py @@ -41,10 +41,13 @@ from ._models_py3 import DataDisk from ._models_py3 import DeleteCertificateError from ._models_py3 import DeploymentConfiguration + from ._models_py3 import DiskEncryptionConfiguration + from ._models_py3 import EncryptionProperties from ._models_py3 import EnvironmentSetting from ._models_py3 import FixedScaleSettings from ._models_py3 import ImageReference from ._models_py3 import InboundNatPool + from ._models_py3 import KeyVaultProperties from ._models_py3 import KeyVaultReference from ._models_py3 import LinuxUserConfiguration from ._models_py3 import MetadataItem @@ -56,7 +59,12 @@ from ._models_py3 import OperationDisplay from ._models_py3 import Pool from ._models_py3 import PoolEndpointConfiguration + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkServiceConnectionState from ._models_py3 import ProxyResource + from ._models_py3 import PublicIPAddressConfiguration from ._models_py3 import ResizeError from ._models_py3 import ResizeOperationStatus from ._models_py3 import Resource @@ -103,10 +111,13 @@ from ._models import DataDisk from ._models import DeleteCertificateError from ._models import DeploymentConfiguration + from ._models import DiskEncryptionConfiguration + from ._models import EncryptionProperties from ._models import EnvironmentSetting from ._models import FixedScaleSettings from ._models import ImageReference from ._models import InboundNatPool + from ._models import KeyVaultProperties from ._models import KeyVaultReference from ._models import LinuxUserConfiguration from ._models import MetadataItem @@ -118,7 +129,12 @@ from ._models import OperationDisplay from ._models import Pool from ._models import PoolEndpointConfiguration + from ._models import PrivateEndpoint + from ._models import PrivateEndpointConnection + from ._models import PrivateLinkResource + from ._models import PrivateLinkServiceConnectionState from ._models import ProxyResource + from ._models import PublicIPAddressConfiguration from ._models import ResizeError from ._models import ResizeOperationStatus from ._models import Resource @@ -139,9 +155,15 @@ from ._paged_models import CertificatePaged from ._paged_models import OperationPaged from ._paged_models import PoolPaged +from ._paged_models import PrivateEndpointConnectionPaged +from ._paged_models import PrivateLinkResourcePaged from ._batch_management_client_enums import ( + KeySource, PoolAllocationMode, + PublicNetworkAccessType, ProvisioningState, + PrivateEndpointConnectionProvisioningState, + PrivateLinkServiceConnectionStatus, AccountKeyType, PackageState, CertificateFormat, @@ -150,10 +172,12 @@ AllocationState, CachingType, StorageAccountType, + DiskEncryptionTarget, ComputeNodeDeallocationOption, InterNodeCommunicationState, InboundEndpointProtocol, NetworkSecurityGroupRuleAccess, + IPAddressProvisioningType, ComputeNodeFillType, ElevationLevel, LoginMode, @@ -196,10 +220,13 @@ 'DataDisk', 'DeleteCertificateError', 'DeploymentConfiguration', + 'DiskEncryptionConfiguration', + 'EncryptionProperties', 'EnvironmentSetting', 'FixedScaleSettings', 'ImageReference', 'InboundNatPool', + 'KeyVaultProperties', 'KeyVaultReference', 'LinuxUserConfiguration', 'MetadataItem', @@ -211,7 +238,12 @@ 'OperationDisplay', 'Pool', 'PoolEndpointConfiguration', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateLinkResource', + 'PrivateLinkServiceConnectionState', 'ProxyResource', + 'PublicIPAddressConfiguration', 'ResizeError', 'ResizeOperationStatus', 'Resource', @@ -231,9 +263,15 @@ 'ApplicationPaged', 'OperationPaged', 'CertificatePaged', + 'PrivateLinkResourcePaged', + 'PrivateEndpointConnectionPaged', 'PoolPaged', + 'KeySource', 'PoolAllocationMode', + 'PublicNetworkAccessType', 'ProvisioningState', + 'PrivateEndpointConnectionProvisioningState', + 'PrivateLinkServiceConnectionStatus', 'AccountKeyType', 'PackageState', 'CertificateFormat', @@ -242,10 +280,12 @@ 'AllocationState', 'CachingType', 'StorageAccountType', + 'DiskEncryptionTarget', 'ComputeNodeDeallocationOption', 'InterNodeCommunicationState', 'InboundEndpointProtocol', 'NetworkSecurityGroupRuleAccess', + 'IPAddressProvisioningType', 'ComputeNodeFillType', 'ElevationLevel', 'LoginMode', diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_batch_management_client_enums.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_batch_management_client_enums.py index 126edf4d370a..7b346a617663 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_batch_management_client_enums.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_batch_management_client_enums.py @@ -12,12 +12,24 @@ from enum import Enum +class KeySource(str, Enum): + + microsoft_batch = "Microsoft.Batch" #: Batch creates and manages the encryption keys used to protect the account data. + microsoft_key_vault = "Microsoft.KeyVault" #: The encryption keys used to protect the account data are stored in an external key vault. + + class PoolAllocationMode(str, Enum): batch_service = "BatchService" #: Pools will be allocated in subscriptions owned by the Batch service. user_subscription = "UserSubscription" #: Pools will be allocated in a subscription owned by the user. +class PublicNetworkAccessType(str, Enum): + + enabled = "Enabled" #: Enables connectivity to Azure Batch through public DNS. + disabled = "Disabled" #: Disables public connectivity and enables private connectivity to Azure Batch Service through private endpoint resource. + + class ProvisioningState(str, Enum): invalid = "Invalid" #: The account is in an invalid state. @@ -28,6 +40,21 @@ class ProvisioningState(str, Enum): cancelled = "Cancelled" #: The last operation for the account is cancelled. +class PrivateEndpointConnectionProvisioningState(str, Enum): + + succeeded = "Succeeded" #: The connection status is final and is ready for use if Status is Approved. + updating = "Updating" #: The user has requested that the connection status be updated, but the update operation has not yet completed. You may not reference the connection when connecting the Batch account. + failed = "Failed" #: The user requested that the connection be updated and it failed. You may retry the update operation. + + +class PrivateLinkServiceConnectionStatus(str, Enum): + + approved = "Approved" #: The private endpoint connection is approved and can be used to access Batch account + pending = "Pending" #: The private endpoint connection is pending and cannot be used to access Batch account + rejected = "Rejected" #: The private endpoint connection is rejected and cannot be used to access Batch account + disconnected = "Disconnected" #: The private endpoint connection is disconnected and cannot be used to access Batch account + + class AccountKeyType(str, Enum): primary = "Primary" #: The primary account key. @@ -79,6 +106,12 @@ class StorageAccountType(str, Enum): premium_lrs = "Premium_LRS" #: The data disk should use premium locally redundant storage. +class DiskEncryptionTarget(str, Enum): + + os_disk = "OsDisk" #: The OS Disk on the compute node is encrypted. + temporary_disk = "TemporaryDisk" #: The temporary disk on the compute node is encrypted. On Linux this encryption applies to other partitions (such as those on mounted data disks) when encryption occurs at boot time. + + class ComputeNodeDeallocationOption(str, Enum): requeue = "Requeue" #: Terminate running task processes and requeue the tasks. The tasks will run again when a node is available. Remove nodes as soon as tasks have been terminated. @@ -105,6 +138,13 @@ class NetworkSecurityGroupRuleAccess(str, Enum): deny = "Deny" #: Deny access. +class IPAddressProvisioningType(str, Enum): + + batch_managed = "BatchManaged" #: A public IP will be created and managed by Batch. There may be multiple public IPs depending on the size of the Pool. + user_managed = "UserManaged" #: Public IPs are provided by the user and will be used to provision the Compute Nodes. + no_public_ip_addresses = "NoPublicIPAddresses" #: No public IP Address will be created for the Compute Nodes in the Pool. + + class ComputeNodeFillType(str, Enum): spread = "Spread" #: Tasks should be assigned evenly across all nodes in the pool. diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models.py index 0ebe8628f102..6e1a4770eddb 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models.py @@ -568,9 +568,21 @@ class BatchAccount(Resource): :ivar key_vault_reference: A reference to the Azure key vault associated with the Batch account. :vartype key_vault_reference: ~azure.mgmt.batch.models.KeyVaultReference + :ivar public_network_access: The network interface type for accessing + Azure Batch service and Batch account operations. If not specified, the + default value is 'enabled'. Possible values include: 'Enabled', + 'Disabled'. Default value: "Enabled" . + :vartype public_network_access: str or + ~azure.mgmt.batch.models.PublicNetworkAccessType + :ivar private_endpoint_connections: List of private endpoint connections + associated with the Batch account + :vartype private_endpoint_connections: + list[~azure.mgmt.batch.models.PrivateEndpointConnection] :ivar auto_storage: The properties and status of any auto-storage account associated with the Batch account. :vartype auto_storage: ~azure.mgmt.batch.models.AutoStorageProperties + :ivar encryption: The encryption configuration for the Batch account. + :vartype encryption: ~azure.mgmt.batch.models.EncryptionProperties :ivar dedicated_core_quota: The dedicated core quota for the Batch account. For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. @@ -613,7 +625,10 @@ class BatchAccount(Resource): 'provisioning_state': {'readonly': True}, 'pool_allocation_mode': {'readonly': True}, 'key_vault_reference': {'readonly': True}, + 'public_network_access': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, 'auto_storage': {'readonly': True}, + 'encryption': {'readonly': True}, 'dedicated_core_quota': {'readonly': True}, 'low_priority_core_quota': {'readonly': True}, 'dedicated_core_quota_per_vm_family': {'readonly': True}, @@ -632,7 +647,10 @@ class BatchAccount(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, 'pool_allocation_mode': {'key': 'properties.poolAllocationMode', 'type': 'PoolAllocationMode'}, 'key_vault_reference': {'key': 'properties.keyVaultReference', 'type': 'KeyVaultReference'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'PublicNetworkAccessType'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, 'auto_storage': {'key': 'properties.autoStorage', 'type': 'AutoStorageProperties'}, + 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperties'}, 'dedicated_core_quota': {'key': 'properties.dedicatedCoreQuota', 'type': 'int'}, 'low_priority_core_quota': {'key': 'properties.lowPriorityCoreQuota', 'type': 'int'}, 'dedicated_core_quota_per_vm_family': {'key': 'properties.dedicatedCoreQuotaPerVMFamily', 'type': '[VirtualMachineFamilyCoreQuota]'}, @@ -647,7 +665,10 @@ def __init__(self, **kwargs): self.provisioning_state = None self.pool_allocation_mode = None self.key_vault_reference = None + self.public_network_access = None + self.private_endpoint_connections = None self.auto_storage = None + self.encryption = None self.dedicated_core_quota = None self.low_priority_core_quota = None self.dedicated_core_quota_per_vm_family = None @@ -679,6 +700,13 @@ class BatchAccountCreateParameters(Model): :param key_vault_reference: A reference to the Azure key vault associated with the Batch account. :type key_vault_reference: ~azure.mgmt.batch.models.KeyVaultReference + :param public_network_access: The network access type for accessing Azure + Batch account. If not specified, the default value is 'enabled'. Possible + values include: 'Enabled', 'Disabled'. Default value: "Enabled" . + :type public_network_access: str or + ~azure.mgmt.batch.models.PublicNetworkAccessType + :param encryption: The encryption configuration for the Batch account. + :type encryption: ~azure.mgmt.batch.models.EncryptionProperties """ _validation = { @@ -691,6 +719,8 @@ class BatchAccountCreateParameters(Model): 'auto_storage': {'key': 'properties.autoStorage', 'type': 'AutoStorageBaseProperties'}, 'pool_allocation_mode': {'key': 'properties.poolAllocationMode', 'type': 'PoolAllocationMode'}, 'key_vault_reference': {'key': 'properties.keyVaultReference', 'type': 'KeyVaultReference'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'PublicNetworkAccessType'}, + 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperties'}, } def __init__(self, **kwargs): @@ -700,6 +730,8 @@ def __init__(self, **kwargs): self.auto_storage = kwargs.get('auto_storage', None) self.pool_allocation_mode = kwargs.get('pool_allocation_mode', None) self.key_vault_reference = kwargs.get('key_vault_reference', None) + self.public_network_access = kwargs.get('public_network_access', "Enabled") + self.encryption = kwargs.get('encryption', None) class BatchAccountKeys(Model): @@ -765,17 +797,21 @@ class BatchAccountUpdateParameters(Model): :type tags: dict[str, str] :param auto_storage: The properties related to the auto-storage account. :type auto_storage: ~azure.mgmt.batch.models.AutoStorageBaseProperties + :param encryption: The encryption configuration for the Batch account. + :type encryption: ~azure.mgmt.batch.models.EncryptionProperties """ _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, 'auto_storage': {'key': 'properties.autoStorage', 'type': 'AutoStorageBaseProperties'}, + 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperties'}, } def __init__(self, **kwargs): super(BatchAccountUpdateParameters, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) self.auto_storage = kwargs.get('auto_storage', None) + self.encryption = kwargs.get('encryption', None) class BatchLocationQuota(Model): @@ -949,8 +985,7 @@ class CertificateCreateOrUpdateParameters(ProxyResource): maximum size is 10KB. :type data: str :param password: The password to access the certificate's private key. - This is required if the certificate format is pfx and must be omitted if - the certificate format is cer. + This must not be specified if the certificate format is Cer. :type password: str """ @@ -1048,8 +1083,7 @@ class CheckNameAvailabilityParameters(Model): :param name: Required. The name to check for availability :type name: str - :ivar type: Required. The resource type. Must be set to - Microsoft.Batch/batchAccounts. Default value: + :ivar type: Required. The resource type. Default value: "Microsoft.Batch/batchAccounts" . :vartype type: str """ @@ -1446,6 +1480,48 @@ def __init__(self, **kwargs): self.virtual_machine_configuration = kwargs.get('virtual_machine_configuration', None) +class DiskEncryptionConfiguration(Model): + """The disk encryption configuration applied on compute nodes in the pool. + Disk encryption configuration is not supported on Linux pool created with + Virtual Machine Image or Shared Image Gallery Image. + + :param targets: The list of disk targets Batch Service will encrypt on the + compute node. On Linux pool, only "TemporaryDisk" is supported; on Windows + pool, "OsDisk" and "TemporaryDisk" must be specified. + :type targets: list[str or ~azure.mgmt.batch.models.DiskEncryptionTarget] + """ + + _attribute_map = { + 'targets': {'key': 'targets', 'type': '[DiskEncryptionTarget]'}, + } + + def __init__(self, **kwargs): + super(DiskEncryptionConfiguration, self).__init__(**kwargs) + self.targets = kwargs.get('targets', None) + + +class EncryptionProperties(Model): + """EncryptionProperties. + + :param key_source: Type of the key source. Possible values include: + 'Microsoft.Batch', 'Microsoft.KeyVault' + :type key_source: str or ~azure.mgmt.batch.models.KeySource + :param key_vault_properties: Additional details when using + Microsoft.KeyVault + :type key_vault_properties: ~azure.mgmt.batch.models.KeyVaultProperties + """ + + _attribute_map = { + 'key_source': {'key': 'keySource', 'type': 'KeySource'}, + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, **kwargs): + super(EncryptionProperties, self).__init__(**kwargs) + self.key_source = kwargs.get('key_source', None) + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + class EnvironmentSetting(Model): """An environment variable to be set on a task process. @@ -1483,12 +1559,12 @@ class FixedScaleSettings(Model): status code is 400 (Bad Request). :type resize_timeout: timedelta :param target_dedicated_nodes: The desired number of dedicated compute - nodes in the pool. At least one of targetDedicatedNodes, targetLowPriority - nodes must be set. + nodes in the pool. At least one of targetDedicatedNodes, + targetLowPriorityNodes must be set. :type target_dedicated_nodes: int :param target_low_priority_nodes: The desired number of low-priority compute nodes in the pool. At least one of targetDedicatedNodes, - targetLowPriority nodes must be set. + targetLowPriorityNodes must be set. :type target_low_priority_nodes: int :param node_deallocation_option: Determines what to do with a node and its running task(s) if the pool size is decreasing. If omitted, the default @@ -1532,18 +1608,14 @@ class ImageReference(Model): image. A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. :type version: str - :param id: The ARM resource identifier of the Virtual Machine Image or - Shared Image Gallery Image. Compute Nodes of the Pool will be created - using this Image Id. This is of either the form - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName} - for Virtual Machine Image or - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionId} - for SIG image. This property is mutually exclusive with other properties. - For Virtual Machine Image it must be in the same region and subscription - as the Azure Batch account. For SIG image it must have replicas in the - same region as the Azure Batch account. For information about the firewall - settings for the Batch node agent to communicate with the Batch service - see + :param id: The ARM resource identifier of the Shared Image Gallery Image. + Compute Nodes in the Pool will be created using this Image Id. This is of + the form + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionId}. + This property is mutually exclusive with other properties. The Shared + Image Gallery image must have replicas in the same region as the Azure + Batch account. For information about the firewall settings for the Batch + node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. :type id: str """ @@ -1639,6 +1711,23 @@ def __init__(self, **kwargs): self.network_security_group_rules = kwargs.get('network_security_group_rules', None) +class KeyVaultProperties(Model): + """KeyVaultProperties. + + :param key_identifier: Full path to the versioned secret. Example + https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053 + :type key_identifier: str + """ + + _attribute_map = { + 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_identifier = kwargs.get('key_identifier', None) + + class KeyVaultReference(Model): """Identifies the Azure key vault associated with a Batch account. @@ -1780,7 +1869,7 @@ class NetworkConfiguration(Model): Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate - compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' + compute nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to @@ -1788,15 +1877,14 @@ class NetworkConfiguration(Model): checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute - nodes to unusable. For pools created via virtualMachineConfiguration the - Batch account must have poolAllocationMode userSubscription in order to - use a VNet. If the specified VNet has any associated Network Security - Groups (NSG), then a few reserved system ports must be enabled for inbound - communication. For pools created with a virtual machine configuration, - enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 - for Windows. For pools created with a cloud service configuration, enable - ports 10100, 20100, and 30100. Also enable outbound connections to Azure - Storage on port 443. For more details see: + nodes to unusable. If the specified VNet has any associated Network + Security Groups (NSG), then a few reserved system ports must be enabled + for inbound communication. For pools created with a virtual machine + configuration, enable ports 29876 and 29877, as well as port 22 for Linux + and port 3389 for Windows. For pools created with a cloud service + configuration, enable ports 10100, 20100, and 30100. Also enable outbound + connections to Azure Storage on port 443. For cloudServiceConfiguration + pools, only 'classic' VNETs are supported. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration :type subnet_id: str :param endpoint_configuration: The configuration for endpoints on compute @@ -1804,27 +1892,24 @@ class NetworkConfiguration(Model): pools with the virtualMachineConfiguration property. :type endpoint_configuration: ~azure.mgmt.batch.models.PoolEndpointConfiguration - :param public_ips: The list of public IPs which the Batch service will use - when provisioning Compute Nodes. The number of IPs specified here limits - the maximum size of the Pool - 50 dedicated nodes or 20 low-priority nodes - can be allocated for each public IP. For example, a pool needing 150 - dedicated VMs would need at least 3 public IPs specified. Each element of - this collection is of the form: - /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}. - :type public_ips: list[str] + :param public_ip_address_configuration: The Public IPAddress configuration + for Compute Nodes in the Batch Pool. This property is only supported on + Pools with the virtualMachineConfiguration property. + :type public_ip_address_configuration: + ~azure.mgmt.batch.models.PublicIPAddressConfiguration """ _attribute_map = { 'subnet_id': {'key': 'subnetId', 'type': 'str'}, 'endpoint_configuration': {'key': 'endpointConfiguration', 'type': 'PoolEndpointConfiguration'}, - 'public_ips': {'key': 'publicIPs', 'type': '[str]'}, + 'public_ip_address_configuration': {'key': 'publicIPAddressConfiguration', 'type': 'PublicIPAddressConfiguration'}, } def __init__(self, **kwargs): super(NetworkConfiguration, self).__init__(**kwargs) self.subnet_id = kwargs.get('subnet_id', None) self.endpoint_configuration = kwargs.get('endpoint_configuration', None) - self.public_ips = kwargs.get('public_ips', None) + self.public_ip_address_configuration = kwargs.get('public_ip_address_configuration', None) class NetworkSecurityGroupRule(Model): @@ -1837,7 +1922,7 @@ class NetworkSecurityGroupRule(Model): number the higher the priority. For example, rules could be specified with order numbers of 150, 250, and 350. The rule with the order number of 150 takes precedence over the rule that has an order of 250. Allowed - priorities are 150 to 3500. If any reserved or duplicate values are + priorities are 150 to 4096. If any reserved or duplicate values are provided the request fails with HTTP status code 400. :type priority: int :param access: Required. The action that should be taken for a specified @@ -2015,7 +2100,7 @@ class Pool(ProxyResource): pool are the same size. For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services - (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). + (https://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with @@ -2214,6 +2299,202 @@ def __init__(self, **kwargs): self.inbound_nat_pools = kwargs.get('inbound_nat_pools', None) +class PrivateEndpoint(Model): + """The private endpoint of the private endpoint connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM resource identifier of the private endpoint. This is of + the form + /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/privateEndpoints/{privateEndpoint}. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(ProxyResource): + """Contains information about a private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar etag: The ETag of the resource, used for concurrency statements. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the private endpoint + connection. Possible values include: 'Succeeded', 'Updating', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.batch.models.PrivateEndpointConnectionProvisioningState + :param private_endpoint: The ARM resource identifier of the private + endpoint. + :type private_endpoint: ~azure.mgmt.batch.models.PrivateEndpoint + :param private_link_service_connection_state: The private link service + connection state of the private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.batch.models.PrivateLinkServiceConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'PrivateEndpointConnectionProvisioningState'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.provisioning_state = None + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + + +class PrivateLinkResource(ProxyResource): + """Contains information about a private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar etag: The ETag of the resource, used for concurrency statements. + :vartype etag: str + :ivar group_id: The group id of the private link resource. The group id is + used to establish the private link connection. + :vartype group_id: str + :ivar required_members: The list of required members that are used to + establish the private link connection. + :vartype required_members: list[str] + :ivar required_zone_names: The list of required zone names for the private + DNS resource name. + :vartype required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + + +class PrivateLinkServiceConnectionState(Model): + """The private link service connection state of the private endpoint + connection. + + 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. + + :param status: Required. The status for the private endpoint connection of + Batch account. Possible values include: 'Approved', 'Pending', 'Rejected', + 'Disconnected' + :type status: str or + ~azure.mgmt.batch.models.PrivateLinkServiceConnectionStatus + :param description: Description of the private Connection state. + :type description: str + :ivar action_required: Action required on the private connection state. + :vartype action_required: str + """ + + _validation = { + 'status': {'required': True}, + 'action_required': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'PrivateLinkServiceConnectionStatus'}, + 'description': {'key': 'description', 'type': 'str'}, + 'action_required': {'key': 'actionRequired', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.action_required = None + + +class PublicIPAddressConfiguration(Model): + """The public IP Address configuration of the networking configuration of a + Pool. + + :param provision: The provisioning type for Public IP Addresses for the + pool. The default value is BatchManaged. Possible values include: + 'BatchManaged', 'UserManaged', 'NoPublicIPAddresses' + :type provision: str or ~azure.mgmt.batch.models.IPAddressProvisioningType + :param ip_address_ids: The list of public IPs which the Batch service will + use when provisioning Compute Nodes. The number of IPs specified here + limits the maximum size of the Pool - 50 dedicated nodes or 20 + low-priority nodes can be allocated for each public IP. For example, a + pool needing 150 dedicated VMs would need at least 3 public IPs specified. + Each element of this collection is of the form: + /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}. + :type ip_address_ids: list[str] + """ + + _attribute_map = { + 'provision': {'key': 'provision', 'type': 'IPAddressProvisioningType'}, + 'ip_address_ids': {'key': 'ipAddressIds', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PublicIPAddressConfiguration, self).__init__(**kwargs) + self.provision = kwargs.get('provision', None) + self.ip_address_ids = kwargs.get('ip_address_ids', None) + + class ResizeError(Model): """An error that occurred when resizing a pool. @@ -2667,6 +2948,11 @@ class VirtualMachineConfiguration(Model): specify it. :type container_configuration: ~azure.mgmt.batch.models.ContainerConfiguration + :param disk_encryption_configuration: The disk encryption configuration + for the pool. If specified, encryption is performed on each node in the + pool during node provisioning. + :type disk_encryption_configuration: + ~azure.mgmt.batch.models.DiskEncryptionConfiguration """ _validation = { @@ -2681,6 +2967,7 @@ class VirtualMachineConfiguration(Model): 'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'}, 'license_type': {'key': 'licenseType', 'type': 'str'}, 'container_configuration': {'key': 'containerConfiguration', 'type': 'ContainerConfiguration'}, + 'disk_encryption_configuration': {'key': 'diskEncryptionConfiguration', 'type': 'DiskEncryptionConfiguration'}, } def __init__(self, **kwargs): @@ -2691,6 +2978,7 @@ def __init__(self, **kwargs): self.data_disks = kwargs.get('data_disks', None) self.license_type = kwargs.get('license_type', None) self.container_configuration = kwargs.get('container_configuration', None) + self.disk_encryption_configuration = kwargs.get('disk_encryption_configuration', None) class VirtualMachineFamilyCoreQuota(Model): diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models_py3.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models_py3.py index fe783b11ca84..a78cfaea0112 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models_py3.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models_py3.py @@ -568,9 +568,21 @@ class BatchAccount(Resource): :ivar key_vault_reference: A reference to the Azure key vault associated with the Batch account. :vartype key_vault_reference: ~azure.mgmt.batch.models.KeyVaultReference + :ivar public_network_access: The network interface type for accessing + Azure Batch service and Batch account operations. If not specified, the + default value is 'enabled'. Possible values include: 'Enabled', + 'Disabled'. Default value: "Enabled" . + :vartype public_network_access: str or + ~azure.mgmt.batch.models.PublicNetworkAccessType + :ivar private_endpoint_connections: List of private endpoint connections + associated with the Batch account + :vartype private_endpoint_connections: + list[~azure.mgmt.batch.models.PrivateEndpointConnection] :ivar auto_storage: The properties and status of any auto-storage account associated with the Batch account. :vartype auto_storage: ~azure.mgmt.batch.models.AutoStorageProperties + :ivar encryption: The encryption configuration for the Batch account. + :vartype encryption: ~azure.mgmt.batch.models.EncryptionProperties :ivar dedicated_core_quota: The dedicated core quota for the Batch account. For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. @@ -613,7 +625,10 @@ class BatchAccount(Resource): 'provisioning_state': {'readonly': True}, 'pool_allocation_mode': {'readonly': True}, 'key_vault_reference': {'readonly': True}, + 'public_network_access': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, 'auto_storage': {'readonly': True}, + 'encryption': {'readonly': True}, 'dedicated_core_quota': {'readonly': True}, 'low_priority_core_quota': {'readonly': True}, 'dedicated_core_quota_per_vm_family': {'readonly': True}, @@ -632,7 +647,10 @@ class BatchAccount(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, 'pool_allocation_mode': {'key': 'properties.poolAllocationMode', 'type': 'PoolAllocationMode'}, 'key_vault_reference': {'key': 'properties.keyVaultReference', 'type': 'KeyVaultReference'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'PublicNetworkAccessType'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, 'auto_storage': {'key': 'properties.autoStorage', 'type': 'AutoStorageProperties'}, + 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperties'}, 'dedicated_core_quota': {'key': 'properties.dedicatedCoreQuota', 'type': 'int'}, 'low_priority_core_quota': {'key': 'properties.lowPriorityCoreQuota', 'type': 'int'}, 'dedicated_core_quota_per_vm_family': {'key': 'properties.dedicatedCoreQuotaPerVMFamily', 'type': '[VirtualMachineFamilyCoreQuota]'}, @@ -647,7 +665,10 @@ def __init__(self, **kwargs) -> None: self.provisioning_state = None self.pool_allocation_mode = None self.key_vault_reference = None + self.public_network_access = None + self.private_endpoint_connections = None self.auto_storage = None + self.encryption = None self.dedicated_core_quota = None self.low_priority_core_quota = None self.dedicated_core_quota_per_vm_family = None @@ -679,6 +700,13 @@ class BatchAccountCreateParameters(Model): :param key_vault_reference: A reference to the Azure key vault associated with the Batch account. :type key_vault_reference: ~azure.mgmt.batch.models.KeyVaultReference + :param public_network_access: The network access type for accessing Azure + Batch account. If not specified, the default value is 'enabled'. Possible + values include: 'Enabled', 'Disabled'. Default value: "Enabled" . + :type public_network_access: str or + ~azure.mgmt.batch.models.PublicNetworkAccessType + :param encryption: The encryption configuration for the Batch account. + :type encryption: ~azure.mgmt.batch.models.EncryptionProperties """ _validation = { @@ -691,15 +719,19 @@ class BatchAccountCreateParameters(Model): 'auto_storage': {'key': 'properties.autoStorage', 'type': 'AutoStorageBaseProperties'}, 'pool_allocation_mode': {'key': 'properties.poolAllocationMode', 'type': 'PoolAllocationMode'}, 'key_vault_reference': {'key': 'properties.keyVaultReference', 'type': 'KeyVaultReference'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'PublicNetworkAccessType'}, + 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperties'}, } - def __init__(self, *, location: str, tags=None, auto_storage=None, pool_allocation_mode=None, key_vault_reference=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, auto_storage=None, pool_allocation_mode=None, key_vault_reference=None, public_network_access="Enabled", encryption=None, **kwargs) -> None: super(BatchAccountCreateParameters, self).__init__(**kwargs) self.location = location self.tags = tags self.auto_storage = auto_storage self.pool_allocation_mode = pool_allocation_mode self.key_vault_reference = key_vault_reference + self.public_network_access = public_network_access + self.encryption = encryption class BatchAccountKeys(Model): @@ -765,17 +797,21 @@ class BatchAccountUpdateParameters(Model): :type tags: dict[str, str] :param auto_storage: The properties related to the auto-storage account. :type auto_storage: ~azure.mgmt.batch.models.AutoStorageBaseProperties + :param encryption: The encryption configuration for the Batch account. + :type encryption: ~azure.mgmt.batch.models.EncryptionProperties """ _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, 'auto_storage': {'key': 'properties.autoStorage', 'type': 'AutoStorageBaseProperties'}, + 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperties'}, } - def __init__(self, *, tags=None, auto_storage=None, **kwargs) -> None: + def __init__(self, *, tags=None, auto_storage=None, encryption=None, **kwargs) -> None: super(BatchAccountUpdateParameters, self).__init__(**kwargs) self.tags = tags self.auto_storage = auto_storage + self.encryption = encryption class BatchLocationQuota(Model): @@ -949,8 +985,7 @@ class CertificateCreateOrUpdateParameters(ProxyResource): maximum size is 10KB. :type data: str :param password: The password to access the certificate's private key. - This is required if the certificate format is pfx and must be omitted if - the certificate format is cer. + This must not be specified if the certificate format is Cer. :type password: str """ @@ -1048,8 +1083,7 @@ class CheckNameAvailabilityParameters(Model): :param name: Required. The name to check for availability :type name: str - :ivar type: Required. The resource type. Must be set to - Microsoft.Batch/batchAccounts. Default value: + :ivar type: Required. The resource type. Default value: "Microsoft.Batch/batchAccounts" . :vartype type: str """ @@ -1446,6 +1480,48 @@ def __init__(self, *, cloud_service_configuration=None, virtual_machine_configur self.virtual_machine_configuration = virtual_machine_configuration +class DiskEncryptionConfiguration(Model): + """The disk encryption configuration applied on compute nodes in the pool. + Disk encryption configuration is not supported on Linux pool created with + Virtual Machine Image or Shared Image Gallery Image. + + :param targets: The list of disk targets Batch Service will encrypt on the + compute node. On Linux pool, only "TemporaryDisk" is supported; on Windows + pool, "OsDisk" and "TemporaryDisk" must be specified. + :type targets: list[str or ~azure.mgmt.batch.models.DiskEncryptionTarget] + """ + + _attribute_map = { + 'targets': {'key': 'targets', 'type': '[DiskEncryptionTarget]'}, + } + + def __init__(self, *, targets=None, **kwargs) -> None: + super(DiskEncryptionConfiguration, self).__init__(**kwargs) + self.targets = targets + + +class EncryptionProperties(Model): + """EncryptionProperties. + + :param key_source: Type of the key source. Possible values include: + 'Microsoft.Batch', 'Microsoft.KeyVault' + :type key_source: str or ~azure.mgmt.batch.models.KeySource + :param key_vault_properties: Additional details when using + Microsoft.KeyVault + :type key_vault_properties: ~azure.mgmt.batch.models.KeyVaultProperties + """ + + _attribute_map = { + 'key_source': {'key': 'keySource', 'type': 'KeySource'}, + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, key_source=None, key_vault_properties=None, **kwargs) -> None: + super(EncryptionProperties, self).__init__(**kwargs) + self.key_source = key_source + self.key_vault_properties = key_vault_properties + + class EnvironmentSetting(Model): """An environment variable to be set on a task process. @@ -1483,12 +1559,12 @@ class FixedScaleSettings(Model): status code is 400 (Bad Request). :type resize_timeout: timedelta :param target_dedicated_nodes: The desired number of dedicated compute - nodes in the pool. At least one of targetDedicatedNodes, targetLowPriority - nodes must be set. + nodes in the pool. At least one of targetDedicatedNodes, + targetLowPriorityNodes must be set. :type target_dedicated_nodes: int :param target_low_priority_nodes: The desired number of low-priority compute nodes in the pool. At least one of targetDedicatedNodes, - targetLowPriority nodes must be set. + targetLowPriorityNodes must be set. :type target_low_priority_nodes: int :param node_deallocation_option: Determines what to do with a node and its running task(s) if the pool size is decreasing. If omitted, the default @@ -1532,18 +1608,14 @@ class ImageReference(Model): image. A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. :type version: str - :param id: The ARM resource identifier of the Virtual Machine Image or - Shared Image Gallery Image. Compute Nodes of the Pool will be created - using this Image Id. This is of either the form - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName} - for Virtual Machine Image or - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionId} - for SIG image. This property is mutually exclusive with other properties. - For Virtual Machine Image it must be in the same region and subscription - as the Azure Batch account. For SIG image it must have replicas in the - same region as the Azure Batch account. For information about the firewall - settings for the Batch node agent to communicate with the Batch service - see + :param id: The ARM resource identifier of the Shared Image Gallery Image. + Compute Nodes in the Pool will be created using this Image Id. This is of + the form + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionId}. + This property is mutually exclusive with other properties. The Shared + Image Gallery image must have replicas in the same region as the Azure + Batch account. For information about the firewall settings for the Batch + node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. :type id: str """ @@ -1639,6 +1711,23 @@ def __init__(self, *, name: str, protocol, backend_port: int, frontend_port_rang self.network_security_group_rules = network_security_group_rules +class KeyVaultProperties(Model): + """KeyVaultProperties. + + :param key_identifier: Full path to the versioned secret. Example + https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053 + :type key_identifier: str + """ + + _attribute_map = { + 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + } + + def __init__(self, *, key_identifier: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_identifier = key_identifier + + class KeyVaultReference(Model): """Identifies the Azure key vault associated with a Batch account. @@ -1780,7 +1869,7 @@ class NetworkConfiguration(Model): Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate - compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' + compute nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to @@ -1788,15 +1877,14 @@ class NetworkConfiguration(Model): checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute - nodes to unusable. For pools created via virtualMachineConfiguration the - Batch account must have poolAllocationMode userSubscription in order to - use a VNet. If the specified VNet has any associated Network Security - Groups (NSG), then a few reserved system ports must be enabled for inbound - communication. For pools created with a virtual machine configuration, - enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 - for Windows. For pools created with a cloud service configuration, enable - ports 10100, 20100, and 30100. Also enable outbound connections to Azure - Storage on port 443. For more details see: + nodes to unusable. If the specified VNet has any associated Network + Security Groups (NSG), then a few reserved system ports must be enabled + for inbound communication. For pools created with a virtual machine + configuration, enable ports 29876 and 29877, as well as port 22 for Linux + and port 3389 for Windows. For pools created with a cloud service + configuration, enable ports 10100, 20100, and 30100. Also enable outbound + connections to Azure Storage on port 443. For cloudServiceConfiguration + pools, only 'classic' VNETs are supported. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration :type subnet_id: str :param endpoint_configuration: The configuration for endpoints on compute @@ -1804,27 +1892,24 @@ class NetworkConfiguration(Model): pools with the virtualMachineConfiguration property. :type endpoint_configuration: ~azure.mgmt.batch.models.PoolEndpointConfiguration - :param public_ips: The list of public IPs which the Batch service will use - when provisioning Compute Nodes. The number of IPs specified here limits - the maximum size of the Pool - 50 dedicated nodes or 20 low-priority nodes - can be allocated for each public IP. For example, a pool needing 150 - dedicated VMs would need at least 3 public IPs specified. Each element of - this collection is of the form: - /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}. - :type public_ips: list[str] + :param public_ip_address_configuration: The Public IPAddress configuration + for Compute Nodes in the Batch Pool. This property is only supported on + Pools with the virtualMachineConfiguration property. + :type public_ip_address_configuration: + ~azure.mgmt.batch.models.PublicIPAddressConfiguration """ _attribute_map = { 'subnet_id': {'key': 'subnetId', 'type': 'str'}, 'endpoint_configuration': {'key': 'endpointConfiguration', 'type': 'PoolEndpointConfiguration'}, - 'public_ips': {'key': 'publicIPs', 'type': '[str]'}, + 'public_ip_address_configuration': {'key': 'publicIPAddressConfiguration', 'type': 'PublicIPAddressConfiguration'}, } - def __init__(self, *, subnet_id: str=None, endpoint_configuration=None, public_ips=None, **kwargs) -> None: + def __init__(self, *, subnet_id: str=None, endpoint_configuration=None, public_ip_address_configuration=None, **kwargs) -> None: super(NetworkConfiguration, self).__init__(**kwargs) self.subnet_id = subnet_id self.endpoint_configuration = endpoint_configuration - self.public_ips = public_ips + self.public_ip_address_configuration = public_ip_address_configuration class NetworkSecurityGroupRule(Model): @@ -1837,7 +1922,7 @@ class NetworkSecurityGroupRule(Model): number the higher the priority. For example, rules could be specified with order numbers of 150, 250, and 350. The rule with the order number of 150 takes precedence over the rule that has an order of 250. Allowed - priorities are 150 to 3500. If any reserved or duplicate values are + priorities are 150 to 4096. If any reserved or duplicate values are provided the request fails with HTTP status code 400. :type priority: int :param access: Required. The action that should be taken for a specified @@ -2015,7 +2100,7 @@ class Pool(ProxyResource): pool are the same size. For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services - (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). + (https://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with @@ -2214,6 +2299,202 @@ def __init__(self, *, inbound_nat_pools, **kwargs) -> None: self.inbound_nat_pools = inbound_nat_pools +class PrivateEndpoint(Model): + """The private endpoint of the private endpoint connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM resource identifier of the private endpoint. This is of + the form + /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/privateEndpoints/{privateEndpoint}. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(ProxyResource): + """Contains information about a private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar etag: The ETag of the resource, used for concurrency statements. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the private endpoint + connection. Possible values include: 'Succeeded', 'Updating', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.batch.models.PrivateEndpointConnectionProvisioningState + :param private_endpoint: The ARM resource identifier of the private + endpoint. + :type private_endpoint: ~azure.mgmt.batch.models.PrivateEndpoint + :param private_link_service_connection_state: The private link service + connection state of the private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.batch.models.PrivateLinkServiceConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'PrivateEndpointConnectionProvisioningState'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + } + + def __init__(self, *, private_endpoint=None, private_link_service_connection_state=None, **kwargs) -> None: + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.provisioning_state = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateLinkResource(ProxyResource): + """Contains information about a private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar etag: The ETag of the resource, used for concurrency statements. + :vartype etag: str + :ivar group_id: The group id of the private link resource. The group id is + used to establish the private link connection. + :vartype group_id: str + :ivar required_members: The list of required members that are used to + establish the private link connection. + :vartype required_members: list[str] + :ivar required_zone_names: The list of required zone names for the private + DNS resource name. + :vartype required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + + +class PrivateLinkServiceConnectionState(Model): + """The private link service connection state of the private endpoint + connection. + + 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. + + :param status: Required. The status for the private endpoint connection of + Batch account. Possible values include: 'Approved', 'Pending', 'Rejected', + 'Disconnected' + :type status: str or + ~azure.mgmt.batch.models.PrivateLinkServiceConnectionStatus + :param description: Description of the private Connection state. + :type description: str + :ivar action_required: Action required on the private connection state. + :vartype action_required: str + """ + + _validation = { + 'status': {'required': True}, + 'action_required': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'PrivateLinkServiceConnectionStatus'}, + 'description': {'key': 'description', 'type': 'str'}, + 'action_required': {'key': 'actionRequired', 'type': 'str'}, + } + + def __init__(self, *, status, description: str=None, **kwargs) -> None: + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.action_required = None + + +class PublicIPAddressConfiguration(Model): + """The public IP Address configuration of the networking configuration of a + Pool. + + :param provision: The provisioning type for Public IP Addresses for the + pool. The default value is BatchManaged. Possible values include: + 'BatchManaged', 'UserManaged', 'NoPublicIPAddresses' + :type provision: str or ~azure.mgmt.batch.models.IPAddressProvisioningType + :param ip_address_ids: The list of public IPs which the Batch service will + use when provisioning Compute Nodes. The number of IPs specified here + limits the maximum size of the Pool - 50 dedicated nodes or 20 + low-priority nodes can be allocated for each public IP. For example, a + pool needing 150 dedicated VMs would need at least 3 public IPs specified. + Each element of this collection is of the form: + /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}. + :type ip_address_ids: list[str] + """ + + _attribute_map = { + 'provision': {'key': 'provision', 'type': 'IPAddressProvisioningType'}, + 'ip_address_ids': {'key': 'ipAddressIds', 'type': '[str]'}, + } + + def __init__(self, *, provision=None, ip_address_ids=None, **kwargs) -> None: + super(PublicIPAddressConfiguration, self).__init__(**kwargs) + self.provision = provision + self.ip_address_ids = ip_address_ids + + class ResizeError(Model): """An error that occurred when resizing a pool. @@ -2667,6 +2948,11 @@ class VirtualMachineConfiguration(Model): specify it. :type container_configuration: ~azure.mgmt.batch.models.ContainerConfiguration + :param disk_encryption_configuration: The disk encryption configuration + for the pool. If specified, encryption is performed on each node in the + pool during node provisioning. + :type disk_encryption_configuration: + ~azure.mgmt.batch.models.DiskEncryptionConfiguration """ _validation = { @@ -2681,9 +2967,10 @@ class VirtualMachineConfiguration(Model): 'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'}, 'license_type': {'key': 'licenseType', 'type': 'str'}, 'container_configuration': {'key': 'containerConfiguration', 'type': 'ContainerConfiguration'}, + 'disk_encryption_configuration': {'key': 'diskEncryptionConfiguration', 'type': 'DiskEncryptionConfiguration'}, } - def __init__(self, *, image_reference, node_agent_sku_id: str, windows_configuration=None, data_disks=None, license_type: str=None, container_configuration=None, **kwargs) -> None: + def __init__(self, *, image_reference, node_agent_sku_id: str, windows_configuration=None, data_disks=None, license_type: str=None, container_configuration=None, disk_encryption_configuration=None, **kwargs) -> None: super(VirtualMachineConfiguration, self).__init__(**kwargs) self.image_reference = image_reference self.node_agent_sku_id = node_agent_sku_id @@ -2691,6 +2978,7 @@ def __init__(self, *, image_reference, node_agent_sku_id: str, windows_configura self.data_disks = data_disks self.license_type = license_type self.container_configuration = container_configuration + self.disk_encryption_configuration = disk_encryption_configuration class VirtualMachineFamilyCoreQuota(Model): diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_paged_models.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_paged_models.py index 1eb94dd020cd..5dd781c2419d 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_paged_models.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_paged_models.py @@ -25,8 +25,6 @@ class BatchAccountPaged(Paged): def __init__(self, *args, **kwargs): super(BatchAccountPaged, self).__init__(*args, **kwargs) - - class ApplicationPackagePaged(Paged): """ A paging container for iterating over a list of :class:`ApplicationPackage ` object @@ -40,8 +38,6 @@ class ApplicationPackagePaged(Paged): def __init__(self, *args, **kwargs): super(ApplicationPackagePaged, self).__init__(*args, **kwargs) - - class ApplicationPaged(Paged): """ A paging container for iterating over a list of :class:`Application ` object @@ -55,8 +51,6 @@ class ApplicationPaged(Paged): def __init__(self, *args, **kwargs): super(ApplicationPaged, self).__init__(*args, **kwargs) - - class OperationPaged(Paged): """ A paging container for iterating over a list of :class:`Operation ` object @@ -70,8 +64,6 @@ class OperationPaged(Paged): def __init__(self, *args, **kwargs): super(OperationPaged, self).__init__(*args, **kwargs) - - class CertificatePaged(Paged): """ A paging container for iterating over a list of :class:`Certificate ` object @@ -85,8 +77,32 @@ class CertificatePaged(Paged): def __init__(self, *args, **kwargs): super(CertificatePaged, self).__init__(*args, **kwargs) +class PrivateLinkResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateLinkResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateLinkResource]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateLinkResourcePaged, self).__init__(*args, **kwargs) +class PrivateEndpointConnectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateEndpointConnection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateEndpointConnection]'} + } + def __init__(self, *args, **kwargs): + super(PrivateEndpointConnectionPaged, self).__init__(*args, **kwargs) class PoolPaged(Paged): """ A paging container for iterating over a list of :class:`Pool ` object diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/__init__.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/__init__.py index 818f748e2734..47fd48779b4f 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/__init__.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/__init__.py @@ -15,6 +15,8 @@ from ._location_operations import LocationOperations from ._operations import Operations from ._certificate_operations import CertificateOperations +from ._private_link_resource_operations import PrivateLinkResourceOperations +from ._private_endpoint_connection_operations import PrivateEndpointConnectionOperations from ._pool_operations import PoolOperations __all__ = [ @@ -24,5 +26,7 @@ 'LocationOperations', 'Operations', 'CertificateOperations', + 'PrivateLinkResourceOperations', + 'PrivateEndpointConnectionOperations', 'PoolOperations', ] diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_operations.py index d78823852422..e4c8906c78a5 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_operations.py @@ -25,7 +25,7 @@ class ApplicationOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to be used with the HTTP request. Constant value: "2019-08-01". + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2020-03-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-01" + self.api_version = "2020-03-01" self.config = config @@ -67,7 +67,7 @@ def create( url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -139,7 +139,7 @@ def delete( url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -198,7 +198,7 @@ def get( url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -266,7 +266,7 @@ def update( url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -338,7 +338,7 @@ def prepare_request(next_link=None): url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_package_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_package_operations.py index 6e125e1993cf..e7b5454a61f8 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_package_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_package_operations.py @@ -25,7 +25,7 @@ class ApplicationPackageOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to be used with the HTTP request. Constant value: "2019-08-01". + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2020-03-01". """ models = models @@ -35,13 +35,15 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-01" + self.api_version = "2020-03-01" self.config = config def activate( self, resource_group_name, account_name, application_name, version_name, format, custom_headers=None, raw=False, **operation_config): - """Activates the specified application package. + """Activates the specified application package. This should be done after + the `ApplicationPackage` was created and uploaded. This needs to be + done before an `ApplicationPackage` can be used on Pools or Tasks. :param resource_group_name: The name of the resource group that contains the Batch account. @@ -71,7 +73,7 @@ def activate( url = self.activate.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), 'versionName': self._serialize.url("version_name", version_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-][a-zA-Z0-9_.-]*$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -118,7 +120,10 @@ def activate( def create( self, resource_group_name, account_name, application_name, version_name, custom_headers=None, raw=False, **operation_config): - """Creates an application package record. + """Creates an application package record. The record contains the SAS + where the package should be uploaded to. Once it is uploaded the + `ApplicationPackage` needs to be activated using + `ApplicationPackageActive` before it can be used. :param resource_group_name: The name of the resource group that contains the Batch account. @@ -146,7 +151,7 @@ def create( url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), 'versionName': self._serialize.url("version_name", version_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-][a-zA-Z0-9_.-]*$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -221,7 +226,7 @@ def delete( url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), 'versionName': self._serialize.url("version_name", version_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-][a-zA-Z0-9_.-]*$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -283,7 +288,7 @@ def get( url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), 'versionName': self._serialize.url("version_name", version_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-][a-zA-Z0-9_.-]*$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -355,7 +360,7 @@ def prepare_request(next_link=None): url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_batch_account_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_batch_account_operations.py index 936fb33a68c9..85d2af8cefcb 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_batch_account_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_batch_account_operations.py @@ -27,7 +27,7 @@ class BatchAccountOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to be used with the HTTP request. Constant value: "2019-08-01". + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2020-03-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-01" + self.api_version = "2020-03-01" self.config = config @@ -48,7 +48,7 @@ def _create_initial( url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-z0-9]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -162,7 +162,7 @@ def get_long_running_output(response): create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}'} def update( - self, resource_group_name, account_name, tags=None, auto_storage=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): """Updates the properties of an existing Batch account. :param resource_group_name: The name of the resource group that @@ -170,11 +170,9 @@ def update( :type resource_group_name: str :param account_name: The name of the Batch account. :type account_name: str - :param tags: The user-specified tags associated with the account. - :type tags: dict[str, str] - :param auto_storage: The properties related to the auto-storage - account. - :type auto_storage: ~azure.mgmt.batch.models.AutoStorageBaseProperties + :param parameters: Additional parameters for account update. + :type parameters: + ~azure.mgmt.batch.models.BatchAccountUpdateParameters :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -185,13 +183,11 @@ def update( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - parameters = models.BatchAccountUpdateParameters(tags=tags, auto_storage=auto_storage) - # Construct URL url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -241,7 +237,7 @@ def _delete_initial( url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -346,7 +342,7 @@ def get( url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -546,7 +542,7 @@ def synchronize_auto_storage_keys( url = self.synchronize_auto_storage_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -606,7 +602,7 @@ def regenerate_key( url = self.regenerate_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -678,7 +674,7 @@ def get_keys( url = self.get_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_certificate_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_certificate_operations.py index faea89158f23..d05e93f5ebd4 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_certificate_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_certificate_operations.py @@ -27,7 +27,7 @@ class CertificateOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to be used with the HTTP request. Constant value: "2019-08-01". + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2020-03-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-01" + self.api_version = "2020-03-01" self.config = config @@ -77,7 +77,7 @@ def prepare_request(next_link=None): url = self.list_by_batch_account.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -138,7 +138,7 @@ def _create_initial( url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', max_length=45, min_length=5, pattern=r'^[\w]+-[\w]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -297,7 +297,7 @@ def update( url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', max_length=45, min_length=5, pattern=r'^[\w]+-[\w]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -355,7 +355,7 @@ def _delete_initial( url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', max_length=45, min_length=5, pattern=r'^[\w]+-[\w]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -470,7 +470,7 @@ def get( url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', max_length=45, min_length=5, pattern=r'^[\w]+-[\w]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -551,7 +551,7 @@ def cancel_deletion( url = self.cancel_deletion.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', max_length=45, min_length=5, pattern=r'^[\w]+-[\w]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_location_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_location_operations.py index c2ab551fb4eb..c63745c8fa64 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_location_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_location_operations.py @@ -25,7 +25,7 @@ class LocationOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to be used with the HTTP request. Constant value: "2019-08-01". + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2020-03-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-01" + self.api_version = "2020-03-01" self.config = config diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_operations.py index 2c6a2e4e32d9..5356eec6d754 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_operations.py @@ -25,7 +25,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to be used with the HTTP request. Constant value: "2019-08-01". + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2020-03-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-01" + self.api_version = "2020-03-01" self.config = config diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_pool_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_pool_operations.py index 22d5a28593c6..4e3a3923ede8 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_pool_operations.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_pool_operations.py @@ -27,7 +27,7 @@ class PoolOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to be used with the HTTP request. Constant value: "2019-08-01". + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2020-03-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-01" + self.api_version = "2020-03-01" self.config = config @@ -87,7 +87,7 @@ def prepare_request(next_link=None): url = self.list_by_batch_account.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -148,7 +148,7 @@ def _create_initial( url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'poolName': self._serialize.url("pool_name", pool_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -305,7 +305,7 @@ def update( url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'poolName': self._serialize.url("pool_name", pool_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -363,7 +363,7 @@ def _delete_initial( url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'poolName': self._serialize.url("pool_name", pool_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -476,7 +476,7 @@ def get( url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'poolName': self._serialize.url("pool_name", pool_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -547,7 +547,7 @@ def disable_auto_scale( url = self.disable_auto_scale.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'poolName': self._serialize.url("pool_name", pool_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -627,7 +627,7 @@ def stop_resize( url = self.stop_resize.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\._]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), 'poolName': self._serialize.url("pool_name", pool_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_endpoint_connection_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_endpoint_connection_operations.py new file mode 100644 index 000000000000..7f618ba79859 --- /dev/null +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_endpoint_connection_operations.py @@ -0,0 +1,274 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 PrivateEndpointConnectionOperations(object): + """PrivateEndpointConnectionOperations 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: The API version to be used with the HTTP request. Constant value: "2020-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-01" + + self.config = config + + def list_by_batch_account( + self, resource_group_name, account_name, maxresults=None, custom_headers=None, raw=False, **operation_config): + """Lists all of the private endpoint connections in the specified account. + + :param resource_group_name: The name of the resource group that + contains the Batch account. + :type resource_group_name: str + :param account_name: The name of the Batch account. + :type account_name: str + :param maxresults: The maximum number of items to return in the + response. + :type maxresults: 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: An iterator like instance of PrivateEndpointConnection + :rtype: + ~azure.mgmt.batch.models.PrivateEndpointConnectionPaged[~azure.mgmt.batch.models.PrivateEndpointConnection] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_batch_account.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$') + } + 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 maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int') + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateEndpointConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_batch_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections'} + + def get( + self, resource_group_name, account_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets information about the specified private endpoint connection. + + :param resource_group_name: The name of the resource group that + contains the Batch account. + :type resource_group_name: str + :param account_name: The name of the Batch account. + :type account_name: str + :param private_endpoint_connection_name: The private endpoint + connection name. This must be unique within the account. + :type private_endpoint_connection_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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.batch.models.PrivateEndpointConnection 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$') + } + 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]: + 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('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def update( + self, resource_group_name, account_name, private_endpoint_connection_name, if_match=None, private_endpoint=None, private_link_service_connection_state=None, custom_headers=None, raw=False, **operation_config): + """Updates the properties of an existing private endpoint connection. + + :param resource_group_name: The name of the resource group that + contains the Batch account. + :type resource_group_name: str + :param account_name: The name of the Batch account. + :type account_name: str + :param private_endpoint_connection_name: The private endpoint + connection name. This must be unique within the account. + :type private_endpoint_connection_name: str + :param if_match: The state (ETag) version of the private endpoint + connection to update. This value can be omitted or set to "*" to apply + the operation unconditionally. + :type if_match: str + :param private_endpoint: The ARM resource identifier of the private + endpoint. + :type private_endpoint: ~azure.mgmt.batch.models.PrivateEndpoint + :param private_link_service_connection_state: The private link service + connection state of the private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.batch.models.PrivateLinkServiceConnectionState + :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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.batch.models.PrivateEndpointConnection or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.PrivateEndpointConnection(private_endpoint=private_endpoint, private_link_service_connection_state=private_link_service_connection_state) + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$') + } + 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' + 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 if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, 'PrivateEndpointConnection') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_link_resource_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_link_resource_operations.py new file mode 100644 index 000000000000..22164b597e26 --- /dev/null +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_link_resource_operations.py @@ -0,0 +1,184 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 PrivateLinkResourceOperations(object): + """PrivateLinkResourceOperations 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: The API version to be used with the HTTP request. Constant value: "2020-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-01" + + self.config = config + + def list_by_batch_account( + self, resource_group_name, account_name, maxresults=None, custom_headers=None, raw=False, **operation_config): + """Lists all of the private link resources in the specified account. + + :param resource_group_name: The name of the resource group that + contains the Batch account. + :type resource_group_name: str + :param account_name: The name of the Batch account. + :type account_name: str + :param maxresults: The maximum number of items to return in the + response. + :type maxresults: 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: An iterator like instance of PrivateLinkResource + :rtype: + ~azure.mgmt.batch.models.PrivateLinkResourcePaged[~azure.mgmt.batch.models.PrivateLinkResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_batch_account.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$') + } + 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 maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int') + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_batch_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateLinkResources'} + + def get( + self, resource_group_name, account_name, private_link_resource_name, custom_headers=None, raw=False, **operation_config): + """Gets information about the specified private link resource. + + :param resource_group_name: The name of the resource group that + contains the Batch account. + :type resource_group_name: str + :param account_name: The name of the Batch account. + :type account_name: str + :param private_link_resource_name: The private link resource name. + This must be unique within the account. + :type private_link_resource_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: PrivateLinkResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.batch.models.PrivateLinkResource 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[a-zA-Z0-9]+$'), + 'privateLinkResourceName': self._serialize.url("private_link_resource_name", private_link_resource_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9_-]+$') + } + 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]: + 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('PrivateLinkResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateLinkResources/{privateLinkResourceName}'}