diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_service_bus_management_client.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_service_bus_management_client.py index 70dc46ba3bbf0..0705c65f32b27 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_service_bus_management_client.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_service_bus_management_client.py @@ -13,48 +13,54 @@ from msrest import Serializer, Deserializer from ._configuration import ServiceBusManagementClientConfiguration -from .operations import Operations from .operations import NamespacesOperations -from .operations import DisasterRecoveryConfigsOperations -from .operations import MigrationConfigsOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .operations import Operations from .operations import QueuesOperations from .operations import TopicsOperations +from .operations import DisasterRecoveryConfigsOperations +from .operations import EventHubsOperations +from .operations import MigrationConfigsOperations +from .operations import PremiumMessagingRegionsOperations +from .operations import RegionsOperations from .operations import SubscriptionsOperations from .operations import RulesOperations -from .operations import RegionsOperations -from .operations import PremiumMessagingRegionsOperations -from .operations import EventHubsOperations from . import models class ServiceBusManagementClient(SDKClient): - """Azure Service Bus client + """ServiceBusManagementClient :ivar config: Configuration for client. :vartype config: ServiceBusManagementClientConfiguration - :ivar operations: Operations operations - :vartype operations: azure.mgmt.servicebus.operations.Operations :ivar namespaces: Namespaces operations :vartype namespaces: azure.mgmt.servicebus.operations.NamespacesOperations - :ivar disaster_recovery_configs: DisasterRecoveryConfigs operations - :vartype disaster_recovery_configs: azure.mgmt.servicebus.operations.DisasterRecoveryConfigsOperations - :ivar migration_configs: MigrationConfigs operations - :vartype migration_configs: azure.mgmt.servicebus.operations.MigrationConfigsOperations + :ivar private_endpoint_connections: PrivateEndpointConnections operations + :vartype private_endpoint_connections: azure.mgmt.servicebus.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResources operations + :vartype private_link_resources: azure.mgmt.servicebus.operations.PrivateLinkResourcesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.servicebus.operations.Operations :ivar queues: Queues operations :vartype queues: azure.mgmt.servicebus.operations.QueuesOperations :ivar topics: Topics operations :vartype topics: azure.mgmt.servicebus.operations.TopicsOperations + :ivar disaster_recovery_configs: DisasterRecoveryConfigs operations + :vartype disaster_recovery_configs: azure.mgmt.servicebus.operations.DisasterRecoveryConfigsOperations + :ivar event_hubs: EventHubs operations + :vartype event_hubs: azure.mgmt.servicebus.operations.EventHubsOperations + :ivar migration_configs: MigrationConfigs operations + :vartype migration_configs: azure.mgmt.servicebus.operations.MigrationConfigsOperations + :ivar premium_messaging_regions: PremiumMessagingRegions operations + :vartype premium_messaging_regions: azure.mgmt.servicebus.operations.PremiumMessagingRegionsOperations + :ivar regions: Regions operations + :vartype regions: azure.mgmt.servicebus.operations.RegionsOperations :ivar subscriptions: Subscriptions operations :vartype subscriptions: azure.mgmt.servicebus.operations.SubscriptionsOperations :ivar rules: Rules operations :vartype rules: azure.mgmt.servicebus.operations.RulesOperations - :ivar regions: Regions operations - :vartype regions: azure.mgmt.servicebus.operations.RegionsOperations - :ivar premium_messaging_regions: PremiumMessagingRegions operations - :vartype premium_messaging_regions: azure.mgmt.servicebus.operations.PremiumMessagingRegionsOperations - :ivar event_hubs: EventHubs operations - :vartype event_hubs: azure.mgmt.servicebus.operations.EventHubsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -73,29 +79,32 @@ def __init__( super(ServiceBusManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2017-04-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) self.namespaces = NamespacesOperations( self._client, self.config, self._serialize, self._deserialize) - self.disaster_recovery_configs = DisasterRecoveryConfigsOperations( + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.migration_configs = MigrationConfigsOperations( + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) self.queues = QueuesOperations( self._client, self.config, self._serialize, self._deserialize) self.topics = TopicsOperations( self._client, self.config, self._serialize, self._deserialize) - self.subscriptions = SubscriptionsOperations( + self.disaster_recovery_configs = DisasterRecoveryConfigsOperations( self._client, self.config, self._serialize, self._deserialize) - self.rules = RulesOperations( + self.event_hubs = EventHubsOperations( self._client, self.config, self._serialize, self._deserialize) - self.regions = RegionsOperations( + self.migration_configs = MigrationConfigsOperations( self._client, self.config, self._serialize, self._deserialize) self.premium_messaging_regions = PremiumMessagingRegionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.event_hubs = EventHubsOperations( + self.regions = RegionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.subscriptions = SubscriptionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.rules = RulesOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py index 63d8bb5d20f32..1d81473c2744b 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py @@ -13,14 +13,20 @@ from ._models_py3 import AccessKeys from ._models_py3 import Action from ._models_py3 import ArmDisasterRecovery - from ._models_py3 import AuthorizationRuleProperties from ._models_py3 import CaptureDescription from ._models_py3 import CheckNameAvailability from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import ConnectionState from ._models_py3 import CorrelationFilter from ._models_py3 import Destination + from ._models_py3 import Encryption + from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import ErrorResponseError from ._models_py3 import Eventhub + from ._models_py3 import Identity + from ._models_py3 import IpFilterRule + from ._models_py3 import KeyVaultProperties from ._models_py3 import MessageCountDetails from ._models_py3 import MigrationConfigProperties from ._models_py3 import NetworkRuleSet @@ -30,6 +36,11 @@ from ._models_py3 import OperationDisplay from ._models_py3 import PremiumMessagingRegions from ._models_py3 import PremiumMessagingRegionsProperties + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionListResult + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourcesListResult from ._models_py3 import RegenerateAccessKeyParameters from ._models_py3 import Resource from ._models_py3 import ResourceNamespacePatch @@ -46,18 +57,25 @@ from ._models_py3 import SqlRuleAction from ._models_py3 import Subnet from ._models_py3 import TrackedResource + from ._models_py3 import VirtualNetworkRule except (SyntaxError, ImportError): from ._models import AccessKeys from ._models import Action from ._models import ArmDisasterRecovery - from ._models import AuthorizationRuleProperties from ._models import CaptureDescription from ._models import CheckNameAvailability from ._models import CheckNameAvailabilityResult + from ._models import ConnectionState from ._models import CorrelationFilter from ._models import Destination + from ._models import Encryption + from ._models import ErrorAdditionalInfo from ._models import ErrorResponse, ErrorResponseException + from ._models import ErrorResponseError from ._models import Eventhub + from ._models import Identity + from ._models import IpFilterRule + from ._models import KeyVaultProperties from ._models import MessageCountDetails from ._models import MigrationConfigProperties from ._models import NetworkRuleSet @@ -67,6 +85,11 @@ from ._models import OperationDisplay from ._models import PremiumMessagingRegions from ._models import PremiumMessagingRegionsProperties + from ._models import PrivateEndpoint + from ._models import PrivateEndpointConnection + from ._models import PrivateEndpointConnectionListResult + from ._models import PrivateLinkResource + from ._models import PrivateLinkResourcesListResult from ._models import RegenerateAccessKeyParameters from ._models import Resource from ._models import ResourceNamespacePatch @@ -83,10 +106,11 @@ from ._models import SqlRuleAction from ._models import Subnet from ._models import TrackedResource + from ._models import VirtualNetworkRule from ._paged_models import ArmDisasterRecoveryPaged from ._paged_models import EventhubPaged +from ._paged_models import IpFilterRulePaged from ._paged_models import MigrationConfigPropertiesPaged -from ._paged_models import NetworkRuleSetPaged from ._paged_models import OperationPaged from ._paged_models import PremiumMessagingRegionsPaged from ._paged_models import RulePaged @@ -95,34 +119,46 @@ from ._paged_models import SBQueuePaged from ._paged_models import SBSubscriptionPaged from ._paged_models import SBTopicPaged +from ._paged_models import VirtualNetworkRulePaged from ._service_bus_management_client_enums import ( + IPAction, SkuName, SkuTier, - NameSpaceType, + KeySource, + PrivateLinkConnectionStatus, + EndPointProvisioningState, + IdentityType, + NetworkRuleIPAction, + DefaultAction, AccessRights, KeyType, - EntityStatus, UnavailableReason, - FilterType, - EncodingCaptureDescription, ProvisioningStateDR, RoleDisasterRecovery, - NetworkRuleIPAction, - DefaultAction, + EntityStatus, + EncodingCaptureDescription, + NameSpaceType, + FilterType, ) __all__ = [ 'AccessKeys', 'Action', 'ArmDisasterRecovery', - 'AuthorizationRuleProperties', 'CaptureDescription', 'CheckNameAvailability', 'CheckNameAvailabilityResult', + 'ConnectionState', 'CorrelationFilter', 'Destination', + 'Encryption', + 'ErrorAdditionalInfo', 'ErrorResponse', 'ErrorResponseException', + 'ErrorResponseError', 'Eventhub', + 'Identity', + 'IpFilterRule', + 'KeyVaultProperties', 'MessageCountDetails', 'MigrationConfigProperties', 'NetworkRuleSet', @@ -132,6 +168,11 @@ 'OperationDisplay', 'PremiumMessagingRegions', 'PremiumMessagingRegionsProperties', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkResource', + 'PrivateLinkResourcesListResult', 'RegenerateAccessKeyParameters', 'Resource', 'ResourceNamespacePatch', @@ -148,29 +189,36 @@ 'SqlRuleAction', 'Subnet', 'TrackedResource', - 'OperationPaged', + 'VirtualNetworkRule', + 'IpFilterRulePaged', 'SBNamespacePaged', + 'VirtualNetworkRulePaged', 'SBAuthorizationRulePaged', - 'NetworkRuleSetPaged', - 'ArmDisasterRecoveryPaged', - 'MigrationConfigPropertiesPaged', + 'OperationPaged', 'SBQueuePaged', 'SBTopicPaged', + 'ArmDisasterRecoveryPaged', + 'EventhubPaged', + 'MigrationConfigPropertiesPaged', + 'PremiumMessagingRegionsPaged', 'SBSubscriptionPaged', 'RulePaged', - 'PremiumMessagingRegionsPaged', - 'EventhubPaged', + 'IPAction', 'SkuName', 'SkuTier', - 'NameSpaceType', + 'KeySource', + 'PrivateLinkConnectionStatus', + 'EndPointProvisioningState', + 'IdentityType', + 'NetworkRuleIPAction', + 'DefaultAction', 'AccessRights', 'KeyType', - 'EntityStatus', 'UnavailableReason', - 'FilterType', - 'EncodingCaptureDescription', 'ProvisioningStateDR', 'RoleDisasterRecovery', - 'NetworkRuleIPAction', - 'DefaultAction', + 'EntityStatus', + 'EncodingCaptureDescription', + 'NameSpaceType', + 'FilterType', ] diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_models.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_models.py index af70d88446e67..22847acb4a672 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_models.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_models.py @@ -194,28 +194,6 @@ def __init__(self, **kwargs): self.role = None -class AuthorizationRuleProperties(Model): - """AuthorizationRule properties. - - All required parameters must be populated in order to send to Azure. - - :param rights: Required. The rights associated with the rule. - :type rights: list[str or ~azure.mgmt.servicebus.models.AccessRights] - """ - - _validation = { - 'rights': {'required': True}, - } - - _attribute_map = { - 'rights': {'key': 'rights', 'type': '[AccessRights]'}, - } - - def __init__(self, **kwargs): - super(AuthorizationRuleProperties, self).__init__(**kwargs) - self.rights = kwargs.get('rights', None) - - class CaptureDescription(Model): """Properties to configure capture description for eventhub. @@ -329,6 +307,28 @@ class CloudError(Model): } +class ConnectionState(Model): + """ConnectionState information. + + :param status: Status of the connection. Possible values include: + 'Pending', 'Approved', 'Rejected', 'Disconnected' + :type status: str or + ~azure.mgmt.servicebus.models.PrivateLinkConnectionStatus + :param description: Description of the connection state. + :type description: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + + class CorrelationFilter(Model): """Represents the correlation filter expression. @@ -414,25 +414,71 @@ def __init__(self, **kwargs): self.archive_name_format = kwargs.get('archive_name_format', None) +class Encryption(Model): + """Properties to configure Encryption. + + :param key_vault_properties: Properties of KeyVault + :type key_vault_properties: + ~azure.mgmt.servicebus.models.KeyVaultProperties + :param key_source: Enumerates the possible value of keySource for + Encryption. Possible values include: 'Microsoft.KeyVault'. Default value: + "Microsoft.KeyVault" . + :type key_source: str or ~azure.mgmt.servicebus.models.KeySource + """ + + _attribute_map = { + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, + 'key_source': {'key': 'keySource', 'type': 'KeySource'}, + } + + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.key_vault_properties = kwargs.get('key_vault_properties', None) + self.key_source = kwargs.get('key_source', "Microsoft.KeyVault") + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + class ErrorResponse(Model): - """Error response indicates ServiceBus service is not able to process the - incoming request. The reason is provided in the error message. + """The resource management error response. - :param code: Error code. - :type code: str - :param message: Error message indicating why the operation failed. - :type message: str + :param error: The error object. + :type error: ~azure.mgmt.servicebus.models.ErrorResponseError """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, } def __init__(self, **kwargs): super(ErrorResponse, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) + self.error = kwargs.get('error', None) class ErrorResponseException(HttpOperationError): @@ -447,6 +493,50 @@ def __init__(self, deserialize, response, *args): super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) +class ErrorResponseError(Model): + """The error object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.servicebus.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.servicebus.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + class Eventhub(Resource): """Single item in List or Get Event Hub operation. @@ -471,7 +561,7 @@ class Eventhub(Resource): :param partition_count: Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. :type partition_count: long - :param status: Enumerates the possible values for the status of the Event + :param status: Enumerates the possible values for the status of a Event Hub. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown' @@ -516,6 +606,95 @@ def __init__(self, **kwargs): self.capture_description = kwargs.get('capture_description', None) +class Identity(Model): + """Properties to configure Identity for Bring your Own Keys. + + :param principal_id: ObjectId from the KeyVault + :type principal_id: str + :param tenant_id: TenantId from the KeyVault + :type tenant_id: str + :param type: Enumerates the possible value Identity type, which currently + supports only 'SystemAssigned'. Possible values include: 'SystemAssigned'. + Default value: "SystemAssigned" . + :type type: str or ~azure.mgmt.servicebus.models.IdentityType + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'IdentityType'}, + } + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.type = kwargs.get('type', "SystemAssigned") + + +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) + + +class KeyVaultProperties(Model): + """Properties to configure keyVault Properties. + + :param key_name: Name of the Key from KeyVault + :type key_name: str + :param key_vault_uri: Uri of KeyVault + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) + + class MessageCountDetails(Model): """Message Count Details. @@ -626,7 +805,7 @@ def __init__(self, **kwargs): class NetworkRuleSet(Resource): - """Description of NetworkRuleSet resource. + """Description of topic resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -670,12 +849,11 @@ def __init__(self, **kwargs): class NWRuleSetIpRules(Model): - """Description of NetWorkRuleSet - IpRules resource. + """The response from the List namespace operation. :param ip_mask: IP Mask :type ip_mask: str - :param action: The IP Filter Action. Possible values include: 'Allow'. - Default value: "Allow" . + :param action: The IP Filter Action. Possible values include: 'Allow' :type action: str or ~azure.mgmt.servicebus.models.NetworkRuleIPAction """ @@ -687,16 +865,16 @@ class NWRuleSetIpRules(Model): def __init__(self, **kwargs): super(NWRuleSetIpRules, self).__init__(**kwargs) self.ip_mask = kwargs.get('ip_mask', None) - self.action = kwargs.get('action', "Allow") + self.action = kwargs.get('action', None) class NWRuleSetVirtualNetworkRules(Model): - """Description of VirtualNetworkRules - NetworkRules resource. + """The response from the List namespace operation. :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 + to ignore missing Vnet Service Endpoint :type ignore_missing_vnet_service_endpoint: bool """ @@ -879,6 +1057,197 @@ def __init__(self, **kwargs): self.full_name = None +class PrivateEndpoint(Model): + """PrivateEndpoint information. + + :param id: The ARM identifier for Private Endpoint. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class TrackedResource(Resource): + """The Resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. The Geo-location where the resource lives + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class PrivateEndpointConnection(TrackedResource): + """Properties of the PrivateEndpointConnection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. The Geo-location where the resource lives + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param private_endpoint: The Private Endpoint resource for this + Connection. + :type private_endpoint: ~azure.mgmt.servicebus.models.PrivateEndpoint + :param private_link_service_connection_state: Details about the state of + the connection. + :type private_link_service_connection_state: + ~azure.mgmt.servicebus.models.ConnectionState + :param provisioning_state: Provisioning state of the Private Endpoint + Connection. Possible values include: 'Creating', 'Updating', 'Deleting', + 'Succeeded', 'Canceled', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.servicebus.models.EndPointProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'ConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class PrivateEndpointConnectionListResult(Model): + """Result of the list of all private endpoint connections operation. + + :param value: A collection of private endpoint connection resources. + :type value: list[~azure.mgmt.servicebus.models.PrivateEndpointConnection] + :param next_link: A link for the next page of private endpoint connection + resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class PrivateLinkResource(Model): + """Information of the private link resource. + + :param group_id: + :type group_id: str + :param required_members: Required Members + :type required_members: list[str] + :param required_zone_names: Required Zone Names + :type required_zone_names: list[str] + :param id: Fully qualified identifier of the resource. + :type id: str + :param name: Name of the resource + :type name: str + :param type: Type of the resource + :type type: str + """ + + _attribute_map = { + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = kwargs.get('group_id', None) + self.required_members = kwargs.get('required_members', None) + self.required_zone_names = kwargs.get('required_zone_names', None) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class PrivateLinkResourcesListResult(Model): + """Result of the List private link resources operation. + + :param value: A collection of private link resources + :type value: list[~azure.mgmt.servicebus.models.PrivateLinkResource] + :param next_link: A link for the next page of private link resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResourcesListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + class RegenerateAccessKeyParameters(Model): """Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs to be reset. @@ -993,47 +1362,6 @@ def __init__(self, **kwargs): self.rights = kwargs.get('rights', None) -class TrackedResource(Resource): - """The Resource definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Required. The Geo-location where the resource lives - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(TrackedResource, self).__init__(**kwargs) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - - class SBNamespace(TrackedResource): """Description of a namespace resource. @@ -1052,7 +1380,7 @@ class SBNamespace(TrackedResource): :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param sku: Properties 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 @@ -1065,6 +1393,15 @@ class SBNamespace(TrackedResource): :vartype service_bus_endpoint: str :ivar metric_id: Identifier for Azure Insights metrics :vartype metric_id: str + :param zone_redundant: Enabling this property creates a Premium Service + Bus Namespace in regions supported availability zones. + :type zone_redundant: bool + :param encryption: Properties of BYOK Encryption description + :type encryption: ~azure.mgmt.servicebus.models.Encryption + :param private_endpoint_connections: A collection of private endpoint + connection resources. + :type private_endpoint_connections: + list[~azure.mgmt.servicebus.models.PrivateEndpointConnectionListResult] """ _validation = { @@ -1091,6 +1428,9 @@ class SBNamespace(TrackedResource): 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionListResult]'}, } def __init__(self, **kwargs): @@ -1101,6 +1441,9 @@ def __init__(self, **kwargs): self.updated_at = None self.service_bus_endpoint = None self.metric_id = None + self.zone_redundant = kwargs.get('zone_redundant', None) + self.encryption = kwargs.get('encryption', None) + self.private_endpoint_connections = kwargs.get('private_endpoint_connections', None) class SBNamespaceMigrate(Model): @@ -1144,7 +1487,7 @@ class SBNamespaceUpdateParameters(ResourceNamespacePatch): :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param sku: Properties 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 @@ -1157,6 +1500,17 @@ class SBNamespaceUpdateParameters(ResourceNamespacePatch): :vartype service_bus_endpoint: str :ivar metric_id: Identifier for Azure Insights metrics :vartype metric_id: str + :param zone_redundant: Enabling this property creates a Premium Service + Bus Namespace in regions supported availability zones. + :type zone_redundant: bool + :param encryption: Properties of BYOK Encryption description + :type encryption: ~azure.mgmt.servicebus.models.Encryption + :param private_endpoint_connections: A collection of private endpoint + connection resources. + :type private_endpoint_connections: + list[~azure.mgmt.servicebus.models.PrivateEndpointConnectionListResult] + :param identity: Properties of BYOK Identity description + :type identity: ~azure.mgmt.servicebus.models.Identity """ _validation = { @@ -1182,6 +1536,10 @@ class SBNamespaceUpdateParameters(ResourceNamespacePatch): 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionListResult]'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, } def __init__(self, **kwargs): @@ -1192,6 +1550,10 @@ def __init__(self, **kwargs): self.updated_at = None self.service_bus_endpoint = None self.metric_id = None + self.zone_redundant = kwargs.get('zone_redundant', None) + self.encryption = kwargs.get('encryption', None) + self.private_endpoint_connections = kwargs.get('private_endpoint_connections', None) + self.identity = kwargs.get('identity', None) class SBQueue(Resource): @@ -1667,20 +2029,48 @@ def __init__(self, **kwargs): 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 + :param id: Resource ID of Virtual Network Subnet :type id: str """ + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Subnet, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +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': {'required': True}, + '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(Subnet, self).__init__(**kwargs) - self.id = kwargs.get('id', None) + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_subnet_id = kwargs.get('virtual_network_subnet_id', None) diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_models_py3.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_models_py3.py index 945cf753e5896..93b014bf2a3bf 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_models_py3.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_models_py3.py @@ -194,28 +194,6 @@ def __init__(self, *, partner_namespace: str=None, alternate_name: str=None, **k self.role = None -class AuthorizationRuleProperties(Model): - """AuthorizationRule properties. - - All required parameters must be populated in order to send to Azure. - - :param rights: Required. The rights associated with the rule. - :type rights: list[str or ~azure.mgmt.servicebus.models.AccessRights] - """ - - _validation = { - 'rights': {'required': True}, - } - - _attribute_map = { - 'rights': {'key': 'rights', 'type': '[AccessRights]'}, - } - - def __init__(self, *, rights, **kwargs) -> None: - super(AuthorizationRuleProperties, self).__init__(**kwargs) - self.rights = rights - - class CaptureDescription(Model): """Properties to configure capture description for eventhub. @@ -329,6 +307,28 @@ class CloudError(Model): } +class ConnectionState(Model): + """ConnectionState information. + + :param status: Status of the connection. Possible values include: + 'Pending', 'Approved', 'Rejected', 'Disconnected' + :type status: str or + ~azure.mgmt.servicebus.models.PrivateLinkConnectionStatus + :param description: Description of the connection state. + :type description: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, status=None, description: str=None, **kwargs) -> None: + super(ConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + + class CorrelationFilter(Model): """Represents the correlation filter expression. @@ -414,25 +414,71 @@ def __init__(self, *, name: str=None, storage_account_resource_id: str=None, blo self.archive_name_format = archive_name_format +class Encryption(Model): + """Properties to configure Encryption. + + :param key_vault_properties: Properties of KeyVault + :type key_vault_properties: + ~azure.mgmt.servicebus.models.KeyVaultProperties + :param key_source: Enumerates the possible value of keySource for + Encryption. Possible values include: 'Microsoft.KeyVault'. Default value: + "Microsoft.KeyVault" . + :type key_source: str or ~azure.mgmt.servicebus.models.KeySource + """ + + _attribute_map = { + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, + 'key_source': {'key': 'keySource', 'type': 'KeySource'}, + } + + def __init__(self, *, key_vault_properties=None, key_source="Microsoft.KeyVault", **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.key_vault_properties = key_vault_properties + self.key_source = key_source + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + class ErrorResponse(Model): - """Error response indicates ServiceBus service is not able to process the - incoming request. The reason is provided in the error message. + """The resource management error response. - :param code: Error code. - :type code: str - :param message: Error message indicating why the operation failed. - :type message: str + :param error: The error object. + :type error: ~azure.mgmt.servicebus.models.ErrorResponseError """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, } - def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + def __init__(self, *, error=None, **kwargs) -> None: super(ErrorResponse, self).__init__(**kwargs) - self.code = code - self.message = message + self.error = error class ErrorResponseException(HttpOperationError): @@ -447,6 +493,50 @@ def __init__(self, deserialize, response, *args): super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) +class ErrorResponseError(Model): + """The error object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.servicebus.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.servicebus.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + class Eventhub(Resource): """Single item in List or Get Event Hub operation. @@ -471,7 +561,7 @@ class Eventhub(Resource): :param partition_count: Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. :type partition_count: long - :param status: Enumerates the possible values for the status of the Event + :param status: Enumerates the possible values for the status of a Event Hub. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown' @@ -516,6 +606,95 @@ def __init__(self, *, message_retention_in_days: int=None, partition_count: int= self.capture_description = capture_description +class Identity(Model): + """Properties to configure Identity for Bring your Own Keys. + + :param principal_id: ObjectId from the KeyVault + :type principal_id: str + :param tenant_id: TenantId from the KeyVault + :type tenant_id: str + :param type: Enumerates the possible value Identity type, which currently + supports only 'SystemAssigned'. Possible values include: 'SystemAssigned'. + Default value: "SystemAssigned" . + :type type: str or ~azure.mgmt.servicebus.models.IdentityType + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'IdentityType'}, + } + + def __init__(self, *, principal_id: str=None, tenant_id: str=None, type="SystemAssigned", **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = principal_id + self.tenant_id = tenant_id + self.type = type + + +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 + + +class KeyVaultProperties(Model): + """Properties to configure keyVault Properties. + + :param key_name: Name of the Key from KeyVault + :type key_name: str + :param key_vault_uri: Uri of KeyVault + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, + } + + def __init__(self, *, key_name: str=None, key_vault_uri: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_vault_uri = key_vault_uri + + class MessageCountDetails(Model): """Message Count Details. @@ -626,7 +805,7 @@ def __init__(self, *, target_namespace: str, post_migration_name: str, **kwargs) class NetworkRuleSet(Resource): - """Description of NetworkRuleSet resource. + """Description of topic resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -670,12 +849,11 @@ def __init__(self, *, default_action=None, virtual_network_rules=None, ip_rules= class NWRuleSetIpRules(Model): - """Description of NetWorkRuleSet - IpRules resource. + """The response from the List namespace operation. :param ip_mask: IP Mask :type ip_mask: str - :param action: The IP Filter Action. Possible values include: 'Allow'. - Default value: "Allow" . + :param action: The IP Filter Action. Possible values include: 'Allow' :type action: str or ~azure.mgmt.servicebus.models.NetworkRuleIPAction """ @@ -684,19 +862,19 @@ class NWRuleSetIpRules(Model): 'action': {'key': 'action', 'type': 'str'}, } - def __init__(self, *, ip_mask: str=None, action="Allow", **kwargs) -> None: + def __init__(self, *, ip_mask: str=None, action=None, **kwargs) -> None: super(NWRuleSetIpRules, self).__init__(**kwargs) self.ip_mask = ip_mask self.action = action class NWRuleSetVirtualNetworkRules(Model): - """Description of VirtualNetworkRules - NetworkRules resource. + """The response from the List namespace operation. :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 + to ignore missing Vnet Service Endpoint :type ignore_missing_vnet_service_endpoint: bool """ @@ -879,6 +1057,197 @@ def __init__(self, **kwargs) -> None: self.full_name = None +class PrivateEndpoint(Model): + """PrivateEndpoint information. + + :param id: The ARM identifier for Private Endpoint. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = id + + +class TrackedResource(Resource): + """The Resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. The Geo-location where the resource lives + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.location = location + self.tags = tags + + +class PrivateEndpointConnection(TrackedResource): + """Properties of the PrivateEndpointConnection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. The Geo-location where the resource lives + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param private_endpoint: The Private Endpoint resource for this + Connection. + :type private_endpoint: ~azure.mgmt.servicebus.models.PrivateEndpoint + :param private_link_service_connection_state: Details about the state of + the connection. + :type private_link_service_connection_state: + ~azure.mgmt.servicebus.models.ConnectionState + :param provisioning_state: Provisioning state of the Private Endpoint + Connection. Possible values include: 'Creating', 'Updating', 'Deleting', + 'Succeeded', 'Canceled', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.servicebus.models.EndPointProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'ConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, private_endpoint=None, private_link_service_connection_state=None, provisioning_state=None, **kwargs) -> None: + super(PrivateEndpointConnection, self).__init__(location=location, tags=tags, **kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = provisioning_state + + +class PrivateEndpointConnectionListResult(Model): + """Result of the list of all private endpoint connections operation. + + :param value: A collection of private endpoint connection resources. + :type value: list[~azure.mgmt.servicebus.models.PrivateEndpointConnection] + :param next_link: A link for the next page of private endpoint connection + resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class PrivateLinkResource(Model): + """Information of the private link resource. + + :param group_id: + :type group_id: str + :param required_members: Required Members + :type required_members: list[str] + :param required_zone_names: Required Zone Names + :type required_zone_names: list[str] + :param id: Fully qualified identifier of the resource. + :type id: str + :param name: Name of the resource + :type name: str + :param type: Type of the resource + :type type: str + """ + + _attribute_map = { + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, group_id: str=None, required_members=None, required_zone_names=None, id: str=None, name: str=None, type: str=None, **kwargs) -> None: + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = group_id + self.required_members = required_members + self.required_zone_names = required_zone_names + self.id = id + self.name = name + self.type = type + + +class PrivateLinkResourcesListResult(Model): + """Result of the List private link resources operation. + + :param value: A collection of private link resources + :type value: list[~azure.mgmt.servicebus.models.PrivateLinkResource] + :param next_link: A link for the next page of private link resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(PrivateLinkResourcesListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + class RegenerateAccessKeyParameters(Model): """Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs to be reset. @@ -993,47 +1362,6 @@ def __init__(self, *, rights, **kwargs) -> None: self.rights = rights -class TrackedResource(Resource): - """The Resource definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Required. The Geo-location where the resource lives - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, location: str, tags=None, **kwargs) -> None: - super(TrackedResource, self).__init__(**kwargs) - self.location = location - self.tags = tags - - class SBNamespace(TrackedResource): """Description of a namespace resource. @@ -1052,7 +1380,7 @@ class SBNamespace(TrackedResource): :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param sku: Properties 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 @@ -1065,6 +1393,15 @@ class SBNamespace(TrackedResource): :vartype service_bus_endpoint: str :ivar metric_id: Identifier for Azure Insights metrics :vartype metric_id: str + :param zone_redundant: Enabling this property creates a Premium Service + Bus Namespace in regions supported availability zones. + :type zone_redundant: bool + :param encryption: Properties of BYOK Encryption description + :type encryption: ~azure.mgmt.servicebus.models.Encryption + :param private_endpoint_connections: A collection of private endpoint + connection resources. + :type private_endpoint_connections: + list[~azure.mgmt.servicebus.models.PrivateEndpointConnectionListResult] """ _validation = { @@ -1091,9 +1428,12 @@ class SBNamespace(TrackedResource): 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionListResult]'}, } - def __init__(self, *, location: str, tags=None, sku=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, sku=None, zone_redundant: bool=None, encryption=None, private_endpoint_connections=None, **kwargs) -> None: super(SBNamespace, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.provisioning_state = None @@ -1101,6 +1441,9 @@ def __init__(self, *, location: str, tags=None, sku=None, **kwargs) -> None: self.updated_at = None self.service_bus_endpoint = None self.metric_id = None + self.zone_redundant = zone_redundant + self.encryption = encryption + self.private_endpoint_connections = private_endpoint_connections class SBNamespaceMigrate(Model): @@ -1144,7 +1487,7 @@ class SBNamespaceUpdateParameters(ResourceNamespacePatch): :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param sku: Properties 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 @@ -1157,6 +1500,17 @@ class SBNamespaceUpdateParameters(ResourceNamespacePatch): :vartype service_bus_endpoint: str :ivar metric_id: Identifier for Azure Insights metrics :vartype metric_id: str + :param zone_redundant: Enabling this property creates a Premium Service + Bus Namespace in regions supported availability zones. + :type zone_redundant: bool + :param encryption: Properties of BYOK Encryption description + :type encryption: ~azure.mgmt.servicebus.models.Encryption + :param private_endpoint_connections: A collection of private endpoint + connection resources. + :type private_endpoint_connections: + list[~azure.mgmt.servicebus.models.PrivateEndpointConnectionListResult] + :param identity: Properties of BYOK Identity description + :type identity: ~azure.mgmt.servicebus.models.Identity """ _validation = { @@ -1182,9 +1536,13 @@ class SBNamespaceUpdateParameters(ResourceNamespacePatch): 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionListResult]'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, } - def __init__(self, *, location: str=None, tags=None, sku=None, **kwargs) -> None: + def __init__(self, *, location: str=None, tags=None, sku=None, zone_redundant: bool=None, encryption=None, private_endpoint_connections=None, identity=None, **kwargs) -> None: super(SBNamespaceUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.provisioning_state = None @@ -1192,6 +1550,10 @@ def __init__(self, *, location: str=None, tags=None, sku=None, **kwargs) -> None self.updated_at = None self.service_bus_endpoint = None self.metric_id = None + self.zone_redundant = zone_redundant + self.encryption = encryption + self.private_endpoint_connections = private_endpoint_connections + self.identity = identity class SBQueue(Resource): @@ -1667,20 +2029,48 @@ def __init__(self, *, sql_expression: str=None, compatibility_level: int=None, r 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 + :param id: Resource ID of Virtual Network Subnet :type id: str """ + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(Subnet, self).__init__(**kwargs) + self.id = id + + +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': {'required': True}, + '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, *, id: str, **kwargs) -> None: - super(Subnet, self).__init__(**kwargs) - self.id = id + 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/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_paged_models.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_paged_models.py index 24f5278b98fdd..c22e16d757a9d 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_paged_models.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_paged_models.py @@ -12,19 +12,19 @@ from msrest.paging import Paged -class OperationPaged(Paged): +class IpFilterRulePaged(Paged): """ - A paging container for iterating over a list of :class:`Operation ` object + 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': '[Operation]'} + 'current_page': {'key': 'value', 'type': '[IpFilterRule]'} } def __init__(self, *args, **kwargs): - super(OperationPaged, self).__init__(*args, **kwargs) + super(IpFilterRulePaged, self).__init__(*args, **kwargs) class SBNamespacePaged(Paged): """ A paging container for iterating over a list of :class:`SBNamespace ` object @@ -38,110 +38,110 @@ class SBNamespacePaged(Paged): def __init__(self, *args, **kwargs): super(SBNamespacePaged, self).__init__(*args, **kwargs) -class SBAuthorizationRulePaged(Paged): +class VirtualNetworkRulePaged(Paged): """ - A paging container for iterating over a list of :class:`SBAuthorizationRule ` object + 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': '[SBAuthorizationRule]'} + 'current_page': {'key': 'value', 'type': '[VirtualNetworkRule]'} } def __init__(self, *args, **kwargs): - super(SBAuthorizationRulePaged, self).__init__(*args, **kwargs) -class NetworkRuleSetPaged(Paged): + super(VirtualNetworkRulePaged, self).__init__(*args, **kwargs) +class SBAuthorizationRulePaged(Paged): """ - A paging container for iterating over a list of :class:`NetworkRuleSet ` object + A paging container for iterating over a list of :class:`SBAuthorizationRule ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[NetworkRuleSet]'} + 'current_page': {'key': 'value', 'type': '[SBAuthorizationRule]'} } def __init__(self, *args, **kwargs): - super(NetworkRuleSetPaged, self).__init__(*args, **kwargs) -class ArmDisasterRecoveryPaged(Paged): + super(SBAuthorizationRulePaged, self).__init__(*args, **kwargs) +class OperationPaged(Paged): """ - A paging container for iterating over a list of :class:`ArmDisasterRecovery ` object + A paging container for iterating over a list of :class:`Operation ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ArmDisasterRecovery]'} + 'current_page': {'key': 'value', 'type': '[Operation]'} } def __init__(self, *args, **kwargs): - super(ArmDisasterRecoveryPaged, self).__init__(*args, **kwargs) -class MigrationConfigPropertiesPaged(Paged): + super(OperationPaged, self).__init__(*args, **kwargs) +class SBQueuePaged(Paged): """ - A paging container for iterating over a list of :class:`MigrationConfigProperties ` object + A paging container for iterating over a list of :class:`SBQueue ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[MigrationConfigProperties]'} + 'current_page': {'key': 'value', 'type': '[SBQueue]'} } def __init__(self, *args, **kwargs): - super(MigrationConfigPropertiesPaged, self).__init__(*args, **kwargs) -class SBQueuePaged(Paged): + super(SBQueuePaged, self).__init__(*args, **kwargs) +class SBTopicPaged(Paged): """ - A paging container for iterating over a list of :class:`SBQueue ` object + A paging container for iterating over a list of :class:`SBTopic ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SBQueue]'} + 'current_page': {'key': 'value', 'type': '[SBTopic]'} } def __init__(self, *args, **kwargs): - super(SBQueuePaged, self).__init__(*args, **kwargs) -class SBTopicPaged(Paged): + super(SBTopicPaged, self).__init__(*args, **kwargs) +class ArmDisasterRecoveryPaged(Paged): """ - A paging container for iterating over a list of :class:`SBTopic ` object + A paging container for iterating over a list of :class:`ArmDisasterRecovery ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SBTopic]'} + 'current_page': {'key': 'value', 'type': '[ArmDisasterRecovery]'} } def __init__(self, *args, **kwargs): - super(SBTopicPaged, self).__init__(*args, **kwargs) -class SBSubscriptionPaged(Paged): + super(ArmDisasterRecoveryPaged, self).__init__(*args, **kwargs) +class EventhubPaged(Paged): """ - A paging container for iterating over a list of :class:`SBSubscription ` object + A paging container for iterating over a list of :class:`Eventhub ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SBSubscription]'} + 'current_page': {'key': 'value', 'type': '[Eventhub]'} } def __init__(self, *args, **kwargs): - super(SBSubscriptionPaged, self).__init__(*args, **kwargs) -class RulePaged(Paged): + super(EventhubPaged, self).__init__(*args, **kwargs) +class MigrationConfigPropertiesPaged(Paged): """ - A paging container for iterating over a list of :class:`Rule ` object + A paging container for iterating over a list of :class:`MigrationConfigProperties ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Rule]'} + 'current_page': {'key': 'value', 'type': '[MigrationConfigProperties]'} } def __init__(self, *args, **kwargs): - super(RulePaged, self).__init__(*args, **kwargs) + super(MigrationConfigPropertiesPaged, self).__init__(*args, **kwargs) class PremiumMessagingRegionsPaged(Paged): """ A paging container for iterating over a list of :class:`PremiumMessagingRegions ` object @@ -155,16 +155,29 @@ class PremiumMessagingRegionsPaged(Paged): def __init__(self, *args, **kwargs): super(PremiumMessagingRegionsPaged, self).__init__(*args, **kwargs) -class EventhubPaged(Paged): +class SBSubscriptionPaged(Paged): """ - A paging container for iterating over a list of :class:`Eventhub ` object + A paging container for iterating over a list of :class:`SBSubscription ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Eventhub]'} + 'current_page': {'key': 'value', 'type': '[SBSubscription]'} } def __init__(self, *args, **kwargs): - super(EventhubPaged, self).__init__(*args, **kwargs) + super(SBSubscriptionPaged, self).__init__(*args, **kwargs) +class RulePaged(Paged): + """ + A paging container for iterating over a list of :class:`Rule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Rule]'} + } + + def __init__(self, *args, **kwargs): + + super(RulePaged, self).__init__(*args, **kwargs) diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_service_bus_management_client_enums.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_service_bus_management_client_enums.py index 9c374dec3903d..21a1d50dfaa1b 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_service_bus_management_client_enums.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_service_bus_management_client_enums.py @@ -12,6 +12,12 @@ from enum import Enum +class IPAction(str, Enum): + + accept = "Accept" + reject = "Reject" + + class SkuName(str, Enum): basic = "Basic" @@ -26,13 +32,43 @@ class SkuTier(str, Enum): premium = "Premium" -class NameSpaceType(str, Enum): +class KeySource(str, Enum): + + microsoft_key_vault = "Microsoft.KeyVault" + + +class PrivateLinkConnectionStatus(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + disconnected = "Disconnected" + + +class EndPointProvisioningState(str, Enum): + + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + succeeded = "Succeeded" + canceled = "Canceled" + failed = "Failed" + + +class IdentityType(str, Enum): + + system_assigned = "SystemAssigned" - messaging = "Messaging" - notification_hub = "NotificationHub" - mixed = "Mixed" - event_hub = "EventHub" - relay = "Relay" + +class NetworkRuleIPAction(str, Enum): + + allow = "Allow" + + +class DefaultAction(str, Enum): + + allow = "Allow" + deny = "Deny" class AccessRights(str, Enum): @@ -48,19 +84,6 @@ class KeyType(str, Enum): secondary_key = "SecondaryKey" -class EntityStatus(str, Enum): - - active = "Active" - disabled = "Disabled" - restoring = "Restoring" - send_disabled = "SendDisabled" - receive_disabled = "ReceiveDisabled" - creating = "Creating" - deleting = "Deleting" - renaming = "Renaming" - unknown = "Unknown" - - class UnavailableReason(str, Enum): none = "None" @@ -71,18 +94,6 @@ class UnavailableReason(str, Enum): too_many_namespace_in_current_subscription = "TooManyNamespaceInCurrentSubscription" -class FilterType(str, Enum): - - sql_filter = "SqlFilter" - correlation_filter = "CorrelationFilter" - - -class EncodingCaptureDescription(str, Enum): - - avro = "Avro" - avro_deflate = "AvroDeflate" - - class ProvisioningStateDR(str, Enum): accepted = "Accepted" @@ -97,12 +108,35 @@ class RoleDisasterRecovery(str, Enum): secondary = "Secondary" -class NetworkRuleIPAction(str, Enum): +class EntityStatus(str, Enum): - allow = "Allow" + active = "Active" + disabled = "Disabled" + restoring = "Restoring" + send_disabled = "SendDisabled" + receive_disabled = "ReceiveDisabled" + creating = "Creating" + deleting = "Deleting" + renaming = "Renaming" + unknown = "Unknown" -class DefaultAction(str, Enum): +class EncodingCaptureDescription(str, Enum): - allow = "Allow" - deny = "Deny" + avro = "Avro" + avro_deflate = "AvroDeflate" + + +class NameSpaceType(str, Enum): + + messaging = "Messaging" + notification_hub = "NotificationHub" + mixed = "Mixed" + event_hub = "EventHub" + relay = "Relay" + + +class FilterType(str, Enum): + + sql_filter = "SqlFilter" + correlation_filter = "CorrelationFilter" diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/__init__.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/__init__.py index f636099e0fbba..b6f8fa85ba6b1 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/__init__.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/__init__.py @@ -9,28 +9,32 @@ # regenerated. # -------------------------------------------------------------------------- -from ._operations import Operations from ._namespaces_operations import NamespacesOperations -from ._disaster_recovery_configs_operations import DisasterRecoveryConfigsOperations -from ._migration_configs_operations import MigrationConfigsOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._operations import Operations from ._queues_operations import QueuesOperations from ._topics_operations import TopicsOperations +from ._disaster_recovery_configs_operations import DisasterRecoveryConfigsOperations +from ._event_hubs_operations import EventHubsOperations +from ._migration_configs_operations import MigrationConfigsOperations +from ._premium_messaging_regions_operations import PremiumMessagingRegionsOperations +from ._regions_operations import RegionsOperations from ._subscriptions_operations import SubscriptionsOperations from ._rules_operations import RulesOperations -from ._regions_operations import RegionsOperations -from ._premium_messaging_regions_operations import PremiumMessagingRegionsOperations -from ._event_hubs_operations import EventHubsOperations __all__ = [ - 'Operations', 'NamespacesOperations', - 'DisasterRecoveryConfigsOperations', - 'MigrationConfigsOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'Operations', 'QueuesOperations', 'TopicsOperations', + 'DisasterRecoveryConfigsOperations', + 'EventHubsOperations', + 'MigrationConfigsOperations', + 'PremiumMessagingRegionsOperations', + 'RegionsOperations', 'SubscriptionsOperations', 'RulesOperations', - 'RegionsOperations', - 'PremiumMessagingRegionsOperations', - 'EventHubsOperations', ] diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_namespaces_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_namespaces_operations.py index 2c26f3bba93a4..ef75d78d8c3ba 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_namespaces_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_namespaces_operations.py @@ -26,7 +26,6 @@ class NamespacesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2017-04-01". """ models = models @@ -36,42 +35,122 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-01" self.config = config - def check_name_availability_method( - self, name, custom_headers=None, raw=False, **operation_config): - """Check the give namespace name availability. + 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 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. - :type name: str + :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.CheckNameAvailabilityResult or + :return: An iterator like instance of IpFilterRule + :rtype: + ~azure.mgmt.servicebus.models.IpFilterRulePaged[~azure.mgmt.servicebus.models.IpFilterRule] + :raises: + :class:`ErrorResponseException` + """ + api_version = "2018-01-01-preview" + + def prepare_request(next_link=None): + 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("api_version", 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.IpFilterRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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` """ - parameters = models.CheckNameAvailability(name=name) + api_version = "2018-01-01-preview" # Construct URL - url = self.check_name_availability_method.metadata['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') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -85,10 +164,10 @@ def check_name_availability_method( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'CheckNameAvailability') + body_content = self._serialize.body(parameters, 'IpFilterRule') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) + 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]: @@ -96,14 +175,138 @@ def check_name_availability_method( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('CheckNameAvailabilityResult', response) + deserialized = self._deserialize('IpFilterRule', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - check_name_availability_method.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/CheckNameAvailability'} + 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` + """ + api_version = "2018-01-01-preview" + + # 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("api_version", 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` + """ + api_version = "2018-01-01-preview" + + # 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("api_version", 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( self, custom_headers=None, raw=False, **operation_config): @@ -121,6 +324,8 @@ def list( :raises: :class:`ErrorResponseException` """ + api_version = "2018-01-01-preview" + def prepare_request(next_link=None): if not next_link: # Construct URL @@ -132,7 +337,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') else: url = next_link @@ -189,6 +394,8 @@ def list_by_resource_group( :raises: :class:`ErrorResponseException` """ + api_version = "2018-01-01-preview" + def prepare_request(next_link=None): if not next_link: # Construct URL @@ -201,7 +408,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') else: url = next_link @@ -243,6 +450,8 @@ def internal_paging(next_link=None): def _create_or_update_initial( self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2018-01-01-preview" + # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -254,7 +463,7 @@ def _create_or_update_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -346,6 +555,8 @@ def get_long_running_output(response): def _delete_initial( self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + api_version = "2018-01-01-preview" + # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -357,7 +568,7 @@ def _delete_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -423,42 +634,462 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'} - def get( - self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): - """Gets a description for the specified namespace. + def get( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + """Gets a description for the specified 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: SBNamespace or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.SBNamespace or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + api_version = "2018-01-01-preview" + + # Construct URL + url = self.get.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("api_version", 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('SBNamespace', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'} + + def update( + self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, **operation_config): + """Updates a service namespace. Once created, this namespace's resource + manifest is immutable. This operation is idempotent. + + :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: Parameters supplied to update a namespace resource. + :type parameters: + ~azure.mgmt.servicebus.models.SBNamespaceUpdateParameters + :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: SBNamespace or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.SBNamespace or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + api_version = "2018-01-01-preview" + + # Construct URL + url = self.update.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("api_version", 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, 'SBNamespaceUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SBNamespace', response) + if response.status_code == 201: + deserialized = self._deserialize('SBNamespace', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'} + + def create_or_update_network_rule_set( + self, resource_group_name, namespace_name, parameters, 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 parameters: The Namespace NetworkRuleSet. + :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` + """ + api_version = "2018-01-01-preview" + + # 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("api_version", 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` + """ + api_version = "2018-01-01-preview" + + # 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("api_version", 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'} + + 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` + """ + api_version = "2018-01-01-preview" + + def prepare_request(next_link=None): + 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("api_version", 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.VirtualNetworkRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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) + + api_version = "2018-01-01-preview" + + # 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("api_version", 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: SBNamespace or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.SBNamespace or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ + api_version = "2018-01-01-preview" + # Construct URL - url = self.get.metadata['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') + query_parameters['api-version'] = self._serialize.query("api_version", 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: @@ -467,64 +1098,58 @@ def get( 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) + 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]: + if response.status_code not in [200, 204]: raise models.ErrorResponseException(self._deserialize, response) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('SBNamespace', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + 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}'} - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'} - - def update( - self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, **operation_config): - """Updates a service namespace. Once created, this namespace's resource - manifest is immutable. This operation is idempotent. + 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 parameters: Parameters supplied to update a namespace resource. - :type parameters: - ~azure.mgmt.servicebus.models.SBNamespaceUpdateParameters + :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: SBNamespace or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.SBNamespace or + :return: VirtualNetworkRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.VirtualNetworkRule or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ + api_version = "2018-01-01-preview" + # Construct URL - url = self.update.metadata['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') + query_parameters['api-version'] = self._serialize.query("api_version", 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: @@ -532,28 +1157,23 @@ def update( 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, 'SBNamespaceUpdateParameters') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) + 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, 201, 202]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SBNamespace', response) - if response.status_code == 201: - deserialized = self._deserialize('SBNamespace', response) + deserialized = self._deserialize('VirtualNetworkRule', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'} + get_virtual_network_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}'} def list_authorization_rules( self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): @@ -575,6 +1195,8 @@ def list_authorization_rules( :raises: :class:`ErrorResponseException` """ + api_version = "2017-04-01" + def prepare_request(next_link=None): if not next_link: # Construct URL @@ -588,7 +1210,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') else: url = next_link @@ -653,6 +1275,8 @@ def create_or_update_authorization_rule( """ parameters = models.SBAuthorizationRule(rights=rights) + api_version = "2017-04-01" + # Construct URL url = self.create_or_update_authorization_rule.metadata['url'] path_format_arguments = { @@ -665,7 +1289,7 @@ def create_or_update_authorization_rule( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -720,6 +1344,8 @@ def delete_authorization_rule( :raises: :class:`ErrorResponseException` """ + api_version = "2017-04-01" + # Construct URL url = self.delete_authorization_rule.metadata['url'] path_format_arguments = { @@ -732,7 +1358,7 @@ def delete_authorization_rule( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -777,6 +1403,8 @@ def get_authorization_rule( :raises: :class:`ErrorResponseException` """ + api_version = "2017-04-01" + # Construct URL url = self.get_authorization_rule.metadata['url'] path_format_arguments = { @@ -789,7 +1417,7 @@ def get_authorization_rule( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -841,6 +1469,8 @@ def list_keys( :raises: :class:`ErrorResponseException` """ + api_version = "2017-04-01" + # Construct URL url = self.list_keys.metadata['url'] path_format_arguments = { @@ -853,7 +1483,7 @@ def list_keys( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -914,6 +1544,8 @@ def regenerate_keys( """ parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key) + api_version = "2017-04-01" + # Construct URL url = self.regenerate_keys.metadata['url'] path_format_arguments = { @@ -926,7 +1558,7 @@ def regenerate_keys( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -960,103 +1592,40 @@ 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. + def check_name_availability_method( + self, name, custom_headers=None, raw=False, **operation_config): + """Check the give namespace name availability. - :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 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. + :type name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.CheckNameAvailabilityResult 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'} + parameters = models.CheckNameAvailability(name=name) - 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. + api_version = "2017-04-01" - :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'] + url = self.check_name_availability_method.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') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -1070,10 +1639,10 @@ def create_or_update_network_rule_set( 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') + body_content = self._serialize.body(parameters, 'CheckNameAvailability') # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + 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]: @@ -1081,37 +1650,44 @@ def create_or_update_network_rule_set( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NetworkRuleSet', response) + deserialized = self._deserialize('CheckNameAvailabilityResult', 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'} + check_name_availability_method.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/CheckNameAvailability'} - def get_network_rule_set( - self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): - """Gets NetworkRuleSet for a Namespace. + 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: NetworkRuleSet or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.NetworkRuleSet or - ~msrest.pipeline.ClientRawResponse + :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) + + api_version = "2017-04-01" + # Construct URL - url = self.get_network_rule_set.metadata['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), @@ -1121,11 +1697,11 @@ def get_network_rule_set( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", 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: @@ -1133,92 +1709,17 @@ def get_network_rule_set( 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.get(url, query_parameters, header_parameters) + 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) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('NetworkRuleSet', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - - return deserialized - get_network_rule_set.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkRuleSets/default'} - - def list_network_rule_sets( - self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): - """Gets list of 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: An iterator like instance of NetworkRuleSet - :rtype: - ~azure.mgmt.servicebus.models.NetworkRuleSetPaged[~azure.mgmt.servicebus.models.NetworkRuleSet] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_network_rule_sets.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) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - 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 - header_dict = None - if raw: - header_dict = {} - deserialized = models.NetworkRuleSetPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_network_rule_sets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkRuleSets'} + migrate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrate'} diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_operations.py index dff3a68c696df..62bfc419b844e 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_operations.py @@ -24,7 +24,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2017-04-01". + :ivar api_version: Client API version. Constant value: "2018-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-01" + self.api_version = "2018-01-01-preview" self.config = config diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_private_endpoint_connections_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_private_endpoint_connections_operations.py new file mode 100644 index 0000000000000..84c08fcccd5c3 --- /dev/null +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,266 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01-preview" + + self.config = config + + def create_or_update( + self, resource_group_name, namespace_name, private_endpoint_connection_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates PrivateEndpointConnections of service 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 private_endpoint_connection_name: The PrivateEndpointConnection + name + :type private_endpoint_connection_name: str + :param parameters: Parameters supplied to update Status of + PrivateEndPoint Connection to namespace resource. + :type parameters: + ~azure.mgmt.servicebus.models.PrivateEndpointConnection + :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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.PrivateEndpointConnection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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, 'PrivateEndpointConnection') + + # 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, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _delete_initial( + self, resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.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'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing namespace. This operation also removes all + associated resources under the 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 private_endpoint_connection_name: The PrivateEndpointConnection + name + :type private_endpoint_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + private_endpoint_connection_name=private_endpoint_connection_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def get( + self, resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets a description for the specified Private Endpoint Connection 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 private_endpoint_connection_name: The PrivateEndpointConnection + name + :type private_endpoint_connection_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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.PrivateEndpointConnection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.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), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_private_link_resources_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_private_link_resources_operations.py new file mode 100644 index 0000000000000..7b218c83d15bb --- /dev/null +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_private_link_resources_operations.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01-preview" + + self.config = config + + def get( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + """Gets a description for the specified 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: PrivateLinkResourcesListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.servicebus.models.PrivateLinkResourcesListResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.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('PrivateLinkResourcesListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateLinkResources'} diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_queues_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_queues_operations.py index 45648e31cfef7..4c305154ae67c 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_queues_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_queues_operations.py @@ -38,41 +38,36 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def list_by_namespace( - self, resource_group_name, namespace_name, skip=None, top=None, custom_headers=None, raw=False, **operation_config): - """Gets the queues within a namespace. + def list_authorization_rules( + self, resource_group_name, namespace_name, queue_name, custom_headers=None, raw=False, **operation_config): + """Gets all authorization rules for a queue. :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 skip: Skip is only used if a previous operation returned a - partial result. If a previous response contains a nextLink element, - the value of the nextLink element will include a skip parameter that - specifies a starting point to use for subsequent calls. - :type skip: int - :param top: May be used to limit the number of results to the most - recent N usageDetails. - :type top: int + :param queue_name: The queue name. + :type queue_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 SBQueue + :return: An iterator like instance of SBAuthorizationRule :rtype: - ~azure.mgmt.servicebus.models.SBQueuePaged[~azure.mgmt.servicebus.models.SBQueue] + ~azure.mgmt.servicebus.models.SBAuthorizationRulePaged[~azure.mgmt.servicebus.models.SBAuthorizationRule] :raises: :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_namespace.metadata['url'] + url = self.list_authorization_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), + 'queueName': self._serialize.url("queue_name", queue_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) @@ -80,10 +75,6 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', maximum=1000, minimum=0) - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) else: url = next_link @@ -117,14 +108,14 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.SBQueuePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.SBAuthorizationRulePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_namespace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues'} + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules'} - def create_or_update( - self, resource_group_name, namespace_name, queue_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates or updates a Service Bus queue. This operation is idempotent. + def create_or_update_authorization_rule( + self, resource_group_name, namespace_name, queue_name, authorization_rule_name, rights, custom_headers=None, raw=False, **operation_config): + """Creates an authorization rule for a queue. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -133,26 +124,30 @@ def create_or_update( :type namespace_name: str :param queue_name: The queue name. :type queue_name: str - :param parameters: Parameters supplied to create or update a queue - resource. - :type parameters: ~azure.mgmt.servicebus.models.SBQueue + :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] :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: SBQueue or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.SBQueue or + :return: SBAuthorizationRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ + parameters = models.SBAuthorizationRule(rights=rights) + # Construct URL - url = self.create_or_update.metadata['url'] + url = self.create_or_update_authorization_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), 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, 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) @@ -173,7 +168,7 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'SBQueue') + body_content = self._serialize.body(parameters, 'SBAuthorizationRule') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -184,18 +179,18 @@ def create_or_update( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SBQueue', response) + deserialized = self._deserialize('SBAuthorizationRule', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}'} + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}'} - def delete( - self, resource_group_name, namespace_name, queue_name, custom_headers=None, raw=False, **operation_config): - """Deletes a queue from the specified namespace in a resource group. + def delete_authorization_rule( + self, resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): + """Deletes a queue authorization rule. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -204,6 +199,8 @@ def delete( :type namespace_name: str :param queue_name: The queue name. :type queue_name: str + :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 deserialized response @@ -215,11 +212,12 @@ def delete( :class:`ErrorResponseException` """ # Construct URL - url = self.delete.metadata['url'] + url = self.delete_authorization_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), 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, 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) @@ -247,11 +245,11 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}'} + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}'} - def get( - self, resource_group_name, namespace_name, queue_name, custom_headers=None, raw=False, **operation_config): - """Returns a description for the specified queue. + def get_authorization_rule( + self, resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): + """Gets an authorization rule for a queue by rule name. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -260,23 +258,26 @@ def get( :type namespace_name: str :param queue_name: The queue name. :type queue_name: str + :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 deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: SBQueue or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.SBQueue or + :return: SBAuthorizationRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.get.metadata['url'] + url = self.get_authorization_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), 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, 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) @@ -304,18 +305,18 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SBQueue', response) + deserialized = self._deserialize('SBAuthorizationRule', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}'} + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}'} - def list_authorization_rules( - self, resource_group_name, namespace_name, queue_name, custom_headers=None, raw=False, **operation_config): - """Gets all authorization rules for a queue. + def list_keys( + self, resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): + """Primary and secondary connection strings to the queue. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -324,73 +325,65 @@ def list_authorization_rules( :type namespace_name: str :param queue_name: The queue name. :type queue_name: str + :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 deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of SBAuthorizationRule - :rtype: - ~azure.mgmt.servicebus.models.SBAuthorizationRulePaged[~azure.mgmt.servicebus.models.SBAuthorizationRule] + :return: AccessKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.AccessKeys or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_authorization_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), - 'queueName': self._serialize.url("queue_name", queue_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') - - 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 URL + url = self.list_keys.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), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, 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 and send request - request = self._client.get(url, query_parameters, header_parameters) - return request + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - def internal_paging(next_link=None): - request = prepare_request(next_link) + # 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') - response = self._client.send(request, stream=False, **operation_config) + # Construct and send request + request = self._client.post(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) + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) - return response + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessKeys', response) - # Deserialize response - header_dict = None if raw: - header_dict = {} - deserialized = models.SBAuthorizationRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response return deserialized - list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules'} + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/ListKeys'} - def create_or_update_authorization_rule( - self, resource_group_name, namespace_name, queue_name, authorization_rule_name, rights, custom_headers=None, raw=False, **operation_config): - """Creates an authorization rule for a queue. + def regenerate_keys( + self, resource_group_name, namespace_name, queue_name, authorization_rule_name, key_type, key=None, custom_headers=None, raw=False, **operation_config): + """Regenerates the primary or secondary connection strings to the queue. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -401,23 +394,27 @@ def create_or_update_authorization_rule( :type queue_name: str :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] + :param key_type: The access key to regenerate. Possible values + include: 'PrimaryKey', 'SecondaryKey' + :type key_type: str or ~azure.mgmt.servicebus.models.KeyType + :param key: Optional, if the key value provided, is reset for KeyType + value or autogenerate Key value set for keyType + :type key: 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: SBAuthorizationRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule or + :return: AccessKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.AccessKeys or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ - parameters = models.SBAuthorizationRule(rights=rights) + parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key) # Construct URL - url = self.create_or_update_authorization_rule.metadata['url'] + url = self.regenerate_keys.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), @@ -443,10 +440,10 @@ def create_or_update_authorization_rule( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'SBAuthorizationRule') + body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + 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]: @@ -454,77 +451,102 @@ def create_or_update_authorization_rule( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SBAuthorizationRule', response) + deserialized = self._deserialize('AccessKeys', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}'} + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} - def delete_authorization_rule( - self, resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): - """Deletes a queue authorization rule. + def list_by_namespace( + self, resource_group_name, namespace_name, skip=None, top=None, custom_headers=None, raw=False, **operation_config): + """Gets the queues within 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 queue_name: The queue name. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str + :param skip: Skip is only used if a previous operation returned a + partial result. If a previous response contains a nextLink element, + the value of the nextLink element will include a skip parameter that + specifies a starting point to use for subsequent calls. + :type skip: int + :param top: May be used to limit the number of results to the most + recent N usageDetails. + :type top: int :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 + :return: An iterator like instance of SBQueue + :rtype: + ~azure.mgmt.servicebus.models.SBQueuePaged[~azure.mgmt.servicebus.models.SBQueue] :raises: :class:`ErrorResponseException` """ - # Construct URL - url = self.delete_authorization_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), - 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, 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) + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_namespace.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 parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', maximum=1000, minimum=0) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - # 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') + else: + url = next_link + query_parameters = {} - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + # 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') - if response.status_code not in [200, 204]: - raise models.ErrorResponseException(self._deserialize, response) + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}'} + header_dict = {} + deserialized = models.SBQueuePaged(internal_paging, self._deserialize.dependencies, header_dict) - def get_authorization_rule( - self, resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): - """Gets an authorization rule for a queue by rule name. + return deserialized + list_by_namespace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues'} + + def create_or_update( + self, resource_group_name, namespace_name, queue_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a Service Bus queue. This operation is idempotent. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -533,26 +555,26 @@ def get_authorization_rule( :type namespace_name: str :param queue_name: The queue name. :type queue_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str + :param parameters: Parameters supplied to create or update a queue + resource. + :type parameters: ~azure.mgmt.servicebus.models.SBQueue :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: SBAuthorizationRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule or + :return: SBQueue or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.SBQueue or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.get_authorization_rule.metadata['url'] + url = self.create_or_update.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), 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, 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) @@ -564,6 +586,7 @@ def get_authorization_rule( # 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: @@ -571,8 +594,11 @@ def get_authorization_rule( 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, 'SBQueue') + # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + 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]: @@ -580,18 +606,18 @@ def get_authorization_rule( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SBAuthorizationRule', response) + deserialized = self._deserialize('SBQueue', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}'} - def list_keys( - self, resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): - """Primary and secondary connection strings to the queue. + def delete( + self, resource_group_name, namespace_name, queue_name, custom_headers=None, raw=False, **operation_config): + """Deletes a queue from the specified namespace in a resource group. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -600,26 +626,22 @@ def list_keys( :type namespace_name: str :param queue_name: The queue name. :type queue_name: str - :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 deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: AccessKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.AccessKeys or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.list_keys.metadata['url'] + url = self.delete.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), 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, 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) @@ -630,7 +652,6 @@ def list_keys( # 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: @@ -639,26 +660,20 @@ def list_keys( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + 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]: + if response.status_code not in [200, 204]: raise models.ErrorResponseException(self._deserialize, response) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('AccessKeys', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}'} - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/ListKeys'} - - def regenerate_keys( - self, resource_group_name, namespace_name, queue_name, authorization_rule_name, key_type, key=None, custom_headers=None, raw=False, **operation_config): - """Regenerates the primary or secondary connection strings to the queue. + def get( + self, resource_group_name, namespace_name, queue_name, custom_headers=None, raw=False, **operation_config): + """Returns a description for the specified queue. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -667,34 +682,23 @@ def regenerate_keys( :type namespace_name: str :param queue_name: The queue name. :type queue_name: str - :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' - :type key_type: str or ~azure.mgmt.servicebus.models.KeyType - :param key: Optional, if the key value provided, is reset for KeyType - value or autogenerate Key value set for keyType - :type key: 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: AccessKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.AccessKeys or + :return: SBQueue or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.SBQueue or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ - parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key) - # Construct URL - url = self.regenerate_keys.metadata['url'] + url = self.get.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), 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, 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) @@ -706,7 +710,6 @@ def regenerate_keys( # 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: @@ -714,11 +717,8 @@ def regenerate_keys( 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, 'RegenerateAccessKeyParameters') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) + 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]: @@ -726,11 +726,11 @@ def regenerate_keys( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('AccessKeys', response) + deserialized = self._deserialize('SBQueue', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}'} diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_topics_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_topics_operations.py index 64ba671466ff7..39281e010b343 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_topics_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_topics_operations.py @@ -38,41 +38,36 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def list_by_namespace( - self, resource_group_name, namespace_name, skip=None, top=None, custom_headers=None, raw=False, **operation_config): - """Gets all the topics in a namespace. + def list_authorization_rules( + self, resource_group_name, namespace_name, topic_name, custom_headers=None, raw=False, **operation_config): + """Gets authorization rules for a topic. :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 skip: Skip is only used if a previous operation returned a - partial result. If a previous response contains a nextLink element, - the value of the nextLink element will include a skip parameter that - specifies a starting point to use for subsequent calls. - :type skip: int - :param top: May be used to limit the number of results to the most - recent N usageDetails. - :type top: int + :param topic_name: The topic name. + :type topic_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 SBTopic + :return: An iterator like instance of SBAuthorizationRule :rtype: - ~azure.mgmt.servicebus.models.SBTopicPaged[~azure.mgmt.servicebus.models.SBTopic] + ~azure.mgmt.servicebus.models.SBAuthorizationRulePaged[~azure.mgmt.servicebus.models.SBAuthorizationRule] :raises: :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_namespace.metadata['url'] + url = self.list_authorization_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), + 'topicName': self._serialize.url("topic_name", topic_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) @@ -80,10 +75,6 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', maximum=1000, minimum=0) - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) else: url = next_link @@ -117,14 +108,14 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.SBTopicPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.SBAuthorizationRulePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_namespace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics'} + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules'} - def create_or_update( - self, resource_group_name, namespace_name, topic_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates a topic in the specified namespace. + 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 authorization rule for the specified topic. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -133,25 +124,30 @@ def create_or_update( :type namespace_name: str :param topic_name: The topic name. :type topic_name: str - :param parameters: Parameters supplied to create a topic resource. - :type parameters: ~azure.mgmt.servicebus.models.SBTopic + :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] :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: SBTopic or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.SBTopic or + :return: SBAuthorizationRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ + parameters = models.SBAuthorizationRule(rights=rights) + # Construct URL - url = self.create_or_update.metadata['url'] + url = self.create_or_update_authorization_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), 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, 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) @@ -172,7 +168,7 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'SBTopic') + body_content = self._serialize.body(parameters, 'SBAuthorizationRule') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -183,18 +179,18 @@ def create_or_update( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SBTopic', response) + deserialized = self._deserialize('SBAuthorizationRule', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}'} + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}'} - def delete( - self, resource_group_name, namespace_name, topic_name, custom_headers=None, raw=False, **operation_config): - """Deletes a topic from the specified namespace and resource group. + def get_authorization_rule( + self, resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): + """Returns the specified authorization rule. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -203,22 +199,26 @@ def delete( :type namespace_name: str :param topic_name: The topic name. :type topic_name: str + :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 deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: SBAuthorizationRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.delete.metadata['url'] + url = self.get_authorization_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), 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, 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) @@ -229,6 +229,7 @@ def delete( # 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: @@ -237,20 +238,26 @@ def delete( 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) + 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, 204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SBAuthorizationRule', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}'} - def get( - self, resource_group_name, namespace_name, topic_name, custom_headers=None, raw=False, **operation_config): - """Returns a description for the specified topic. + return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}'} + + def delete_authorization_rule( + self, resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): + """Deletes a topic authorization rule. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -259,23 +266,25 @@ def get( :type namespace_name: str :param topic_name: The topic name. :type topic_name: str + :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 deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: SBTopic or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.SBTopic or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.get.metadata['url'] + url = self.delete_authorization_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), 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, 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) @@ -286,7 +295,6 @@ def get( # 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: @@ -295,101 +303,20 @@ def get( 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) + 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]: + if response.status_code not in [200, 204]: raise models.ErrorResponseException(self._deserialize, response) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('SBTopic', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}'} - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}'} - - def list_authorization_rules( - self, resource_group_name, namespace_name, topic_name, custom_headers=None, raw=False, **operation_config): - """Gets authorization rules for a topic. - - :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 topic_name: The topic name. - :type topic_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 SBAuthorizationRule - :rtype: - ~azure.mgmt.servicebus.models.SBAuthorizationRulePaged[~azure.mgmt.servicebus.models.SBAuthorizationRule] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_authorization_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), - 'topicName': self._serialize.url("topic_name", topic_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') - - 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) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - 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 - header_dict = None - if raw: - header_dict = {} - deserialized = models.SBAuthorizationRulePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules'} - - 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 authorization rule for the specified topic. + def list_keys( + self, resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): + """Gets the primary and secondary connection strings for the topic. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -400,23 +327,19 @@ def create_or_update_authorization_rule( :type topic_name: str :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] :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: SBAuthorizationRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule or + :return: AccessKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.AccessKeys or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ - parameters = models.SBAuthorizationRule(rights=rights) - # Construct URL - url = self.create_or_update_authorization_rule.metadata['url'] + url = self.list_keys.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), @@ -433,7 +356,6 @@ def create_or_update_authorization_rule( # 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: @@ -441,11 +363,8 @@ def create_or_update_authorization_rule( 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, 'SBAuthorizationRule') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -453,18 +372,18 @@ def create_or_update_authorization_rule( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SBAuthorizationRule', response) + deserialized = self._deserialize('AccessKeys', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}'} + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/ListKeys'} - def get_authorization_rule( - self, resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): - """Returns the specified authorization rule. + def regenerate_keys( + self, resource_group_name, namespace_name, topic_name, authorization_rule_name, key_type, key=None, custom_headers=None, raw=False, **operation_config): + """Regenerates primary or secondary connection strings for the topic. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -475,19 +394,27 @@ def get_authorization_rule( :type topic_name: str :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' + :type key_type: str or ~azure.mgmt.servicebus.models.KeyType + :param key: Optional, if the key value provided, is reset for KeyType + value or autogenerate Key value set for keyType + :type key: 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: SBAuthorizationRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule or + :return: AccessKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.AccessKeys or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ + parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key) + # Construct URL - url = self.get_authorization_rule.metadata['url'] + url = self.regenerate_keys.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), @@ -504,6 +431,7 @@ def get_authorization_rule( # 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: @@ -511,8 +439,11 @@ def get_authorization_rule( 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, 'RegenerateAccessKeyParameters') + # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + 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]: @@ -520,18 +451,102 @@ def get_authorization_rule( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SBAuthorizationRule', response) + deserialized = self._deserialize('AccessKeys', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}'} + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} - def delete_authorization_rule( - self, resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): - """Deletes a topic authorization rule. + def list_by_namespace( + self, resource_group_name, namespace_name, skip=None, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all the topics in 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 skip: Skip is only used if a previous operation returned a + partial result. If a previous response contains a nextLink element, + the value of the nextLink element will include a skip parameter that + specifies a starting point to use for subsequent calls. + :type skip: int + :param top: May be used to limit the number of results to the most + recent N usageDetails. + :type top: int + :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 SBTopic + :rtype: + ~azure.mgmt.servicebus.models.SBTopicPaged[~azure.mgmt.servicebus.models.SBTopic] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_namespace.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') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', maximum=1000, minimum=0) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.SBTopicPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_namespace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics'} + + def create_or_update( + self, resource_group_name, namespace_name, topic_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates a topic in the specified namespace. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -540,25 +555,25 @@ def delete_authorization_rule( :type namespace_name: str :param topic_name: The topic name. :type topic_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str + :param parameters: Parameters supplied to create a topic resource. + :type parameters: ~azure.mgmt.servicebus.models.SBTopic :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 + :return: SBTopic or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.SBTopic or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.delete_authorization_rule.metadata['url'] + url = self.create_or_update.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), 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, 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) @@ -569,6 +584,8 @@ def delete_authorization_rule( # 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: @@ -576,21 +593,30 @@ def delete_authorization_rule( 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, 'SBTopic') + # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) + 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, 204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SBTopic', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}'} - def list_keys( - self, resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): - """Gets the primary and secondary connection strings for the topic. + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}'} + + def delete( + self, resource_group_name, namespace_name, topic_name, custom_headers=None, raw=False, **operation_config): + """Deletes a topic from the specified namespace and resource group. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -599,26 +625,22 @@ def list_keys( :type namespace_name: str :param topic_name: The topic name. :type topic_name: str - :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 deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: AccessKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.AccessKeys or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.list_keys.metadata['url'] + url = self.delete.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), 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, 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) @@ -629,7 +651,6 @@ def list_keys( # 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: @@ -638,26 +659,20 @@ def list_keys( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + 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]: + if response.status_code not in [200, 204]: raise models.ErrorResponseException(self._deserialize, response) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('AccessKeys', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}'} - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/ListKeys'} - - def regenerate_keys( - self, resource_group_name, namespace_name, topic_name, authorization_rule_name, key_type, key=None, custom_headers=None, raw=False, **operation_config): - """Regenerates primary or secondary connection strings for the topic. + def get( + self, resource_group_name, namespace_name, topic_name, custom_headers=None, raw=False, **operation_config): + """Returns a description for the specified topic. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -666,34 +681,23 @@ def regenerate_keys( :type namespace_name: str :param topic_name: The topic name. :type topic_name: str - :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' - :type key_type: str or ~azure.mgmt.servicebus.models.KeyType - :param key: Optional, if the key value provided, is reset for KeyType - value or autogenerate Key value set for keyType - :type key: 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: AccessKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.servicebus.models.AccessKeys or + :return: SBTopic or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.SBTopic or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ - parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key) - # Construct URL - url = self.regenerate_keys.metadata['url'] + url = self.get.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), 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, 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) @@ -705,7 +709,6 @@ def regenerate_keys( # 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: @@ -713,11 +716,8 @@ def regenerate_keys( 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, 'RegenerateAccessKeyParameters') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) + 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]: @@ -725,11 +725,11 @@ def regenerate_keys( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('AccessKeys', response) + deserialized = self._deserialize('SBTopic', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}'}