Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def get_authorization_rule(
return deserialized
get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'}

def postt_authorization_rule(
def post_authorization_rule(
self, resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config):
"""Gets an AuthorizationRule for an Event Hub by rule name.

Expand All @@ -558,7 +558,7 @@ def postt_authorization_rule(
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.postt_authorization_rule.metadata['url']
url = self.post_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),
Expand Down Expand Up @@ -600,7 +600,7 @@ def postt_authorization_rule(
return client_raw_response

return deserialized
postt_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'}
post_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'}

def delete_authorization_rule(
self, resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
from ._paged_models import EHNamespacePaged
from ._paged_models import EventhubPaged
from ._paged_models import MessagingRegionsPaged
from ._paged_models import NetworkRuleSetPaged
from ._paged_models import OperationPaged
from ._event_hub_management_client_enums import (
SkuName,
Expand Down Expand Up @@ -108,6 +109,7 @@
'OperationPaged',
'EHNamespacePaged',
'AuthorizationRulePaged',
'NetworkRuleSetPaged',
'ArmDisasterRecoveryPaged',
'EventhubPaged',
'ConsumerGroupPaged',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ class AuthorizationRulePaged(Paged):
def __init__(self, *args, **kwargs):

super(AuthorizationRulePaged, self).__init__(*args, **kwargs)
class NetworkRuleSetPaged(Paged):
"""
A paging container for iterating over a list of :class:`NetworkRuleSet <azure.mgmt.eventhub.v2017_04_01.models.NetworkRuleSet>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[NetworkRuleSet]'}
}

def __init__(self, *args, **kwargs):

super(NetworkRuleSetPaged, self).__init__(*args, **kwargs)
class ArmDisasterRecoveryPaged(Paged):
"""
A paging container for iterating over a list of :class:`ArmDisasterRecovery <azure.mgmt.eventhub.v2017_04_01.models.ArmDisasterRecovery>` object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1149,3 +1149,75 @@ def get_network_rule_set(

return deserialized
get_network_rule_set.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/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<msrest:optionsforoperations>`.
:return: An iterator like instance of NetworkRuleSet
:rtype:
~azure.mgmt.eventhub.v2017_04_01.models.NetworkRuleSetPaged[~azure.mgmt.eventhub.v2017_04_01.models.NetworkRuleSet]
:raises:
:class:`ErrorResponseException<azure.mgmt.eventhub.v2017_04_01.models.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.EventHub/namespaces/{namespaceName}/networkRuleSets'}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@
from ._models_py3 import EHNamespace
from ._models_py3 import EHNamespaceIdContainer
from ._models_py3 import EHNamespaceIdListResult
from ._models_py3 import Encryption
from ._models_py3 import ErrorResponse, ErrorResponseException
from ._models_py3 import Identity
from ._models_py3 import IpFilterRule
from ._models_py3 import KeyVaultProperties
from ._models_py3 import NetworkRuleSet
from ._models_py3 import NWRuleSetIpRules
from ._models_py3 import NWRuleSetVirtualNetworkRules
Expand All @@ -39,8 +42,11 @@
from ._models import EHNamespace
from ._models import EHNamespaceIdContainer
from ._models import EHNamespaceIdListResult
from ._models import Encryption
from ._models import ErrorResponse, ErrorResponseException
from ._models import Identity
from ._models import IpFilterRule
from ._models import KeyVaultProperties
from ._models import NetworkRuleSet
from ._models import NWRuleSetIpRules
from ._models import NWRuleSetVirtualNetworkRules
Expand All @@ -59,6 +65,8 @@
from ._event_hub2018_preview_management_client_enums import (
SkuName,
SkuTier,
IdentityType,
KeySource,
IPAction,
NetworkRuleIPAction,
DefaultAction,
Expand All @@ -73,8 +81,11 @@
'EHNamespace',
'EHNamespaceIdContainer',
'EHNamespaceIdListResult',
'Encryption',
'ErrorResponse', 'ErrorResponseException',
'Identity',
'IpFilterRule',
'KeyVaultProperties',
'NetworkRuleSet',
'NWRuleSetIpRules',
'NWRuleSetVirtualNetworkRules',
Expand All @@ -92,6 +103,8 @@
'VirtualNetworkRulePaged',
'SkuName',
'SkuTier',
'IdentityType',
'KeySource',
'IPAction',
'NetworkRuleIPAction',
'DefaultAction',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ class SkuTier(str, Enum):
standard = "Standard"


class IdentityType(str, Enum):

system_assigned = "SystemAssigned"


class KeySource(str, Enum):

microsoft_key_vault = "Microsoft.KeyVault"


class IPAction(str, Enum):

accept = "Accept"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ class EHNamespace(TrackedResource):
:ivar service_bus_endpoint: Endpoint you can use to perform Service Bus
operations.
:vartype service_bus_endpoint: str
:param cluster_arm_id: Cluster ARM ID of the Namespace.
:type cluster_arm_id: str
:ivar metric_id: Identifier for Azure Insights metrics.
:vartype metric_id: str
:param is_auto_inflate_enabled: Value that indicates whether AutoInflate
Expand All @@ -279,6 +281,11 @@ class EHNamespace(TrackedResource):
:param zone_redundant: Enabling this property creates a Standard Event
Hubs Namespace in regions supported availability zones.
:type zone_redundant: bool
:param identity: Properties of BYOK Identity description
:type identity: ~azure.mgmt.eventhub.v2018_01_01_preview.models.Identity
:param encryption: Properties of BYOK Encryption description
:type encryption:
~azure.mgmt.eventhub.v2018_01_01_preview.models.Encryption
"""

_validation = {
Expand All @@ -304,11 +311,14 @@ class EHNamespace(TrackedResource):
'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'},
'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'},
'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'},
'cluster_arm_id': {'key': 'properties.clusterArmId', 'type': 'str'},
'metric_id': {'key': 'properties.metricId', 'type': 'str'},
'is_auto_inflate_enabled': {'key': 'properties.isAutoInflateEnabled', 'type': 'bool'},
'maximum_throughput_units': {'key': 'properties.maximumThroughputUnits', 'type': 'int'},
'kafka_enabled': {'key': 'properties.kafkaEnabled', 'type': 'bool'},
'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'},
'identity': {'key': 'properties.identity', 'type': 'Identity'},
'encryption': {'key': 'properties.encryption', 'type': 'Encryption'},
}

def __init__(self, **kwargs):
Expand All @@ -318,11 +328,14 @@ def __init__(self, **kwargs):
self.created_at = None
self.updated_at = None
self.service_bus_endpoint = None
self.cluster_arm_id = kwargs.get('cluster_arm_id', None)
self.metric_id = None
self.is_auto_inflate_enabled = kwargs.get('is_auto_inflate_enabled', None)
self.maximum_throughput_units = kwargs.get('maximum_throughput_units', None)
self.kafka_enabled = kwargs.get('kafka_enabled', None)
self.zone_redundant = kwargs.get('zone_redundant', None)
self.identity = kwargs.get('identity', None)
self.encryption = kwargs.get('encryption', None)


class EHNamespaceIdContainer(Model):
Expand Down Expand Up @@ -358,6 +371,30 @@ def __init__(self, **kwargs):
self.value = kwargs.get('value', None)


class Encryption(Model):
"""Properties to configure Encryption.

:param key_vault_properties: Properties of KeyVault
:type key_vault_properties:
~azure.mgmt.eventhub.v2018_01_01_preview.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.eventhub.v2018_01_01_preview.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 ErrorResponse(Model):
"""Error response that indicates the service is not able to process the
incoming request. The reason is provided in the error message.
Expand Down Expand Up @@ -391,6 +428,33 @@ def __init__(self, deserialize, response, *args):
super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)


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.eventhub.v2018_01_01_preview.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.

Expand Down Expand Up @@ -435,6 +499,26 @@ def __init__(self, **kwargs):
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 NetworkRuleSet(Resource):
"""Description of topic resource.

Expand Down
Loading