Skip to content

Commit

Permalink
[AutoRelease] t2-batch-2024-08-23-81943(can only be merged by SDK own…
Browse files Browse the repository at this point in the history
…er) (#36998)

* code and test

* update-testcase

* Delete sdk/batch/azure-mgmt-batch/assets.json

* update-testcase

* changelog

* changelog

* Update CHANGELOG.md

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <[email protected]>
Co-authored-by: ChenxiJiang333 <[email protected]>
Co-authored-by: msyyc <[email protected]>
Co-authored-by: Yuchao Yan <[email protected]>
  • Loading branch information
5 people authored Sep 25, 2024
1 parent b55e230 commit b6a47ab
Show file tree
Hide file tree
Showing 146 changed files with 6,501 additions and 2,809 deletions.
60 changes: 60 additions & 0 deletions sdk/batch/azure-mgmt-batch/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,65 @@
# Release History

## 18.0.0 (2024-09-25)

### Features Added

- Client `BatchManagementClient` added operation group `network_security_perimeter`
- Model `Application` added parameter `tags` in method `__init__`
- Model `ApplicationPackage` added parameter `tags` in method `__init__`
- Model `Certificate` added parameter `tags` in method `__init__`
- Model `CertificateCreateOrUpdateParameters` added parameter `tags` in method `__init__`
- Model `DetectorResponse` added parameter `tags` in method `__init__`
- Model `ImageReference` added property `shared_gallery_image_id`
- Model `ImageReference` added property `community_gallery_image_id`
- Model `ManagedDisk` added property `security_profile`
- Model `Pool` added parameter `tags` in method `__init__`
- Model `PrivateEndpointConnection` added parameter `tags` in method `__init__`
- Model `PrivateLinkResource` added parameter `tags` in method `__init__`
- Model `ProxyResource` added property `system_data`
- Model `ProxyResource` added property `additional_properties`
- Enum `PublicNetworkAccessType` added member `SECURED_BY_PERIMETER`
- Model `Resource` added property `system_data`
- Model `TaskContainerSettings` added property `container_host_batch_bind_mounts`
- Added model `AccessRule`
- Added enum `AccessRuleDirection`
- Added model `AccessRuleProperties`
- Added model `AccessRulePropertiesSubscriptionsItem`
- Added model `AzureProxyResource`
- Added model `AzureResource`
- Added model `ContainerHostBatchBindMountEntry`
- Added enum `ContainerHostDataPath`
- Added enum `CreatedByType`
- Added model `ErrorAdditionalInfo`
- Added model `ErrorDetail`
- Added model `ErrorResponse`
- Added enum `IssueType`
- Added model `NetworkSecurityPerimeter`
- Added model `NetworkSecurityPerimeterConfiguration`
- Added model `NetworkSecurityPerimeterConfigurationListResult`
- Added model `NetworkSecurityPerimeterConfigurationProperties`
- Added enum `NetworkSecurityPerimeterConfigurationProvisioningState`
- Added model `NetworkSecurityProfile`
- Added model `ProvisioningIssue`
- Added model `ProvisioningIssueProperties`
- Added model `ResourceAssociation`
- Added enum `ResourceAssociationAccessMode`
- Added enum `SecurityEncryptionTypes`
- Added enum `SecurityTypes`
- Added enum `Severity`
- Added model `SystemData`
- Added model `VMDiskSecurityProfile`
- Added model `NetworkSecurityPerimeterOperations`

### Breaking Changes

- Model `DeploymentConfiguration` deleted or renamed its instance variable `cloud_service_configuration`
- Model `ProxyResource` deleted or renamed its instance variable `etag`
- Model `Resource` deleted or renamed its instance variable `location`
- Model `Resource` deleted or renamed its instance variable `tags`
- Deleted or renamed model `CloudServiceConfiguration`
- Deleted or renamed method `LocationOperations.list_supported_cloud_service_skus`

## 17.3.0 (2024-03-19)

### Features Added
Expand Down
10 changes: 5 additions & 5 deletions sdk/batch/azure-mgmt-batch/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "c577d8f27e0c3e5e4885134db19bc8193af7260c",
"commit": "1040c6b9bd69bf414c895f7bef87bfd470e90127",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.7",
"autorest": "3.10.2",
"use": [
"@autorest/python@6.7.1",
"@autorest/modelerfour@4.26.2"
"@autorest/python@6.19.0",
"@autorest/modelerfour@4.27.0"
],
"autorest_command": "autorest specification/batch/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False",
"autorest_command": "autorest specification/batch/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/batch/resource-manager/readme.md"
}
6 changes: 0 additions & 6 deletions sdk/batch/azure-mgmt-batch/assets.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@

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

from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy

from . import models as _models
from ._configuration import BatchManagementClientConfiguration
Expand All @@ -21,6 +24,7 @@
BatchAccountOperations,
CertificateOperations,
LocationOperations,
NetworkSecurityPerimeterOperations,
Operations,
PoolOperations,
PrivateEndpointConnectionOperations,
Expand Down Expand Up @@ -54,14 +58,17 @@ class BatchManagementClient: # pylint: disable=client-accepts-api-version-keywo
azure.mgmt.batch.operations.PrivateEndpointConnectionOperations
:ivar pool: PoolOperations operations
:vartype pool: azure.mgmt.batch.operations.PoolOperations
:ivar network_security_perimeter: NetworkSecurityPerimeterOperations operations
:vartype network_security_perimeter:
azure.mgmt.batch.operations.NetworkSecurityPerimeterOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
00000000-0000-0000-0000-000000000000). Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2024-02-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2024-07-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand All @@ -78,7 +85,25 @@ def __init__(
self._config = BatchManagementClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
policies.RequestIdPolicy(**kwargs),
self._config.headers_policy,
self._config.user_agent_policy,
self._config.proxy_policy,
policies.ContentDecodePolicy(**kwargs),
ARMAutoResourceProviderRegistrationPolicy(),
self._config.redirect_policy,
self._config.retry_policy,
self._config.authentication_policy,
self._config.custom_hook_policy,
self._config.logging_policy,
policies.DistributedTracingPolicy(**kwargs),
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
Expand All @@ -99,8 +124,11 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.pool = PoolOperations(self._client, self._config, self._serialize, self._deserialize)
self.network_security_perimeter = NetworkSecurityPerimeterOperations(
self._client, self._config, self._serialize, self._deserialize
)

def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
Expand All @@ -120,12 +148,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:

request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, **kwargs)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore

def close(self) -> None:
self._client.close()

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

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

from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

Expand All @@ -19,7 +18,7 @@
from azure.core.credentials import TokenCredential


class BatchManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
class BatchManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for BatchManagementClient.
Note that all parameters used to create this instance are saved as instance
Expand All @@ -30,14 +29,13 @@ class BatchManagementClientConfiguration(Configuration): # pylint: disable=too-
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
00000000-0000-0000-0000-000000000000). Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2024-02-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2024-07-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(BatchManagementClientConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop("api_version", "2024-02-01")
api_version: str = kwargs.pop("api_version", "2024-07-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-batch/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)

def _configure(self, **kwargs: Any) -> None:
Expand All @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None:
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(
Expand Down
1 change: 1 addition & 0 deletions sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#
# --------------------------------------------------------------------------


# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
Expand Down
Loading

0 comments on commit b6a47ab

Please sign in to comment.