Skip to content

Commit 52bdd94

Browse files
shawncxmsxichen
andauthored
Release sdk 667 (Azure#13166)
* release for appplatform * fix comment * update test Co-authored-by: xichen <[email protected]>
1 parent b23c203 commit 52bdd94

Some content is hidden

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

46 files changed

+15119
-701
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release History
22

3+
## 1.0.0 (2020-08-25)
4+
5+
- Initial API version Release
6+
37
## 0.1.0 (2019-10-25)
48

59
- Additional pre-release API changes

sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_app_platform_management_client.py

+216-38
Original file line numberDiff line numberDiff line change
@@ -12,60 +12,238 @@
1212
from msrest.service_client import SDKClient
1313
from msrest import Serializer, Deserializer
1414

15+
from azure.profiles import KnownProfiles, ProfileDefinition
16+
from azure.profiles.multiapiclient import MultiApiClientMixin
1517
from ._configuration import AppPlatformManagementClientConfiguration
16-
from .operations import ServicesOperations
17-
from .operations import AppsOperations
18-
from .operations import BindingsOperations
19-
from .operations import DeploymentsOperations
20-
from .operations import Operations
21-
from . import models
2218

2319

24-
class AppPlatformManagementClient(SDKClient):
20+
21+
class AppPlatformManagementClient(MultiApiClientMixin, SDKClient):
2522
"""REST API for Azure Spring Cloud
2623
24+
This ready contains multiple API versions, to help you deal with all Azure clouds
25+
(Azure Stack, Azure Government, Azure China, etc.).
26+
By default, uses latest API version available on public Azure.
27+
For production, you should stick a particular api-version and/or profile.
28+
The profile sets a mapping between the operation group and an API version.
29+
The api-version parameter sets the default API version if the operation
30+
group is not described in the profile.
31+
2732
:ivar config: Configuration for client.
2833
:vartype config: AppPlatformManagementClientConfiguration
2934
30-
:ivar services: Services operations
31-
:vartype services: azure.mgmt.appplatform.operations.ServicesOperations
32-
:ivar apps: Apps operations
33-
:vartype apps: azure.mgmt.appplatform.operations.AppsOperations
34-
:ivar bindings: Bindings operations
35-
:vartype bindings: azure.mgmt.appplatform.operations.BindingsOperations
36-
:ivar deployments: Deployments operations
37-
:vartype deployments: azure.mgmt.appplatform.operations.DeploymentsOperations
38-
:ivar operations: Operations operations
39-
:vartype operations: azure.mgmt.appplatform.operations.Operations
40-
4135
:param credentials: Credentials needed for the client to connect to Azure.
4236
:type credentials: :mod:`A msrestazure Credentials
4337
object<msrestazure.azure_active_directory>`
44-
:param subscription_id: Gets subscription ID which uniquely identify the
38+
:param subscription_id: Subscription credentials which uniquely identify
4539
Microsoft Azure subscription. The subscription ID forms part of the URI
4640
for every service call.
4741
:type subscription_id: str
42+
:param str api_version: API version to use if no profile is provided, or if
43+
missing in profile.
4844
:param str base_url: Service URL
45+
:param profile: A profile definition, from KnownProfiles to dict.
46+
:type profile: azure.profiles.KnownProfiles
4947
"""
5048

51-
def __init__(
52-
self, credentials, subscription_id, base_url=None):
49+
DEFAULT_API_VERSION = '2020-07-01'
50+
_PROFILE_TAG = "azure.mgmt.appplatform.AppPlatformManagementClient"
51+
LATEST_PROFILE = ProfileDefinition({
52+
_PROFILE_TAG: {
53+
None: DEFAULT_API_VERSION,
54+
'sku': '2019-05-01-preview',
55+
}},
56+
_PROFILE_TAG + " latest"
57+
)
5358

59+
def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default):
5460
self.config = AppPlatformManagementClientConfiguration(credentials, subscription_id, base_url)
55-
super(AppPlatformManagementClient, self).__init__(self.config.credentials, self.config)
56-
57-
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
58-
self.api_version = '2019-05-01-preview'
59-
self._serialize = Serializer(client_models)
60-
self._deserialize = Deserializer(client_models)
61-
62-
self.services = ServicesOperations(
63-
self._client, self.config, self._serialize, self._deserialize)
64-
self.apps = AppsOperations(
65-
self._client, self.config, self._serialize, self._deserialize)
66-
self.bindings = BindingsOperations(
67-
self._client, self.config, self._serialize, self._deserialize)
68-
self.deployments = DeploymentsOperations(
69-
self._client, self.config, self._serialize, self._deserialize)
70-
self.operations = Operations(
71-
self._client, self.config, self._serialize, self._deserialize)
61+
super(AppPlatformManagementClient, self).__init__(
62+
credentials,
63+
self.config,
64+
api_version=api_version,
65+
profile=profile
66+
)
67+
68+
@classmethod
69+
def _models_dict(cls, api_version):
70+
return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}
71+
72+
@classmethod
73+
def models(cls, api_version=DEFAULT_API_VERSION):
74+
"""Module depends on the API version:
75+
76+
* 2019-05-01-preview: :mod:`v2019_05_01_preview.models<azure.mgmt.appplatform.v2019_05_01_preview.models>`
77+
* 2020-07-01: :mod:`v2020_07_01.models<azure.mgmt.appplatform.v2020_07_01.models>`
78+
"""
79+
if api_version == '2019-05-01-preview':
80+
from .v2019_05_01_preview import models
81+
return models
82+
elif api_version == '2020-07-01':
83+
from .v2020_07_01 import models
84+
return models
85+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
86+
87+
@property
88+
def apps(self):
89+
"""Instance depends on the API version:
90+
91+
* 2019-05-01-preview: :class:`AppsOperations<azure.mgmt.appplatform.v2019_05_01_preview.operations.AppsOperations>`
92+
* 2020-07-01: :class:`AppsOperations<azure.mgmt.appplatform.v2020_07_01.operations.AppsOperations>`
93+
"""
94+
api_version = self._get_api_version('apps')
95+
if api_version == '2019-05-01-preview':
96+
from .v2019_05_01_preview.operations import AppsOperations as OperationClass
97+
elif api_version == '2020-07-01':
98+
from .v2020_07_01.operations import AppsOperations as OperationClass
99+
else:
100+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
101+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
102+
103+
@property
104+
def bindings(self):
105+
"""Instance depends on the API version:
106+
107+
* 2019-05-01-preview: :class:`BindingsOperations<azure.mgmt.appplatform.v2019_05_01_preview.operations.BindingsOperations>`
108+
* 2020-07-01: :class:`BindingsOperations<azure.mgmt.appplatform.v2020_07_01.operations.BindingsOperations>`
109+
"""
110+
api_version = self._get_api_version('bindings')
111+
if api_version == '2019-05-01-preview':
112+
from .v2019_05_01_preview.operations import BindingsOperations as OperationClass
113+
elif api_version == '2020-07-01':
114+
from .v2020_07_01.operations import BindingsOperations as OperationClass
115+
else:
116+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
117+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
118+
119+
@property
120+
def certificates(self):
121+
"""Instance depends on the API version:
122+
123+
* 2019-05-01-preview: :class:`CertificatesOperations<azure.mgmt.appplatform.v2019_05_01_preview.operations.CertificatesOperations>`
124+
* 2020-07-01: :class:`CertificatesOperations<azure.mgmt.appplatform.v2020_07_01.operations.CertificatesOperations>`
125+
"""
126+
api_version = self._get_api_version('certificates')
127+
if api_version == '2019-05-01-preview':
128+
from .v2019_05_01_preview.operations import CertificatesOperations as OperationClass
129+
elif api_version == '2020-07-01':
130+
from .v2020_07_01.operations import CertificatesOperations as OperationClass
131+
else:
132+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
133+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
134+
135+
@property
136+
def config_servers(self):
137+
"""Instance depends on the API version:
138+
139+
* 2020-07-01: :class:`ConfigServersOperations<azure.mgmt.appplatform.v2020_07_01.operations.ConfigServersOperations>`
140+
"""
141+
api_version = self._get_api_version('config_servers')
142+
if api_version == '2020-07-01':
143+
from .v2020_07_01.operations import ConfigServersOperations as OperationClass
144+
else:
145+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
146+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
147+
148+
@property
149+
def custom_domains(self):
150+
"""Instance depends on the API version:
151+
152+
* 2019-05-01-preview: :class:`CustomDomainsOperations<azure.mgmt.appplatform.v2019_05_01_preview.operations.CustomDomainsOperations>`
153+
* 2020-07-01: :class:`CustomDomainsOperations<azure.mgmt.appplatform.v2020_07_01.operations.CustomDomainsOperations>`
154+
"""
155+
api_version = self._get_api_version('custom_domains')
156+
if api_version == '2019-05-01-preview':
157+
from .v2019_05_01_preview.operations import CustomDomainsOperations as OperationClass
158+
elif api_version == '2020-07-01':
159+
from .v2020_07_01.operations import CustomDomainsOperations as OperationClass
160+
else:
161+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
162+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
163+
164+
@property
165+
def deployments(self):
166+
"""Instance depends on the API version:
167+
168+
* 2019-05-01-preview: :class:`DeploymentsOperations<azure.mgmt.appplatform.v2019_05_01_preview.operations.DeploymentsOperations>`
169+
* 2020-07-01: :class:`DeploymentsOperations<azure.mgmt.appplatform.v2020_07_01.operations.DeploymentsOperations>`
170+
"""
171+
api_version = self._get_api_version('deployments')
172+
if api_version == '2019-05-01-preview':
173+
from .v2019_05_01_preview.operations import DeploymentsOperations as OperationClass
174+
elif api_version == '2020-07-01':
175+
from .v2020_07_01.operations import DeploymentsOperations as OperationClass
176+
else:
177+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
178+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
179+
180+
@property
181+
def monitoring_settings(self):
182+
"""Instance depends on the API version:
183+
184+
* 2020-07-01: :class:`MonitoringSettingsOperations<azure.mgmt.appplatform.v2020_07_01.operations.MonitoringSettingsOperations>`
185+
"""
186+
api_version = self._get_api_version('monitoring_settings')
187+
if api_version == '2020-07-01':
188+
from .v2020_07_01.operations import MonitoringSettingsOperations as OperationClass
189+
else:
190+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
191+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
192+
193+
@property
194+
def operations(self):
195+
"""Instance depends on the API version:
196+
197+
* 2019-05-01-preview: :class:`Operations<azure.mgmt.appplatform.v2019_05_01_preview.operations.Operations>`
198+
* 2020-07-01: :class:`Operations<azure.mgmt.appplatform.v2020_07_01.operations.Operations>`
199+
"""
200+
api_version = self._get_api_version('operations')
201+
if api_version == '2019-05-01-preview':
202+
from .v2019_05_01_preview.operations import Operations as OperationClass
203+
elif api_version == '2020-07-01':
204+
from .v2020_07_01.operations import Operations as OperationClass
205+
else:
206+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
207+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
208+
209+
@property
210+
def services(self):
211+
"""Instance depends on the API version:
212+
213+
* 2019-05-01-preview: :class:`ServicesOperations<azure.mgmt.appplatform.v2019_05_01_preview.operations.ServicesOperations>`
214+
* 2020-07-01: :class:`ServicesOperations<azure.mgmt.appplatform.v2020_07_01.operations.ServicesOperations>`
215+
"""
216+
api_version = self._get_api_version('services')
217+
if api_version == '2019-05-01-preview':
218+
from .v2019_05_01_preview.operations import ServicesOperations as OperationClass
219+
elif api_version == '2020-07-01':
220+
from .v2020_07_01.operations import ServicesOperations as OperationClass
221+
else:
222+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
223+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
224+
225+
@property
226+
def sku(self):
227+
"""Instance depends on the API version:
228+
229+
* 2019-05-01-preview: :class:`SkuOperations<azure.mgmt.appplatform.v2019_05_01_preview.operations.SkuOperations>`
230+
"""
231+
api_version = self._get_api_version('sku')
232+
if api_version == '2019-05-01-preview':
233+
from .v2019_05_01_preview.operations import SkuOperations as OperationClass
234+
else:
235+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
236+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
237+
238+
@property
239+
def skus(self):
240+
"""Instance depends on the API version:
241+
242+
* 2020-07-01: :class:`SkusOperations<azure.mgmt.appplatform.v2020_07_01.operations.SkusOperations>`
243+
"""
244+
api_version = self._get_api_version('skus')
245+
if api_version == '2020-07-01':
246+
from .v2020_07_01.operations import SkusOperations as OperationClass
247+
else:
248+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
249+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
# --------------------------------------------------------------------------
7+
from .v2019_05_01_preview.models import *
8+
from .v2020_07_01.models import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from ._configuration import AppPlatformManagementClientConfiguration
13+
from ._app_platform_management_client import AppPlatformManagementClient
14+
__all__ = ['AppPlatformManagementClient', 'AppPlatformManagementClientConfiguration']
15+
16+
from .version import VERSION
17+
18+
__version__ = VERSION
19+

0 commit comments

Comments
 (0)