Skip to content

Commit f4aee7e

Browse files
authored
Update to latest REST API (Azure#11715)
* Update to latest REST API * fix doc * minor
1 parent bf137c2 commit f4aee7e

27 files changed

+1480
-385
lines changed

sdk/batch/azure-mgmt-batch/CHANGELOG.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,33 @@
11
# Release History
2+
## 9.0.0 (2020-05-29)
3+
### REST API version
4+
- This version targets REST API version 2020-05-01.
5+
6+
### Features
7+
- Added ability to access the Batch DataPlane API without needing a public DNS entry for the account via the new `public_network_access` property on `BatchAccount`.
8+
- Added new `PrivateLinkResource` and `PrivateEndpointConnection` resource types. These are both only used when the `public_network_access` property on `BatchAccount` is set to `Disabled`.
9+
- When `public_network_access` is set to `Disabled` a new `PrivateLinkResource` is visible in that account, which can be used to connect to the account using an ARM Private Endpoint in your VNET.
10+
- Added ability to encrypt `ComputeNode` disk drives using the new `disk_encryption_configuration` property of `VirtualMachineConfiguration`.
11+
- **[Breaking]** The `id` property of `ImageReference` can now only refer to a Shared Image Gallery image.
12+
- **[Breaking]** Pools can now be provisioned without a public IP using the new `public_ip_configuration` property of `NetworkConfiguration`.
13+
- The `public_ips` property of `NetworkConfiguration` has moved in to `PublicIPAddressConfiguration` as well. This property can only be specified if `IPAddressProvisioningType` is `UserManaged`.
14+
- Adds a new property `identity` of type `BatchAccountIdentity` to `BatchAccount`. This can be used to configure how customer data is encrypted inside the Batch account.
15+
- This new property is configurable at the account level on create and update through a new `identity` property on `BatchAccountCreateParameters` and `BatchAccountUpdateParameters`
16+
17+
### Fixes
18+
- [Breaking] Move tags from being an argument on create and update pool parameters to being a part of `BatchAccountCreateParameters` and `BatchAccountUpdateParameters` to properly reflect the REST API
19+
20+
## 8.0.1 (2020-05-26) [Deprecated]
21+
### Notices
22+
- This version targeted an invalid REST API. This version does not honor the associated REST API contract.
223

3-
## 8.0.1 (2020-05-26)
424
### Bugfixes
5-
- Fix issues in PrivateEndpointConnection get and update methods due to mistakes in the Swagger specification causing validation to fail.
25+
- Fix issues in PrivateEndpointConnection get and update methods due to mistakes in the Swagger specification causing validation to fail. It is advised to use version 9+ to make use of the features added in this version.
26+
27+
## 8.0.0 (2020-04-10) [Deprecated]
28+
### Notices
29+
- This version targeted an invalid REST API. Currently the PrivateEndpoint get() and update() functions do not function correctly. It is advised to use version 9+ to make use of the features added in this version.
630

7-
## 8.0.0 (2020-04-10)
831
### REST API version
932
- This version targets REST API version 2020-03-01.
1033

sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_batch_management_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(
6666
super(BatchManagementClient, self).__init__(self.config.credentials, self.config)
6767

6868
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
69-
self.api_version = '2020-03-01'
69+
self.api_version = '2020-05-01'
7070
self._serialize = Serializer(client_models)
7171
self._deserialize = Deserializer(client_models)
7272

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from ._models_py3 import AzureFileShareConfiguration
2525
from ._models_py3 import BatchAccount
2626
from ._models_py3 import BatchAccountCreateParameters
27+
from ._models_py3 import BatchAccountIdentity
2728
from ._models_py3 import BatchAccountKeys
2829
from ._models_py3 import BatchAccountRegenerateKeyParameters
2930
from ._models_py3 import BatchAccountUpdateParameters
@@ -94,6 +95,7 @@
9495
from ._models import AzureFileShareConfiguration
9596
from ._models import BatchAccount
9697
from ._models import BatchAccountCreateParameters
98+
from ._models import BatchAccountIdentity
9799
from ._models import BatchAccountKeys
98100
from ._models import BatchAccountRegenerateKeyParameters
99101
from ._models import BatchAccountUpdateParameters
@@ -161,6 +163,7 @@
161163
KeySource,
162164
PoolAllocationMode,
163165
PublicNetworkAccessType,
166+
ResourceIdentityType,
164167
ProvisioningState,
165168
PrivateEndpointConnectionProvisioningState,
166169
PrivateLinkServiceConnectionStatus,
@@ -205,6 +208,7 @@
205208
'AzureFileShareConfiguration',
206209
'BatchAccount',
207210
'BatchAccountCreateParameters',
211+
'BatchAccountIdentity',
208212
'BatchAccountKeys',
209213
'BatchAccountRegenerateKeyParameters',
210214
'BatchAccountUpdateParameters',
@@ -271,6 +275,7 @@
271275
'KeySource',
272276
'PoolAllocationMode',
273277
'PublicNetworkAccessType',
278+
'ResourceIdentityType',
274279
'ProvisioningState',
275280
'PrivateEndpointConnectionProvisioningState',
276281
'PrivateLinkServiceConnectionStatus',

sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_batch_management_client_enums.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class KeySource(str, Enum):
1616

1717
microsoft_batch = "Microsoft.Batch" #: Batch creates and manages the encryption keys used to protect the account data.
18-
microsoft_key_vault = "Microsoft.KeyVault" #: The encryption keys used to protect the account data are stored in an external key vault.
18+
microsoft_key_vault = "Microsoft.KeyVault" #: The encryption keys used to protect the account data are stored in an external key vault. If this is set then the Batch Account identity must be set to `SystemAssigned` and a valid Key Identifier must also be supplied under the keyVaultProperties.
1919

2020

2121
class PoolAllocationMode(str, Enum):
@@ -30,6 +30,12 @@ class PublicNetworkAccessType(str, Enum):
3030
disabled = "Disabled" #: Disables public connectivity and enables private connectivity to Azure Batch Service through private endpoint resource.
3131

3232

33+
class ResourceIdentityType(str, Enum):
34+
35+
system_assigned = "SystemAssigned" #: Batch account has a system assigned identity with it.
36+
none = "None" #: Batch account has no identity associated with it. Setting `None` in update account will remove existing identities.
37+
38+
3339
class ProvisioningState(str, Enum):
3440

3541
invalid = "Invalid" #: The account is in an invalid state.

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

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,9 @@ class BatchAccount(Resource):
570570
associated with the Batch account.
571571
:vartype auto_storage: ~azure.mgmt.batch.models.AutoStorageProperties
572572
:ivar encryption: The encryption configuration for the Batch account.
573+
Configures how customer data is encrypted inside the Batch account. By
574+
default, accounts are encrypted using a Microsoft managed key. For
575+
additional control, a customer-managed key can be used instead.
573576
:vartype encryption: ~azure.mgmt.batch.models.EncryptionProperties
574577
:ivar dedicated_core_quota: The dedicated core quota for the Batch
575578
account. For accounts with PoolAllocationMode set to UserSubscription,
@@ -601,6 +604,8 @@ class BatchAccount(Resource):
601604
:ivar active_job_and_job_schedule_quota: The active job and job schedule
602605
quota for the Batch account.
603606
:vartype active_job_and_job_schedule_quota: int
607+
:param identity: The identity of the Batch account.
608+
:type identity: ~azure.mgmt.batch.models.BatchAccountIdentity
604609
"""
605610

606611
_validation = {
@@ -645,6 +650,7 @@ class BatchAccount(Resource):
645650
'dedicated_core_quota_per_vm_family_enforced': {'key': 'properties.dedicatedCoreQuotaPerVMFamilyEnforced', 'type': 'bool'},
646651
'pool_quota': {'key': 'properties.poolQuota', 'type': 'int'},
647652
'active_job_and_job_schedule_quota': {'key': 'properties.activeJobAndJobScheduleQuota', 'type': 'int'},
653+
'identity': {'key': 'identity', 'type': 'BatchAccountIdentity'},
648654
}
649655

650656
def __init__(self, **kwargs):
@@ -663,6 +669,7 @@ def __init__(self, **kwargs):
663669
self.dedicated_core_quota_per_vm_family_enforced = None
664670
self.pool_quota = None
665671
self.active_job_and_job_schedule_quota = None
672+
self.identity = kwargs.get('identity', None)
666673

667674

668675
class BatchAccountCreateParameters(Model):
@@ -694,7 +701,12 @@ class BatchAccountCreateParameters(Model):
694701
:type public_network_access: str or
695702
~azure.mgmt.batch.models.PublicNetworkAccessType
696703
:param encryption: The encryption configuration for the Batch account.
704+
Configures how customer data is encrypted inside the Batch account. By
705+
default, accounts are encrypted using a Microsoft managed key. For
706+
additional control, a customer-managed key can be used instead.
697707
:type encryption: ~azure.mgmt.batch.models.EncryptionProperties
708+
:param identity: The identity of the Batch account.
709+
:type identity: ~azure.mgmt.batch.models.BatchAccountIdentity
698710
"""
699711

700712
_validation = {
@@ -709,6 +721,7 @@ class BatchAccountCreateParameters(Model):
709721
'key_vault_reference': {'key': 'properties.keyVaultReference', 'type': 'KeyVaultReference'},
710722
'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'PublicNetworkAccessType'},
711723
'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperties'},
724+
'identity': {'key': 'identity', 'type': 'BatchAccountIdentity'},
712725
}
713726

714727
def __init__(self, **kwargs):
@@ -720,6 +733,47 @@ def __init__(self, **kwargs):
720733
self.key_vault_reference = kwargs.get('key_vault_reference', None)
721734
self.public_network_access = kwargs.get('public_network_access', "Enabled")
722735
self.encryption = kwargs.get('encryption', None)
736+
self.identity = kwargs.get('identity', None)
737+
738+
739+
class BatchAccountIdentity(Model):
740+
"""The identity of the Batch account, if configured. This is only used when
741+
the user specifies 'Microsoft.KeyVault' as their Batch account encryption
742+
configuration.
743+
744+
Variables are only populated by the server, and will be ignored when
745+
sending a request.
746+
747+
All required parameters must be populated in order to send to Azure.
748+
749+
:ivar principal_id: The principal id of the Batch account. This property
750+
will only be provided for a system assigned identity.
751+
:vartype principal_id: str
752+
:ivar tenant_id: The tenant id associated with the Batch account. This
753+
property will only be provided for a system assigned identity.
754+
:vartype tenant_id: str
755+
:param type: Required. The type of identity used for the Batch account.
756+
Possible values include: 'SystemAssigned', 'None'
757+
:type type: str or ~azure.mgmt.batch.models.ResourceIdentityType
758+
"""
759+
760+
_validation = {
761+
'principal_id': {'readonly': True},
762+
'tenant_id': {'readonly': True},
763+
'type': {'required': True},
764+
}
765+
766+
_attribute_map = {
767+
'principal_id': {'key': 'principalId', 'type': 'str'},
768+
'tenant_id': {'key': 'tenantId', 'type': 'str'},
769+
'type': {'key': 'type', 'type': 'ResourceIdentityType'},
770+
}
771+
772+
def __init__(self, **kwargs):
773+
super(BatchAccountIdentity, self).__init__(**kwargs)
774+
self.principal_id = None
775+
self.tenant_id = None
776+
self.type = kwargs.get('type', None)
723777

724778

725779
class BatchAccountKeys(Model):
@@ -786,20 +840,27 @@ class BatchAccountUpdateParameters(Model):
786840
:param auto_storage: The properties related to the auto-storage account.
787841
:type auto_storage: ~azure.mgmt.batch.models.AutoStorageBaseProperties
788842
:param encryption: The encryption configuration for the Batch account.
843+
Configures how customer data is encrypted inside the Batch account. By
844+
default, accounts are encrypted using a Microsoft managed key. For
845+
additional control, a customer-managed key can be used instead.
789846
:type encryption: ~azure.mgmt.batch.models.EncryptionProperties
847+
:param identity: The identity of the Batch account.
848+
:type identity: ~azure.mgmt.batch.models.BatchAccountIdentity
790849
"""
791850

792851
_attribute_map = {
793852
'tags': {'key': 'tags', 'type': '{str}'},
794853
'auto_storage': {'key': 'properties.autoStorage', 'type': 'AutoStorageBaseProperties'},
795854
'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperties'},
855+
'identity': {'key': 'identity', 'type': 'BatchAccountIdentity'},
796856
}
797857

798858
def __init__(self, **kwargs):
799859
super(BatchAccountUpdateParameters, self).__init__(**kwargs)
800860
self.tags = kwargs.get('tags', None)
801861
self.auto_storage = kwargs.get('auto_storage', None)
802862
self.encryption = kwargs.get('encryption', None)
863+
self.identity = kwargs.get('identity', None)
803864

804865

805866
class BatchLocationQuota(Model):
@@ -1466,7 +1527,9 @@ def __init__(self, **kwargs):
14661527

14671528

14681529
class EncryptionProperties(Model):
1469-
"""EncryptionProperties.
1530+
"""Configures how customer data is encrypted inside the Batch account. By
1531+
default, accounts are encrypted using a Microsoft managed key. For
1532+
additional control, a customer-managed key can be used instead.
14701533
14711534
:param key_source: Type of the key source. Possible values include:
14721535
'Microsoft.Batch', 'Microsoft.KeyVault'
@@ -1666,10 +1729,16 @@ def __init__(self, **kwargs):
16661729

16671730

16681731
class KeyVaultProperties(Model):
1669-
"""KeyVaultProperties.
1732+
"""KeyVault configuration when using an encryption KeySource of
1733+
Microsoft.KeyVault.
16701734
16711735
:param key_identifier: Full path to the versioned secret. Example
1672-
https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053
1736+
https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053.
1737+
To be usable the following prerequisites must be met:
1738+
The Batch Account has a System Assigned identity
1739+
The account identity has been granted Key/Get, Key/Unwrap and Key/Wrap
1740+
permissions
1741+
The KeyVault has soft-delete and purge protection enabled
16731742
:type key_identifier: str
16741743
"""
16751744

0 commit comments

Comments
 (0)