Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServiceBus: Added sb extension #21

Closed
wants to merge 10 commits into from
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
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/src/index.json @derekbekoe

/src/image-copy/ @tamirkamara

/src/servicebus/ @v-ajnava
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,6 @@ ENV/

# mypy
.mypy_cache/

# idea
.idea/
2 changes: 1 addition & 1 deletion src/image-copy/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from codecs import open
from setuptools import setup, find_packages

VERSION = "0.0.4"
VERSION = "0.0.1"

CLASSIFIERS = [
'Development Status :: 4 - Beta',
Expand Down
4 changes: 4 additions & 0 deletions src/servicebus/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/servicebus/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/servicebus/.idea/servicebus.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

533 changes: 533 additions & 0 deletions src/servicebus/.idea/workspace.xml

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions src/servicebus/azext_servicebus/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# --------------------------------------------------------------------------------------------
# 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


class ServicebusCommandsLoader(AzCommandsLoader):

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

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

def load_arguments(self, command):
from azext_servicebus._params import load_arguments_namespace, load_arguments_queue, load_arguments_topic,\
load_arguments_subscription, load_arguments_rule, load_arguments_geodr
load_arguments_namespace(self, command)
load_arguments_queue(self, command)
load_arguments_topic(self, command)
load_arguments_subscription(self, command)
load_arguments_rule(self, command)
load_arguments_geodr(self, command)


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


def cf_servicebus(cli_ctx, **_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azext_servicebus.servicebus import ServiceBusManagementClient
return get_mgmt_service_client(cli_ctx, ServiceBusManagementClient)


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


def queues_mgmt_client_factory(cli_ctx, _):
return cf_servicebus(cli_ctx).queues


def topics_mgmt_client_factory(cli_ctx, _):
return cf_servicebus(cli_ctx).topics


def subscriptions_mgmt_client_factory(cli_ctx, _):
return cf_servicebus(cli_ctx).subscriptions


def rules_mgmt_client_factory(cli_ctx, _):
return cf_servicebus(cli_ctx).rules


def regions_mgmt_client_factory(cli_ctx, _):
return cf_servicebus(cli_ctx).regions


def premium_messaging_mgmt_client_factory(cli_ctx, _):
return cf_servicebus(cli_ctx).premium_messaging


def event_subscriptions_mgmt_client_factory(cli_ctx, _):
return cf_servicebus(cli_ctx).event_subscriptions


def event_hubs_mgmt_client_factory(cli_ctx, _):
return cf_servicebus(cli_ctx).event_hubs


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