From 8c79281cf4ca3ce4c2713434563af8d629d9d6ca Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 17 Oct 2018 09:03:35 -0700 Subject: [PATCH 1/9] [AutoPR servicebus/resource-manager] Service Bus: moved VNet and IpFilter rules from 2018-preview to 2017 API version (#3626) * Generated from d7bcecddf6db2cf2857de2ed818a5b3a33bf4b5f moved VNet and IpFilter rules from 2018-preview to 2017 API version * Packaging update of azure-mgmt-servicebus * Generated from cf8138058fa1001ab7532759064a35de1860aed5 added the readonly enum for type of replication of Alias(Geo DR) * Generated from fedce30b02d58fee823a40fd8cfb34fe8ddbd514 Removed the type property of DisasterRecoveryConfig --- azure-mgmt-servicebus/MANIFEST.in | 3 + .../azure/mgmt/servicebus/models/__init__.py | 12 + .../mgmt/servicebus/models/ip_filter_rule.py | 55 ++ .../servicebus/models/ip_filter_rule_paged.py | 27 + .../servicebus/models/ip_filter_rule_py3.py | 55 ++ .../service_bus_management_client_enums.py | 6 + .../servicebus/models/virtual_network_rule.py | 46 ++ .../models/virtual_network_rule_paged.py | 27 + .../models/virtual_network_rule_py3.py | 46 ++ .../operations/namespaces_operations.py | 527 ++++++++++++++++++ .../azure/mgmt/servicebus/version.py | 2 +- 11 files changed, 805 insertions(+), 1 deletion(-) create mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule.py create mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule_paged.py create mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule_py3.py create mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule.py create mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule_paged.py create mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule_py3.py diff --git a/azure-mgmt-servicebus/MANIFEST.in b/azure-mgmt-servicebus/MANIFEST.in index bb37a2723dae..6ceb27f7a96e 100644 --- a/azure-mgmt-servicebus/MANIFEST.in +++ b/azure-mgmt-servicebus/MANIFEST.in @@ -1 +1,4 @@ include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py index 28d9624d67c0..5d211fbf8244 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py @@ -41,6 +41,8 @@ from .eventhub_py3 import Eventhub from .arm_disaster_recovery_py3 import ArmDisasterRecovery from .migration_config_properties_py3 import MigrationConfigProperties + from .ip_filter_rule_py3 import IpFilterRule + from .virtual_network_rule_py3 import VirtualNetworkRule except (SyntaxError, ImportError): from .tracked_resource import TrackedResource from .resource import Resource @@ -73,9 +75,13 @@ from .eventhub import Eventhub from .arm_disaster_recovery import ArmDisasterRecovery from .migration_config_properties import MigrationConfigProperties + from .ip_filter_rule import IpFilterRule + from .virtual_network_rule import VirtualNetworkRule from .operation_paged import OperationPaged from .sb_namespace_paged import SBNamespacePaged from .sb_authorization_rule_paged import SBAuthorizationRulePaged +from .ip_filter_rule_paged import IpFilterRulePaged +from .virtual_network_rule_paged import VirtualNetworkRulePaged from .arm_disaster_recovery_paged import ArmDisasterRecoveryPaged from .migration_config_properties_paged import MigrationConfigPropertiesPaged from .sb_queue_paged import SBQueuePaged @@ -95,6 +101,7 @@ EncodingCaptureDescription, ProvisioningStateDR, RoleDisasterRecovery, + IPAction, ) __all__ = [ @@ -129,9 +136,13 @@ 'Eventhub', 'ArmDisasterRecovery', 'MigrationConfigProperties', + 'IpFilterRule', + 'VirtualNetworkRule', 'OperationPaged', 'SBNamespacePaged', 'SBAuthorizationRulePaged', + 'IpFilterRulePaged', + 'VirtualNetworkRulePaged', 'ArmDisasterRecoveryPaged', 'MigrationConfigPropertiesPaged', 'SBQueuePaged', @@ -150,4 +161,5 @@ 'EncodingCaptureDescription', 'ProvisioningStateDR', 'RoleDisasterRecovery', + 'IPAction', ] diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule.py new file mode 100644 index 000000000000..927652d86d36 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule.py @@ -0,0 +1,55 @@ +# 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 IpFilterRule(Resource): + """Single item in a List or Get IpFilterRules operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param ip_mask: IP Mask + :type ip_mask: str + :param action: The IP Filter Action. Possible values include: 'Accept', + 'Reject' + :type action: str or ~azure.mgmt.servicebus.models.IPAction + :param filter_name: IP Filter name + :type filter_name: 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'}, + 'ip_mask': {'key': 'properties.ipMask', 'type': 'str'}, + 'action': {'key': 'properties.action', 'type': 'str'}, + 'filter_name': {'key': 'properties.filterName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IpFilterRule, self).__init__(**kwargs) + self.ip_mask = kwargs.get('ip_mask', None) + self.action = kwargs.get('action', None) + self.filter_name = kwargs.get('filter_name', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule_paged.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule_paged.py new file mode 100644 index 000000000000..44c2148fff71 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule_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 IpFilterRulePaged(Paged): + """ + A paging container for iterating over a list of :class:`IpFilterRule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[IpFilterRule]'} + } + + def __init__(self, *args, **kwargs): + + super(IpFilterRulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule_py3.py new file mode 100644 index 000000000000..2b74fc97b46c --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule_py3.py @@ -0,0 +1,55 @@ +# 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_py3 import Resource + + +class IpFilterRule(Resource): + """Single item in a List or Get IpFilterRules operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param ip_mask: IP Mask + :type ip_mask: str + :param action: The IP Filter Action. Possible values include: 'Accept', + 'Reject' + :type action: str or ~azure.mgmt.servicebus.models.IPAction + :param filter_name: IP Filter name + :type filter_name: 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'}, + 'ip_mask': {'key': 'properties.ipMask', 'type': 'str'}, + 'action': {'key': 'properties.action', 'type': 'str'}, + 'filter_name': {'key': 'properties.filterName', 'type': 'str'}, + } + + def __init__(self, *, ip_mask: str=None, action=None, filter_name: str=None, **kwargs) -> None: + super(IpFilterRule, self).__init__(**kwargs) + self.ip_mask = ip_mask + self.action = action + self.filter_name = filter_name diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py index a313fa144d3b..53552468acd9 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py @@ -86,3 +86,9 @@ class RoleDisasterRecovery(str, Enum): primary = "Primary" primary_not_replicating = "PrimaryNotReplicating" secondary = "Secondary" + + +class IPAction(str, Enum): + + accept = "Accept" + reject = "Reject" diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule.py new file mode 100644 index 000000000000..68c1a893cf4c --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule.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 .resource import Resource + + +class VirtualNetworkRule(Resource): + """Single item in a List or Get VirtualNetworkRules operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param virtual_network_subnet_id: Resource ID of Virtual Network Subnet + :type virtual_network_subnet_id: 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'}, + 'virtual_network_subnet_id': {'key': 'properties.virtualNetworkSubnetId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_subnet_id = kwargs.get('virtual_network_subnet_id', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule_paged.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule_paged.py new file mode 100644 index 000000000000..7808ab7872f9 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule_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 VirtualNetworkRulePaged(Paged): + """ + A paging container for iterating over a list of :class:`VirtualNetworkRule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VirtualNetworkRule]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualNetworkRulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule_py3.py new file mode 100644 index 000000000000..7fd2e204ca98 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule_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 .resource_py3 import Resource + + +class VirtualNetworkRule(Resource): + """Single item in a List or Get VirtualNetworkRules operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param virtual_network_subnet_id: Resource ID of Virtual Network Subnet + :type virtual_network_subnet_id: 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'}, + 'virtual_network_subnet_id': {'key': 'properties.virtualNetworkSubnetId', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_subnet_id: str=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_subnet_id = virtual_network_subnet_id diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py index 24c24da1dfa5..7768f6856311 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py @@ -958,3 +958,530 @@ def regenerate_keys( return deserialized regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys'} + + def list_ip_filter_rules( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of IP Filter rules for a Namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_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 IpFilterRule + :rtype: + ~azure.mgmt.servicebus.models.IpFilterRulePaged[~azure.mgmt.servicebus.models.IpFilterRule] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_ip_filter_rules.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.IpFilterRulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.IpFilterRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_ip_filter_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules'} + + def create_or_update_ip_filter_rule( + self, resource_group_name, namespace_name, ip_filter_rule_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates an IpFilterRule for a Namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param ip_filter_rule_name: The IP Filter Rule name. + :type ip_filter_rule_name: str + :param parameters: The Namespace IpFilterRule. + :type parameters: ~azure.mgmt.servicebus.models.IpFilterRule + :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: IpFilterRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.IpFilterRule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update_ip_filter_rule.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'ipFilterRuleName': self._serialize.url("ip_filter_rule_name", ip_filter_rule_name, 'str', min_length=1), + '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['Accept'] = 'application/json' + 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 + body_content = self._serialize.body(parameters, 'IpFilterRule') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IpFilterRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_ip_filter_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}'} + + def delete_ip_filter_rule( + self, resource_group_name, namespace_name, ip_filter_rule_name, custom_headers=None, raw=False, **operation_config): + """Deletes an IpFilterRule for a Namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param ip_filter_rule_name: The IP Filter Rule name. + :type ip_filter_rule_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_ip_filter_rule.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'ipFilterRuleName': self._serialize.url("ip_filter_rule_name", ip_filter_rule_name, 'str', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_ip_filter_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}'} + + def get_ip_filter_rule( + self, resource_group_name, namespace_name, ip_filter_rule_name, custom_headers=None, raw=False, **operation_config): + """Gets an IpFilterRule for a Namespace by rule name. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param ip_filter_rule_name: The IP Filter Rule name. + :type ip_filter_rule_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: IpFilterRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.IpFilterRule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_ip_filter_rule.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'ipFilterRuleName': self._serialize.url("ip_filter_rule_name", ip_filter_rule_name, 'str', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IpFilterRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_ip_filter_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}'} + + def list_virtual_network_rules( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of VirtualNetwork rules for a Namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_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 VirtualNetworkRule + :rtype: + ~azure.mgmt.servicebus.models.VirtualNetworkRulePaged[~azure.mgmt.servicebus.models.VirtualNetworkRule] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_virtual_network_rules.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.VirtualNetworkRulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VirtualNetworkRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_virtual_network_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/virtualnetworkrules'} + + def create_or_update_virtual_network_rule( + self, resource_group_name, namespace_name, virtual_network_rule_name, virtual_network_subnet_id=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates an VirtualNetworkRule for a Namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param virtual_network_rule_name: The Virtual Network Rule name. + :type virtual_network_rule_name: str + :param virtual_network_subnet_id: Resource ID of Virtual Network + Subnet + :type virtual_network_subnet_id: 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: VirtualNetworkRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.VirtualNetworkRule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.VirtualNetworkRule(virtual_network_subnet_id=virtual_network_subnet_id) + + # Construct URL + url = self.create_or_update_virtual_network_rule.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'virtualNetworkRuleName': self._serialize.url("virtual_network_rule_name", virtual_network_rule_name, 'str', min_length=1), + '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['Accept'] = 'application/json' + 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 + body_content = self._serialize.body(parameters, 'VirtualNetworkRule') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_virtual_network_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}'} + + def delete_virtual_network_rule( + self, resource_group_name, namespace_name, virtual_network_rule_name, custom_headers=None, raw=False, **operation_config): + """Deletes an VirtualNetworkRule for a Namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param virtual_network_rule_name: The Virtual Network Rule name. + :type virtual_network_rule_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_virtual_network_rule.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'virtualNetworkRuleName': self._serialize.url("virtual_network_rule_name", virtual_network_rule_name, 'str', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_virtual_network_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}'} + + def get_virtual_network_rule( + self, resource_group_name, namespace_name, virtual_network_rule_name, custom_headers=None, raw=False, **operation_config): + """Gets an VirtualNetworkRule for a Namespace by rule name. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param virtual_network_rule_name: The Virtual Network Rule name. + :type virtual_network_rule_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: VirtualNetworkRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.VirtualNetworkRule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_virtual_network_rule.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'virtualNetworkRuleName': self._serialize.url("virtual_network_rule_name", virtual_network_rule_name, 'str', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_virtual_network_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}'} diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py index 3c93989b8fef..266f5a486d79 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.5.2" +VERSION = "0.5.0" From 3d9ad782ac78e8e42ac72cd20e4a832a76dbf51c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 23 Oct 2018 12:52:19 -0700 Subject: [PATCH 2/9] Generated from 4b6f298444a858abae912e63dd544acedb760373 (#3634) Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs into sbmigrateaction # Conflicts: # specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2017-04-01/servicebus.json --- .../azure/mgmt/servicebus/models/__init__.py | 5 ++ .../servicebus/models/sb_namespace_migrate.py | 37 +++++++++++ .../models/sb_namespace_migrate_py3.py | 37 +++++++++++ .../service_bus_management_client_enums.py | 9 +++ .../operations/namespaces_operations.py | 63 +++++++++++++++++++ 5 files changed, 151 insertions(+) create mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_migrate.py create mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_migrate_py3.py diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py index 5d211fbf8244..2aab74f95055 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py @@ -16,6 +16,7 @@ from .sb_sku_py3 import SBSku from .sb_namespace_py3 import SBNamespace from .sb_namespace_update_parameters_py3 import SBNamespaceUpdateParameters + from .sb_namespace_migrate_py3 import SBNamespaceMigrate from .sb_authorization_rule_py3 import SBAuthorizationRule from .authorization_rule_properties_py3 import AuthorizationRuleProperties from .access_keys_py3 import AccessKeys @@ -50,6 +51,7 @@ from .sb_sku import SBSku from .sb_namespace import SBNamespace from .sb_namespace_update_parameters import SBNamespaceUpdateParameters + from .sb_namespace_migrate import SBNamespaceMigrate from .sb_authorization_rule import SBAuthorizationRule from .authorization_rule_properties import AuthorizationRuleProperties from .access_keys import AccessKeys @@ -93,6 +95,7 @@ from .service_bus_management_client_enums import ( SkuName, SkuTier, + NameSpaceType, AccessRights, KeyType, EntityStatus, @@ -111,6 +114,7 @@ 'SBSku', 'SBNamespace', 'SBNamespaceUpdateParameters', + 'SBNamespaceMigrate', 'SBAuthorizationRule', 'AuthorizationRuleProperties', 'AccessKeys', @@ -153,6 +157,7 @@ 'EventhubPaged', 'SkuName', 'SkuTier', + 'NameSpaceType', 'AccessRights', 'KeyType', 'EntityStatus', diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_migrate.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_migrate.py new file mode 100644 index 000000000000..a428dd686e41 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_migrate.py @@ -0,0 +1,37 @@ +# 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 SBNamespaceMigrate(Model): + """Namespace Migrate Object. + + All required parameters must be populated in order to send to Azure. + + :param target_namespace_type: Required. Type of namespaces. Possible + values include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', + 'Relay' + :type target_namespace_type: str or + ~azure.mgmt.servicebus.models.NameSpaceType + """ + + _validation = { + 'target_namespace_type': {'required': True}, + } + + _attribute_map = { + 'target_namespace_type': {'key': 'targetNamespaceType', 'type': 'NameSpaceType'}, + } + + def __init__(self, **kwargs): + super(SBNamespaceMigrate, self).__init__(**kwargs) + self.target_namespace_type = kwargs.get('target_namespace_type', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_migrate_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_migrate_py3.py new file mode 100644 index 000000000000..52e28dbea884 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_migrate_py3.py @@ -0,0 +1,37 @@ +# 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 SBNamespaceMigrate(Model): + """Namespace Migrate Object. + + All required parameters must be populated in order to send to Azure. + + :param target_namespace_type: Required. Type of namespaces. Possible + values include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', + 'Relay' + :type target_namespace_type: str or + ~azure.mgmt.servicebus.models.NameSpaceType + """ + + _validation = { + 'target_namespace_type': {'required': True}, + } + + _attribute_map = { + 'target_namespace_type': {'key': 'targetNamespaceType', 'type': 'NameSpaceType'}, + } + + def __init__(self, *, target_namespace_type, **kwargs) -> None: + super(SBNamespaceMigrate, self).__init__(**kwargs) + self.target_namespace_type = target_namespace_type diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py index 53552468acd9..f5dbf7311524 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py @@ -26,6 +26,15 @@ class SkuTier(str, Enum): premium = "Premium" +class NameSpaceType(str, Enum): + + messaging = "Messaging" + notification_hub = "NotificationHub" + mixed = "Mixed" + event_hub = "EventHub" + relay = "Relay" + + class AccessRights(str, Enum): manage = "Manage" diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py index 7768f6856311..401f5c2202d5 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py @@ -959,6 +959,69 @@ def regenerate_keys( return deserialized regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys'} + def migrate( + self, resource_group_name, namespace_name, target_namespace_type, custom_headers=None, raw=False, **operation_config): + """This operation Migrate the given namespace to provided name type. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param target_namespace_type: Type of namespaces. Possible values + include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', 'Relay' + :type target_namespace_type: str or + ~azure.mgmt.servicebus.models.NameSpaceType + :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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.SBNamespaceMigrate(target_namespace_type=target_namespace_type) + + # Construct URL + url = self.migrate.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + '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 + body_content = self._serialize.body(parameters, 'SBNamespaceMigrate') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + migrate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrate'} + def list_ip_filter_rules( self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): """Gets a list of IP Filter rules for a Namespace. From 4cc0e407b0f0464f26c0145c42a4b3edc2836257 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 29 Oct 2018 07:49:11 -0700 Subject: [PATCH 3/9] Generated from 48c274ab891a2e7a085370133c6940f17ccdc6ad (#3688) lint fix --- .../azure/mgmt/servicebus/models/__init__.py | 12 - .../mgmt/servicebus/models/ip_filter_rule.py | 55 -- .../servicebus/models/ip_filter_rule_paged.py | 27 - .../servicebus/models/ip_filter_rule_py3.py | 55 -- .../service_bus_management_client_enums.py | 6 - .../servicebus/models/virtual_network_rule.py | 46 -- .../models/virtual_network_rule_paged.py | 27 - .../models/virtual_network_rule_py3.py | 46 -- .../operations/namespaces_operations.py | 527 ------------------ 9 files changed, 801 deletions(-) delete mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule.py delete mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule_paged.py delete mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule_py3.py delete mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule.py delete mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule_paged.py delete mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule_py3.py diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py index 2aab74f95055..a08fabf3bf29 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py @@ -42,8 +42,6 @@ from .eventhub_py3 import Eventhub from .arm_disaster_recovery_py3 import ArmDisasterRecovery from .migration_config_properties_py3 import MigrationConfigProperties - from .ip_filter_rule_py3 import IpFilterRule - from .virtual_network_rule_py3 import VirtualNetworkRule except (SyntaxError, ImportError): from .tracked_resource import TrackedResource from .resource import Resource @@ -77,13 +75,9 @@ from .eventhub import Eventhub from .arm_disaster_recovery import ArmDisasterRecovery from .migration_config_properties import MigrationConfigProperties - from .ip_filter_rule import IpFilterRule - from .virtual_network_rule import VirtualNetworkRule from .operation_paged import OperationPaged from .sb_namespace_paged import SBNamespacePaged from .sb_authorization_rule_paged import SBAuthorizationRulePaged -from .ip_filter_rule_paged import IpFilterRulePaged -from .virtual_network_rule_paged import VirtualNetworkRulePaged from .arm_disaster_recovery_paged import ArmDisasterRecoveryPaged from .migration_config_properties_paged import MigrationConfigPropertiesPaged from .sb_queue_paged import SBQueuePaged @@ -104,7 +98,6 @@ EncodingCaptureDescription, ProvisioningStateDR, RoleDisasterRecovery, - IPAction, ) __all__ = [ @@ -140,13 +133,9 @@ 'Eventhub', 'ArmDisasterRecovery', 'MigrationConfigProperties', - 'IpFilterRule', - 'VirtualNetworkRule', 'OperationPaged', 'SBNamespacePaged', 'SBAuthorizationRulePaged', - 'IpFilterRulePaged', - 'VirtualNetworkRulePaged', 'ArmDisasterRecoveryPaged', 'MigrationConfigPropertiesPaged', 'SBQueuePaged', @@ -166,5 +155,4 @@ 'EncodingCaptureDescription', 'ProvisioningStateDR', 'RoleDisasterRecovery', - 'IPAction', ] diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule.py deleted file mode 100644 index 927652d86d36..000000000000 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 IpFilterRule(Resource): - """Single item in a List or Get IpFilterRules operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param ip_mask: IP Mask - :type ip_mask: str - :param action: The IP Filter Action. Possible values include: 'Accept', - 'Reject' - :type action: str or ~azure.mgmt.servicebus.models.IPAction - :param filter_name: IP Filter name - :type filter_name: 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'}, - 'ip_mask': {'key': 'properties.ipMask', 'type': 'str'}, - 'action': {'key': 'properties.action', 'type': 'str'}, - 'filter_name': {'key': 'properties.filterName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(IpFilterRule, self).__init__(**kwargs) - self.ip_mask = kwargs.get('ip_mask', None) - self.action = kwargs.get('action', None) - self.filter_name = kwargs.get('filter_name', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule_paged.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule_paged.py deleted file mode 100644 index 44c2148fff71..000000000000 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 IpFilterRulePaged(Paged): - """ - A paging container for iterating over a list of :class:`IpFilterRule ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[IpFilterRule]'} - } - - def __init__(self, *args, **kwargs): - - super(IpFilterRulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule_py3.py deleted file mode 100644 index 2b74fc97b46c..000000000000 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/ip_filter_rule_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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_py3 import Resource - - -class IpFilterRule(Resource): - """Single item in a List or Get IpFilterRules operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param ip_mask: IP Mask - :type ip_mask: str - :param action: The IP Filter Action. Possible values include: 'Accept', - 'Reject' - :type action: str or ~azure.mgmt.servicebus.models.IPAction - :param filter_name: IP Filter name - :type filter_name: 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'}, - 'ip_mask': {'key': 'properties.ipMask', 'type': 'str'}, - 'action': {'key': 'properties.action', 'type': 'str'}, - 'filter_name': {'key': 'properties.filterName', 'type': 'str'}, - } - - def __init__(self, *, ip_mask: str=None, action=None, filter_name: str=None, **kwargs) -> None: - super(IpFilterRule, self).__init__(**kwargs) - self.ip_mask = ip_mask - self.action = action - self.filter_name = filter_name diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py index f5dbf7311524..fca792784228 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py @@ -95,9 +95,3 @@ class RoleDisasterRecovery(str, Enum): primary = "Primary" primary_not_replicating = "PrimaryNotReplicating" secondary = "Secondary" - - -class IPAction(str, Enum): - - accept = "Accept" - reject = "Reject" diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule.py deleted file mode 100644 index 68c1a893cf4c..000000000000 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 VirtualNetworkRule(Resource): - """Single item in a List or Get VirtualNetworkRules operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param virtual_network_subnet_id: Resource ID of Virtual Network Subnet - :type virtual_network_subnet_id: 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'}, - 'virtual_network_subnet_id': {'key': 'properties.virtualNetworkSubnetId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualNetworkRule, self).__init__(**kwargs) - self.virtual_network_subnet_id = kwargs.get('virtual_network_subnet_id', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule_paged.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule_paged.py deleted file mode 100644 index 7808ab7872f9..000000000000 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 VirtualNetworkRulePaged(Paged): - """ - A paging container for iterating over a list of :class:`VirtualNetworkRule ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[VirtualNetworkRule]'} - } - - def __init__(self, *args, **kwargs): - - super(VirtualNetworkRulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule_py3.py deleted file mode 100644 index 7fd2e204ca98..000000000000 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/virtual_network_rule_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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_py3 import Resource - - -class VirtualNetworkRule(Resource): - """Single item in a List or Get VirtualNetworkRules operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param virtual_network_subnet_id: Resource ID of Virtual Network Subnet - :type virtual_network_subnet_id: 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'}, - 'virtual_network_subnet_id': {'key': 'properties.virtualNetworkSubnetId', 'type': 'str'}, - } - - def __init__(self, *, virtual_network_subnet_id: str=None, **kwargs) -> None: - super(VirtualNetworkRule, self).__init__(**kwargs) - self.virtual_network_subnet_id = virtual_network_subnet_id diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py index 401f5c2202d5..76d25c129e07 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py @@ -1021,530 +1021,3 @@ def migrate( client_raw_response = ClientRawResponse(None, response) return client_raw_response migrate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrate'} - - def list_ip_filter_rules( - self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of IP Filter rules for a Namespace. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_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 IpFilterRule - :rtype: - ~azure.mgmt.servicebus.models.IpFilterRulePaged[~azure.mgmt.servicebus.models.IpFilterRule] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_ip_filter_rules.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.IpFilterRulePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.IpFilterRulePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_ip_filter_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules'} - - def create_or_update_ip_filter_rule( - self, resource_group_name, namespace_name, ip_filter_rule_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates or updates an IpFilterRule for a Namespace. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param ip_filter_rule_name: The IP Filter Rule name. - :type ip_filter_rule_name: str - :param parameters: The Namespace IpFilterRule. - :type parameters: ~azure.mgmt.servicebus.models.IpFilterRule - :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: IpFilterRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.IpFilterRule or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.create_or_update_ip_filter_rule.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'ipFilterRuleName': self._serialize.url("ip_filter_rule_name", ip_filter_rule_name, 'str', min_length=1), - '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['Accept'] = 'application/json' - 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 - body_content = self._serialize.body(parameters, 'IpFilterRule') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('IpFilterRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update_ip_filter_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}'} - - def delete_ip_filter_rule( - self, resource_group_name, namespace_name, ip_filter_rule_name, custom_headers=None, raw=False, **operation_config): - """Deletes an IpFilterRule for a Namespace. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param ip_filter_rule_name: The IP Filter Rule name. - :type ip_filter_rule_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_ip_filter_rule.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'ipFilterRuleName': self._serialize.url("ip_filter_rule_name", ip_filter_rule_name, 'str', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete_ip_filter_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}'} - - def get_ip_filter_rule( - self, resource_group_name, namespace_name, ip_filter_rule_name, custom_headers=None, raw=False, **operation_config): - """Gets an IpFilterRule for a Namespace by rule name. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param ip_filter_rule_name: The IP Filter Rule name. - :type ip_filter_rule_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: IpFilterRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.IpFilterRule or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_ip_filter_rule.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'ipFilterRuleName': self._serialize.url("ip_filter_rule_name", ip_filter_rule_name, 'str', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('IpFilterRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_ip_filter_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}'} - - def list_virtual_network_rules( - self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of VirtualNetwork rules for a Namespace. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_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 VirtualNetworkRule - :rtype: - ~azure.mgmt.servicebus.models.VirtualNetworkRulePaged[~azure.mgmt.servicebus.models.VirtualNetworkRule] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_virtual_network_rules.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.VirtualNetworkRulePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.VirtualNetworkRulePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_virtual_network_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/virtualnetworkrules'} - - def create_or_update_virtual_network_rule( - self, resource_group_name, namespace_name, virtual_network_rule_name, virtual_network_subnet_id=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates an VirtualNetworkRule for a Namespace. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param virtual_network_rule_name: The Virtual Network Rule name. - :type virtual_network_rule_name: str - :param virtual_network_subnet_id: Resource ID of Virtual Network - Subnet - :type virtual_network_subnet_id: 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: VirtualNetworkRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.VirtualNetworkRule or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - parameters = models.VirtualNetworkRule(virtual_network_subnet_id=virtual_network_subnet_id) - - # Construct URL - url = self.create_or_update_virtual_network_rule.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'virtualNetworkRuleName': self._serialize.url("virtual_network_rule_name", virtual_network_rule_name, 'str', min_length=1), - '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['Accept'] = 'application/json' - 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 - body_content = self._serialize.body(parameters, 'VirtualNetworkRule') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('VirtualNetworkRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update_virtual_network_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}'} - - def delete_virtual_network_rule( - self, resource_group_name, namespace_name, virtual_network_rule_name, custom_headers=None, raw=False, **operation_config): - """Deletes an VirtualNetworkRule for a Namespace. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param virtual_network_rule_name: The Virtual Network Rule name. - :type virtual_network_rule_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_virtual_network_rule.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'virtualNetworkRuleName': self._serialize.url("virtual_network_rule_name", virtual_network_rule_name, 'str', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete_virtual_network_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}'} - - def get_virtual_network_rule( - self, resource_group_name, namespace_name, virtual_network_rule_name, custom_headers=None, raw=False, **operation_config): - """Gets an VirtualNetworkRule for a Namespace by rule name. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param virtual_network_rule_name: The Virtual Network Rule name. - :type virtual_network_rule_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: VirtualNetworkRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.VirtualNetworkRule or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_virtual_network_rule.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'virtualNetworkRuleName': self._serialize.url("virtual_network_rule_name", virtual_network_rule_name, 'str', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('VirtualNetworkRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_virtual_network_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}'} From b6d0e0b7ed03372c7b1300568046ebd367e6592d Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 22 Jan 2019 12:27:06 -0800 Subject: [PATCH 4/9] Generated from a191937f86b853c5addfa5a04eae618baba005d7 (#3990) chore: Additional ServiceBus example renames --- .../mgmt/servicebus/models/arm_disaster_recovery.py | 4 ++-- .../servicebus/models/arm_disaster_recovery_py3.py | 4 ++-- .../servicebus/models/check_name_availability.py | 2 +- .../servicebus/models/check_name_availability_py3.py | 2 +- .../azure/mgmt/servicebus/models/error_response.py | 2 +- .../mgmt/servicebus/models/error_response_py3.py | 2 +- .../models/regenerate_access_key_parameters.py | 2 +- .../models/regenerate_access_key_parameters_py3.py | 2 +- .../azure/mgmt/servicebus/models/sb_namespace.py | 2 +- .../azure/mgmt/servicebus/models/sb_namespace_py3.py | 2 +- .../models/sb_namespace_update_parameters.py | 2 +- .../models/sb_namespace_update_parameters_py3.py | 2 +- .../azure/mgmt/servicebus/models/sb_topic.py | 2 +- .../azure/mgmt/servicebus/models/sb_topic_py3.py | 2 +- .../disaster_recovery_configs_operations.py | 12 ++++++------ .../operations/migration_configs_operations.py | 4 ++-- .../servicebus/operations/namespaces_operations.py | 12 ++++++------ .../mgmt/servicebus/operations/queues_operations.py | 10 +++++----- .../mgmt/servicebus/operations/topics_operations.py | 12 ++++++------ 19 files changed, 41 insertions(+), 41 deletions(-) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/arm_disaster_recovery.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/arm_disaster_recovery.py index b2134935b610..fd5cbb1978d6 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/arm_disaster_recovery.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/arm_disaster_recovery.py @@ -34,10 +34,10 @@ class ArmDisasterRecovery(Resource): be replicated. :vartype pending_replication_operations_count: long :param partner_namespace: ARM Id of the Primary/Secondary eventhub - namespace name, which is part of GEO DR pairning + namespace name, which is part of GEO DR pairing :type partner_namespace: str :param alternate_name: Primary/Secondary eventhub namespace name, which is - part of GEO DR pairning + part of GEO DR pairing :type alternate_name: str :ivar role: role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or 'Secondary'. Possible values include: diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/arm_disaster_recovery_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/arm_disaster_recovery_py3.py index 6b6b91e9c6db..e9247b683da8 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/arm_disaster_recovery_py3.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/arm_disaster_recovery_py3.py @@ -34,10 +34,10 @@ class ArmDisasterRecovery(Resource): be replicated. :vartype pending_replication_operations_count: long :param partner_namespace: ARM Id of the Primary/Secondary eventhub - namespace name, which is part of GEO DR pairning + namespace name, which is part of GEO DR pairing :type partner_namespace: str :param alternate_name: Primary/Secondary eventhub namespace name, which is - part of GEO DR pairning + part of GEO DR pairing :type alternate_name: str :ivar role: role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or 'Secondary'. Possible values include: diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability.py index 46029ace9293..1fb6c7d532af 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability.py @@ -17,7 +17,7 @@ class CheckNameAvailability(Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The Name to check the namespce name availability + :param name: Required. The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability_py3.py index c04f123ecafa..aa5cedb278ad 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability_py3.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability_py3.py @@ -17,7 +17,7 @@ class CheckNameAvailability(Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The Name to check the namespce name availability + :param name: Required. The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/error_response.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/error_response.py index a303ca9b634a..094413f37b29 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/error_response.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/error_response.py @@ -14,7 +14,7 @@ class ErrorResponse(Model): - """Error reponse indicates ServiceBus service is not able to process the + """Error response indicates ServiceBus service is not able to process the incoming request. The reason is provided in the error message. :param code: Error code. diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/error_response_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/error_response_py3.py index 85e198147221..e9d51bc83f31 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/error_response_py3.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/error_response_py3.py @@ -14,7 +14,7 @@ class ErrorResponse(Model): - """Error reponse indicates ServiceBus service is not able to process the + """Error response indicates ServiceBus service is not able to process the incoming request. The reason is provided in the error message. :param code: Error code. diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/regenerate_access_key_parameters.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/regenerate_access_key_parameters.py index c54d0d30b21d..a4526b2eba48 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/regenerate_access_key_parameters.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/regenerate_access_key_parameters.py @@ -14,7 +14,7 @@ class RegenerateAccessKeyParameters(Model): """Parameters supplied to the Regenerate Authorization Rule operation, - specifies which key neeeds to be reset. + specifies which key needs to be reset. All required parameters must be populated in order to send to Azure. diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/regenerate_access_key_parameters_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/regenerate_access_key_parameters_py3.py index 1b51d422ea4c..b18043d81452 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/regenerate_access_key_parameters_py3.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/regenerate_access_key_parameters_py3.py @@ -14,7 +14,7 @@ class RegenerateAccessKeyParameters(Model): """Parameters supplied to the Regenerate Authorization Rule operation, - specifies which key neeeds to be reset. + specifies which key needs to be reset. All required parameters must be populated in order to send to Azure. diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace.py index 398be39f0412..94c70ca44055 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace.py @@ -30,7 +30,7 @@ class SBNamespace(TrackedResource): :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param sku: Porperties of Sku + :param sku: Properties of Sku :type sku: ~azure.mgmt.servicebus.models.SBSku :ivar provisioning_state: Provisioning state of the namespace. :vartype provisioning_state: str diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_py3.py index d308e48b33a6..72041e6d9a85 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_py3.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_py3.py @@ -30,7 +30,7 @@ class SBNamespace(TrackedResource): :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param sku: Porperties of Sku + :param sku: Properties of Sku :type sku: ~azure.mgmt.servicebus.models.SBSku :ivar provisioning_state: Provisioning state of the namespace. :vartype provisioning_state: str diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_update_parameters.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_update_parameters.py index 5b6274272ba3..76765c7ff07a 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_update_parameters.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_update_parameters.py @@ -28,7 +28,7 @@ class SBNamespaceUpdateParameters(ResourceNamespacePatch): :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param sku: Porperties of Sku + :param sku: Properties of Sku :type sku: ~azure.mgmt.servicebus.models.SBSku :ivar provisioning_state: Provisioning state of the namespace. :vartype provisioning_state: str diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_update_parameters_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_update_parameters_py3.py index 80ac2a2b3457..d61858aa3328 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_update_parameters_py3.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_update_parameters_py3.py @@ -28,7 +28,7 @@ class SBNamespaceUpdateParameters(ResourceNamespacePatch): :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param sku: Porperties of Sku + :param sku: Properties of Sku :type sku: ~azure.mgmt.servicebus.models.SBSku :ivar provisioning_state: Provisioning state of the namespace. :vartype provisioning_state: str diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_topic.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_topic.py index ce92872562e1..d6606145f094 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_topic.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_topic.py @@ -35,7 +35,7 @@ class SBTopic(Resource): :vartype accessed_at: datetime :ivar subscription_count: Number of subscriptions. :vartype subscription_count: int - :ivar count_details: Message count deatils + :ivar count_details: Message count details :vartype count_details: ~azure.mgmt.servicebus.models.MessageCountDetails :param default_message_time_to_live: ISO 8601 Default message timespan to live value. This is the duration after which the message expires, starting diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_topic_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_topic_py3.py index 3f7e90ea3f9f..6a07ddcdfb91 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_topic_py3.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_topic_py3.py @@ -35,7 +35,7 @@ class SBTopic(Resource): :vartype accessed_at: datetime :ivar subscription_count: Number of subscriptions. :vartype subscription_count: int - :ivar count_details: Message count deatils + :ivar count_details: Message count details :vartype count_details: ~azure.mgmt.servicebus.models.MessageCountDetails :param default_message_time_to_live: ISO 8601 Default message timespan to live value. This is the duration after which the message expires, starting diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/disaster_recovery_configs_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/disaster_recovery_configs_operations.py index 954ba0228663..5ee7b0bd605e 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/disaster_recovery_configs_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/disaster_recovery_configs_operations.py @@ -45,7 +45,7 @@ def check_name_availability_method( :type resource_group_name: str :param namespace_name: The namespace name :type namespace_name: str - :param name: The Name to check the namespce name availability and The + :param name: The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. @@ -191,10 +191,10 @@ def create_or_update( :param alias: The Disaster Recovery configuration name :type alias: str :param partner_namespace: ARM Id of the Primary/Secondary eventhub - namespace name, which is part of GEO DR pairning + namespace name, which is part of GEO DR pairing :type partner_namespace: str :param alternate_name: Primary/Secondary eventhub namespace name, - which is part of GEO DR pairning + which is part of GEO DR pairing :type alternate_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -437,7 +437,7 @@ def break_pairing( def fail_over( self, resource_group_name, namespace_name, alias, custom_headers=None, raw=False, **operation_config): - """envokes GEO DR failover and reconfigure the alias to point to the + """Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. :param resource_group_name: Name of the Resource group within the @@ -576,7 +576,7 @@ def get_authorization_rule( :type namespace_name: str :param alias: The Disaster Recovery configuration name :type alias: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -644,7 +644,7 @@ def list_keys( :type namespace_name: str :param alias: The Disaster Recovery configuration name :type alias: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/migration_configs_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/migration_configs_operations.py index a0df317c9ff6..1fbda5b37da5 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/migration_configs_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/migration_configs_operations.py @@ -163,7 +163,7 @@ def _create_and_start_migration_initial( def create_and_start_migration( self, resource_group_name, namespace_name, target_namespace, post_migration_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates Migration configuration and starts migration of enties from + """Creates Migration configuration and starts migration of entities from Standard to Premium namespace. :param resource_group_name: Name of the Resource group within the @@ -340,7 +340,7 @@ def get( def complete_migration( self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): """This operation Completes Migration of entities by pointing the - connection strings to Premium namespace and any enties created after + connection strings to Premium namespace and any entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when entity migration is in-progress. diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py index 76d25c129e07..c6fe24f87c12 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py @@ -42,7 +42,7 @@ def check_name_availability_method( self, name, custom_headers=None, raw=False, **operation_config): """Check the give namespace name availability. - :param name: The Name to check the namespce name availability and The + :param name: The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. @@ -631,7 +631,7 @@ def create_or_update_authorization_rule( :type resource_group_name: str :param namespace_name: The namespace name :type namespace_name: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param rights: The rights associated with the rule. :type rights: list[str or ~azure.mgmt.servicebus.models.AccessRights] @@ -704,7 +704,7 @@ def delete_authorization_rule( :type resource_group_name: str :param namespace_name: The namespace name :type namespace_name: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -760,7 +760,7 @@ def get_authorization_rule( :type resource_group_name: str :param namespace_name: The namespace name :type namespace_name: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -825,7 +825,7 @@ def list_keys( :type resource_group_name: str :param namespace_name: The namespace name :type namespace_name: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -891,7 +891,7 @@ def regenerate_keys( :type resource_group_name: str :param namespace_name: The namespace name :type namespace_name: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param key_type: The access key to regenerate. Possible values include: 'PrimaryKey', 'SecondaryKey' diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/queues_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/queues_operations.py index 67c1e1d70e91..5e60e0854c50 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/queues_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/queues_operations.py @@ -395,7 +395,7 @@ def create_or_update_authorization_rule( :type namespace_name: str :param queue_name: The queue name. :type queue_name: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param rights: The rights associated with the rule. :type rights: list[str or ~azure.mgmt.servicebus.models.AccessRights] @@ -471,7 +471,7 @@ def delete_authorization_rule( :type namespace_name: str :param queue_name: The queue name. :type queue_name: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -530,7 +530,7 @@ def get_authorization_rule( :type namespace_name: str :param queue_name: The queue name. :type queue_name: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -598,7 +598,7 @@ def list_keys( :type namespace_name: str :param queue_name: The queue name. :type queue_name: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -666,7 +666,7 @@ def regenerate_keys( :type namespace_name: str :param queue_name: The queue name. :type queue_name: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param key_type: The access key to regenerate. Possible values include: 'PrimaryKey', 'SecondaryKey' diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/topics_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/topics_operations.py index c23bdff1cfb0..4b8469557ad1 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/topics_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/topics_operations.py @@ -385,7 +385,7 @@ def internal_paging(next_link=None, raw=False): def create_or_update_authorization_rule( self, resource_group_name, namespace_name, topic_name, authorization_rule_name, rights, custom_headers=None, raw=False, **operation_config): - """Creates an authorizatio rule for the specified topic. + """Creates an authorization rule for the specified topic. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -394,7 +394,7 @@ def create_or_update_authorization_rule( :type namespace_name: str :param topic_name: The topic name. :type topic_name: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param rights: The rights associated with the rule. :type rights: list[str or ~azure.mgmt.servicebus.models.AccessRights] @@ -470,7 +470,7 @@ def get_authorization_rule( :type namespace_name: str :param topic_name: The topic name. :type topic_name: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -538,7 +538,7 @@ def delete_authorization_rule( :type namespace_name: str :param topic_name: The topic name. :type topic_name: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -597,7 +597,7 @@ def list_keys( :type namespace_name: str :param topic_name: The topic name. :type topic_name: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -665,7 +665,7 @@ def regenerate_keys( :type namespace_name: str :param topic_name: The topic name. :type topic_name: str - :param authorization_rule_name: The authorizationrule name. + :param authorization_rule_name: The authorization rule name. :type authorization_rule_name: str :param key_type: The access key to regenerate. Possible values include: 'PrimaryKey', 'SecondaryKey' From 18e439189fa939b7ff1897986c91f723ff315f6b Mon Sep 17 00:00:00 2001 From: Isabella Cai Date: Fri, 15 Feb 2019 14:38:06 -0800 Subject: [PATCH 5/9] updated versioning and changelog --- azure-mgmt-servicebus/HISTORY.rst | 7 +++++++ azure-mgmt-servicebus/azure/mgmt/servicebus/version.py | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/azure-mgmt-servicebus/HISTORY.rst b/azure-mgmt-servicebus/HISTORY.rst index 7304b6dc1f8c..e5ae5d963fd2 100644 --- a/azure-mgmt-servicebus/HISTORY.rst +++ b/azure-mgmt-servicebus/HISTORY.rst @@ -3,6 +3,13 @@ Release History =============== +0.5.3 (2019-02-25) +++++++++++++++++++ + +**Features** + +- Added operation NamespacesOperations.migrate + 0.5.2 (2018-09-28) ++++++++++++++++++ diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py index 266f5a486d79..d1e0cac30d33 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py @@ -9,5 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.5.0" - +VERSION = "0.5.3" From 2ecebf9ca8268070d000da8c19ef75f9d7ec2ea4 Mon Sep 17 00:00:00 2001 From: azuresdkci Date: Fri, 15 Feb 2019 22:42:10 +0000 Subject: [PATCH 6/9] Packaging update of azure-mgmt-servicebus --- azure-mgmt-servicebus/README.rst | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/azure-mgmt-servicebus/README.rst b/azure-mgmt-servicebus/README.rst index cdfd9e5bab7f..982825691830 100644 --- a/azure-mgmt-servicebus/README.rst +++ b/azure-mgmt-servicebus/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see 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 ===== From 4b74fff643a7e3c0f8bcd1e4fa99d4daf42ff92b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 21 Mar 2019 09:57:22 -0700 Subject: [PATCH 7/9] [AutoPR servicebus/resource-manager] Servicebus : NetworkruleSet (#4534) * Generated from dba02a7e5a4dc5206712658d8ab20fd5ccf5bf0a Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs into SBvnetkafka2017 * Packaging update of azure-mgmt-servicebus * Generated from e828e75e53a4091dc3dc4c9f27dc34b2a60446b7 fixed default for enum * Generated from 530b1bf768af8bde3f78795429c083d446f3ec5b updated the URI to networkRuleSets as per ARM guideline * Generated from ba179ab792139616c7b8812464f6814eba64c87b updated with review comments resolve --- azure-mgmt-servicebus/MANIFEST.in | 1 + azure-mgmt-servicebus/README.rst | 3 + .../azure/mgmt/servicebus/models/__init__.py | 16 +++ .../servicebus/models/network_rule_set.py | 56 ++++++++ .../servicebus/models/network_rule_set_py3.py | 56 ++++++++ .../servicebus/models/nw_rule_set_ip_rules.py | 33 +++++ .../models/nw_rule_set_ip_rules_py3.py | 33 +++++ .../nw_rule_set_virtual_network_rules.py | 33 +++++ .../nw_rule_set_virtual_network_rules_py3.py | 33 +++++ .../service_bus_management_client_enums.py | 11 ++ .../azure/mgmt/servicebus/models/subnet.py | 34 +++++ .../mgmt/servicebus/models/subnet_py3.py | 34 +++++ .../operations/namespaces_operations.py | 130 ++++++++++++++++++ .../azure/mgmt/servicebus/version.py | 3 +- 14 files changed, 475 insertions(+), 1 deletion(-) create mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/network_rule_set.py create mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/network_rule_set_py3.py create mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/nw_rule_set_ip_rules.py create mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/nw_rule_set_ip_rules_py3.py create mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/nw_rule_set_virtual_network_rules.py create mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/nw_rule_set_virtual_network_rules_py3.py create mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/subnet.py create mode 100644 azure-mgmt-servicebus/azure/mgmt/servicebus/models/subnet_py3.py diff --git a/azure-mgmt-servicebus/MANIFEST.in b/azure-mgmt-servicebus/MANIFEST.in index 6ceb27f7a96e..e4884efef41b 100644 --- a/azure-mgmt-servicebus/MANIFEST.in +++ b/azure-mgmt-servicebus/MANIFEST.in @@ -1,3 +1,4 @@ +recursive-include tests *.py *.yaml include *.rst include azure/__init__.py include azure/mgmt/__init__.py diff --git a/azure-mgmt-servicebus/README.rst b/azure-mgmt-servicebus/README.rst index 982825691830..4bcd7348bfc5 100644 --- a/azure-mgmt-servicebus/README.rst +++ b/azure-mgmt-servicebus/README.rst @@ -28,3 +28,6 @@ Provide Feedback If you encounter any bugs or have suggestions, please file an issue in the `Issues `__ section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-servicebus%2FREADME.png diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py index a08fabf3bf29..d0aa97c6be8f 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py @@ -42,6 +42,10 @@ from .eventhub_py3 import Eventhub from .arm_disaster_recovery_py3 import ArmDisasterRecovery from .migration_config_properties_py3 import MigrationConfigProperties + from .subnet_py3 import Subnet + from .nw_rule_set_ip_rules_py3 import NWRuleSetIpRules + from .nw_rule_set_virtual_network_rules_py3 import NWRuleSetVirtualNetworkRules + from .network_rule_set_py3 import NetworkRuleSet except (SyntaxError, ImportError): from .tracked_resource import TrackedResource from .resource import Resource @@ -75,6 +79,10 @@ from .eventhub import Eventhub from .arm_disaster_recovery import ArmDisasterRecovery from .migration_config_properties import MigrationConfigProperties + from .subnet import Subnet + from .nw_rule_set_ip_rules import NWRuleSetIpRules + from .nw_rule_set_virtual_network_rules import NWRuleSetVirtualNetworkRules + from .network_rule_set import NetworkRuleSet from .operation_paged import OperationPaged from .sb_namespace_paged import SBNamespacePaged from .sb_authorization_rule_paged import SBAuthorizationRulePaged @@ -98,6 +106,8 @@ EncodingCaptureDescription, ProvisioningStateDR, RoleDisasterRecovery, + NetworkRuleIPAction, + DefaultAction, ) __all__ = [ @@ -133,6 +143,10 @@ 'Eventhub', 'ArmDisasterRecovery', 'MigrationConfigProperties', + 'Subnet', + 'NWRuleSetIpRules', + 'NWRuleSetVirtualNetworkRules', + 'NetworkRuleSet', 'OperationPaged', 'SBNamespacePaged', 'SBAuthorizationRulePaged', @@ -155,4 +169,6 @@ 'EncodingCaptureDescription', 'ProvisioningStateDR', 'RoleDisasterRecovery', + 'NetworkRuleIPAction', + 'DefaultAction', ] diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/network_rule_set.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/network_rule_set.py new file mode 100644 index 000000000000..b86e59dfbfae --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/network_rule_set.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 .resource import Resource + + +class NetworkRuleSet(Resource): + """Description of NetworkRuleSet resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param default_action: Default Action for Network Rule Set. Possible + values include: 'Allow', 'Deny' + :type default_action: str or ~azure.mgmt.servicebus.models.DefaultAction + :param virtual_network_rules: List VirtualNetwork Rules + :type virtual_network_rules: + list[~azure.mgmt.servicebus.models.NWRuleSetVirtualNetworkRules] + :param ip_rules: List of IpRules + :type ip_rules: list[~azure.mgmt.servicebus.models.NWRuleSetIpRules] + """ + + _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'}, + 'default_action': {'key': 'properties.defaultAction', 'type': 'str'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[NWRuleSetVirtualNetworkRules]'}, + 'ip_rules': {'key': 'properties.ipRules', 'type': '[NWRuleSetIpRules]'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.default_action = kwargs.get('default_action', None) + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/network_rule_set_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/network_rule_set_py3.py new file mode 100644 index 000000000000..8a15c0e689cf --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/network_rule_set_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 .resource_py3 import Resource + + +class NetworkRuleSet(Resource): + """Description of NetworkRuleSet resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param default_action: Default Action for Network Rule Set. Possible + values include: 'Allow', 'Deny' + :type default_action: str or ~azure.mgmt.servicebus.models.DefaultAction + :param virtual_network_rules: List VirtualNetwork Rules + :type virtual_network_rules: + list[~azure.mgmt.servicebus.models.NWRuleSetVirtualNetworkRules] + :param ip_rules: List of IpRules + :type ip_rules: list[~azure.mgmt.servicebus.models.NWRuleSetIpRules] + """ + + _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'}, + 'default_action': {'key': 'properties.defaultAction', 'type': 'str'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[NWRuleSetVirtualNetworkRules]'}, + 'ip_rules': {'key': 'properties.ipRules', 'type': '[NWRuleSetIpRules]'}, + } + + def __init__(self, *, default_action=None, virtual_network_rules=None, ip_rules=None, **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.default_action = default_action + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/nw_rule_set_ip_rules.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/nw_rule_set_ip_rules.py new file mode 100644 index 000000000000..2d3b32b452c0 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/nw_rule_set_ip_rules.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NWRuleSetIpRules(Model): + """Description of NetWorkRuleSet - IpRules resource. + + :param ip_mask: IP Mask + :type ip_mask: str + :param action: The IP Filter Action. Possible values include: 'Allow'. + Default value: "Allow" . + :type action: str or ~azure.mgmt.servicebus.models.NetworkRuleIPAction + """ + + _attribute_map = { + 'ip_mask': {'key': 'ipMask', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NWRuleSetIpRules, self).__init__(**kwargs) + self.ip_mask = kwargs.get('ip_mask', None) + self.action = kwargs.get('action', "Allow") diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/nw_rule_set_ip_rules_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/nw_rule_set_ip_rules_py3.py new file mode 100644 index 000000000000..e3fc2ba83bd3 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/nw_rule_set_ip_rules_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NWRuleSetIpRules(Model): + """Description of NetWorkRuleSet - IpRules resource. + + :param ip_mask: IP Mask + :type ip_mask: str + :param action: The IP Filter Action. Possible values include: 'Allow'. + Default value: "Allow" . + :type action: str or ~azure.mgmt.servicebus.models.NetworkRuleIPAction + """ + + _attribute_map = { + 'ip_mask': {'key': 'ipMask', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__(self, *, ip_mask: str=None, action="Allow", **kwargs) -> None: + super(NWRuleSetIpRules, self).__init__(**kwargs) + self.ip_mask = ip_mask + self.action = action diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/nw_rule_set_virtual_network_rules.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/nw_rule_set_virtual_network_rules.py new file mode 100644 index 000000000000..1dd737cedaf7 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/nw_rule_set_virtual_network_rules.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NWRuleSetVirtualNetworkRules(Model): + """Description of VirtualNetworkRules - NetworkRules resource. + + :param subnet: Subnet properties + :type subnet: ~azure.mgmt.servicebus.models.Subnet + :param ignore_missing_vnet_service_endpoint: Value that indicates whether + to ignore missing VNet Service Endpoint + :type ignore_missing_vnet_service_endpoint: bool + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'Subnet'}, + 'ignore_missing_vnet_service_endpoint': {'key': 'ignoreMissingVnetServiceEndpoint', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(NWRuleSetVirtualNetworkRules, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.ignore_missing_vnet_service_endpoint = kwargs.get('ignore_missing_vnet_service_endpoint', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/nw_rule_set_virtual_network_rules_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/nw_rule_set_virtual_network_rules_py3.py new file mode 100644 index 000000000000..8ac33e005e27 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/nw_rule_set_virtual_network_rules_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NWRuleSetVirtualNetworkRules(Model): + """Description of VirtualNetworkRules - NetworkRules resource. + + :param subnet: Subnet properties + :type subnet: ~azure.mgmt.servicebus.models.Subnet + :param ignore_missing_vnet_service_endpoint: Value that indicates whether + to ignore missing VNet Service Endpoint + :type ignore_missing_vnet_service_endpoint: bool + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'Subnet'}, + 'ignore_missing_vnet_service_endpoint': {'key': 'ignoreMissingVnetServiceEndpoint', 'type': 'bool'}, + } + + def __init__(self, *, subnet=None, ignore_missing_vnet_service_endpoint: bool=None, **kwargs) -> None: + super(NWRuleSetVirtualNetworkRules, self).__init__(**kwargs) + self.subnet = subnet + self.ignore_missing_vnet_service_endpoint = ignore_missing_vnet_service_endpoint diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py index fca792784228..9c374dec3903 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py @@ -95,3 +95,14 @@ class RoleDisasterRecovery(str, Enum): primary = "Primary" primary_not_replicating = "PrimaryNotReplicating" secondary = "Secondary" + + +class NetworkRuleIPAction(str, Enum): + + allow = "Allow" + + +class DefaultAction(str, Enum): + + allow = "Allow" + deny = "Deny" diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/subnet.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/subnet.py new file mode 100644 index 000000000000..315dc091e4c3 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/subnet.py @@ -0,0 +1,34 @@ +# 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 Subnet(Model): + """Properties supplied for Subnet. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Resource ID of Virtual Network Subnet + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Subnet, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/subnet_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/subnet_py3.py new file mode 100644 index 000000000000..ffe67f69d235 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/subnet_py3.py @@ -0,0 +1,34 @@ +# 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 Subnet(Model): + """Properties supplied for Subnet. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Resource ID of Virtual Network Subnet + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(Subnet, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py index c6fe24f87c12..07031de56219 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py @@ -1021,3 +1021,133 @@ def migrate( client_raw_response = ClientRawResponse(None, response) return client_raw_response migrate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrate'} + + def create_or_update_network_rule_set( + self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update NetworkRuleSet for a Namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param parameters: The Namespace IpFilterRule. + :type parameters: ~azure.mgmt.servicebus.models.NetworkRuleSet + :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: NetworkRuleSet or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.NetworkRuleSet or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update_network_rule_set.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + '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['Accept'] = 'application/json' + 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 + body_content = self._serialize.body(parameters, 'NetworkRuleSet') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NetworkRuleSet', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_network_rule_set.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkRuleSets/default'} + + def get_network_rule_set( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + """Gets NetworkRuleSet for a Namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_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: NetworkRuleSet or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.NetworkRuleSet or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_network_rule_set.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NetworkRuleSet', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_network_rule_set.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkRuleSets/default'} diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py index 3b3ef9f6b207..266f5a486d79 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py @@ -9,4 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.5.4" +VERSION = "0.5.0" + From 8e9d2758b7070b54547f8b6f1738917843f3af46 Mon Sep 17 00:00:00 2001 From: azuresdkci Date: Tue, 9 Apr 2019 16:23:02 +0000 Subject: [PATCH 8/9] Packaging update of azure-mgmt-servicebus --- azure-mgmt-servicebus/setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-mgmt-servicebus/setup.py b/azure-mgmt-servicebus/setup.py index 01b326350489..56179d34d1a1 100644 --- a/azure-mgmt-servicebus/setup.py +++ b/azure-mgmt-servicebus/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com', From b23fc694dfed99c6895d4e5c611055bb7ab89db5 Mon Sep 17 00:00:00 2001 From: Isabella Cai Date: Tue, 9 Apr 2019 09:23:38 -0700 Subject: [PATCH 9/9] updated versioning and changelog --- azure-mgmt-servicebus/HISTORY.rst | 9 +++++++++ azure-mgmt-servicebus/azure/mgmt/servicebus/version.py | 3 +-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/azure-mgmt-servicebus/HISTORY.rst b/azure-mgmt-servicebus/HISTORY.rst index aaa4b0506a77..453d052c234f 100644 --- a/azure-mgmt-servicebus/HISTORY.rst +++ b/azure-mgmt-servicebus/HISTORY.rst @@ -3,6 +3,15 @@ Release History =============== +0.6.0 (2019-04-09) +++++++++++++++++++ + +**Features** + +- Added operation NamespacesOperations.get_network_rule_set +- Added operation NamespacesOperations.migrate +- Added operation NamespacesOperations.create_or_update_network_rule_set + 0.5.4 (2019-02-15) ++++++++++++++++++ diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py index 266f5a486d79..901c89378794 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py @@ -9,5 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.5.0" - +VERSION = "0.6.0"