-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 CLI Extension #31
Merged
Merged
Changes from 14 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3d184b0
ServiceBus CLI Extension
79e2369
updated Codeowners
41be029
changed sb to servicebus
270f3e1
fixed lint error
4c9ba91
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
247a580
updated help
ca2ebf4
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
3b0dac4
Review comments resolved
2291a74
Review comments resolved
68e2c0d
fixed the lint error
b55b9cf
lint error of trailing whitespace fixed
4203d5c
test fixture
0b686be
resolved help review comments
b8c2575
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
c65326d
Review comments for help and params
3c5bac2
Added Matadat file
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
/src/index.json @derekbekoe | ||
|
||
/src/image-copy/ @tamirkamara | ||
|
||
/src/servicebus/ @v-ajnava |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
# pylint: disable=unused-import | ||
|
||
from azure.cli.core import AzCommandsLoader | ||
from ._help import helps | ||
|
||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Load the _helps file here otherwise it won't be loaded and so no help is shown.
e.g. https://github.com/Azure/azure-cli/blob/dev/src/command_modules/azure-cli-batchai/azure/cli/command_modules/batchai/__init__.py#L8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved