Skip to content

Commit df0e798

Browse files
emgartenlmazuel
authored andcommitted
IoT Central ARM SDK (#2937)
* Generated from a4006792c97fe0c9c295a03aadf25284b03922f1 (#2672) Add specs for Microsoft.IoTCentral RP Merge from private repo. PR: Azure/azure-rest-api-specs-pr#472 * Generated from a40cc7c2f4f8e9140546f47683c1fcb9b74f5442 (#2693) Remove subscriptionId uuid format for IotCentral * Packaging for IoTCentral * Add IoT Central tests
1 parent 5081613 commit df0e798

39 files changed

+2357
-0
lines changed

azure-mgmt-iotcentral/HISTORY.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. :changelog:
2+
3+
Release History
4+
===============
5+
6+
0.1.0 (2018-07-16)
7+
++++++++++++++++++
8+
9+
* Initial Release with support for 2017-07-01-privatepreview

azure-mgmt-iotcentral/MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include *.rst
2+
include azure_bdist_wheel.py

azure-mgmt-iotcentral/README.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Microsoft Azure SDK for Python
2+
==============================
3+
4+
This is the Microsoft Azure IoTCentral Management Client Library.
5+
6+
Azure Resource Manager (ARM) is the next generation of management APIs that
7+
replace the old Azure Service Management (ASM).
8+
9+
This package has been tested with Python 2.7, 3.4, 3.5 and 3.6.
10+
11+
For the older Azure Service Management (ASM) libraries, see
12+
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
13+
14+
For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.
15+
16+
17+
Compatibility
18+
=============
19+
20+
**IMPORTANT**: If you have an earlier version of the azure package
21+
(version < 1.0), you should uninstall it before installing this package.
22+
23+
You can check the version using pip:
24+
25+
.. code:: shell
26+
27+
pip freeze
28+
29+
If you see azure==0.11.0 (or any version below 1.0), uninstall it first:
30+
31+
.. code:: shell
32+
33+
pip uninstall azure
34+
35+
36+
Usage
37+
=====
38+
39+
For code examples, see `IoTCentral Management
40+
<https://docs.microsoft.com/python/api/overview/azure/>`__
41+
on docs.microsoft.com.
42+
43+
44+
Provide Feedback
45+
================
46+
47+
If you encounter any bugs or have suggestions, please file an issue in the
48+
`Issues <https://github.com/Azure/azure-sdk-for-python/issues>`__
49+
section of the project.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__import__('pkg_resources').declare_namespace(__name__)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__import__('pkg_resources').declare_namespace(__name__)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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 .iot_central_client import IotCentralClient
13+
from .version import VERSION
14+
15+
__all__ = ['IotCentralClient']
16+
17+
__version__ = VERSION
18+
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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+
from msrestazure import AzureConfiguration
15+
from .version import VERSION
16+
from .operations.apps_operations import AppsOperations
17+
from .operations.operations import Operations
18+
from . import models
19+
20+
21+
class IotCentralClientConfiguration(AzureConfiguration):
22+
"""Configuration for IotCentralClient
23+
Note that all parameters used to create this instance are saved as instance
24+
attributes.
25+
26+
:param credentials: Credentials needed for the client to connect to Azure.
27+
:type credentials: :mod:`A msrestazure Credentials
28+
object<msrestazure.azure_active_directory>`
29+
:param subscription_id: The subscription identifier.
30+
:type subscription_id: str
31+
:param str base_url: Service URL
32+
"""
33+
34+
def __init__(
35+
self, credentials, subscription_id, base_url=None):
36+
37+
if credentials is None:
38+
raise ValueError("Parameter 'credentials' must not be None.")
39+
if subscription_id is None:
40+
raise ValueError("Parameter 'subscription_id' must not be None.")
41+
if not base_url:
42+
base_url = 'https://management.azure.com'
43+
44+
super(IotCentralClientConfiguration, self).__init__(base_url)
45+
46+
self.add_user_agent('azure-mgmt-iotcentral/{}'.format(VERSION))
47+
self.add_user_agent('Azure-SDK-For-Python')
48+
49+
self.credentials = credentials
50+
self.subscription_id = subscription_id
51+
52+
53+
class IotCentralClient(SDKClient):
54+
"""Use this API to manage IoT Central Applications in your Azure subscription.
55+
56+
:ivar config: Configuration for client.
57+
:vartype config: IotCentralClientConfiguration
58+
59+
:ivar apps: Apps operations
60+
:vartype apps: azure.mgmt.iotcentral.operations.AppsOperations
61+
:ivar operations: Operations operations
62+
:vartype operations: azure.mgmt.iotcentral.operations.Operations
63+
64+
:param credentials: Credentials needed for the client to connect to Azure.
65+
:type credentials: :mod:`A msrestazure Credentials
66+
object<msrestazure.azure_active_directory>`
67+
:param subscription_id: The subscription identifier.
68+
:type subscription_id: str
69+
:param str base_url: Service URL
70+
"""
71+
72+
def __init__(
73+
self, credentials, subscription_id, base_url=None):
74+
75+
self.config = IotCentralClientConfiguration(credentials, subscription_id, base_url)
76+
super(IotCentralClient, self).__init__(self.config.credentials, self.config)
77+
78+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
79+
self.api_version = '2017-07-01-privatepreview'
80+
self._serialize = Serializer(client_models)
81+
self._deserialize = Deserializer(client_models)
82+
83+
self.apps = AppsOperations(
84+
self._client, self.config, self._serialize, self._deserialize)
85+
self.operations = Operations(
86+
self._client, self.config, self._serialize, self._deserialize)
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
try:
13+
from .app_sku_info_py3 import AppSkuInfo
14+
from .app_py3 import App
15+
from .app_patch_py3 import AppPatch
16+
from .resource_py3 import Resource
17+
from .error_details_py3 import ErrorDetails, ErrorDetailsException
18+
from .operation_display_py3 import OperationDisplay
19+
from .operation_py3 import Operation
20+
from .operation_inputs_py3 import OperationInputs
21+
from .app_name_availability_info_py3 import AppNameAvailabilityInfo
22+
except (SyntaxError, ImportError):
23+
from .app_sku_info import AppSkuInfo
24+
from .app import App
25+
from .app_patch import AppPatch
26+
from .resource import Resource
27+
from .error_details import ErrorDetails, ErrorDetailsException
28+
from .operation_display import OperationDisplay
29+
from .operation import Operation
30+
from .operation_inputs import OperationInputs
31+
from .app_name_availability_info import AppNameAvailabilityInfo
32+
from .app_paged import AppPaged
33+
from .operation_paged import OperationPaged
34+
from .iot_central_client_enums import (
35+
AppSku,
36+
AppNameUnavailabilityReason,
37+
)
38+
39+
__all__ = [
40+
'AppSkuInfo',
41+
'App',
42+
'AppPatch',
43+
'Resource',
44+
'ErrorDetails', 'ErrorDetailsException',
45+
'OperationDisplay',
46+
'Operation',
47+
'OperationInputs',
48+
'AppNameAvailabilityInfo',
49+
'AppPaged',
50+
'OperationPaged',
51+
'AppSku',
52+
'AppNameUnavailabilityReason',
53+
]
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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 .resource import Resource
13+
14+
15+
class App(Resource):
16+
"""The IoT Central application.
17+
18+
Variables are only populated by the server, and will be ignored when
19+
sending a request.
20+
21+
All required parameters must be populated in order to send to Azure.
22+
23+
:ivar id: The ARM resource identifier.
24+
:vartype id: str
25+
:ivar name: The ARM resource name.
26+
:vartype name: str
27+
:ivar type: The resource type.
28+
:vartype type: str
29+
:param location: Required. The resource location.
30+
:type location: str
31+
:param tags: The resource tags.
32+
:type tags: dict[str, str]
33+
:ivar application_id: The ID of the application.
34+
:vartype application_id: str
35+
:param display_name: The display name of the application.
36+
:type display_name: str
37+
:param subdomain: The subdomain of the application.
38+
:type subdomain: str
39+
:param template: The ID of the application template, which is a blueprint
40+
that defines the characteristics and behaviors of an application.
41+
Optional; if not specified, defaults to a blank blueprint and allows the
42+
application to be defined from scratch.
43+
:type template: str
44+
:param sku: Required. A valid instance SKU.
45+
:type sku: ~azure.mgmt.iotcentral.models.AppSkuInfo
46+
"""
47+
48+
_validation = {
49+
'id': {'readonly': True},
50+
'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,99}[a-zA-Z0-9]$'},
51+
'type': {'readonly': True},
52+
'location': {'required': True},
53+
'application_id': {'readonly': True},
54+
'display_name': {'pattern': r'^.{1,200}$'},
55+
'subdomain': {'pattern': r'^[a-z0-9-]{1,63}$'},
56+
'sku': {'required': True},
57+
}
58+
59+
_attribute_map = {
60+
'id': {'key': 'id', 'type': 'str'},
61+
'name': {'key': 'name', 'type': 'str'},
62+
'type': {'key': 'type', 'type': 'str'},
63+
'location': {'key': 'location', 'type': 'str'},
64+
'tags': {'key': 'tags', 'type': '{str}'},
65+
'application_id': {'key': 'properties.applicationId', 'type': 'str'},
66+
'display_name': {'key': 'properties.displayName', 'type': 'str'},
67+
'subdomain': {'key': 'properties.subdomain', 'type': 'str'},
68+
'template': {'key': 'properties.template', 'type': 'str'},
69+
'sku': {'key': 'sku', 'type': 'AppSkuInfo'},
70+
}
71+
72+
def __init__(self, **kwargs):
73+
super(App, self).__init__(**kwargs)
74+
self.application_id = None
75+
self.display_name = kwargs.get('display_name', None)
76+
self.subdomain = kwargs.get('subdomain', None)
77+
self.template = kwargs.get('template', None)
78+
self.sku = kwargs.get('sku', None)
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+
12+
from msrest.serialization import Model
13+
14+
15+
class AppNameAvailabilityInfo(Model):
16+
"""The properties indicating whether a given IoT Central application name is
17+
available.
18+
19+
Variables are only populated by the server, and will be ignored when
20+
sending a request.
21+
22+
:ivar name_available: The value which indicates whether the provided name
23+
is available.
24+
:vartype name_available: bool
25+
:ivar reason: The reason for unavailability. Possible values include:
26+
'Invalid', 'AlreadyExists'
27+
:vartype reason: str or
28+
~azure.mgmt.iotcentral.models.AppNameUnavailabilityReason
29+
:param message: The detailed reason message.
30+
:type message: str
31+
"""
32+
33+
_validation = {
34+
'name_available': {'readonly': True},
35+
'reason': {'readonly': True},
36+
}
37+
38+
_attribute_map = {
39+
'name_available': {'key': 'nameAvailable', 'type': 'bool'},
40+
'reason': {'key': 'reason', 'type': 'AppNameUnavailabilityReason'},
41+
'message': {'key': 'message', 'type': 'str'},
42+
}
43+
44+
def __init__(self, **kwargs):
45+
super(AppNameAvailabilityInfo, self).__init__(**kwargs)
46+
self.name_available = None
47+
self.reason = None
48+
self.message = kwargs.get('message', None)

0 commit comments

Comments
 (0)