Skip to content

Commit

Permalink
EventHub - cli extension (#37)
Browse files Browse the repository at this point in the history
* EventHub - cli extension

* fixed lint errors

* Review Comments

* fixed lint errors and test recordings

* exception handler

* Review Comments

* lint fixes

* Review Comments for Adding Help sub groups and exception fix

* added help for geodr authorule and keys

* corrected access rights help text
  • Loading branch information
Ajit Navasare authored and derekbekoe committed Jan 25, 2018
1 parent de8d267 commit e8200a5
Show file tree
Hide file tree
Showing 51 changed files with 7,927 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
/src/image-copy/ @tamirkamara

/src/servicebus/ @v-ajnava

/src/eventhubs/ @v-ajnava
34 changes: 34 additions & 0 deletions src/eventhubs/azext_eventhub/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader

# pylint: disable=unused-import
# pylint: disable=line-too-long

from ._help import helps


class EventhubCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
eventhub_custom = CliCommandType(operations_tmpl='azext_eventhub.custom#{}')
super(EventhubCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=eventhub_custom, min_profile="2017-03-10-profile")

def load_command_table(self, args):
from azext_eventhub.commands import load_command_table
load_command_table(self, args)
return self.command_table

def load_arguments(self, command):
from azext_eventhub._params import load_arguments_namespace, load_arguments_eventhub, load_arguments_consumergroup, load_arguments_geodr
load_arguments_namespace(self, command)
load_arguments_eventhub(self, command)
load_arguments_consumergroup(self, command)
load_arguments_geodr(self, command)


COMMAND_LOADER_CLS = EventhubCommandsLoader
26 changes: 26 additions & 0 deletions src/eventhubs/azext_eventhub/_client_factory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------


def cf_eventhub(cli_ctx, **_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azext_eventhub.eventhub import EventHubManagementClient
return get_mgmt_service_client(cli_ctx, EventHubManagementClient)


def namespaces_mgmt_client_factory(cli_ctx, _):
return cf_eventhub(cli_ctx).namespaces


def event_hub_mgmt_client_factory(cli_ctx, _):
return cf_eventhub(cli_ctx).event_hubs


def consumer_groups_mgmt_client_factory(cli_ctx, _):
return cf_eventhub(cli_ctx).consumer_groups


def disaster_recovery_mgmt_client_factory(cli_ctx, _):
return cf_eventhub(cli_ctx).disaster_recovery_configs
Loading

0 comments on commit e8200a5

Please sign in to comment.