Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR] iothub/resource-manager #3201

Merged
merged 2 commits into from
Aug 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion azure-mgmt-iothub/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
Release History
===============

0.6.0 (2018-08-27)
++++++++++++++++++

**Features**

- Model CertificatePropertiesWithNonce has a new parameter certificate
- Model CertificateProperties has a new parameter certificate
- Added operation IotHubResourceOperations.test_all_routes
- Added operation IotHubResourceOperations.test_route
- Added operation IotHubResourceOperations.get_endpoint_health
- Added operation group ResourceProviderCommonOperations
- Client class can be used as a context manager to keep the underlying HTTP session open for performance

0.5.0 (2018-04-17)
++++++++++++++++++

Expand All @@ -24,7 +37,7 @@ This version uses a next-generation code generator that *might* introduce breaki

- Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same.
- Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used.
- The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`,
- The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`,
without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`.
- New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`,
the response of the initial call will be returned without polling.
Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-iothub/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is the Microsoft Azure IoTHub Management Client Library.
Azure Resource Manager (ARM) is the next generation of management APIs that
replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.4, 3.5 and 3.6.
This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
Expand Down
11 changes: 8 additions & 3 deletions azure-mgmt-iothub/azure/mgmt/iothub/iot_hub_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import ServiceClient
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.operations import Operations
from .operations.iot_hub_resource_operations import IotHubResourceOperations
from .operations.resource_provider_common_operations import ResourceProviderCommonOperations
from .operations.certificates_operations import CertificatesOperations
from . import models

