Skip to content

Commit 8b5fbd8

Browse files
cRui861Rena Chendpwatrous
authored
[Batch] Beta Data Plane SDK 15.0.0b2 Update to 07-01-2024 API (Azure#40222)
* Generate off latest TypeSpec for 2024-07-01 API changes * Update timeout naming * Regenerate for long encoding update * Fix unit tests * More changes from long encoding update * Fix unit tests * Fix typing errors * Async test helpers now preserve type info * Add test utility for handling file downloads * Update async wrapper * Re-generate with certificates re-added in * Update recording assets * Fix mypy errors * Minor space add * Mypy fixes and update tests * Update changelog * Fix test_batch_files by adding BatchFileProperties - made manual operation naming changes that need to be added to typespec * Update tests * Fixes --------- Co-authored-by: Rena Chen <[email protected]> Co-authored-by: David Watrous <[email protected]>
1 parent e72ab70 commit 8b5fbd8

33 files changed

+8824
-55385
lines changed

sdk/batch/azure-batch/CHANGELOG.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,37 @@
11
# Release History
22

3-
## 15.0.0b2 (Unreleased)
3+
## 15.0.0b2 (2025-03-01)
44

55
### Features Added
66

7-
### Breaking Changes
7+
- Force delete/terminate job or job schedule:
8+
- Added `force` parameter of type Boolean to `delete_job`, `terminate_job`, `delete_job_schedule`, and `terminate_job_schedule`
89

9-
### Bugs Fixed
10+
- Support for compute node start/deallocate operations:
11+
- Added `start_node`, `deallocate_node` methods to `BatchClient` and `AsyncBatchClient`
1012

11-
### Other Changes
13+
- Container task data mount isolation:
14+
- Added `containerHostBatchBindMounts` of type `List<ContainerHostBatchBindMountEntry>` to `BatchTaskContainerSettings`
15+
16+
- Patch improvements for pool and job:
17+
- Added `displayName`, `vmSize`, `taskSlotsPerNode`, `taskSchedulingPolicy`, `enableInterNodeCommunication`, `virtualMachineConfiguration`, `networkConfiguration`, `userAccounts`, `mountConfiguration`, `upgradePolicy`, and `resourceTags` to `BatchPoolUpdateContent`
18+
- Added `networkConfiguration` to `BatchJobUpdateContent`
19+
20+
- Confidential VM support:
21+
- Added `confidentialVM` to `SecurityTypes`.
22+
- Added `securityProfile` of type `VMDiskSecurityProfile` to `ManagedDisk`
23+
24+
- Support for shared and community gallery images:
25+
- Added `sharedGalleryImageId` and `communityGalleryImageId` to `ImageReference`
26+
27+
- Re-add support for `BatchCertificate` (temporary since this feature is deprecated):
28+
- Added `create_certificate`, `list_certificates`, `cancel_certificate_deletion`, `delete_certificate`, and`get_certificate` methods to `BatchClient` and `AsyncBatchClient`
29+
30+
### Breaking Changes
31+
32+
- Removed `get_remote_desktop` method from `BatchClient`. Use `get_node_remote_login_settings` instead to remotely login to a compute node
33+
- Removed `CloudServiceConfiguration` from pool models and operations. Use `VirtualMachineConfiguration` when creating pools
34+
- Removed `ApplicationLicenses` from pool models and operations
1235

1336
## 15.0.0b1 (2024-09-01)
1437

sdk/batch/azure-batch/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/batch/azure-batch",
5-
"Tag": "python/batch/azure-batch_b2cb0e7ad7"
5+
"Tag": "python/batch/azure-batch_8d51b2d53f"
66
}

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._client import BatchClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import BatchClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"BatchClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()

sdk/batch/azure-batch/azure/batch/_client.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
11+
from typing_extensions import Self
1112

1213
from azure.core import PipelineClient
1314
from azure.core.pipeline import policies
@@ -18,20 +19,20 @@
1819
from ._serialization import Deserializer, Serializer
1920

2021
if TYPE_CHECKING:
21-
# pylint: disable=unused-import,ungrouped-imports
2222
from azure.core.credentials import TokenCredential
2323

2424

25-
class BatchClient(BatchClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
25+
class BatchClient(BatchClientOperationsMixin):
2626
"""BatchClient.
2727
2828
:param endpoint: Batch account endpoint (for example:
29-
https://batchaccount.eastus2.batch.azure.com). Required.
29+
`https://batchaccount.eastus2.batch.azure.com
30+
<https://batchaccount.eastus2.batch.azure.com>`_). Required.
3031
:type endpoint: str
3132
:param credential: Credential used to authenticate requests to the service. Required.
3233
:type credential: ~azure.core.credentials.TokenCredential
3334
:keyword api_version: The API version to use for this operation. Default value is
34-
"2024-02-01.19.0". Note that overriding this default value may result in unsupported behavior.
35+
"2024-07-01.20.0". Note that overriding this default value may result in unsupported behavior.
3536
:paramtype api_version: str
3637
"""
3738

@@ -91,7 +92,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
9192
def close(self) -> None:
9293
self._client.close()
9394

94-
def __enter__(self) -> "BatchClient":
95+
def __enter__(self) -> Self:
9596
self._client.__enter__()
9697
return self
9798

sdk/batch/azure-batch/azure/batch/_configuration.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from ._version import VERSION
1414

1515
if TYPE_CHECKING:
16-
# pylint: disable=unused-import,ungrouped-imports
1716
from azure.core.credentials import TokenCredential
1817

1918

@@ -24,17 +23,18 @@ class BatchClientConfiguration: # pylint: disable=too-many-instance-attributes
2423
attributes.
2524
2625
:param endpoint: Batch account endpoint (for example:
27-
https://batchaccount.eastus2.batch.azure.com). Required.
26+
`https://batchaccount.eastus2.batch.azure.com
27+
<https://batchaccount.eastus2.batch.azure.com>`_). Required.
2828
:type endpoint: str
2929
:param credential: Credential used to authenticate requests to the service. Required.
3030
:type credential: ~azure.core.credentials.TokenCredential
3131
:keyword api_version: The API version to use for this operation. Default value is
32-
"2024-02-01.19.0". Note that overriding this default value may result in unsupported behavior.
32+
"2024-07-01.20.0". Note that overriding this default value may result in unsupported behavior.
3333
:paramtype api_version: str
3434
"""
3535

3636
def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
37-
api_version: str = kwargs.pop("api_version", "2024-02-01.19.0")
37+
api_version: str = kwargs.pop("api_version", "2024-07-01.20.0")
3838

3939
if endpoint is None:
4040
raise ValueError("Parameter 'endpoint' must not be None.")

0 commit comments

Comments
 (0)