Skip to content

Commit e8200a5

Browse files
Ajit Navasarederekbekoe
authored andcommitted
EventHub - cli extension (#37)
* 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
1 parent de8d267 commit e8200a5

51 files changed

Lines changed: 7927 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
/src/image-copy/ @tamirkamara
66

77
/src/servicebus/ @v-ajnava
8+
9+
/src/eventhubs/ @v-ajnava
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# --------------------------------------------------------------------------------------------
5+
6+
from azure.cli.core import AzCommandsLoader
7+
8+
# pylint: disable=unused-import
9+
# pylint: disable=line-too-long
10+
11+
from ._help import helps
12+
13+
14+
class EventhubCommandsLoader(AzCommandsLoader):
15+
16+
def __init__(self, cli_ctx=None):
17+
from azure.cli.core.commands import CliCommandType
18+
eventhub_custom = CliCommandType(operations_tmpl='azext_eventhub.custom#{}')
19+
super(EventhubCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=eventhub_custom, min_profile="2017-03-10-profile")
20+
21+
def load_command_table(self, args):
22+
from azext_eventhub.commands import load_command_table
23+
load_command_table(self, args)
24+
return self.command_table
25+
26+
def load_arguments(self, command):
27+
from azext_eventhub._params import load_arguments_namespace, load_arguments_eventhub, load_arguments_consumergroup, load_arguments_geodr
28+
load_arguments_namespace(self, command)
29+
load_arguments_eventhub(self, command)
30+
load_arguments_consumergroup(self, command)
31+
load_arguments_geodr(self, command)
32+
33+
34+
COMMAND_LOADER_CLS = EventhubCommandsLoader
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# --------------------------------------------------------------------------------------------
5+
6+
7+
def cf_eventhub(cli_ctx, **_):
8+
from azure.cli.core.commands.client_factory import get_mgmt_service_client
9+
from azext_eventhub.eventhub import EventHubManagementClient
10+
return get_mgmt_service_client(cli_ctx, EventHubManagementClient)
11+
12+
13+
def namespaces_mgmt_client_factory(cli_ctx, _):
14+
return cf_eventhub(cli_ctx).namespaces
15+
16+
17+
def event_hub_mgmt_client_factory(cli_ctx, _):
18+
return cf_eventhub(cli_ctx).event_hubs
19+
20+
21+
def consumer_groups_mgmt_client_factory(cli_ctx, _):
22+
return cf_eventhub(cli_ctx).consumer_groups
23+
24+
25+
def disaster_recovery_mgmt_client_factory(cli_ctx, _):
26+
return cf_eventhub(cli_ctx).disaster_recovery_configs

0 commit comments

Comments
 (0)