summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/source/command-objects/hypervisor.rst36
-rw-r--r--doc/source/commands.rst2
-rw-r--r--openstackclient/compute/v2/hypervisor.py14
3 files changed, 44 insertions, 8 deletions
diff --git a/doc/source/command-objects/hypervisor.rst b/doc/source/command-objects/hypervisor.rst
new file mode 100644
index 00000000..d6d0469b
--- /dev/null
+++ b/doc/source/command-objects/hypervisor.rst
@@ -0,0 +1,36 @@
+==========
+hypervisor
+==========
+
+Compute v2
+
+hypervisor list
+---------------
+
+List hypervisors
+
+.. program:: hypervisor list
+.. code:: bash
+
+ os hypervisor list
+ [--matching <hostname>]
+
+.. option:: --matching <hostname>
+
+ Filter hypervisors using <hostname> substring
+
+hypervisor show
+---------------
+
+Display hypervisor details
+
+.. program:: hypervisor show
+.. code:: bash
+
+ os hypervisor show
+ <hypervisor>
+
+.. _hypervisor_show-flavor:
+.. describe:: <hypervisor>
+
+ Hypervisor to display (name or ID)
diff --git a/doc/source/commands.rst b/doc/source/commands.rst
index 6dbaf117..b621f8c8 100644
--- a/doc/source/commands.rst
+++ b/doc/source/commands.rst
@@ -87,7 +87,7 @@ referring to both Compute and Volume quotas.
* ``flavor``: (**Compute**) predefined server configurations: ram, root disk, etc
* ``group``: (**Identity**) a grouping of users
* ``host``: Compute - the physical computer running a hypervisor
-* ``hypervisor``: Compute - the virtual machine manager
+* ``hypervisor``: (**Compute**) the virtual machine manager
* ``identity provider``: (**Identity**) a source of users and authentication
* ``image``: (**Image**) a disk image
* ``ip fixed``: Compute, Network - an internal IP address assigned to a server
diff --git a/openstackclient/compute/v2/hypervisor.py b/openstackclient/compute/v2/hypervisor.py
index e01258d1..355ffbb3 100644
--- a/openstackclient/compute/v2/hypervisor.py
+++ b/openstackclient/compute/v2/hypervisor.py
@@ -33,8 +33,8 @@ class ListHypervisor(lister.Lister):
parser = super(ListHypervisor, self).get_parser(prog_name)
parser.add_argument(
"--matching",
- metavar="<hostname-str>",
- help="Filter hypervisors using <hostname-str> substring",
+ metavar="<hostname>",
+ help="Filter hypervisors using <hostname> substring",
)
return parser
@@ -58,23 +58,23 @@ class ListHypervisor(lister.Lister):
class ShowHypervisor(show.ShowOne):
- """Show hypervisor details"""
+ """Display hypervisor details"""
log = logging.getLogger(__name__ + ".ShowHypervisor")
def get_parser(self, prog_name):
parser = super(ShowHypervisor, self).get_parser(prog_name)
parser.add_argument(
- "id",
- metavar="<id>",
- help="ID of the hypervisor to display")
+ "hypervisor",
+ metavar="<hypervisor>",
+ help="Hypervisor to display (name or ID)")
return parser
def take_action(self, parsed_args):
self.log.debug("take_action(%s)", parsed_args)
compute_client = self.app.client_manager.compute
hypervisor = utils.find_resource(compute_client.hypervisors,
- parsed_args.id)._info.copy()
+ parsed_args.hypervisor)._info.copy()
hypervisor["service_id"] = hypervisor["service"]["id"]
hypervisor["service_host"] = hypervisor["service"]["host"]