Skip to content
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 @@ -15,9 +15,11 @@
from .version import VERSION
from .operations.operations import Operations
from .operations.namespaces_operations import NamespacesOperations
from .operations.messaging_plan_operations import MessagingPlanOperations
from .operations.disaster_recovery_configs_operations import DisasterRecoveryConfigsOperations
from .operations.event_hubs_operations import EventHubsOperations
from .operations.consumer_groups_operations import ConsumerGroupsOperations
from .operations.regions_operations import RegionsOperations
from . import models


Expand Down Expand Up @@ -65,12 +67,16 @@ class EventHubManagementClient(object):
:vartype operations: azure.mgmt.eventhub.operations.Operations
:ivar namespaces: Namespaces operations
:vartype namespaces: azure.mgmt.eventhub.operations.NamespacesOperations
:ivar messaging_plan: MessagingPlan operations
:vartype messaging_plan: azure.mgmt.eventhub.operations.MessagingPlanOperations
:ivar disaster_recovery_configs: DisasterRecoveryConfigs operations
:vartype disaster_recovery_configs: azure.mgmt.eventhub.operations.DisasterRecoveryConfigsOperations
:ivar event_hubs: EventHubs operations
:vartype event_hubs: azure.mgmt.eventhub.operations.EventHubsOperations
:ivar consumer_groups: ConsumerGroups operations
:vartype consumer_groups: azure.mgmt.eventhub.operations.ConsumerGroupsOperations
:ivar regions: Regions operations
:vartype regions: azure.mgmt.eventhub.operations.RegionsOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
Expand All @@ -97,9 +103,13 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.namespaces = NamespacesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.messaging_plan = MessagingPlanOperations(
self._client, self.config, self._serialize, self._deserialize)
self.disaster_recovery_configs = DisasterRecoveryConfigsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.event_hubs = EventHubsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.consumer_groups = ConsumerGroupsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.regions = RegionsOperations(
self._client, self.config, self._serialize, self._deserialize)
8 changes: 8 additions & 0 deletions azure-mgmt-eventhub/azure/mgmt/eventhub/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@
from .operation import Operation
from .error_response import ErrorResponse, ErrorResponseException
from .arm_disaster_recovery import ArmDisasterRecovery
from .messaging_regions_properties import MessagingRegionsProperties
from .messaging_regions import MessagingRegions
from .messaging_plan import MessagingPlan
from .operation_paged import OperationPaged
from .eh_namespace_paged import EHNamespacePaged
from .authorization_rule_paged import AuthorizationRulePaged
from .arm_disaster_recovery_paged import ArmDisasterRecoveryPaged
from .eventhub_paged import EventhubPaged
from .consumer_group_paged import ConsumerGroupPaged
from .messaging_regions_paged import MessagingRegionsPaged
from .event_hub_management_client_enums import (
SkuName,
SkuTier,
Expand Down Expand Up @@ -62,12 +66,16 @@
'Operation',
'ErrorResponse', 'ErrorResponseException',
'ArmDisasterRecovery',
'MessagingRegionsProperties',
'MessagingRegions',
'MessagingPlan',
'OperationPaged',
'EHNamespacePaged',
'AuthorizationRulePaged',
'ArmDisasterRecoveryPaged',
'EventhubPaged',
'ConsumerGroupPaged',
'MessagingRegionsPaged',
'SkuName',
'SkuTier',
'AccessRights',
Expand Down
65 changes: 65 additions & 0 deletions azure-mgmt-eventhub/azure/mgmt/eventhub/models/messaging_plan.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .tracked_resource import TrackedResource


class MessagingPlan(TrackedResource):
"""Messaging.

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 location: Resource location
:type location: str
:param tags: Resource tags
:type tags: dict[str, str]
:param sku: Sku type
:type sku: int
:param selected_event_hub_unit: Selected event hub unit
:type selected_event_hub_unit: int
:ivar updated_at: The exact time the messaging plan was updated.
:vartype updated_at: datetime
:param revision: revision number
:type revision: long
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'updated_at': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'sku': {'key': 'properties.sku', 'type': 'int'},
'selected_event_hub_unit': {'key': 'properties.selectedEventHubUnit', 'type': 'int'},
'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'},
'revision': {'key': 'properties.revision', 'type': 'long'},
}

def __init__(self, location=None, tags=None, sku=None, selected_event_hub_unit=None, revision=None):
super(MessagingPlan, self).__init__(location=location, tags=tags)
self.sku = sku
self.selected_event_hub_unit = selected_event_hub_unit
self.updated_at = None
self.revision = revision
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .tracked_resource import TrackedResource


class MessagingRegions(TrackedResource):
"""Messaging Region.

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 location: Resource location
:type location: str
:param tags: Resource tags
:type tags: dict[str, str]
:param properties:
:type properties: ~azure.mgmt.eventhub.models.MessagingRegionsProperties
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'properties': {'key': 'properties', 'type': 'MessagingRegionsProperties'},
}

def __init__(self, location=None, tags=None, properties=None):
super(MessagingRegions, self).__init__(location=location, tags=tags)
self.properties = properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.paging import Paged


class MessagingRegionsPaged(Paged):
"""
A paging container for iterating over a list of :class:`MessagingRegions <azure.mgmt.eventhub.models.MessagingRegions>` object
"""

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

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

super(MessagingRegionsPaged, self).__init__(*args, **kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class MessagingRegionsProperties(Model):
"""MessagingRegionsProperties.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar code: Region code
:vartype code: str
:ivar full_name: Full name of the region
:vartype full_name: str
"""

_validation = {
'code': {'readonly': True},
'full_name': {'readonly': True},
}

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'full_name': {'key': 'fullName', 'type': 'str'},
}

def __init__(self):
super(MessagingRegionsProperties, self).__init__()
self.code = None
self.full_name = None
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@

from .operations import Operations
from .namespaces_operations import NamespacesOperations
from .messaging_plan_operations import MessagingPlanOperations
from .disaster_recovery_configs_operations import DisasterRecoveryConfigsOperations
from .event_hubs_operations import EventHubsOperations
from .consumer_groups_operations import ConsumerGroupsOperations
from .regions_operations import RegionsOperations

__all__ = [
'Operations',
'NamespacesOperations',
'MessagingPlanOperations',
'DisasterRecoveryConfigsOperations',
'EventHubsOperations',
'ConsumerGroupsOperations',
'RegionsOperations',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError

from .. import models


class MessagingPlanOperations(object):
"""MessagingPlanOperations operations.

:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An objec model deserializer.
:ivar api_version: Client API Version. Constant value: "2017-04-01".
"""

models = models

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 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<msrest:optionsforoperations>`.
:return: MessagingPlan or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.eventhub.models.MessagingPlan or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/messagingplan'
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 and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('MessagingPlan', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized
Loading