Difference between revisions of "UnifiedCLI"
(Add links to team and code) |
|||
Line 14: | Line 14: | ||
At this point it seems fair to consider those tools to be the 'free sample cli' that comes bundled with the client libraries and ignore them in favor of a new unified (in spirit, if not in implementation) [[OpenStack]] CLI interface. | At this point it seems fair to consider those tools to be the 'free sample cli' that comes bundled with the client libraries and ignore them in favor of a new unified (in spirit, if not in implementation) [[OpenStack]] CLI interface. | ||
− | + | The existing binaries can be replaced with one (or more) binaries that have a uniform command structure and option usage. The intended model is similar to that used by <code><nowiki>git</nowiki></code> (multiple binaries front-ended by a single interface) or libvirt's <code><nowiki>virsh</nowiki></code> (a single monolithic binary that does everything) where they follow the form <code><nowiki>cli-tool command arguments</nowiki></code>. In addition, the virsh-like mode of an embedded command line can be supported that would be able to speed up operations by caching authentication and other data between commands. | |
== Goals == | == Goals == | ||
Line 32: | Line 32: | ||
=== Command Structure === | === Command Structure === | ||
− | * | + | * The top level command name is <code><nowiki>openstack</nowiki></code> |
− | * | + | * Sub-commands take the form: |
− | + | <code><nowiki>openstack [<global-options>] <verb> <subject> [<command-local-arguments>]</nowiki></code> | |
=== Command Arguments === | === Command Arguments === | ||
Line 44: | Line 44: | ||
=== Other === | === Other === | ||
− | * | + | * Arguments that normally require an ID in the OS-API may also use the name or other short identifier where reasonable to support |
− | * | + | * Output option for character-delimited format, character can be specified, default to '|' (TODO(dtroyer): update this with cliff's capabilities). |
== Implementation == | == Implementation == | ||
Line 67: | Line 67: | ||
* Previous work in this vein is at [[UnifiedCommandLineClient]] | * Previous work in this vein is at [[UnifiedCommandLineClient]] | ||
* A Perl implementation is at https://metacpan.org/module/oscompute | * A Perl implementation is at https://metacpan.org/module/oscompute | ||
− | |||
---- | ---- | ||
[[Category:Spec]] | [[Category:Spec]] |
Revision as of 15:20, 28 June 2012
UnifiedCLI
Status: DRAFT
Summary
A unified OpenStack CLI will provide users with an improved experience in dealing with the variety of commands and arguments required to interact with OpenStack. The unified CLI is intended to be a complete substitute for the bundled CLI binaries supplied with the OpenStack project clients. Where possible it will utilize the existing client modules to minimize duplication of effort.
Rationale
The user experience with OpenStack CLI tools is a frustrating one right now due to a number of inconsistencies between the various tools, not to mention making a user know that keystone
is the user/tenant tool and nova
is the instance/flavor/image tools and glance
is the image tool that replaces the image functions in nova
.
At this point it seems fair to consider those tools to be the 'free sample cli' that comes bundled with the client libraries and ignore them in favor of a new unified (in spirit, if not in implementation) OpenStack CLI interface.
The existing binaries can be replaced with one (or more) binaries that have a uniform command structure and option usage. The intended model is similar to that used by git
(multiple binaries front-ended by a single interface) or libvirt's virsh
(a single monolithic binary that does everything) where they follow the form cli-tool command arguments
. In addition, the virsh-like mode of an embedded command line can be supported that would be able to speed up operations by caching authentication and other data between commands.
Goals
- use the OpenStack Python client API modules, extending them as required
- use consistent naming and structure for commands and arguments
- consistent output formats with the option of reliably machine parsable formats
- use a single-binary approach that also contains an embedded command-line that can execute multiple commands on a single authentication (see libvirt's
virsh
for an example) - independence from the OpenStack project names
Design
There is a Human Interface Guidelines document being prepared that replaces this section.
The existing command sets for Keystone, Nova, Glance and Quantum have been mapped into the new command format.
Command Structure
- The top level command name is
openstack
- Sub-commands take the form:
openstack [<global-options>] <verb> <subject> [<command-local-arguments>]
Command Arguments
- All long options names shall use '-' as the interpolation character
- Authentication options conform to a revised version of the original CLIAuth
- All arguments are
--argument=value
Other
- Arguments that normally require an ID in the OS-API may also use the name or other short identifier where reasonable to support
- Output option for character-delimited format, character can be specified, default to '|' (TODO(dtroyer): update this with cliff's capabilities).
Implementation
- Team: https://launchpad.net/~python-openstackclient
- Code: https://github.com/openstack/python-openstackclient
Unresolved issues
- Positional arguments are allowed where the common use case is obvious, with the
--argument=value
also being accepted
Additional Information
Supplemental Documents
Other Resources
- Previous work in this vein is at UnifiedCommandLineClient
- A Perl implementation is at https://metacpan.org/module/oscompute