Skip to content

Commit eb5207e

Browse files
authored
[AutoPR] restapi_auto_containerregistry/resource-manager (#1935)
* Autorest.Python 2.1.35 + Profile support * [AutoPR containerregistry/resource-manager] add a copy image operation to Azure Container Registry (#2246) * Generated from ffa69db8536d9ae71c581f58d88431c514400035 add a copy image operation to Azure Container Registry - adds an operation to support copying a Docker image from one registry to another - supports copying to multiple places in the target registry - only one source and one target registry are supported * Generated from 4e6be6f7aaa5d702c6f96feccac22fe922cc51c9 add a copy image operation to Azure Container Registry - adds an operation to support copying a Docker image from one registry to another - supports copying to multiple places in the target registry - only one source and one target registry are supported * Generated from d3b9410a38ed23a3f681e823e368d13be5476911 add a copy image operation to Azure Container Registry - adds an operation to support copying a Docker image from one registry to another - supports copying to multiple places in the target registry - only one source and one target registry are supported * Generated from 57b80df533758c342479734ab4660ecffad4236e add a copy image operation to Azure Container Registry - adds an operation to support copying a Docker image from one registry to another - supports copying to multiple places in the target registry - only one source and one target registry are supported * Generated from 8c306b9774829c9683c09365e29ff4265e655bcf add a copy image operation to Azure Container Registry - adds an operation to support copying a Docker image from one registry to another - supports copying to multiple places in the target registry - only one source and one target registry are supported * Generated from 8c306b9774829c9683c09365e29ff4265e655bcf add a copy image operation to Azure Container Registry - adds an operation to support copying a Docker image from one registry to another - supports copying to multiple places in the target registry - only one source and one target registry are supported * Rebuild by #1935 * Use MultiAPISdk base class * Move doc link to docs.microsoft.com * Update version to v2.0.0 * Add tests (#2) * Test cases for build in python sdk * Add ContextManager to ACR client * Packaging
1 parent 9dfea4d commit eb5207e

File tree

263 files changed

+16816
-1908
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+16816
-1908
lines changed

azure-mgmt-containerregistry/HISTORY.rst

+38
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,44 @@
33
Release History
44
===============
55

6+
2.0.0 (2018-04-30)
7+
++++++++++++++++++
8+
9+
**Features**
10+
11+
- Support for build steps/taks (ApiVersion 2018-02-01-preview)
12+
- Support for Azure Profiles
13+
- Client class can be used as a context manager to keep the underlying HTTP session open for performance
14+
15+
**General Breaking changes**
16+
17+
This version uses a next-generation code generator that *might* introduce breaking changes.
18+
19+
- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments.
20+
To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments.
21+
- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered.
22+
While this is not a breaking change, the distinctions are important, and are documented here:
23+
https://docs.python.org/3/library/enum.html#others
24+
At a glance:
25+
26+
- "is" should not be used at all.
27+
- "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered.
28+
29+
- New Long Running Operation:
30+
31+
- Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same.
32+
- Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used.
33+
- The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`,
34+
without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`.
35+
- New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`,
36+
the response of the initial call will be returned without polling.
37+
- `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`.
38+
- `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away.
39+
40+
**Bugfixes**
41+
42+
- Compatibility of the sdist with wheel 0.31.0
43+
644
1.0.1 (2017-10-09)
745
++++++++++++++++++
846

azure-mgmt-containerregistry/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Usage
3737
=====
3838

3939
For code examples, see `Container Registry
40-
<https://azure-sdk-for-python.readthedocs.org/en/latest/sample_azure-mgmt-containerregistry.html>`__
40+
<https://docs.microsoft.com/python/api/overview/azure/container-registry>`__
4141
on readthedocs.org.
4242

4343

azure-mgmt-containerregistry/azure/mgmt/containerregistry/container_registry_management_client.py

+101-27
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from msrest.service_client import ServiceClient
12+
from msrest.service_client import SDKClient
1313
from msrest import Serializer, Deserializer
1414
from msrestazure import AzureConfiguration
15+
16+
from azure.profiles import KnownProfiles, ProfileDefinition
17+
from azure.profiles.multiapiclient import MultiApiClientMixin
1518
from .version import VERSION
1619

1720

@@ -47,7 +50,7 @@ def __init__(
4750
self.subscription_id = subscription_id
4851

4952

50-
class ContainerRegistryManagementClient(object):
53+
class ContainerRegistryManagementClient(MultiApiClientMixin, SDKClient):
5154
"""ContainerRegistryManagementClient
5255
5356
:ivar config: Configuration for client.
@@ -58,89 +61,160 @@ class ContainerRegistryManagementClient(object):
5861
object<msrestazure.azure_active_directory>`
5962
:param subscription_id: The Microsoft Azure subscription ID.
6063
:type subscription_id: str
64+
:param str api_version: API version to use if no profile is provided, or if
65+
missing in profile.
6166
:param str base_url: Service URL
62-
"""
67+
:param profile: A dict using operation group name to API version.
68+
:type profile: dict[str, str] """
6369

6470
DEFAULT_API_VERSION = '2017-10-01'
65-
66-
def __init__(
67-
self, credentials, subscription_id, api_version=DEFAULT_API_VERSION, base_url=None):
68-
71+
_PROFILE_TAG = "azure.mgmt.containerregistry.ContainerRegistryManagementClient"
72+
LATEST_PROFILE = ProfileDefinition({
73+
_PROFILE_TAG: {
74+
None: DEFAULT_API_VERSION
75+
}},
76+
_PROFILE_TAG + " latest"
77+
)
78+
79+
def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default):
6980
self.config = ContainerRegistryManagementClientConfiguration(credentials, subscription_id, base_url)
70-
self._client = ServiceClient(self.config.credentials, self.config)
71-
72-
client_models = {k: v for k, v in self.models(api_version).__dict__.items() if isinstance(v, type)}
73-
self.api_version = api_version
74-
self._serialize = Serializer(client_models)
75-
self._deserialize = Deserializer(client_models)
81+
super(ContainerRegistryManagementClient, self).__init__(
82+
credentials,
83+
self.config,
84+
api_version=api_version,
85+
profile=profile
86+
)
7687

7788
############ Generated from here ############
7889

90+
@classmethod
91+
def _models_dict(cls, api_version):
92+
return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}
93+
7994
@classmethod
8095
def models(cls, api_version=DEFAULT_API_VERSION):
8196
"""Module depends on the API version:
8297
8398
* 2017-03-01: :mod:`v2017_03_01.models<azure.mgmt.containerregistry.v2017_03_01.models>`
8499
* 2017-10-01: :mod:`v2017_10_01.models<azure.mgmt.containerregistry.v2017_10_01.models>`
100+
* 2018-02-01-preview: :mod:`v2018_02_01_preview.models<azure.mgmt.containerregistry.v2018_02_01_preview.models>`
85101
"""
86102
if api_version == '2017-03-01':
87103
from .v2017_03_01 import models
88104
return models
89105
elif api_version == '2017-10-01':
90106
from .v2017_10_01 import models
91107
return models
108+
elif api_version == '2018-02-01-preview':
109+
from .v2018_02_01_preview import models
110+
return models
92111
raise NotImplementedError("APIVersion {} is not available".format(api_version))
112+
113+
@property
114+
def build_steps(self):
115+
"""Instance depends on the API version:
116+
117+
* 2018-02-01-preview: :class:`BuildStepsOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.BuildStepsOperations>`
118+
"""
119+
api_version = self._get_api_version('build_steps')
120+
if api_version == '2018-02-01-preview':
121+
from .v2018_02_01_preview.operations import BuildStepsOperations as OperationClass
122+
else:
123+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
124+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
125+
126+
@property
127+
def build_tasks(self):
128+
"""Instance depends on the API version:
129+
130+
* 2018-02-01-preview: :class:`BuildTasksOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.BuildTasksOperations>`
131+
"""
132+
api_version = self._get_api_version('build_tasks')
133+
if api_version == '2018-02-01-preview':
134+
from .v2018_02_01_preview.operations import BuildTasksOperations as OperationClass
135+
else:
136+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
137+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
138+
139+
@property
140+
def builds(self):
141+
"""Instance depends on the API version:
142+
143+
* 2018-02-01-preview: :class:`BuildsOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.BuildsOperations>`
144+
"""
145+
api_version = self._get_api_version('builds')
146+
if api_version == '2018-02-01-preview':
147+
from .v2018_02_01_preview.operations import BuildsOperations as OperationClass
148+
else:
149+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
150+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
93151

94152
@property
95153
def operations(self):
96154
"""Instance depends on the API version:
97155
98156
* 2017-03-01: :class:`Operations<azure.mgmt.containerregistry.v2017_03_01.operations.Operations>`
99157
* 2017-10-01: :class:`Operations<azure.mgmt.containerregistry.v2017_10_01.operations.Operations>`
158+
* 2018-02-01-preview: :class:`Operations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.Operations>`
100159
"""
101-
if self.api_version == '2017-03-01':
160+
api_version = self._get_api_version('operations')
161+
if api_version == '2017-03-01':
102162
from .v2017_03_01.operations import Operations as OperationClass
103-
elif self.api_version == '2017-10-01':
163+
elif api_version == '2017-10-01':
104164
from .v2017_10_01.operations import Operations as OperationClass
165+
elif api_version == '2018-02-01-preview':
166+
from .v2018_02_01_preview.operations import Operations as OperationClass
105167
else:
106-
raise NotImplementedError("APIVersion {} is not available".format(self.api_version))
107-
return OperationClass(self._client, self.config, self._serialize, self._deserialize)
168+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
169+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
108170

109171
@property
110172
def registries(self):
111173
"""Instance depends on the API version:
112174
113175
* 2017-03-01: :class:`RegistriesOperations<azure.mgmt.containerregistry.v2017_03_01.operations.RegistriesOperations>`
114176
* 2017-10-01: :class:`RegistriesOperations<azure.mgmt.containerregistry.v2017_10_01.operations.RegistriesOperations>`
177+
* 2018-02-01-preview: :class:`RegistriesOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.RegistriesOperations>`
115178
"""
116-
if self.api_version == '2017-03-01':
179+
api_version = self._get_api_version('registries')
180+
if api_version == '2017-03-01':
117181
from .v2017_03_01.operations import RegistriesOperations as OperationClass
118-
elif self.api_version == '2017-10-01':
182+
elif api_version == '2017-10-01':
119183
from .v2017_10_01.operations import RegistriesOperations as OperationClass
184+
elif api_version == '2018-02-01-preview':
185+
from .v2018_02_01_preview.operations import RegistriesOperations as OperationClass
120186
else:
121-
raise NotImplementedError("APIVersion {} is not available".format(self.api_version))
122-
return OperationClass(self._client, self.config, self._serialize, self._deserialize)
187+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
188+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
123189

124190
@property
125191
def replications(self):
126192
"""Instance depends on the API version:
127193
128194
* 2017-10-01: :class:`ReplicationsOperations<azure.mgmt.containerregistry.v2017_10_01.operations.ReplicationsOperations>`
195+
* 2018-02-01-preview: :class:`ReplicationsOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.ReplicationsOperations>`
129196
"""
130-
if self.api_version == '2017-10-01':
197+
api_version = self._get_api_version('replications')
198+
if api_version == '2017-10-01':
131199
from .v2017_10_01.operations import ReplicationsOperations as OperationClass
200+
elif api_version == '2018-02-01-preview':
201+
from .v2018_02_01_preview.operations import ReplicationsOperations as OperationClass
132202
else:
133-
raise NotImplementedError("APIVersion {} is not available".format(self.api_version))
134-
return OperationClass(self._client, self.config, self._serialize, self._deserialize)
203+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
204+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
135205

136206
@property
137207
def webhooks(self):
138208
"""Instance depends on the API version:
139209
140210
* 2017-10-01: :class:`WebhooksOperations<azure.mgmt.containerregistry.v2017_10_01.operations.WebhooksOperations>`
211+
* 2018-02-01-preview: :class:`WebhooksOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.WebhooksOperations>`
141212
"""
142-
if self.api_version == '2017-10-01':
213+
api_version = self._get_api_version('webhooks')
214+
if api_version == '2017-10-01':
143215
from .v2017_10_01.operations import WebhooksOperations as OperationClass
216+
elif api_version == '2018-02-01-preview':
217+
from .v2018_02_01_preview.operations import WebhooksOperations as OperationClass
144218
else:
145-
raise NotImplementedError("APIVersion {} is not available".format(self.api_version))
146-
return OperationClass(self._client, self.config, self._serialize, self._deserialize)
219+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
220+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

0 commit comments

Comments
 (0)