Expand Down Expand Up @@ -51,7 +52,7 @@ def __init__(
self.subscription_id = subscription_id


class IotHubClient(object):
class IotHubClient(SDKClient):
"""Use this API to manage the IoT hubs in your Azure subscription.

:ivar config: Configuration for client.
Expand All @@ -61,6 +62,8 @@ class IotHubClient(object):
:vartype operations: azure.mgmt.iothub.operations.Operations
:ivar iot_hub_resource: IotHubResource operations
:vartype iot_hub_resource: azure.mgmt.iothub.operations.IotHubResourceOperations
:ivar resource_provider_common: ResourceProviderCommon operations
:vartype resource_provider_common: azure.mgmt.iothub.operations.ResourceProviderCommonOperations
:ivar certificates: Certificates operations
:vartype certificates: azure.mgmt.iothub.operations.CertificatesOperations

Expand All @@ -76,7 +79,7 @@ def __init__(
self, credentials, subscription_id, base_url=None):

self.config = IotHubClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(self.config.credentials, self.config)
super(IotHubClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2018-04-01'
Expand All @@ -87,5 +90,7 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.iot_hub_resource = IotHubResourceOperations(
self._client, self.config, self._serialize, self._deserialize)
self.resource_provider_common = ResourceProviderCommonOperations(
self._client, self.config, self._serialize, self._deserialize)
self.certificates = CertificatesOperations(
self._client, self.config, self._serialize, self._deserialize)
56 changes: 53 additions & 3 deletions azure-mgmt-iothub/azure/mgmt/iothub/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

try:
from .certificate_verification_description_py3 import CertificateVerificationDescription
from .certificate_body_description_py3 import CertificateBodyDescription
from .certificate_properties_py3 import CertificateProperties
from .certificate_description_py3 import CertificateDescription
from .certificate_list_description_py3 import CertificateListDescription
from .certificate_body_description_py3 import CertificateBodyDescription
from .certificate_properties_with_nonce_py3 import CertificatePropertiesWithNonce
from .certificate_with_nonce_description_py3 import CertificateWithNonceDescription
from .shared_access_signature_authorization_rule_py3 import SharedAccessSignatureAuthorizationRule
Expand All @@ -41,6 +41,7 @@
from .operation_py3 import Operation
from .error_details_py3 import ErrorDetails, ErrorDetailsException
from .iot_hub_quota_metric_info_py3 import IotHubQuotaMetricInfo
from .endpoint_health_data_py3 import EndpointHealthData
from .registry_statistics_py3 import RegistryStatistics
from .job_response_py3 import JobResponse
from .iot_hub_capacity_py3 import IotHubCapacity
Expand All @@ -49,14 +50,27 @@
from .event_hub_consumer_group_info_py3 import EventHubConsumerGroupInfo
from .operation_inputs_py3 import OperationInputs
from .iot_hub_name_availability_info_py3 import IotHubNameAvailabilityInfo
from .name_py3 import Name
from .user_subscription_quota_py3 import UserSubscriptionQuota
from .user_subscription_quota_list_result_py3 import UserSubscriptionQuotaListResult
from .routing_message_py3 import RoutingMessage
from .test_all_routes_input_py3 import TestAllRoutesInput
from .matched_route_py3 import MatchedRoute
from .test_all_routes_result_py3 import TestAllRoutesResult
from .test_route_input_py3 import TestRouteInput
from .route_error_position_py3 import RouteErrorPosition
from .route_error_range_py3 import RouteErrorRange
from .route_compilation_error_py3 import RouteCompilationError
from .test_route_result_details_py3 import TestRouteResultDetails
from .test_route_result_py3 import TestRouteResult
from .export_devices_request_py3 import ExportDevicesRequest
from .import_devices_request_py3 import ImportDevicesRequest
except (SyntaxError, ImportError):
from .certificate_verification_description import CertificateVerificationDescription
from .certificate_body_description import CertificateBodyDescription
from .certificate_properties import CertificateProperties
from .certificate_description import CertificateDescription
from .certificate_list_description import CertificateListDescription
from .certificate_body_description import CertificateBodyDescription
from .certificate_properties_with_nonce import CertificatePropertiesWithNonce
from .certificate_with_nonce_description import CertificateWithNonceDescription
from .shared_access_signature_authorization_rule import SharedAccessSignatureAuthorizationRule
Expand All @@ -83,6 +97,7 @@
from .operation import Operation
from .error_details import ErrorDetails, ErrorDetailsException
from .iot_hub_quota_metric_info import IotHubQuotaMetricInfo
from .endpoint_health_data import EndpointHealthData
from .registry_statistics import RegistryStatistics
from .job_response import JobResponse
from .iot_hub_capacity import IotHubCapacity
Expand All @@ -91,6 +106,19 @@
from .event_hub_consumer_group_info import EventHubConsumerGroupInfo
from .operation_inputs import OperationInputs
from .iot_hub_name_availability_info import IotHubNameAvailabilityInfo
from .name import Name
from .user_subscription_quota import UserSubscriptionQuota
from .user_subscription_quota_list_result import UserSubscriptionQuotaListResult
from .routing_message import RoutingMessage
from .test_all_routes_input import TestAllRoutesInput
from .matched_route import MatchedRoute
from .test_all_routes_result import TestAllRoutesResult
from .test_route_input import TestRouteInput
from .route_error_position import RouteErrorPosition
from .route_error_range import RouteErrorRange
from .route_compilation_error import RouteCompilationError
from .test_route_result_details import TestRouteResultDetails
from .test_route_result import TestRouteResult
from .export_devices_request import ExportDevicesRequest
from .import_devices_request import ImportDevicesRequest
from .operation_paged import OperationPaged
Expand All @@ -99,6 +127,7 @@
from .event_hub_consumer_group_info_paged import EventHubConsumerGroupInfoPaged
from .job_response_paged import JobResponsePaged
from .iot_hub_quota_metric_info_paged import IotHubQuotaMetricInfoPaged
from .endpoint_health_data_paged import EndpointHealthDataPaged
from .shared_access_signature_authorization_rule_paged import SharedAccessSignatureAuthorizationRulePaged
from .iot_hub_client_enums import (
AccessRights,
Expand All @@ -108,18 +137,21 @@
Capabilities,
IotHubSku,
IotHubSkuTier,
EndpointHealthStatus,
JobType,
JobStatus,
IotHubScaleType,
IotHubNameUnavailabilityReason,
TestResultStatus,
RouteErrorSeverity,
)

__all__ = [
'CertificateVerificationDescription',
'CertificateBodyDescription',
'CertificateProperties',
'CertificateDescription',
'CertificateListDescription',
'CertificateBodyDescription',
'CertificatePropertiesWithNonce',
'CertificateWithNonceDescription',
'SharedAccessSignatureAuthorizationRule',
Expand All @@ -146,6 +178,7 @@
'Operation',
'ErrorDetails', 'ErrorDetailsException',
'IotHubQuotaMetricInfo',
'EndpointHealthData',
'RegistryStatistics',
'JobResponse',
'IotHubCapacity',
Expand All @@ -154,6 +187,19 @@
'EventHubConsumerGroupInfo',
'OperationInputs',
'IotHubNameAvailabilityInfo',
'Name',
'UserSubscriptionQuota',
'UserSubscriptionQuotaListResult',
'RoutingMessage',
'TestAllRoutesInput',
'MatchedRoute',
'TestAllRoutesResult',
'TestRouteInput',
'RouteErrorPosition',
'RouteErrorRange',
'RouteCompilationError',
'TestRouteResultDetails',
'TestRouteResult',
'ExportDevicesRequest',
'ImportDevicesRequest',
'OperationPaged',
Expand All @@ -162,6 +208,7 @@
'EventHubConsumerGroupInfoPaged',
'JobResponsePaged',
'IotHubQuotaMetricInfoPaged',
'EndpointHealthDataPaged',
'SharedAccessSignatureAuthorizationRulePaged',
'AccessRights',
'IpFilterActionType',
Expand All @@ -170,8 +217,11 @@
'Capabilities',
'IotHubSku',
'IotHubSkuTier',
'EndpointHealthStatus',
'JobType',
'JobStatus',
'IotHubScaleType',
'IotHubNameUnavailabilityReason',
'TestResultStatus',
'RouteErrorSeverity',
]
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class CertificateProperties(Model):
:vartype created: datetime
:ivar updated: The certificate's last update date and time.
:vartype updated: datetime
:param certificate: The certificate content
:type certificate: str
"""

_validation = {
Expand All @@ -48,6 +50,7 @@ class CertificateProperties(Model):
'is_verified': {'key': 'isVerified', 'type': 'bool'},
'created': {'key': 'created', 'type': 'rfc-1123'},
'updated': {'key': 'updated', 'type': 'rfc-1123'},
'certificate': {'key': 'certificate', 'type': 'str'},
}

def __init__(self, **kwargs):
Expand All @@ -58,3 +61,4 @@ def __init__(self, **kwargs):
self.is_verified = None
self.created = None
self.updated = None
self.certificate = kwargs.get('certificate', None)
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class CertificateProperties(Model):
:vartype created: datetime
:ivar updated: The certificate's last update date and time.
:vartype updated: datetime
:param certificate: The certificate content
:type certificate: str
"""

_validation = {
Expand All @@ -48,13 +50,15 @@ class CertificateProperties(Model):
'is_verified': {'key': 'isVerified', 'type': 'bool'},
'created': {'key': 'created', 'type': 'rfc-1123'},
'updated': {'key': 'updated', 'type': 'rfc-1123'},
'certificate': {'key': 'certificate', 'type': 'str'},
}

def __init__(self, **kwargs) -> None:
def __init__(self, *, certificate: str=None, **kwargs) -> None:
super(CertificateProperties, self).__init__(**kwargs)
self.subject = None
self.expiry = None
self.thumbprint = None
self.is_verified = None
self.created = None
self.updated = None
self.certificate = certificate
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class CertificatePropertiesWithNonce(Model):
:ivar verification_code: The certificate's verification code that will be
used for proof of possession.
:vartype verification_code: str
:ivar certificate: The certificate content
:vartype certificate: str
"""

_validation = {
Expand All @@ -44,6 +46,7 @@ class CertificatePropertiesWithNonce(Model):
'created': {'readonly': True},
'updated': {'readonly': True},
'verification_code': {'readonly': True},
'certificate': {'readonly': True},
}

_attribute_map = {
Expand All @@ -54,6 +57,7 @@ class CertificatePropertiesWithNonce(Model):
'created': {'key': 'created', 'type': 'rfc-1123'},
'updated': {'key': 'updated', 'type': 'rfc-1123'},
'verification_code': {'key': 'verificationCode', 'type': 'str'},
'certificate': {'key': 'certificate', 'type': 'str'},
}

def __init__(self, **kwargs):
Expand All @@ -65,3 +69,4 @@ def __init__(self, **kwargs):
self.created = None
self.updated = None
self.verification_code = None
self.certificate = None
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class CertificatePropertiesWithNonce(Model):
:ivar verification_code: The certificate's verification code that will be
used for proof of possession.
:vartype verification_code: str
:ivar certificate: The certificate content
:vartype certificate: str
"""

_validation = {
Expand All @@ -44,6 +46,7 @@ class CertificatePropertiesWithNonce(Model):
'created': {'readonly': True},
'updated': {'readonly': True},
'verification_code': {'readonly': True},
'certificate': {'readonly': True},
}

_attribute_map = {
Expand All @@ -54,6 +57,7 @@ class CertificatePropertiesWithNonce(Model):
'created': {'key': 'created', 'type': 'rfc-1123'},
'updated': {'key': 'updated', 'type': 'rfc-1123'},
'verification_code': {'key': 'verificationCode', 'type': 'str'},
'certificate': {'key': 'certificate', 'type': 'str'},
}

def __init__(self, **kwargs) -> None:
Expand All @@ -65,3 +69,4 @@ def __init__(self, **kwargs) -> None:
self.created = None
self.updated = None
self.verification_code = None
self.certificate = None
33 changes: 33 additions & 0 deletions azure-mgmt-iothub/azure/mgmt/iothub/models/endpoint_health_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class EndpointHealthData(Model):
"""The health data for an endpoint.

:param endpoint_id: Id of the endpoint
:type endpoint_id: str
:param health_status: Health status. Possible values include: 'unknown',
'healthy', 'unhealthy', 'dead'
:type health_status: str or ~azure.mgmt.iothub.models.EndpointHealthStatus
"""

_attribute_map = {
'endpoint_id': {'key': 'endpointId', 'type': 'str'},
'health_status': {'key': 'healthStatus', 'type': 'str'},
}

def __init__(self, **kwargs):
super(EndpointHealthData, self).__init__(**kwargs)
self.endpoint_id = kwargs.get('endpoint_id', None)
self.health_status = kwargs.get('health_status', None)
Loading