diff --git a/azure-mgmt-signalr/HISTORY.rst b/azure-mgmt-signalr/HISTORY.rst new file mode 100644 index 000000000000..e2b8d8d1fcca --- /dev/null +++ b/azure-mgmt-signalr/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (2018-05-07) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-signalr/MANIFEST.in b/azure-mgmt-signalr/MANIFEST.in new file mode 100644 index 000000000000..9ecaeb15de50 --- /dev/null +++ b/azure-mgmt-signalr/MANIFEST.in @@ -0,0 +1,2 @@ +include *.rst +include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-signalr/README.rst b/azure-mgmt-signalr/README.rst new file mode 100644 index 000000000000..400691184145 --- /dev/null +++ b/azure-mgmt-signalr/README.rst @@ -0,0 +1,49 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure SignalR 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. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Compatibility +============= + +**IMPORTANT**: If you have an earlier version of the azure package +(version < 1.0), you should uninstall it before installing this package. + +You can check the version using pip: + +.. code:: shell + + pip freeze + +If you see azure==0.11.0 (or any version below 1.0), uninstall it first: + +.. code:: shell + + pip uninstall azure + + +Usage +===== + +For code examples, see `SignalR +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. diff --git a/azure-mgmt-signalr/azure/__init__.py b/azure-mgmt-signalr/azure/__init__.py new file mode 100644 index 000000000000..849489fca33c --- /dev/null +++ b/azure-mgmt-signalr/azure/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/azure-mgmt-signalr/azure/mgmt/__init__.py b/azure-mgmt-signalr/azure/mgmt/__init__.py new file mode 100644 index 000000000000..849489fca33c --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/__init__.py b/azure-mgmt-signalr/azure/mgmt/signalr/__init__.py new file mode 100644 index 000000000000..9a9b15f10c6b --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/__init__.py @@ -0,0 +1,18 @@ +# 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 .signal_rmanagement_client import SignalRManagementClient +from .version import VERSION + +__all__ = ['SignalRManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/__init__.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/__init__.py new file mode 100644 index 000000000000..6605edb1e93e --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/__init__.py @@ -0,0 +1,76 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from .operation_display_py3 import OperationDisplay + from .metric_specification_py3 import MetricSpecification + from .service_specification_py3 import ServiceSpecification + from .operation_properties_py3 import OperationProperties + from .operation_py3 import Operation + from .name_availability_parameters_py3 import NameAvailabilityParameters + from .name_availability_py3 import NameAvailability + from .resource_sku_py3 import ResourceSku + from .signal_rresource_py3 import SignalRResource + from .tracked_resource_py3 import TrackedResource + from .resource_py3 import Resource + from .signal_rcreate_or_update_properties_py3 import SignalRCreateOrUpdateProperties + from .signal_rkeys_py3 import SignalRKeys + from .regenerate_key_parameters_py3 import RegenerateKeyParameters + from .signal_rcreate_parameters_py3 import SignalRCreateParameters + from .signal_rupdate_parameters_py3 import SignalRUpdateParameters +except (SyntaxError, ImportError): + from .operation_display import OperationDisplay + from .metric_specification import MetricSpecification + from .service_specification import ServiceSpecification + from .operation_properties import OperationProperties + from .operation import Operation + from .name_availability_parameters import NameAvailabilityParameters + from .name_availability import NameAvailability + from .resource_sku import ResourceSku + from .signal_rresource import SignalRResource + from .tracked_resource import TrackedResource + from .resource import Resource + from .signal_rcreate_or_update_properties import SignalRCreateOrUpdateProperties + from .signal_rkeys import SignalRKeys + from .regenerate_key_parameters import RegenerateKeyParameters + from .signal_rcreate_parameters import SignalRCreateParameters + from .signal_rupdate_parameters import SignalRUpdateParameters +from .operation_paged import OperationPaged +from .signal_rresource_paged import SignalRResourcePaged +from .signal_rmanagement_client_enums import ( + SignalRSkuTier, + ProvisioningState, + KeyType, +) + +__all__ = [ + 'OperationDisplay', + 'MetricSpecification', + 'ServiceSpecification', + 'OperationProperties', + 'Operation', + 'NameAvailabilityParameters', + 'NameAvailability', + 'ResourceSku', + 'SignalRResource', + 'TrackedResource', + 'Resource', + 'SignalRCreateOrUpdateProperties', + 'SignalRKeys', + 'RegenerateKeyParameters', + 'SignalRCreateParameters', + 'SignalRUpdateParameters', + 'OperationPaged', + 'SignalRResourcePaged', + 'SignalRSkuTier', + 'ProvisioningState', + 'KeyType', +] diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/metric_specification.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/metric_specification.py new file mode 100644 index 000000000000..c54739236aef --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/metric_specification.py @@ -0,0 +1,59 @@ +# 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 MetricSpecification(Model): + """Specifications of the Metrics for Azure Monitoring. + + :param name: Name of the metric. + :type name: str + :param display_name: Localized friendly display name of the metric. + :type display_name: str + :param display_description: Localized friendly description of the metric. + :type display_description: str + :param unit: The unit that makes sense for the metric. + :type unit: str + :param aggregation_type: Only provide one value for this field. Valid + values: Average, Minimum, Maximum, Total, Count. + :type aggregation_type: str + :param fill_gap_with_zero: Optional. If set to true, then zero will be + returned for time duration where no metric is emitted/published. + Ex. a metric that returns the number of times a particular error code was + emitted. The error code may not appear + often, instead of the RP publishing 0, Shoebox can auto fill in 0s for + time periods where nothing was emitted. + :type fill_gap_with_zero: str + :param category: The name of the metric category that the metric belongs + to. A metric can only belong to a single category. + :type category: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/metric_specification_py3.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/metric_specification_py3.py new file mode 100644 index 000000000000..21cc1d12a2e1 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/metric_specification_py3.py @@ -0,0 +1,59 @@ +# 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 MetricSpecification(Model): + """Specifications of the Metrics for Azure Monitoring. + + :param name: Name of the metric. + :type name: str + :param display_name: Localized friendly display name of the metric. + :type display_name: str + :param display_description: Localized friendly description of the metric. + :type display_description: str + :param unit: The unit that makes sense for the metric. + :type unit: str + :param aggregation_type: Only provide one value for this field. Valid + values: Average, Minimum, Maximum, Total, Count. + :type aggregation_type: str + :param fill_gap_with_zero: Optional. If set to true, then zero will be + returned for time duration where no metric is emitted/published. + Ex. a metric that returns the number of times a particular error code was + emitted. The error code may not appear + often, instead of the RP publishing 0, Shoebox can auto fill in 0s for + time periods where nothing was emitted. + :type fill_gap_with_zero: str + :param category: The name of the metric category that the metric belongs + to. A metric can only belong to a single category. + :type category: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, fill_gap_with_zero: str=None, category: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/name_availability.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/name_availability.py new file mode 100644 index 000000000000..7b56e67c6704 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/name_availability.py @@ -0,0 +1,38 @@ +# 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 NameAvailability(Model): + """Result of the request to check name availability. It contains a flag and + possible reason of failure. + + :param name_available: Indicates whether the name is available or not. + :type name_available: bool + :param reason: The reason of the availability. Required if name is not + available. + :type reason: str + :param message: The message of the operation. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NameAvailability, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/name_availability_parameters.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/name_availability_parameters.py new file mode 100644 index 000000000000..69d961776458 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/name_availability_parameters.py @@ -0,0 +1,41 @@ +# 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 NameAvailabilityParameters(Model): + """Data POST-ed to the nameAvailability action. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The resource type. Should be always + "Microsoft.SignalRService/SignalR". + :type type: str + :param name: Required. The SignalR service name to validate. + e.g."my-signalR-name-here" + :type name: str + """ + + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NameAvailabilityParameters, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/name_availability_parameters_py3.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/name_availability_parameters_py3.py new file mode 100644 index 000000000000..caefb77011fd --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/name_availability_parameters_py3.py @@ -0,0 +1,41 @@ +# 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 NameAvailabilityParameters(Model): + """Data POST-ed to the nameAvailability action. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The resource type. Should be always + "Microsoft.SignalRService/SignalR". + :type type: str + :param name: Required. The SignalR service name to validate. + e.g."my-signalR-name-here" + :type name: str + """ + + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, type: str, name: str, **kwargs) -> None: + super(NameAvailabilityParameters, self).__init__(**kwargs) + self.type = type + self.name = name diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/name_availability_py3.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/name_availability_py3.py new file mode 100644 index 000000000000..9792b3765937 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/name_availability_py3.py @@ -0,0 +1,38 @@ +# 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 NameAvailability(Model): + """Result of the request to check name availability. It contains a flag and + possible reason of failure. + + :param name_available: Indicates whether the name is available or not. + :type name_available: bool + :param reason: The reason of the availability. Required if name is not + available. + :type reason: str + :param message: The message of the operation. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, reason: str=None, message: str=None, **kwargs) -> None: + super(NameAvailability, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/operation.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/operation.py new file mode 100644 index 000000000000..77f115a4d2fc --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/operation.py @@ -0,0 +1,42 @@ +# 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 Operation(Model): + """REST API operation supported by SignalR resource provider. + + :param name: Name of the operation with format: + {provider}/{resource}/{operation} + :type name: str + :param display: The object that describes the operation. + :type display: ~azure.mgmt.signalr.models.OperationDisplay + :param origin: Optional. The intended executor of the operation; governs + the display of the operation in the RBAC UX and the audit logs UX. + :type origin: str + :param properties: Extra properties for the operation. + :type properties: ~azure.mgmt.signalr.models.OperationProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'OperationProperties'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_display.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_display.py new file mode 100644 index 000000000000..d368ed731f5b --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_display.py @@ -0,0 +1,40 @@ +# 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 OperationDisplay(Model): + """The object that describes a operation. + + :param provider: Friendly name of the resource provider + :type provider: str + :param resource: Resource type on which the operation is performed. + :type resource: str + :param operation: The localized friendly name for the operation. + :type operation: str + :param description: The localized friendly description for the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_display_py3.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_display_py3.py new file mode 100644 index 000000000000..6e8283000f0a --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# 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 OperationDisplay(Model): + """The object that describes a operation. + + :param provider: Friendly name of the resource provider + :type provider: str + :param resource: Resource type on which the operation is performed. + :type resource: str + :param operation: The localized friendly name for the operation. + :type operation: str + :param description: The localized friendly description for the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_paged.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_paged.py new file mode 100644 index 000000000000..60109137961f --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_properties.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_properties.py new file mode 100644 index 000000000000..5884decce60a --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_properties.py @@ -0,0 +1,29 @@ +# 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 OperationProperties(Model): + """Extra Operation properties. + + :param service_specification: The service specifications. + :type service_specification: + ~azure.mgmt.signalr.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(OperationProperties, self).__init__(**kwargs) + self.service_specification = kwargs.get('service_specification', None) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_properties_py3.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_properties_py3.py new file mode 100644 index 000000000000..c78e2043ebff --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_properties_py3.py @@ -0,0 +1,29 @@ +# 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 OperationProperties(Model): + """Extra Operation properties. + + :param service_specification: The service specifications. + :type service_specification: + ~azure.mgmt.signalr.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, service_specification=None, **kwargs) -> None: + super(OperationProperties, self).__init__(**kwargs) + self.service_specification = service_specification diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_py3.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_py3.py new file mode 100644 index 000000000000..47e90891f0cd --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/operation_py3.py @@ -0,0 +1,42 @@ +# 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 Operation(Model): + """REST API operation supported by SignalR resource provider. + + :param name: Name of the operation with format: + {provider}/{resource}/{operation} + :type name: str + :param display: The object that describes the operation. + :type display: ~azure.mgmt.signalr.models.OperationDisplay + :param origin: Optional. The intended executor of the operation; governs + the display of the operation in the RBAC UX and the audit logs UX. + :type origin: str + :param properties: Extra properties for the operation. + :type properties: ~azure.mgmt.signalr.models.OperationProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'OperationProperties'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, properties=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.properties = properties diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/regenerate_key_parameters.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/regenerate_key_parameters.py new file mode 100644 index 000000000000..5e313a7a9fce --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/regenerate_key_parameters.py @@ -0,0 +1,30 @@ +# 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 RegenerateKeyParameters(Model): + """Parameters describes the request to regenerate access keys. + + :param key_type: The keyType to regenerate. Must be either 'primary' or + 'secondary'(case-insensitive). Possible values include: 'Primary', + 'Secondary' + :type key_type: str or ~azure.mgmt.signalr.models.KeyType + """ + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegenerateKeyParameters, self).__init__(**kwargs) + self.key_type = kwargs.get('key_type', None) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/regenerate_key_parameters_py3.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..84996057d07f --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/regenerate_key_parameters_py3.py @@ -0,0 +1,30 @@ +# 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 RegenerateKeyParameters(Model): + """Parameters describes the request to regenerate access keys. + + :param key_type: The keyType to regenerate. Must be either 'primary' or + 'secondary'(case-insensitive). Possible values include: 'Primary', + 'Secondary' + :type key_type: str or ~azure.mgmt.signalr.models.KeyType + """ + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__(self, *, key_type=None, **kwargs) -> None: + super(RegenerateKeyParameters, self).__init__(**kwargs) + self.key_type = key_type diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/resource.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/resource.py new file mode 100644 index 000000000000..52faf058b594 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/resource.py @@ -0,0 +1,46 @@ +# 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 Resource(Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resouce. + :vartype name: str + :ivar type: The type of the service - e.g. + "Microsoft.SignalRService/SignalR" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/resource_py3.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/resource_py3.py new file mode 100644 index 000000000000..e0a419dfa795 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/resource_py3.py @@ -0,0 +1,46 @@ +# 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 Resource(Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resouce. + :vartype name: str + :ivar type: The type of the service - e.g. + "Microsoft.SignalRService/SignalR" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/resource_sku.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/resource_sku.py new file mode 100644 index 000000000000..18cebb3dcfa9 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/resource_sku.py @@ -0,0 +1,56 @@ +# 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 ResourceSku(Model): + """The billing information of the resource.(e.g. basic vs. standard). + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the SKU. This is typically a letter + + number code, such as A0 or P3. Required (if sku is specified) + :type name: str + :param tier: The tier of this particular SKU. Optional. Possible values + include: 'Free', 'Basic', 'Premium' + :type tier: str or ~azure.mgmt.signalr.models.SignalRSkuTier + :param size: Optional, string. When the name field is the combination of + tier and some other value, this would be the standalone code. + :type size: str + :param family: Optional, string. If the service has different generations + of hardware, for the same SKU, then that can be captured here. + :type family: str + :param capacity: Optional, integer. If the SKU supports scale out/in then + the capacity integer should be included. If scale out/in is not + possible for the resource this may be omitted. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ResourceSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/resource_sku_py3.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/resource_sku_py3.py new file mode 100644 index 000000000000..fb2ead5223c3 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/resource_sku_py3.py @@ -0,0 +1,56 @@ +# 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 ResourceSku(Model): + """The billing information of the resource.(e.g. basic vs. standard). + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the SKU. This is typically a letter + + number code, such as A0 or P3. Required (if sku is specified) + :type name: str + :param tier: The tier of this particular SKU. Optional. Possible values + include: 'Free', 'Basic', 'Premium' + :type tier: str or ~azure.mgmt.signalr.models.SignalRSkuTier + :param size: Optional, string. When the name field is the combination of + tier and some other value, this would be the standalone code. + :type size: str + :param family: Optional, string. If the service has different generations + of hardware, for the same SKU, then that can be captured here. + :type family: str + :param capacity: Optional, integer. If the SKU supports scale out/in then + the capacity integer should be included. If scale out/in is not + possible for the resource this may be omitted. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name: str, tier=None, size: str=None, family: str=None, capacity: int=None, **kwargs) -> None: + super(ResourceSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.capacity = capacity diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/service_specification.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/service_specification.py new file mode 100644 index 000000000000..3c1c6a87bcea --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/service_specification.py @@ -0,0 +1,30 @@ +# 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 ServiceSpecification(Model): + """An object that describes a specification. + + :param metric_specifications: Specifications of the Metrics for Azure + Monitoring. + :type metric_specifications: + list[~azure.mgmt.signalr.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/service_specification_py3.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/service_specification_py3.py new file mode 100644 index 000000000000..16125e83ba09 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/service_specification_py3.py @@ -0,0 +1,30 @@ +# 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 ServiceSpecification(Model): + """An object that describes a specification. + + :param metric_specifications: Specifications of the Metrics for Azure + Monitoring. + :type metric_specifications: + list[~azure.mgmt.signalr.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rcreate_or_update_properties.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rcreate_or_update_properties.py new file mode 100644 index 000000000000..4735f85fd6b2 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rcreate_or_update_properties.py @@ -0,0 +1,31 @@ +# 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 SignalRCreateOrUpdateProperties(Model): + """Settings used to provision or configure the resource. + + :param host_name_prefix: Prefix for the hostName of the SignalR service. + Retained for future use. + The hostname will be of format: + <hostNamePrefix>.service.signalr.net. + :type host_name_prefix: str + """ + + _attribute_map = { + 'host_name_prefix': {'key': 'hostNamePrefix', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SignalRCreateOrUpdateProperties, self).__init__(**kwargs) + self.host_name_prefix = kwargs.get('host_name_prefix', None) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rcreate_or_update_properties_py3.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rcreate_or_update_properties_py3.py new file mode 100644 index 000000000000..dd051d50d0af --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rcreate_or_update_properties_py3.py @@ -0,0 +1,31 @@ +# 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 SignalRCreateOrUpdateProperties(Model): + """Settings used to provision or configure the resource. + + :param host_name_prefix: Prefix for the hostName of the SignalR service. + Retained for future use. + The hostname will be of format: + <hostNamePrefix>.service.signalr.net. + :type host_name_prefix: str + """ + + _attribute_map = { + 'host_name_prefix': {'key': 'hostNamePrefix', 'type': 'str'}, + } + + def __init__(self, *, host_name_prefix: str=None, **kwargs) -> None: + super(SignalRCreateOrUpdateProperties, self).__init__(**kwargs) + self.host_name_prefix = host_name_prefix diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rcreate_parameters.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rcreate_parameters.py new file mode 100644 index 000000000000..69ee100c20c8 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rcreate_parameters.py @@ -0,0 +1,49 @@ +# 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 .signal_rupdate_parameters import SignalRUpdateParameters + + +class SignalRCreateParameters(SignalRUpdateParameters): + """Parameters for SignalR service create/update operation. + Keep the same schema as AzSignalR.Models.SignalRResource. + + All required parameters must be populated in order to send to Azure. + + :param tags: A list of key value pairs that describe the resource. + :type tags: dict[str, str] + :param sku: The billing information of the resource.(e.g. basic vs. + standard) + :type sku: ~azure.mgmt.signalr.models.ResourceSku + :param properties: Settings used to provision or configure the resource + :type properties: + ~azure.mgmt.signalr.models.SignalRCreateOrUpdateProperties + :param location: Required. Azure GEO region: e.g. West US | East US | + North Central US | South Central US | West Europe | North Europe | East + Asia | Southeast Asia | etc. + The geo region of a resource never changes after it is created. + :type location: str + """ + + _validation = { + 'location': {'required': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ResourceSku'}, + 'properties': {'key': 'properties', 'type': 'SignalRCreateOrUpdateProperties'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SignalRCreateParameters, self).__init__(**kwargs) + self.location = kwargs.get('location', None) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rcreate_parameters_py3.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rcreate_parameters_py3.py new file mode 100644 index 000000000000..f58bd64a8877 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rcreate_parameters_py3.py @@ -0,0 +1,49 @@ +# 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 .signal_rupdate_parameters import SignalRUpdateParameters + + +class SignalRCreateParameters(SignalRUpdateParameters): + """Parameters for SignalR service create/update operation. + Keep the same schema as AzSignalR.Models.SignalRResource. + + All required parameters must be populated in order to send to Azure. + + :param tags: A list of key value pairs that describe the resource. + :type tags: dict[str, str] + :param sku: The billing information of the resource.(e.g. basic vs. + standard) + :type sku: ~azure.mgmt.signalr.models.ResourceSku + :param properties: Settings used to provision or configure the resource + :type properties: + ~azure.mgmt.signalr.models.SignalRCreateOrUpdateProperties + :param location: Required. Azure GEO region: e.g. West US | East US | + North Central US | South Central US | West Europe | North Europe | East + Asia | Southeast Asia | etc. + The geo region of a resource never changes after it is created. + :type location: str + """ + + _validation = { + 'location': {'required': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ResourceSku'}, + 'properties': {'key': 'properties', 'type': 'SignalRCreateOrUpdateProperties'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, sku=None, properties=None, **kwargs) -> None: + super(SignalRCreateParameters, self).__init__(tags=tags, sku=sku, properties=properties, **kwargs) + self.location = location diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rkeys.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rkeys.py new file mode 100644 index 000000000000..8549853cbc44 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rkeys.py @@ -0,0 +1,32 @@ +# 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 SignalRKeys(Model): + """A class represents the access keys of SignalR service. + + :param primary_key: The primary access key. + :type primary_key: str + :param secondary_key: The secondary access key. + :type secondary_key: str + """ + + _attribute_map = { + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SignalRKeys, self).__init__(**kwargs) + self.primary_key = kwargs.get('primary_key', None) + self.secondary_key = kwargs.get('secondary_key', None) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rkeys_py3.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rkeys_py3.py new file mode 100644 index 000000000000..2ca3ca658857 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rkeys_py3.py @@ -0,0 +1,32 @@ +# 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 SignalRKeys(Model): + """A class represents the access keys of SignalR service. + + :param primary_key: The primary access key. + :type primary_key: str + :param secondary_key: The secondary access key. + :type secondary_key: str + """ + + _attribute_map = { + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + } + + def __init__(self, *, primary_key: str=None, secondary_key: str=None, **kwargs) -> None: + super(SignalRKeys, self).__init__(**kwargs) + self.primary_key = primary_key + self.secondary_key = secondary_key diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rmanagement_client_enums.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rmanagement_client_enums.py new file mode 100644 index 000000000000..7869b8dbfc8d --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rmanagement_client_enums.py @@ -0,0 +1,38 @@ +# 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 enum import Enum + + +class SignalRSkuTier(str, Enum): + + free = "Free" + basic = "Basic" + premium = "Premium" + + +class ProvisioningState(str, Enum): + + unknown = "Unknown" + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" + running = "Running" + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + moving = "Moving" + + +class KeyType(str, Enum): + + primary = "Primary" + secondary = "Secondary" diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rresource.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rresource.py new file mode 100644 index 000000000000..45edb88c3d00 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rresource.py @@ -0,0 +1,93 @@ +# 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 .tracked_resource import TrackedResource + + +class SignalRResource(TrackedResource): + """A class represent a SignalR service resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resouce. + :vartype name: str + :ivar type: The type of the service - e.g. + "Microsoft.SignalRService/SignalR" + :vartype type: str + :param location: The GEO location of the SignalR service. e.g. West US | + East US | North Central US | South Central US. + :type location: str + :param tags: Tags of the service which is a list of key value pairs that + describe the resource. + :type tags: dict[str, str] + :param sku: SKU of the service. + :type sku: ~azure.mgmt.signalr.models.ResourceSku + :param host_name_prefix: Prefix for the hostName of the SignalR service. + Retained for future use. + The hostname will be of format: + <hostNamePrefix>.service.signalr.net. + :type host_name_prefix: str + :ivar provisioning_state: Provisioning state of the resource. Possible + values include: 'Unknown', 'Succeeded', 'Failed', 'Canceled', 'Running', + 'Creating', 'Updating', 'Deleting', 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.signalr.models.ProvisioningState + :ivar external_ip: The publicly accessible IP of the SignalR service. + :vartype external_ip: str + :ivar host_name: FQDN of the SignalR service instance. Format: + xxx.service.signalr.net + :vartype host_name: str + :ivar public_port: The publicly accessibly port of the SignalR service + which is designed for browser/client side usage. + :vartype public_port: int + :ivar server_port: The publicly accessibly port of the SignalR service + which is designed for customer server side usage. + :vartype server_port: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'external_ip': {'readonly': True}, + 'host_name': {'readonly': True}, + 'public_port': {'readonly': True}, + 'server_port': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ResourceSku'}, + 'host_name_prefix': {'key': 'properties.hostNamePrefix', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'external_ip': {'key': 'properties.externalIP', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'public_port': {'key': 'properties.publicPort', 'type': 'int'}, + 'server_port': {'key': 'properties.serverPort', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(SignalRResource, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.host_name_prefix = kwargs.get('host_name_prefix', None) + self.provisioning_state = None + self.external_ip = None + self.host_name = None + self.public_port = None + self.server_port = None diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rresource_paged.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rresource_paged.py new file mode 100644 index 000000000000..98b0225b9fa0 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rresource_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class SignalRResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`SignalRResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SignalRResource]'} + } + + def __init__(self, *args, **kwargs): + + super(SignalRResourcePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rresource_py3.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rresource_py3.py new file mode 100644 index 000000000000..4356b4f06b84 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rresource_py3.py @@ -0,0 +1,93 @@ +# 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 .tracked_resource import TrackedResource + + +class SignalRResource(TrackedResource): + """A class represent a SignalR service resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resouce. + :vartype name: str + :ivar type: The type of the service - e.g. + "Microsoft.SignalRService/SignalR" + :vartype type: str + :param location: The GEO location of the SignalR service. e.g. West US | + East US | North Central US | South Central US. + :type location: str + :param tags: Tags of the service which is a list of key value pairs that + describe the resource. + :type tags: dict[str, str] + :param sku: SKU of the service. + :type sku: ~azure.mgmt.signalr.models.ResourceSku + :param host_name_prefix: Prefix for the hostName of the SignalR service. + Retained for future use. + The hostname will be of format: + <hostNamePrefix>.service.signalr.net. + :type host_name_prefix: str + :ivar provisioning_state: Provisioning state of the resource. Possible + values include: 'Unknown', 'Succeeded', 'Failed', 'Canceled', 'Running', + 'Creating', 'Updating', 'Deleting', 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.signalr.models.ProvisioningState + :ivar external_ip: The publicly accessible IP of the SignalR service. + :vartype external_ip: str + :ivar host_name: FQDN of the SignalR service instance. Format: + xxx.service.signalr.net + :vartype host_name: str + :ivar public_port: The publicly accessibly port of the SignalR service + which is designed for browser/client side usage. + :vartype public_port: int + :ivar server_port: The publicly accessibly port of the SignalR service + which is designed for customer server side usage. + :vartype server_port: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'external_ip': {'readonly': True}, + 'host_name': {'readonly': True}, + 'public_port': {'readonly': True}, + 'server_port': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ResourceSku'}, + 'host_name_prefix': {'key': 'properties.hostNamePrefix', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'external_ip': {'key': 'properties.externalIP', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'public_port': {'key': 'properties.publicPort', 'type': 'int'}, + 'server_port': {'key': 'properties.serverPort', 'type': 'int'}, + } + + def __init__(self, *, location: str=None, tags=None, sku=None, host_name_prefix: str=None, **kwargs) -> None: + super(SignalRResource, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.host_name_prefix = host_name_prefix + self.provisioning_state = None + self.external_ip = None + self.host_name = None + self.public_port = None + self.server_port = None diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rupdate_parameters.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rupdate_parameters.py new file mode 100644 index 000000000000..2f177255176b --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rupdate_parameters.py @@ -0,0 +1,38 @@ +# 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 SignalRUpdateParameters(Model): + """Parameters for SignalR service update operation. + + :param tags: A list of key value pairs that describe the resource. + :type tags: dict[str, str] + :param sku: The billing information of the resource.(e.g. basic vs. + standard) + :type sku: ~azure.mgmt.signalr.models.ResourceSku + :param properties: Settings used to provision or configure the resource + :type properties: + ~azure.mgmt.signalr.models.SignalRCreateOrUpdateProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ResourceSku'}, + 'properties': {'key': 'properties', 'type': 'SignalRCreateOrUpdateProperties'}, + } + + def __init__(self, **kwargs): + super(SignalRUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rupdate_parameters_py3.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rupdate_parameters_py3.py new file mode 100644 index 000000000000..da20f519dd5d --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/signal_rupdate_parameters_py3.py @@ -0,0 +1,38 @@ +# 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 SignalRUpdateParameters(Model): + """Parameters for SignalR service update operation. + + :param tags: A list of key value pairs that describe the resource. + :type tags: dict[str, str] + :param sku: The billing information of the resource.(e.g. basic vs. + standard) + :type sku: ~azure.mgmt.signalr.models.ResourceSku + :param properties: Settings used to provision or configure the resource + :type properties: + ~azure.mgmt.signalr.models.SignalRCreateOrUpdateProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ResourceSku'}, + 'properties': {'key': 'properties', 'type': 'SignalRCreateOrUpdateProperties'}, + } + + def __init__(self, *, tags=None, sku=None, properties=None, **kwargs) -> None: + super(SignalRUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.sku = sku + self.properties = properties diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/tracked_resource.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/tracked_resource.py new file mode 100644 index 000000000000..ef21d96d0089 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/tracked_resource.py @@ -0,0 +1,53 @@ +# 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 .resource import Resource + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resouce. + :vartype name: str + :ivar type: The type of the service - e.g. + "Microsoft.SignalRService/SignalR" + :vartype type: str + :param location: The GEO location of the SignalR service. e.g. West US | + East US | North Central US | South Central US. + :type location: str + :param tags: Tags of the service which is a list of key value pairs that + describe the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/models/tracked_resource_py3.py b/azure-mgmt-signalr/azure/mgmt/signalr/models/tracked_resource_py3.py new file mode 100644 index 000000000000..066145840c5e --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/models/tracked_resource_py3.py @@ -0,0 +1,53 @@ +# 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 .resource import Resource + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resouce. + :vartype name: str + :ivar type: The type of the service - e.g. + "Microsoft.SignalRService/SignalR" + :vartype type: str + :param location: The GEO location of the SignalR service. e.g. West US | + East US | North Central US | South Central US. + :type location: str + :param tags: Tags of the service which is a list of key value pairs that + describe the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.location = location + self.tags = tags diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/operations/__init__.py b/azure-mgmt-signalr/azure/mgmt/signalr/operations/__init__.py new file mode 100644 index 000000000000..6eacbb8c5db5 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/operations/__init__.py @@ -0,0 +1,18 @@ +# 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 .operations import Operations +from .signal_roperations import SignalROperations + +__all__ = [ + 'Operations', + 'SignalROperations', +] diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/operations/operations.py b/azure-mgmt-signalr/azure/mgmt/signalr/operations/operations.py new file mode 100644 index 000000000000..e04d3eee4058 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/operations/operations.py @@ -0,0 +1,100 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-03-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available REST API operations of the + Microsoft.SignalRService provider. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.signalr.models.OperationPaged[~azure.mgmt.signalr.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.SignalRService/operations'} diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/operations/signal_roperations.py b/azure-mgmt-signalr/azure/mgmt/signalr/operations/signal_roperations.py new file mode 100644 index 000000000000..07d6c59a6292 --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/operations/signal_roperations.py @@ -0,0 +1,783 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class SignalROperations(object): + """SignalROperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-03-01-preview" + + self.config = config + + def check_name_availability( + self, location, type, name, custom_headers=None, raw=False, **operation_config): + """Checks that the SignalR name is valid and is not already in use. + + :param location: the region + :type location: str + :param type: The resource type. Should be always + "Microsoft.SignalRService/SignalR". + :type type: str + :param name: The SignalR service name to validate. + e.g."my-signalR-name-here" + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NameAvailability or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.signalr.models.NameAvailability or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if type is not None or name is not None: + parameters = models.NameAvailabilityParameters(type=type, name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if parameters is not None: + body_content = self._serialize.body(parameters, 'NameAvailabilityParameters') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NameAvailability', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/checkNameAvailability'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Handles requests to list all resources in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SignalRResource + :rtype: + ~azure.mgmt.signalr.models.SignalRResourcePaged[~azure.mgmt.signalr.models.SignalRResource] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SignalRResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SignalRResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/SignalR'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Handles requests to list all resources in a resource group. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SignalRResource + :rtype: + ~azure.mgmt.signalr.models.SignalRResourcePaged[~azure.mgmt.signalr.models.SignalRResource] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SignalRResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SignalRResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR'} + + def list_keys( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get the access keys of the SignalR resource. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param resource_name: The name of the SignalR resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SignalRKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.signalr.models.SignalRKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_keys.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SignalRKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}/listKeys'} + + + def _regenerate_key_initial( + self, resource_group_name, resource_name, key_type=None, custom_headers=None, raw=False, **operation_config): + parameters = None + if key_type is not None: + parameters = models.RegenerateKeyParameters(key_type=key_type) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if parameters is not None: + body_content = self._serialize.body(parameters, 'RegenerateKeyParameters') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('SignalRKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def regenerate_key( + self, resource_group_name, resource_name, key_type=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Regenerate SignalR service access key. PrimaryKey and SecondaryKey + cannot be regenerated at the same time. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param resource_name: The name of the SignalR resource. + :type resource_name: str + :param key_type: The keyType to regenerate. Must be either 'primary' + or 'secondary'(case-insensitive). Possible values include: 'Primary', + 'Secondary' + :type key_type: str or ~azure.mgmt.signalr.models.KeyType + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SignalRKeys or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.signalr.models.SignalRKeys] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.signalr.models.SignalRKeys]] + :raises: :class:`CloudError` + """ + raw_result = self._regenerate_key_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + key_type=key_type, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('SignalRKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}/regenerateKey'} + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get the SignalR service and its properties. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param resource_name: The name of the SignalR resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SignalRResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.signalr.models.SignalRResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SignalRResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}'} + + + def _create_or_update_initial( + self, resource_group_name, resource_name, parameters=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if parameters is not None: + body_content = self._serialize.body(parameters, 'SignalRCreateParameters') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('SignalRResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_name, parameters=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a new SignalR service and update an exiting SignalR service. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param resource_name: The name of the SignalR resource. + :type resource_name: str + :param parameters: Parameters for the create or update operation + :type parameters: ~azure.mgmt.signalr.models.SignalRCreateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SignalRResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.signalr.models.SignalRResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.signalr.models.SignalRResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('SignalRResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to delete a SignalR service. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param resource_name: The name of the SignalR resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}'} + + + def _update_initial( + self, resource_group_name, resource_name, parameters=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if parameters is not None: + body_content = self._serialize.body(parameters, 'SignalRUpdateParameters') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SignalRResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, resource_name, parameters=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to update an exiting SignalR service. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param resource_name: The name of the SignalR resource. + :type resource_name: str + :param parameters: Parameters for the update operation + :type parameters: ~azure.mgmt.signalr.models.SignalRUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SignalRResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.signalr.models.SignalRResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.signalr.models.SignalRResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('SignalRResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}'} diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/signal_rmanagement_client.py b/azure-mgmt-signalr/azure/mgmt/signalr/signal_rmanagement_client.py new file mode 100644 index 000000000000..166b6bff533e --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/signal_rmanagement_client.py @@ -0,0 +1,90 @@ +# 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.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.operations import Operations +from .operations.signal_roperations import SignalROperations +from . import models + + +class SignalRManagementClientConfiguration(AzureConfiguration): + """Configuration for SignalRManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription Id which uniquely identify the + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(SignalRManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-signalr/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class SignalRManagementClient(SDKClient): + """REST API for Azure SignalR Service + + :ivar config: Configuration for client. + :vartype config: SignalRManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.signalr.operations.Operations + :ivar signal_r: SignalR operations + :vartype signal_r: azure.mgmt.signalr.operations.SignalROperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription Id which uniquely identify the + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = SignalRManagementClientConfiguration(credentials, subscription_id, base_url) + super(SignalRManagementClient, 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-03-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.signal_r = SignalROperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-signalr/azure/mgmt/signalr/version.py b/azure-mgmt-signalr/azure/mgmt/signalr/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/azure-mgmt-signalr/azure/mgmt/signalr/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" + diff --git a/azure-mgmt-signalr/azure_bdist_wheel.py b/azure-mgmt-signalr/azure_bdist_wheel.py new file mode 100644 index 000000000000..8a81d1b61775 --- /dev/null +++ b/azure-mgmt-signalr/azure_bdist_wheel.py @@ -0,0 +1,54 @@ +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +from distutils import log as logger +import os.path + +from wheel.bdist_wheel import bdist_wheel +class azure_bdist_wheel(bdist_wheel): + """The purpose of this class is to build wheel a little differently than the sdist, + without requiring to build the wheel from the sdist (i.e. you can build the wheel + directly from source). + """ + + description = "Create an Azure wheel distribution" + + user_options = bdist_wheel.user_options + \ + [('azure-namespace-package=', None, + "Name of the deepest nspkg used")] + + def initialize_options(self): + bdist_wheel.initialize_options(self) + self.azure_namespace_package = None + + def finalize_options(self): + bdist_wheel.finalize_options(self) + if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"): + raise ValueError("azure_namespace_package must finish by -nspkg") + + def run(self): + if not self.distribution.install_requires: + self.distribution.install_requires = [] + self.distribution.install_requires.append( + "{}>=2.0.0".format(self.azure_namespace_package)) + bdist_wheel.run(self) + + def write_record(self, bdist_dir, distinfo_dir): + if self.azure_namespace_package: + # Split and remove last part, assuming it's "nspkg" + subparts = self.azure_namespace_package.split('-')[0:-1] + folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))] + for azure_sub_package in folder_with_init: + init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py') + if os.path.isfile(init_file): + logger.info("manually remove {} while building the wheel".format(init_file)) + os.remove(init_file) + else: + raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file)) + bdist_wheel.write_record(self, bdist_dir, distinfo_dir) +cmdclass = { + 'bdist_wheel': azure_bdist_wheel, +} diff --git a/azure-mgmt-signalr/setup.cfg b/azure-mgmt-signalr/setup.cfg new file mode 100644 index 000000000000..856f4164982c --- /dev/null +++ b/azure-mgmt-signalr/setup.cfg @@ -0,0 +1,3 @@ +[bdist_wheel] +universal=1 +azure-namespace-package=azure-mgmt-nspkg \ No newline at end of file diff --git a/azure-mgmt-signalr/setup.py b/azure-mgmt-signalr/setup.py new file mode 100644 index 000000000000..9c5946249c46 --- /dev/null +++ b/azure-mgmt-signalr/setup.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup +try: + from azure_bdist_wheel import cmdclass +except ImportError: + from distutils import log as logger + logger.warn("Wheel is not available, disabling bdist_wheel hook") + cmdclass = {} + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-signalr" +PACKAGE_PPRINT_NAME = "SignalR" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=["tests"]), + install_requires=[ + 'msrestazure>=0.4.27,<2.0.0', + 'azure-common~=1.1', + ], + cmdclass=cmdclass +)