Rename cue command shell commands with message-broker

Change-Id: Iffa4b9822c65d55b14b4225af65df7e3ec5ab069
This commit is contained in:
Vipul Sabhaya 2015-06-05 12:29:12 -07:00 committed by Min Pae
parent d5b3acd521
commit 1acc546704
9 changed files with 53 additions and 52 deletions

View File

@ -18,10 +18,10 @@ from cueclient import utils
from openstackclient.common import utils as oscutils
DEFAULT_MQ_API_VERSION = '1'
DEFAULT_MB_API_VERSION = '1'
API_NAME = 'mq'
API_VERSION_OPTION = 'os_mq_api_version'
API_NAME = 'mb'
API_VERSION_OPTION = 'os_mb_api_version'
API_VERSIONS = {
'1': 'cueclient.v1.client.Client',
}
@ -37,13 +37,13 @@ def make_client(instance):
def build_option_parser(parser):
"""Hook to add global options."""
parser.add_argument(
'--os-mq-api-version',
metavar='<mq-api-version>',
'--os-mb-api-version',
metavar='<mb-api-version>',
default=utils.env(
'OS_MQ_API_VERSION',
default=DEFAULT_MQ_API_VERSION),
help='MQ API version, default=' +
DEFAULT_MQ_API_VERSION +
' (Env: OS_MQ_API_VERSION)')
'OS_MB_API_VERSION',
default=DEFAULT_MB_API_VERSION),
help='MB API version, default=' +
DEFAULT_MB_API_VERSION +
' (Env: OS_MB_API_VERSION)')
return parser

View File

@ -33,7 +33,7 @@ class TestCueBase(testtools.TestCase):
# Build up a fake app
self.app = mock.Mock()
self.app.client_manager = mock.Mock()
self.app.client_manager.mq = cs
self.app.client_manager.mb = cs
def check_parser(self, cmd, args, verify_args):
"""Test for parsing arguments"""
@ -63,4 +63,4 @@ class TestCueBase(testtools.TestCase):
if not isinstance(body, six.string_types):
# json load if the input body to match against is not a string
req_data = jsonutils.loads(req_data)
self.assertEqual(req_data, body)
self.assertEqual(req_data, body)

View File

@ -16,7 +16,7 @@ from six.moves.urllib import parse
from cueclient.v1 import client
MESSAGE_QUEUE_URL = 'http://message.queue'
MESSAGE_BROKER_URL = 'http://message.broker'
class V1(fixtures.Fixture):
@ -85,10 +85,10 @@ class V1(fixtures.Fixture):
headers=self.json_headers)
self.client = client.Client(session=session.Session())
self.client.session.endpoint_override = MESSAGE_QUEUE_URL
self.client.session.endpoint_override = MESSAGE_BROKER_URL
def url(self, *args, **kwargs):
url_args = [MESSAGE_QUEUE_URL]
url_args = [MESSAGE_BROKER_URL]
if self.base_url:
url_args.append(self.base_url)
@ -98,4 +98,4 @@ class V1(fixtures.Fixture):
if kwargs:
url += '?%s' % parse.urlencode(kwargs, doseq=True)
return url
return url

View File

