Improve "openstack server xxx" commands to effect on multiple servers.

Registered by Tang Chen

NOTE: This BP has been redirected to a new one:
https://blueprints.launchpad.net/python-openstackclient/+spec/multi-argument-compute

Improve "openstack server xxx" commands to effect on multiple servers.

Now in Openstack client, some commands are able to be operated on
more than one instances. eg:

# openstack server delete -h
usage: openstack server delete [-h] [--wait] <server> [<server> ...]

Delete server(s)

positional arguments:
  <server> Server(s) to delete (name or ID)

But more commands could only accept one server. eg:

# openstack server pause -h
usage: openstack server pause [-h] <server>

Pause server

positional arguments:
  <server> Server (name or ID)

And also many other commands. So improve these commands to accept multiple servers. A lot of commands are going to be changed in this BP, but not at one time. Will change some of them first, and when the changes are confirmed, go on to the rest of them.

And there are some commands not supported by osc (start and stop). Also implement them.

The commands will be improved as this BP going on:

Step 1: implement unsupported commands (In progress)
---------------------------------------------------------
Todo: reset-state.
Done: start, stop

Step 2: basic operation on servers (In progress)
---------------------------------------------------------
Todo: set/unset, rescue/unrescue, suspend/resume, create, reboot
Done: delete, pause/unpause, lock/unlock

Step 3: migration operations
---------------------------------------------------------
Todo: migrate, resize, rebuild
Done:

Step 4: other operations
---------------------------------------------------------
Todo: add security group, remove security group, add volume, remove volume, image create
Done:

These commands may take one server, but multiple groups/volumes,images.

No need to change:
---------------------------------------------------------
list, show, ssh

This BP will be used to track the progress, and will move items in Todo to Done when the work is finished.

There is another BP adding unit tests for the commands:
https://blueprints.launchpad.net/python-openstackclient/+spec/osc-unit-test-framework-improvement

Blueprint information

Status:
Started
Approver:
Steve Martinelli
Priority:
Medium
Drafter:
Tang Chen
Direction:
Approved
Assignee:
Tang Chen
Definition:
Approved
Series goal:
None
Implementation:
Good progress
Milestone target:
None
Started by
Steve Martinelli

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/cmd-with-multi-servers,n,z

Addressed by: https://review.openstack.org/238409
    Enable "openstack server pause" command to take multiple servers.

Addressed by: https://review.openstack.org/239268
    Add "server start" command to osc.

Addressed by: https://review.openstack.org/239269
    Add "server stop" command to osc.

Addressed by: https://review.openstack.org/241924
    Add unit tests for "server pause" command.

Gerrit topic: https://review.openstack.org/#q,topic:reset-state,n,z

Addressed by: https://review.openstack.org/243393
    Add "server reset state" command to osc.

Addressed by: https://review.openstack.org/244192
    Enable "openstack server unpause" command to take multiple servers.

Addressed by: https://review.openstack.org/244417
    Enable "openstack server lock" command to take multiple servers.

Addressed by: https://review.openstack.org/244418
    Enable "openstack server unlock" command to take multiple servers.

Addressed by: https://review.openstack.org/248624
    Enable "openstack server suspend" command to take multiple servers.

Addressed by: https://review.openstack.org/248625
    Enable "openstack server resume" command to take multiple servers.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.