Skip to content

Commit 4cab01f

Browse files
chenjianfei2017root
authored and
root
committed
release preview version of iothub
1 parent df727b3 commit 4cab01f

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

+22124
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Release History
2+
## 0.11.0 (package-preview-2019-07, package-preview-2019-03, package-2018-12-preview)
3+
- Add preview version
24

35
## 0.10.0 (2020-01-09)
46

sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/_iot_hub_client.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ def models(cls, api_version=DEFAULT_API_VERSION):
7777
* 2017-07-01: :mod:`v2017_07_01.models<azure.mgmt.iothub.v2017_07_01.models>`
7878
* 2018-01-22: :mod:`v2018_01_22.models<azure.mgmt.iothub.v2018_01_22.models>`
7979
* 2018-04-01: :mod:`v2018_04_01.models<azure.mgmt.iothub.v2018_04_01.models>`
80+
* 2018-12-01-preview: :mod:`v2018_12_01_preview.models<azure.mgmt.iothub.v2018_12_01_preview.models>`
8081
* 2019-03-22: :mod:`v2019_03_22.models<azure.mgmt.iothub.v2019_03_22.models>`
82+
* 2019-03-22-preview: :mod:`v2019_03_22_preview.models<azure.mgmt.iothub.v2019_03_22_preview.models>`
83+
* 2019-07-01-preview: :mod:`v2019_07_01_preview.models<azure.mgmt.iothub.v2019_07_01_preview.models>`
8184
* 2019-11-04: :mod:`v2019_11_04.models<azure.mgmt.iothub.v2019_11_04.models>`
8285
"""
8386
if api_version == '2016-02-03':
@@ -95,9 +98,18 @@ def models(cls, api_version=DEFAULT_API_VERSION):
9598
elif api_version == '2018-04-01':
9699
from .v2018_04_01 import models
97100
return models
101+
elif api_version == '2018-12-01-preview':
102+
from .v2018_12_01_preview import models
103+
return models
98104
elif api_version == '2019-03-22':
99105
from .v2019_03_22 import models
100106
return models
107+
elif api_version == '2019-03-22-preview':
108+
from .v2019_03_22_preview import models
109+
return models
110+
elif api_version == '2019-07-01-preview':
111+
from .v2019_07_01_preview import models
112+
return models
101113
elif api_version == '2019-11-04':
102114
from .v2019_11_04 import models
103115
return models
@@ -110,7 +122,10 @@ def certificates(self):
110122
* 2017-07-01: :class:`CertificatesOperations<azure.mgmt.iothub.v2017_07_01.operations.CertificatesOperations>`
111123
* 2018-01-22: :class:`CertificatesOperations<azure.mgmt.iothub.v2018_01_22.operations.CertificatesOperations>`
112124
* 2018-04-01: :class:`CertificatesOperations<azure.mgmt.iothub.v2018_04_01.operations.CertificatesOperations>`
125+
* 2018-12-01-preview: :class:`CertificatesOperations<azure.mgmt.iothub.v2018_12_01_preview.operations.CertificatesOperations>`
113126
* 2019-03-22: :class:`CertificatesOperations<azure.mgmt.iothub.v2019_03_22.operations.CertificatesOperations>`
127+
* 2019-03-22-preview: :class:`CertificatesOperations<azure.mgmt.iothub.v2019_03_22_preview.operations.CertificatesOperations>`
128+
* 2019-07-01-preview: :class:`CertificatesOperations<azure.mgmt.iothub.v2019_07_01_preview.operations.CertificatesOperations>`
114129
* 2019-11-04: :class:`CertificatesOperations<azure.mgmt.iothub.v2019_11_04.operations.CertificatesOperations>`
115130
"""
116131
api_version = self._get_api_version('certificates')
@@ -120,8 +135,14 @@ def certificates(self):
120135
from .v2018_01_22.operations import CertificatesOperations as OperationClass
121136
elif api_version == '2018-04-01':
122137
from .v2018_04_01.operations import CertificatesOperations as OperationClass
138+
elif api_version == '2018-12-01-preview':
139+
from .v2018_12_01_preview.operations import CertificatesOperations as OperationClass
123140
elif api_version == '2019-03-22':
124141
from .v2019_03_22.operations import CertificatesOperations as OperationClass
142+
elif api_version == '2019-03-22-preview':
143+
from .v2019_03_22_preview.operations import CertificatesOperations as OperationClass
144+
elif api_version == '2019-07-01-preview':
145+
from .v2019_07_01_preview.operations import CertificatesOperations as OperationClass
125146
elif api_version == '2019-11-04':
126147
from .v2019_11_04.operations import CertificatesOperations as OperationClass
127148
else:
@@ -133,11 +154,17 @@ def iot_hub(self):
133154
"""Instance depends on the API version:
134155
135156
* 2019-03-22: :class:`IotHubOperations<azure.mgmt.iothub.v2019_03_22.operations.IotHubOperations>`
157+
* 2019-03-22-preview: :class:`IotHubOperations<azure.mgmt.iothub.v2019_03_22_preview.operations.IotHubOperations>`
158+
* 2019-07-01-preview: :class:`IotHubOperations<azure.mgmt.iothub.v2019_07_01_preview.operations.IotHubOperations>`
136159
* 2019-11-04: :class:`IotHubOperations<azure.mgmt.iothub.v2019_11_04.operations.IotHubOperations>`
137160
"""
138161
api_version = self._get_api_version('iot_hub')
139162
if api_version == '2019-03-22':
140163
from .v2019_03_22.operations import IotHubOperations as OperationClass
164+
elif api_version == '2019-03-22-preview':
165+
from .v2019_03_22_preview.operations import IotHubOperations as OperationClass
166+
elif api_version == '2019-07-01-preview':
167+
from .v2019_07_01_preview.operations import IotHubOperations as OperationClass
141168
elif api_version == '2019-11-04':
142169
from .v2019_11_04.operations import IotHubOperations as OperationClass
143170
else:
@@ -153,7 +180,10 @@ def iot_hub_resource(self):
153180
* 2017-07-01: :class:`IotHubResourceOperations<azure.mgmt.iothub.v2017_07_01.operations.IotHubResourceOperations>`
154181
* 2018-01-22: :class:`IotHubResourceOperations<azure.mgmt.iothub.v2018_01_22.operations.IotHubResourceOperations>`
155182
* 2018-04-01: :class:`IotHubResourceOperations<azure.mgmt.iothub.v2018_04_01.operations.IotHubResourceOperations>`
183+
* 2018-12-01-preview: :class:`IotHubResourceOperations<azure.mgmt.iothub.v2018_12_01_preview.operations.IotHubResourceOperations>`
156184
* 2019-03-22: :class:`IotHubResourceOperations<azure.mgmt.iothub.v2019_03_22.operations.IotHubResourceOperations>`
185+
* 2019-03-22-preview: :class:`IotHubResourceOperations<azure.mgmt.iothub.v2019_03_22_preview.operations.IotHubResourceOperations>`
186+
* 2019-07-01-preview: :class:`IotHubResourceOperations<azure.mgmt.iothub.v2019_07_01_preview.operations.IotHubResourceOperations>`
157187
* 2019-11-04: :class:`IotHubResourceOperations<azure.mgmt.iothub.v2019_11_04.operations.IotHubResourceOperations>`
158188
"""
159189
api_version = self._get_api_version('iot_hub_resource')
@@ -167,8 +197,14 @@ def iot_hub_resource(self):
167197
from .v2018_01_22.operations import IotHubResourceOperations as OperationClass
168198
elif api_version == '2018-04-01':
169199
from .v2018_04_01.operations import IotHubResourceOperations as OperationClass
200+
elif api_version == '2018-12-01-preview':
201+
from .v2018_12_01_preview.operations import IotHubResourceOperations as OperationClass
170202
elif api_version == '2019-03-22':
171203
from .v2019_03_22.operations import IotHubResourceOperations as OperationClass
204+
elif api_version == '2019-03-22-preview':
205+
from .v2019_03_22_preview.operations import IotHubResourceOperations as OperationClass
206+
elif api_version == '2019-07-01-preview':
207+
from .v2019_07_01_preview.operations import IotHubResourceOperations as OperationClass
172208
elif api_version == '2019-11-04':
173209
from .v2019_11_04.operations import IotHubResourceOperations as OperationClass
174210
else:
@@ -182,7 +218,10 @@ def operations(self):
182218
* 2017-07-01: :class:`Operations<azure.mgmt.iothub.v2017_07_01.operations.Operations>`
183219
* 2018-01-22: :class:`Operations<azure.mgmt.iothub.v2018_01_22.operations.Operations>`
184220
* 2018-04-01: :class:`Operations<azure.mgmt.iothub.v2018_04_01.operations.Operations>`
221+
* 2018-12-01-preview: :class:`Operations<azure.mgmt.iothub.v2018_12_01_preview.operations.Operations>`
185222
* 2019-03-22: :class:`Operations<azure.mgmt.iothub.v2019_03_22.operations.Operations>`
223+
* 2019-03-22-preview: :class:`Operations<azure.mgmt.iothub.v2019_03_22_preview.operations.Operations>`
224+
* 2019-07-01-preview: :class:`Operations<azure.mgmt.iothub.v2019_07_01_preview.operations.Operations>`
186225
* 2019-11-04: :class:`Operations<azure.mgmt.iothub.v2019_11_04.operations.Operations>`
187226
"""
188227
api_version = self._get_api_version('operations')
@@ -192,8 +231,14 @@ def operations(self):
192231
from .v2018_01_22.operations import Operations as OperationClass
193232
elif api_version == '2018-04-01':
194233
from .v2018_04_01.operations import Operations as OperationClass
234+
elif api_version == '2018-12-01-preview':
235+
from .v2018_12_01_preview.operations import Operations as OperationClass
195236
elif api_version == '2019-03-22':
196237
from .v2019_03_22.operations import Operations as OperationClass
238+
elif api_version == '2019-03-22-preview':
239+
from .v2019_03_22_preview.operations import Operations as OperationClass
240+
elif api_version == '2019-07-01-preview':
241+
from .v2019_07_01_preview.operations import Operations as OperationClass
197242
elif api_version == '2019-11-04':
198243
from .v2019_11_04.operations import Operations as OperationClass
199244
else:
@@ -205,14 +250,23 @@ def resource_provider_common(self):
205250
"""Instance depends on the API version:
206251
207252
* 2018-04-01: :class:`ResourceProviderCommonOperations<azure.mgmt.iothub.v2018_04_01.operations.ResourceProviderCommonOperations>`
253+
* 2018-12-01-preview: :class:`ResourceProviderCommonOperations<azure.mgmt.iothub.v2018_12_01_preview.operations.ResourceProviderCommonOperations>`
208254
* 2019-03-22: :class:`ResourceProviderCommonOperations<azure.mgmt.iothub.v2019_03_22.operations.ResourceProviderCommonOperations>`
255+
* 2019-03-22-preview: :class:`ResourceProviderCommonOperations<azure.mgmt.iothub.v2019_03_22_preview.operations.ResourceProviderCommonOperations>`
256+
* 2019-07-01-preview: :class:`ResourceProviderCommonOperations<azure.mgmt.iothub.v2019_07_01_preview.operations.ResourceProviderCommonOperations>`
209257
* 2019-11-04: :class:`ResourceProviderCommonOperations<azure.mgmt.iothub.v2019_11_04.operations.ResourceProviderCommonOperations>`
210258
"""
211259
api_version = self._get_api_version('resource_provider_common')
212260
if api_version == '2018-04-01':
213261
from .v2018_04_01.operations import ResourceProviderCommonOperations as OperationClass
262+
elif api_version == '2018-12-01-preview':
263+
from .v2018_12_01_preview.operations import ResourceProviderCommonOperations as OperationClass
214264
elif api_version == '2019-03-22':
215265
from .v2019_03_22.operations import ResourceProviderCommonOperations as OperationClass
266+
elif api_version == '2019-03-22-preview':
267+
from .v2019_03_22_preview.operations import ResourceProviderCommonOperations as OperationClass
268+
elif api_version == '2019-07-01-preview':
269+
from .v2019_07_01_preview.operations import ResourceProviderCommonOperations as OperationClass
216270
elif api_version == '2019-11-04':
217271
from .v2019_11_04.operations import ResourceProviderCommonOperations as OperationClass
218272
else:
Lines changed: 19 additions & 0 deletions
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 IotHubClientConfiguration
13+
from ._iot_hub_client import IotHubClient
14+
__all__ = ['IotHubClient', 'IotHubClientConfiguration']
15+
16+
from .version import VERSION
17+
18+
__version__ = VERSION
19+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
from msrestazure import AzureConfiguration
12+
13+
from .version import VERSION
14+
15+
16+
class IotHubClientConfiguration(AzureConfiguration):
17+
"""Configuration for IotHubClient
18+
Note that all parameters used to create this instance are saved as instance
19+
attributes.
20+
21+
:param credentials: Credentials needed for the client to connect to Azure.
22+
:type credentials: :mod:`A msrestazure Credentials
23+
object<msrestazure.azure_active_directory>`
24+
:param subscription_id: The subscription identifier.
25+
:type subscription_id: str
26+
:param str base_url: Service URL
27+
"""
28+
29+
def __init__(
30+
self, credentials, subscription_id, base_url=None):
31+
32+
if credentials is None:
33+
raise ValueError("Parameter 'credentials' must not be None.")
34+
if subscription_id is None:
35+
raise ValueError("Parameter 'subscription_id' must not be None.")
36+
if not base_url:
37+
base_url = 'https://management.azure.com'
38+
39+
super(IotHubClientConfiguration, self).__init__(base_url)
40+
41+
# Starting Autorest.Python 4.0.64, make connection pool activated by default
42+
self.keep_alive = True
43+
44+
self.add_user_agent('azure-mgmt-iothub/{}'.format(VERSION))
45+
self.add_user_agent('Azure-SDK-For-Python')
46+
47+
self.credentials = credentials
48+
self.subscription_id = subscription_id
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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 msrest.service_client import SDKClient
13+
from msrest import Serializer, Deserializer
14+
15+
from ._configuration import IotHubClientConfiguration
16+
from .operations import Operations
17+
from .operations import IotHubResourceOperations
18+
from .operations import ResourceProviderCommonOperations
19+
from .operations import CertificatesOperations
20+
from . import models
21+
22+
23+
class IotHubClient(SDKClient):
24+
"""Use this API to manage the IoT hubs in your Azure subscription.
25+
26+
:ivar config: Configuration for client.
27+
:vartype config: IotHubClientConfiguration
28+
29+
:ivar operations: Operations operations
30+
:vartype operations: azure.mgmt.iothub.operations.Operations
31+
:ivar iot_hub_resource: IotHubResource operations
32+
:vartype iot_hub_resource: azure.mgmt.iothub.operations.IotHubResourceOperations
33+
:ivar resource_provider_common: ResourceProviderCommon operations
34+
:vartype resource_provider_common: azure.mgmt.iothub.operations.ResourceProviderCommonOperations
35+
:ivar certificates: Certificates operations
36+
:vartype certificates: azure.mgmt.iothub.operations.CertificatesOperations
37+
38+
:param credentials: Credentials needed for the client to connect to Azure.
39+
:type credentials: :mod:`A msrestazure Credentials
40+
object<msrestazure.azure_active_directory>`
41+
:param subscription_id: The subscription identifier.
42+
:type subscription_id: str
43+
:param str base_url: Service URL
44+
"""
45+
46+
def __init__(
47+
self, credentials, subscription_id, base_url=None):
48+
49+
self.config = IotHubClientConfiguration(credentials, subscription_id, base_url)
50+
super(IotHubClient, self).__init__(self.config.credentials, self.config)
51+
52+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
53+
self.api_version = '2018-12-01-preview'
54+
self._serialize = Serializer(client_models)
55+
self._deserialize = Deserializer(client_models)
56+
57+
self.operations = Operations(
58+
self._client, self.config, self._serialize, self._deserialize)
59+
self.iot_hub_resource = IotHubResourceOperations(
60+
self._client, self.config, self._serialize, self._deserialize)
61+
self.resource_provider_common = ResourceProviderCommonOperations(
62+
self._client, self.config, self._serialize, self._deserialize)
63+
self.certificates = CertificatesOperations(
64+
self._client, self.config, self._serialize, self._deserialize)

0 commit comments

Comments
 (0)