Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Batch] Beta Data Plane SDK 15.0.0b2 Update to 07-01-2024 API #40222

Merged
merged 19 commits into from
Apr 4, 2025
Merged
31 changes: 27 additions & 4 deletions sdk/batch/azure-batch/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,37 @@
# Release History

## 15.0.0b2 (Unreleased)
## 15.0.0b2 (2025-03-01)

### Features Added

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

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

### Other Changes
- Container task data mount isolation:
- Added `containerHostBatchBindMounts` of type `List<ContainerHostBatchBindMountEntry>` to `BatchTaskContainerSettings`

- Patch improvements for pool and job:
- Added `displayName`, `vmSize`, `taskSlotsPerNode`, `taskSchedulingPolicy`, `enableInterNodeCommunication`, `virtualMachineConfiguration`, `networkConfiguration`, `userAccounts`, `mountConfiguration`, `upgradePolicy`, and `resourceTags` to `BatchPoolUpdateContent`
- Added `networkConfiguration` to `BatchJobUpdateContent`

- Confidential VM support:
- Added `confidentialVM` to `SecurityTypes`.
- Added `securityProfile` of type `VMDiskSecurityProfile` to `ManagedDisk`

- Support for shared and community gallery images:
- Added `sharedGalleryImageId` and `communityGalleryImageId` to `ImageReference`

- Re-add support for `BatchCertificate` (temporary since this feature is deprecated):
- Added `create_certificate`, `list_certificates`, `cancel_certificate_deletion`, `delete_certificate`, and`get_certificate` methods to `BatchClient` and `AsyncBatchClient`

### Breaking Changes

- Removed `get_remote_desktop` method from `BatchClient`. Use `get_node_remote_login_settings` instead to remotely login to a compute node
- Removed `CloudServiceConfiguration` from pool models and operations. Use `VirtualMachineConfiguration` when creating pools
- Removed `ApplicationLicenses` from pool models and operations

## 15.0.0b1 (2024-09-01)

Expand Down
2 changes: 1 addition & 1 deletion sdk/batch/azure-batch/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "python",
"TagPrefix": "python/batch/azure-batch",
"Tag": "python/batch/azure-batch_b2cb0e7ad7"
"Tag": "python/batch/azure-batch_8d51b2d53f"
}
12 changes: 9 additions & 3 deletions sdk/batch/azure-batch/azure/batch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,28 @@
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position

from ._client import BatchClient
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._client import BatchClient # type: ignore
from ._version import VERSION

__version__ = VERSION

try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"BatchClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore

_patch_sdk()
11 changes: 6 additions & 5 deletions sdk/batch/azure-batch/azure/batch/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing_extensions import Self

from azure.core import PipelineClient
from azure.core.pipeline import policies
Expand All @@ -18,20 +19,20 @@
from ._serialization import Deserializer, Serializer

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


class BatchClient(BatchClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
class BatchClient(BatchClientOperationsMixin):
"""BatchClient.

:param endpoint: Batch account endpoint (for example:
https://batchaccount.eastus2.batch.azure.com). Required.
`https://batchaccount.eastus2.batch.azure.com
<https://batchaccount.eastus2.batch.azure.com>`_). Required.
:type endpoint: str
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials.TokenCredential
:keyword api_version: The API version to use for this operation. Default value is
"2024-02-01.19.0". Note that overriding this default value may result in unsupported behavior.
"2024-07-01.20.0". Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str
"""

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

def __enter__(self) -> "BatchClient":
def __enter__(self) -> Self:
self._client.__enter__()
return self

Expand Down
8 changes: 4 additions & 4 deletions sdk/batch/azure-batch/azure/batch/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from ._version import VERSION

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


Expand All @@ -24,17 +23,18 @@ class BatchClientConfiguration: # pylint: disable=too-many-instance-attributes
attributes.

:param endpoint: Batch account endpoint (for example:
https://batchaccount.eastus2.batch.azure.com). Required.
`https://batchaccount.eastus2.batch.azure.com
<https://batchaccount.eastus2.batch.azure.com>`_). Required.
:type endpoint: str
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials.TokenCredential
:keyword api_version: The API version to use for this operation. Default value is
"2024-02-01.19.0". Note that overriding this default value may result in unsupported behavior.
"2024-07-01.20.0". Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str
"""

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

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
Expand Down
Loading