@ -37,7 +37,7 @@ class ListClustersCommand(lister.Lister):
return parser
def take_action(self, parsed_args):
client = self.app.client_manager.mq
client = self.app.client_manager.mb
data = client.clusters.list()
@ -55,7 +55,7 @@ class ShowClusterCommand(show.ShowOne):
return parser
def take_action(self, parsed_args):
client = self.app.client_manager.mq
client = self.app.client_manager.mb
data = client.clusters.get(parsed_args.id)
@ -78,7 +78,7 @@ class CreateClusterCommand(show.ShowOne):
return parser
def take_action(self, parsed_args):
client = self.app.client_manager.mq
client = self.app.client_manager.mb
data = client.clusters.create(
name=parsed_args.name,
@ -109,7 +109,7 @@ class SetClusterCommand(command.Command):
return parser
def take_action(self, parsed_args):
client = self.app.client_manager.mq
client = self.app.client_manager.mb
data = {}
@ -146,6 +146,6 @@ class DeleteClusterCommand(command.Command):
return parser
def take_action(self, parsed_args):
client = self.app.client_manager.mq
client = self.app.client_manager.mb
client.clusters.delete(parsed_args.id)
LOG.info('Cluster %s was deleted', parsed_args.id)

View File

@ -21,7 +21,7 @@ from cueclient import version
class Client(object):
def __init__(self, region_name=None, endpoint_type='publicURL',
extensions=None, service_type='message_queue',
extensions=None, service_type='message-broker',
service_name=None, http_log_debug=False, session=None,
auth=None):
self.session = adapter.Adapter(

View File

@ -46,7 +46,7 @@ Required fields for 'create' : name, network id , flavor and size.
.. code-block:: shell-session
(openstack) cue cluster create --name cluster_04 --nic 3dd26c0b-03f2-4d2e-ae87-c02d7f33c788 --flavor 2 --size 3
(openstack) message-broker cluster create --name cluster_04 --nic 3dd26c0b-03f2-4d2e-ae87-c02d7f33c788 --flavor 2 --size 3
+-------------+--------------------------------------+
| Field | Value |
+-------------+--------------------------------------+
@ -70,7 +70,7 @@ Required field for 'show' : cluster-id
.. code-block:: shell-session
(openstack) cue cluster show 06d3c0e4-4972-4ca9-91c1-373b1c74e8e1
(openstack) message-broker cluster show 06d3c0e4-4972-4ca9-91c1-373b1c74e8e1
+-------------+--------------------------------------+
| Field | Value |
+-------------+--------------------------------------+
@ -93,14 +93,14 @@ Required field for 'delete' : cluster-id
.. code-block:: shell-session
(openstack) cue cluster delete 06d3c0e4-4972-4ca9-91c1-373b1c74e8e1
(openstack) message-broker cluster delete 06d3c0e4-4972-4ca9-91c1-373b1c74e8e1
Cluster List
------------
.. code-block:: shell-session
(openstack) cue cluster list
(openstack) message-broker cluster list
+--------------------------------------+-------------+----------+--------+------+
| id | name | status | flavor | size |
+--------------------------------------+-------------+----------+--------+------+
@ -114,12 +114,12 @@ Subcommands
Here are the full list of subcommands:
======================= ======================================================
subcommand Notes
======================= ======================================================
cue cluster create Create Cluster
cue cluster delete Delete Cluster
cue cluster show Show Cluster
cue cluster list List Clusters
======================= ======================================================
================================== ======================================================
subcommand Notes
================================== ======================================================
message-broker cluster create Create Cluster
message-broker cluster delete Delete Cluster
message-broker cluster show Show Cluster
message-broker cluster list List Clusters
================================== ======================================================

View File

@ -6,19 +6,19 @@ cue
SYNOPSIS
========
`cue` [options] <command> [command-options]
`message-broker` [options] <command> [command-options]
`cue help`
`message-broker help`
`cue help` <command>
`message-broker help` <command>
DESCRIPTION
===========
`cue` is a command line client for controlling OpenStack Cue, the messaging service.
`message-broker` is a command line client for controlling OpenStack Cue, the message broker provisioning service.
Before you can issue commands with `cue`, you must ensure that your
Before you can issue commands with `message-broker`, you must ensure that your
environment contains the necessary variables so that you can prove to the CLI
who you are and what credentials you have to issue the commands.
@ -27,28 +27,28 @@ OPTIONS
To get a list of available commands and options run::
cue help
message-broker help
To get usage and options of a command run::
cue help <command>
message-broker help <command>
EXAMPLES
========
Get information about cluster create command::
help cue cluster create
help message-broker cluster create
List available clusters::
help cue cluster list
help message-broker cluster list
View cluster information::
help cue cluster show
help message-broker cluster show
Delete clusters::
help cue cluster delete
help message-broker cluster delete

View File

@ -28,15 +28,15 @@ packages =
cueclient
[entry_points]
openstack.mq.v1 =
cue_cluster_create = cueclient.v1.cli.clusters:CreateClusterCommand
cue_cluster_list = cueclient.v1.cli.clusters:ListClustersCommand
cue_cluster_show = cueclient.v1.cli.clusters:ShowClusterCommand
cue_cluster_set = cueclient.v1.cli.clusters:SetClusterCommand
cue_cluster_delete = cueclient.v1.cli.clusters:DeleteClusterCommand
openstack.mb.v1 =
message-broker_cluster_create = cueclient.v1.cli.clusters:CreateClusterCommand
message-broker_cluster_list = cueclient.v1.cli.clusters:ListClustersCommand
message-broker_cluster_show = cueclient.v1.cli.clusters:ShowClusterCommand
message-broker_cluster_set = cueclient.v1.cli.clusters:SetClusterCommand
message-broker_cluster_delete = cueclient.v1.cli.clusters:DeleteClusterCommand
openstack.cli.extension =
mq = cueclient.osc.plugin
mb = cueclient.osc.plugin
[build_sphinx]

View File

@ -13,3 +13,4 @@ testrepository>=0.0.18
# Doc requirements
sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
oslosphinx>=2.5.0 # Apache-2.0