Skip to content

Commit 6a97737

Browse files
committed
Merge branch 'shared_credential' of https://github.com/iscai-msft/azure-sdk-for-python into shared_credential_search
* 'shared_credential' of https://github.com/iscai-msft/azure-sdk-for-python: fixed test Update install link [Event Hubs] Put uamqp.Message.properties into EventData.system_properties (Azure#10508) Sync eng/common directory with azure-sdk-tools repository (Azure#10531) Prevent DefaultAzureCredential changing authentication method (Azure#10349) Update Batch Data plane (Azure#10477)
2 parents fe1bae6 + 8767663 commit 6a97737

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2847
-2257
lines changed

doc/sphinx/installation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Installation
22
============
33

4-
This content has moved to https://docs.microsoft.com/python/azure/python-sdk-azure-install
4+
This content has moved to https://docs.microsoft.com/en-us/azure/python/azure-sdk-install

eng/common/scripts/copy-docs-to-blobstorage.ps1

+9-3
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,26 @@ param (
1111
$Language = $Language.ToLower()
1212

1313
# Regex inspired but simplified from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
14-
$SEMVER_REGEX = "^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-?(?<prelabel>[a-zA-Z-]*)(?:\.?(?<prenumber>0|[1-9]\d*)))?$"
14+
$SEMVER_REGEX = "^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-?(?<prelabel>[a-zA-Z-]*)(?:\.?(?<prenumber>0|[1-9]\d*))?)?$"
1515

1616
function ToSemVer($version){
1717
if ($version -match $SEMVER_REGEX)
1818
{
19-
if($matches['prelabel'] -eq $null) {
19+
if(-not $matches['prelabel']) {
2020
# artifically provide these values for non-prereleases to enable easy sorting of them later than prereleases.
2121
$prelabel = "zzz"
2222
$prenumber = 999;
2323
$isPre = $false;
2424
}
2525
else {
2626
$prelabel = $matches["prelabel"]
27-
$prenumber = [int]$matches["prenumber"]
27+
$prenumber = 0
28+
29+
# some older packages don't have a prenumber, should handle this
30+
if($matches["prenumber"]){
31+
$prenumber = [int]$matches["prenumber"]
32+
}
33+
2834
$isPre = $true;
2935
}
3036

sdk/batch/azure-batch/CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Release History
22

3+
## 9.0.0 (2020-03-24)
4+
5+
### Features
6+
- Added ability to encrypt `ComputeNode` disk drives using the new `disk_encryption_configuration` property of `VirtualMachineConfiguration`.
7+
- **[Breaking]** The `virtual_machine_id` property of `ImageReference` can now only refer to a Shared Image Gallery image.
8+
- **[Breaking]** Pools can now be provisioned without a public IP using the new `public_ip_address_configuration` property of `NetworkConfiguration`.
9+
- The `public_ips` property of `NetworkConfiguration` has moved in to `public_ip_address_configuration` as well. This property can only be specified if `ip_provisioning_type` is `UserManaged`.
10+
11+
### REST API version
12+
This version of the Batch .NET client library targets version 2020-03-01.11.0 of the Azure Batch REST API.
13+
314
## 8.0.0 (2019-8-5)
415

516
- Using REST API version 2019-08-01.10.0.

sdk/batch/azure-batch/azure/batch/_batch_service_client.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from . import models
2626
from .custom.patch import patch_client
2727

28-
2928
class BatchServiceClient(SDKClient):
3029
"""A client for issuing REST requests to the Azure Batch service.
3130
@@ -65,7 +64,7 @@ def __init__(
6564
super(BatchServiceClient, self).__init__(self.config.credentials, self.config)
6665

6766
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
68-
self.api_version = '2019-08-01.10.0'
67+
self.api_version = '2020-03-01.11.0'
6968
self._serialize = Serializer(client_models)
7069
self._deserialize = Deserializer(client_models)
7170

sdk/batch/azure-batch/azure/batch/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
VERSION = "8.0.0"
12+
VERSION = "9.0.0"
1313

sdk/batch/azure-batch/azure/batch/models/__init__.py

+10
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
from ._models_py3 import ContainerRegistry
6464
from ._models_py3 import DataDisk
6565
from ._models_py3 import DeleteCertificateError
66+
from ._models_py3 import DiskEncryptionConfiguration
6667
from ._models_py3 import EnvironmentSetting
6768
from ._models_py3 import ErrorMessage
6869
from ._models_py3 import ExitCodeMapping
@@ -174,6 +175,7 @@
174175
from ._models_py3 import PoolUpdatePropertiesOptions
175176
from ._models_py3 import PoolUpdatePropertiesParameter
176177
from ._models_py3 import PoolUsageMetrics
178+
from ._models_py3 import PublicIPAddressConfiguration
177179
from ._models_py3 import RecentJob
178180
from ._models_py3 import ResizeError
179181
from ._models_py3 import ResourceFile
@@ -269,6 +271,7 @@
269271
from ._models import ContainerRegistry
270272
from ._models import DataDisk
271273
from ._models import DeleteCertificateError
274+
from ._models import DiskEncryptionConfiguration
272275
from ._models import EnvironmentSetting
273276
from ._models import ErrorMessage
274277
from ._models import ExitCodeMapping
@@ -380,6 +383,7 @@
380383
from ._models import PoolUpdatePropertiesOptions
381384
from ._models import PoolUpdatePropertiesParameter
382385
from ._models import PoolUsageMetrics
386+
from ._models import PublicIPAddressConfiguration
383387
from ._models import RecentJob
384388
from ._models import ResizeError
385389
from ._models import ResourceFile
@@ -451,9 +455,11 @@
451455
CertificateVisibility,
452456
CachingType,
453457
StorageAccountType,
458+
DiskEncryptionTarget,
454459
DynamicVNetAssignmentScope,
455460
InboundEndpointProtocol,
456461
NetworkSecurityGroupRuleAccess,
462+
IPAddressProvisioningType,
457463
PoolLifetimeOption,
458464
OnAllTasksComplete,
459465
OnTaskFailure,
@@ -532,6 +538,7 @@
532538
'ContainerRegistry',
533539
'DataDisk',
534540
'DeleteCertificateError',
541+
'DiskEncryptionConfiguration',
535542
'EnvironmentSetting',
536543
'ErrorMessage',
537544
'ExitCodeMapping',
@@ -643,6 +650,7 @@
643650
'PoolUpdatePropertiesOptions',
644651
'PoolUpdatePropertiesParameter',
645652
'PoolUsageMetrics',
653+
'PublicIPAddressConfiguration',
646654
'RecentJob',
647655
'ResizeError',
648656
'ResourceFile',
@@ -713,9 +721,11 @@
713721
'CertificateVisibility',
714722
'CachingType',
715723
'StorageAccountType',
724+
'DiskEncryptionTarget',
716725
'DynamicVNetAssignmentScope',
717726
'InboundEndpointProtocol',
718727
'NetworkSecurityGroupRuleAccess',
728+
'IPAddressProvisioningType',
719729
'PoolLifetimeOption',
720730
'OnAllTasksComplete',
721731
'OnTaskFailure',

sdk/batch/azure-batch/azure/batch/models/_batch_service_client_enums.py

+13
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ class StorageAccountType(str, Enum):
118118
premium_lrs = "premium_lrs" #: The data disk should use premium locally redundant storage.
119119

120120

121+
class DiskEncryptionTarget(str, Enum):
122+
123+
os_disk = "osdisk" #: The OS Disk on the compute node is encrypted.
124+
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.
125+
126+
121127
class DynamicVNetAssignmentScope(str, Enum):
122128

123129
none = "none" #: No dynamic VNet assignment is enabled.
@@ -136,6 +142,13 @@ class NetworkSecurityGroupRuleAccess(str, Enum):
136142
deny = "deny" #: Deny access.
137143

138144

145+
class IPAddressProvisioningType(str, Enum):
146+
147+
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.
148+
user_managed = "usermanaged" #: Public IPs are provided by the user and will be used to provision the Compute Nodes.
149+
no_public_ip_addresses = "nopublicipaddresses" #: No public IP Address will be created.
150+
151+
139152
class PoolLifetimeOption(str, Enum):
140153

141154
job_schedule = "jobschedule" #: The Pool exists for the lifetime of the Job Schedule. The Batch Service creates the Pool when it creates the first Job on the schedule. You may apply this option only to Job Schedules, not to Jobs.

sdk/batch/azure-batch/azure/batch/models/_models.py

+77-27
Original file line numberDiff line numberDiff line change
@@ -697,8 +697,7 @@ class CertificateAddParameter(Model):
697697
values include: 'pfx', 'cer'
698698
:type certificate_format: str or ~azure.batch.models.CertificateFormat
699699
:param password: The password to access the Certificate's private key.
700-
This is required if the Certificate format is pfx. It should be omitted if
701-
the Certificate format is cer.
700+
This must be omitted if the Certificate format is cer.
702701
:type password: str
703702
"""
704703

@@ -2624,6 +2623,27 @@ def __init__(self, **kwargs):
26242623
self.values = kwargs.get('values', None)
26252624

26262625

2626+
class DiskEncryptionConfiguration(Model):
2627+
"""The disk encryption configuration applied on compute nodes in the pool.
2628+
Disk encryption configuration is not supported on Linux pool created with
2629+
Shared Image Gallery Image.
2630+
2631+
:param targets: The list of disk targets Batch Service will encrypt on the
2632+
compute node. If omitted, no disks on the compute nodes in the pool will
2633+
be encrypted. On Linux pool, only "TemporaryDisk" is supported; on Windows
2634+
pool, "OsDisk" and "TemporaryDisk" must be specified.
2635+
:type targets: list[str or ~azure.batch.models.DiskEncryptionTarget]
2636+
"""
2637+
2638+
_attribute_map = {
2639+
'targets': {'key': 'targets', 'type': '[DiskEncryptionTarget]'},
2640+
}
2641+
2642+
def __init__(self, **kwargs):
2643+
super(DiskEncryptionConfiguration, self).__init__(**kwargs)
2644+
self.targets = kwargs.get('targets', None)
2645+
2646+
26272647
class EnvironmentSetting(Model):
26282648
"""An environment variable to be set on a Task process.
26292649

@@ -3282,19 +3302,16 @@ class ImageReference(Model):
32823302
Image. A value of 'latest' can be specified to select the latest version
32833303
of an Image. If omitted, the default is 'latest'.
32843304
:type version: str
3285-
:param virtual_machine_image_id: The ARM resource identifier of the
3286-
Virtual Machine Image or Shared Image Gallery Image. Computes Compute
3287-
Nodes of the Pool will be created using this Image Id. This is of either
3288-
the form
3289-
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}
3290-
for Virtual Machine Image or
3291-
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionId}
3292-
for SIG image. This property is mutually exclusive with other
3293-
ImageReference properties. For Virtual Machine Image it must be in the
3294-
same region and subscription as the Azure Batch account. For SIG image it
3295-
must have replicas in the same region as the Azure Batch account. For
3296-
information about the firewall settings for the Batch Compute Node agent
3297-
to communicate with the Batch service see
3305+
:param virtual_machine_image_id: The ARM resource identifier of the Shared
3306+
Image Gallery Image. Compute Nodes in the Pool will be created using this
3307+
Image Id. This is of the
3308+
form/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionId}.
3309+
This property is mutually exclusive with other ImageReference properties.
3310+
For Virtual Machine Image it must be in the same region and subscription
3311+
as the Azure Batch account. The Shared Image Gallery Image must have
3312+
replicas in the same region as the Azure Batch account. For information
3313+
about the firewall settings for the Batch Compute Node agent to
3314+
communicate with the Batch service see
32983315
https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
32993316
:type virtual_machine_image_id: str
33003317
"""
@@ -6479,7 +6496,7 @@ class NetworkConfiguration(Model):
64796496
Azure Batch Account. The specified subnet should have enough free IP
64806497
addresses to accommodate the number of Compute Nodes in the Pool. If the
64816498
subnet doesn't have enough free IP addresses, the Pool will partially
6482-
allocate Nodes, and a resize error will occur. The 'MicrosoftAzureBatch'
6499+
allocate Nodes and a resize error will occur. The 'MicrosoftAzureBatch'
64836500
service principal must have the 'Classic Virtual Machine Contributor'
64846501
Role-Based Access Control (RBAC) role for the specified VNet. The
64856502
specified subnet must allow communication from the Azure Batch service to
@@ -6508,29 +6525,26 @@ class NetworkConfiguration(Model):
65086525
Pools with the virtualMachineConfiguration property.
65096526
:type endpoint_configuration:
65106527
~azure.batch.models.PoolEndpointConfiguration
6511-
:param public_ips: The list of public IPs which the Batch service will use
6512-
when provisioning Compute Nodes. The number of IPs specified here limits
6513-
the maximum size of the Pool - 50 dedicated nodes or 20 low-priority nodes
6514-
can be allocated for each public IP. For example, a pool needing 150
6515-
dedicated VMs would need at least 3 public IPs specified. Each element of
6516-
this collection is of the form:
6517-
/subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}.
6518-
:type public_ips: list[str]
6528+
:param public_ip_address_configuration: The Public IPAddress configuration
6529+
for Compute Nodes in the Batch Pool. Public IP configuration property is
6530+
only supported on Pools with the virtualMachineConfiguration property.
6531+
:type public_ip_address_configuration:
6532+
~azure.batch.models.PublicIPAddressConfiguration
65196533
"""
65206534

65216535
_attribute_map = {
65226536
'subnet_id': {'key': 'subnetId', 'type': 'str'},
65236537
'dynamic_vnet_assignment_scope': {'key': 'dynamicVNetAssignmentScope', 'type': 'DynamicVNetAssignmentScope'},
65246538
'endpoint_configuration': {'key': 'endpointConfiguration', 'type': 'PoolEndpointConfiguration'},
6525-
'public_ips': {'key': 'publicIPs', 'type': '[str]'},
6539+
'public_ip_address_configuration': {'key': 'publicIPAddressConfiguration', 'type': 'PublicIPAddressConfiguration'},
65266540
}
65276541

65286542
def __init__(self, **kwargs):
65296543
super(NetworkConfiguration, self).__init__(**kwargs)
65306544
self.subnet_id = kwargs.get('subnet_id', None)
65316545
self.dynamic_vnet_assignment_scope = kwargs.get('dynamic_vnet_assignment_scope', None)
65326546
self.endpoint_configuration = kwargs.get('endpoint_configuration', None)
6533-
self.public_ips = kwargs.get('public_ips', None)
6547+
self.public_ip_address_configuration = kwargs.get('public_ip_address_configuration', None)
65346548

65356549

65366550
class NetworkSecurityGroupRule(Model):
@@ -6543,7 +6557,7 @@ class NetworkSecurityGroupRule(Model):
65436557
number the higher the priority. For example, rules could be specified with
65446558
order numbers of 150, 250, and 350. The rule with the order number of 150
65456559
takes precedence over the rule that has an order of 250. Allowed
6546-
priorities are 150 to 3500. If any reserved or duplicate values are
6560+
priorities are 150 to 4096. If any reserved or duplicate values are
65476561
provided the request fails with HTTP status code 400.
65486562
:type priority: int
65496563
:param access: Required. The action that should be taken for a specified
@@ -8609,6 +8623,35 @@ def __init__(self, **kwargs):
86098623
self.total_core_hours = kwargs.get('total_core_hours', None)
86108624

86118625

8626+
class PublicIPAddressConfiguration(Model):
8627+
"""The public IP Address configuration of the networking configuration of a
8628+
Pool.
8629+
8630+
:param provision: The provisioning type for Public IP Addresses for the
8631+
Pool. The default value is BatchManaged. Possible values include:
8632+
'batchManaged', 'userManaged', 'noPublicIPAddresses'
8633+
:type provision: str or ~azure.batch.models.IPAddressProvisioningType
8634+
:param ip_address_ids: The list of public IPs which the Batch service will
8635+
use when provisioning Compute Nodes. The number of IPs specified here
8636+
limits the maximum size of the Pool - 50 dedicated nodes or 20
8637+
low-priority nodes can be allocated for each public IP. For example, a
8638+
pool needing 150 dedicated VMs would need at least 3 public IPs specified.
8639+
Each element of this collection is of the form:
8640+
/subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}.
8641+
:type ip_address_ids: list[str]
8642+
"""
8643+
8644+
_attribute_map = {
8645+
'provision': {'key': 'provision', 'type': 'IPAddressProvisioningType'},
8646+
'ip_address_ids': {'key': 'ipAddressIds', 'type': '[str]'},
8647+
}
8648+
8649+
def __init__(self, **kwargs):
8650+
super(PublicIPAddressConfiguration, self).__init__(**kwargs)
8651+
self.provision = kwargs.get('provision', None)
8652+
self.ip_address_ids = kwargs.get('ip_address_ids', None)
8653+
8654+
86128655
class RecentJob(Model):
86138656
"""Information about the most recent Job to run under the Job Schedule.
86148657

@@ -10648,6 +10691,11 @@ class VirtualMachineConfiguration(Model):
1064810691
this Pool must specify the containerSettings property, and all other Tasks
1064910692
may specify it.
1065010693
:type container_configuration: ~azure.batch.models.ContainerConfiguration
10694+
:param disk_encryption_configuration: The disk encryption configuration
10695+
for the pool. If specified, encryption is performed on each node in the
10696+
pool during node provisioning.
10697+
:type disk_encryption_configuration:
10698+
~azure.batch.models.DiskEncryptionConfiguration
1065110699
"""
1065210700

1065310701
_validation = {
@@ -10662,6 +10710,7 @@ class VirtualMachineConfiguration(Model):
1066210710
'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'},
1066310711
'license_type': {'key': 'licenseType', 'type': 'str'},
1066410712
'container_configuration': {'key': 'containerConfiguration', 'type': 'ContainerConfiguration'},
10713+
'disk_encryption_configuration': {'key': 'diskEncryptionConfiguration', 'type': 'DiskEncryptionConfiguration'},
1066510714
}
1066610715

1066710716
def __init__(self, **kwargs):
@@ -10672,6 +10721,7 @@ def __init__(self, **kwargs):
1067210721
self.data_disks = kwargs.get('data_disks', None)
1067310722
self.license_type = kwargs.get('license_type', None)
1067410723
self.container_configuration = kwargs.get('container_configuration', None)
10724+
self.disk_encryption_configuration = kwargs.get('disk_encryption_configuration', None)
1067510725

1067610726

1067710727
class WindowsConfiguration(Model):

0 commit comments

Comments
 (0)