Skip to content

Commit 25d36c4

Browse files
authored
code and test (Azure#25916)
Co-authored-by: PythonSdkPipelines <PythonSdkPipelines>
1 parent 4334655 commit 25d36c4

31 files changed

+5759
-2687
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Release History
22

3+
## 10.0.0 (2022-08-29)
4+
5+
### Features Added
6+
7+
- Added operation group SubnetServiceAssociationLinkOperations
8+
- Model IpAddress has a new parameter auto_generated_domain_name_label_scope
9+
- Model Usage has a new parameter id
10+
11+
### Breaking Changes
12+
13+
- Model IpAddress no longer has parameter dns_name_label_reuse_policy
14+
315
## 9.2.0 (2022-04-15)
416

517
**Features**
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.7.2",
2+
"autorest": "3.8.4",
33
"use": [
4-
"@autorest/python@5.12.0",
5-
"@autorest/modelerfour@4.19.3"
4+
"@autorest/python@6.0.1",
5+
"@autorest/modelerfour@4.23.5"
66
],
7-
"commit": "5dad3b83d0926768ede15ed41895d5f38defd512",
7+
"commit": "25fc6633c6feecfc01fd46f4926947f31d2e5945",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/containerinstance/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
9+
"autorest_command": "autorest specification/containerinstance/resource-manager/readme.md --models-mode=msrest --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.0.1 --use=@autorest/modelerfour@4.23.5 --version=3.8.4 --version-tolerant=False",
1010
"readme": "specification/containerinstance/resource-manager/readme.md"
1111
}

sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/__init__.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
13-
__all__ = ['ContainerInstanceManagementClient']
1413

15-
# `._patch.py` is used for handwritten extensions to the generated code
16-
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17-
from ._patch import patch_sdk
18-
patch_sdk()
14+
try:
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
17+
except ImportError:
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
21+
__all__ = ["ContainerInstanceManagementClient"]
22+
__all__.extend([p for p in _patch_all if p not in __all__])
23+
24+
_patch_sdk()

sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_configuration.py

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,50 +19,52 @@
1919
from azure.core.credentials import TokenCredential
2020

2121

22-
class ContainerInstanceManagementClientConfiguration(Configuration):
22+
class ContainerInstanceManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2323
"""Configuration for ContainerInstanceManagementClient.
2424
2525
Note that all parameters used to create this instance are saved as instance
2626
attributes.
2727
28-
:param credential: Credential needed for the client to connect to Azure.
28+
:param credential: Credential needed for the client to connect to Azure. Required.
2929
:type credential: ~azure.core.credentials.TokenCredential
30-
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
30+
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
31+
subscription. The subscription ID forms part of the URI for every service call. Required.
3132
:type subscription_id: str
33+
:keyword api_version: Api Version. Default value is "2021-10-01". Note that overriding this
34+
default value may result in unsupported behavior.
35+
:paramtype api_version: str
3236
"""
3337

34-
def __init__(
35-
self,
36-
credential: "TokenCredential",
37-
subscription_id: str,
38-
**kwargs: Any
39-
) -> None:
38+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
4039
super(ContainerInstanceManagementClientConfiguration, self).__init__(**kwargs)
40+
api_version = kwargs.pop("api_version", "2021-10-01") # type: str
41+
4142
if credential is None:
4243
raise ValueError("Parameter 'credential' must not be None.")
4344
if subscription_id is None:
4445
raise ValueError("Parameter 'subscription_id' must not be None.")
4546

4647
self.credential = credential
4748
self.subscription_id = subscription_id
48-
self.api_version = "2021-10-01"
49-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
50-
kwargs.setdefault('sdk_moniker', 'mgmt-containerinstance/{}'.format(VERSION))
49+
self.api_version = api_version
50+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
51+
kwargs.setdefault("sdk_moniker", "mgmt-containerinstance/{}".format(VERSION))
5152
self._configure(**kwargs)
5253

5354
def _configure(
54-
self,
55-
**kwargs # type: Any
55+
self, **kwargs # type: Any
5656
):
5757
# type: (...) -> None
58-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
59-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
60-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
61-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
62-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
63-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
64-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
65-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
66-
self.authentication_policy = kwargs.get('authentication_policy')
58+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
59+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
60+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
61+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
62+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
63+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
64+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
65+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
66+
self.authentication_policy = kwargs.get("authentication_policy")
6767
if self.credential and not self.authentication_policy:
68-
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
68+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
69+
self.credential, *self.credential_scopes, **kwargs
70+
)

sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_container_instance_management_client.py

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,28 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, Optional, TYPE_CHECKING
10+
from typing import Any, TYPE_CHECKING
1111

1212
from azure.core.rest import HttpRequest, HttpResponse
1313
from azure.mgmt.core import ARMPipelineClient
14-
from msrest import Deserializer, Serializer
1514

1615
from . import models
1716
from ._configuration import ContainerInstanceManagementClientConfiguration
18-
from .operations import ContainerGroupsOperations, ContainersOperations, LocationOperations, Operations
17+
from ._serialization import Deserializer, Serializer
18+
from .operations import (
19+
ContainerGroupsOperations,
20+
ContainersOperations,
21+
LocationOperations,
22+
Operations,
23+
SubnetServiceAssociationLinkOperations,
24+
)
1925

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

24-
class ContainerInstanceManagementClient:
30+
31+
class ContainerInstanceManagementClient: # pylint: disable=client-accepts-api-version-keyword
2532
"""ContainerInstanceManagementClient.
2633
2734
:ivar container_groups: ContainerGroupsOperations operations
@@ -32,13 +39,19 @@ class ContainerInstanceManagementClient:
3239
:vartype location: azure.mgmt.containerinstance.operations.LocationOperations
3340
:ivar containers: ContainersOperations operations
3441
:vartype containers: azure.mgmt.containerinstance.operations.ContainersOperations
35-
:param credential: Credential needed for the client to connect to Azure.
42+
:ivar subnet_service_association_link: SubnetServiceAssociationLinkOperations operations
43+
:vartype subnet_service_association_link:
44+
azure.mgmt.containerinstance.operations.SubnetServiceAssociationLinkOperations
45+
:param credential: Credential needed for the client to connect to Azure. Required.
3646
:type credential: ~azure.core.credentials.TokenCredential
3747
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
38-
subscription. The subscription ID forms part of the URI for every service call.
48+
subscription. The subscription ID forms part of the URI for every service call. Required.
3949
:type subscription_id: str
40-
:param base_url: Service URL. Default value is 'https://management.azure.com'.
50+
:param base_url: Service URL. Default value is "https://management.azure.com".
4151
:type base_url: str
52+
:keyword api_version: Api Version. Default value is "2021-10-01". Note that overriding this
53+
default value may result in unsupported behavior.
54+
:paramtype api_version: str
4255
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4356
Retry-After header is present.
4457
"""
@@ -50,24 +63,26 @@ def __init__(
5063
base_url: str = "https://management.azure.com",
5164
**kwargs: Any
5265
) -> None:
53-
self._config = ContainerInstanceManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
66+
self._config = ContainerInstanceManagementClientConfiguration(
67+
credential=credential, subscription_id=subscription_id, **kwargs
68+
)
5469
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
5570

5671
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
5772
self._serialize = Serializer(client_models)
5873
self._deserialize = Deserializer(client_models)
5974
self._serialize.client_side_validation = False
60-
self.container_groups = ContainerGroupsOperations(self._client, self._config, self._serialize, self._deserialize)
75+
self.container_groups = ContainerGroupsOperations(
76+
self._client, self._config, self._serialize, self._deserialize
77+
)
6178
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
6279
self.location = LocationOperations(self._client, self._config, self._serialize, self._deserialize)
6380
self.containers = ContainersOperations(self._client, self._config, self._serialize, self._deserialize)
81+
self.subnet_service_association_link = SubnetServiceAssociationLinkOperations(
82+
self._client, self._config, self._serialize, self._deserialize
83+
)
6484

65-
66-
def _send_request(
67-
self,
68-
request, # type: HttpRequest
69-
**kwargs: Any
70-
) -> HttpResponse:
85+
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
7186
"""Runs the network request through the client's chained policies.
7287
7388
>>> from azure.core.rest import HttpRequest
@@ -76,7 +91,7 @@ def _send_request(
7691
>>> response = client._send_request(request)
7792
<HttpResponse: 200 OK>
7893
79-
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
94+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
8095
8196
:param request: The network request you want to make. Required.
8297
:type request: ~azure.core.rest.HttpRequest

sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
# This file is used for handwritten extensions to the generated code. Example:
2929
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3030
def patch_sdk():
31-
pass
31+
pass

0 commit comments

Comments
 (0)