Add and document all the rest of the client options

This commit is contained in:
Andrew Hutchings
2012-10-16 16:50:03 -07:00
parent d8cd95e20f
commit 43d129bc9d
3 changed files with 119 additions and 18 deletions

View File

@@ -48,15 +48,6 @@ Global Options
Client Commands
---------------
======= ==================
Command Required Parameter
======= ==================
list None
create loadbalancerID
modify loadbalancerID
status loadbalancerID
======= ==================
.. program:: libra_client.py create
create
@@ -91,6 +82,10 @@ modify
Update a load balancer's configuration
.. option:: --id <id>
The ID of the load balancer
.. option:: --name <name>
A new name for the load balancer
@@ -112,3 +107,93 @@ status
^^^^^^
Get the status of a single load balancer
.. option:: --id <id>
The ID of the load balancer
.. program:: libra_client.py delete
delete
^^^^^^
Delete a load balancer
.. option:: --id <id>
The ID of the load balancer
.. program:: libra_client.py node-list
node-list
^^^^^^^^^
List the nodes in a load balancer
.. option:: --id <id>
The ID of the load balancer
.. program:: libra_client.py node-delete
node-delete
^^^^^^^^^^^
Delete a node from the load balancer
.. option:: --id <id>
The ID of the load balancer
.. option:: --nodeid <nodeid>
The ID of the node to be removed
.. program:: libra_client.py node-add
node-add
^^^^^^^^
Add a node to a load balancer
.. option:: --id <id>
The ID of the load balancer
.. option:: --node <ip:port>
The node address in ip:port format
.. program:: libra_client.py node-modify
node-modify
^^^^^^^^^^^
Modify a node in a load balancer
.. option:: --id <id>
The ID of the load balancer
.. option:: --nodeid <nodeid>
The ID of the node to be modified
.. option:: --node <ip:port>
The new node address in ip:port format
.. program:: libra_client.py node-status
node-status
^^^^^^^^^^^
Get the status of a node in a load balancer
.. option:: --id <id>
The ID of the load balancer
.. option:: --nodeid <nodeid>
The ID of the node in the load balancer

View File

@@ -2,7 +2,7 @@ Load Balancer as a Service Device Tools
=======================================
.. toctree::
:maxdepth: 2
:maxdepth: 3
client
worker/index

View File

@@ -56,9 +56,10 @@ class ClientOptions(object):
subparsers.add_parser(
'list', help='list load balancers'
)
subparsers.add_parser(
sp = subparsers.add_parser(
'delete', help='delete a load balancer'
)
sp.add_argument('--id', help='load balancer ID', required=True)
sp = subparsers.add_parser(
'create', help='create a load balancer'
)
@@ -77,7 +78,7 @@ class ClientOptions(object):
sp = subparsers.add_parser(
'modify', help='modify a load balancer'
)
sp.add_argument('lbid', help='load balancer ID')
sp.add_argument('--id', help='load balancer ID', required=True)
sp.add_argument('--name', help='new name for the load balancer')
sp.add_argument('--algorithm',
help='new algorithm for the load balancer',
@@ -85,22 +86,37 @@ class ClientOptions(object):
sp = subparsers.add_parser(
'status', help='get status of a load balancer'
)
sp.add_argument('lbid', help='load balancer ID')
subparsers.add_parser(
sp.add_argument('--id', help='load balancer ID', requied=True)
sp = subparsers.add_parser(
'node-list', help='list nodes in a load balancer'
)
subparsers.add_parser(
sp.add_argument('--id', help='load balancer ID', required=True)
sp = subparsers.add_parser(
'node-delete', help='delete node from a load balancer'
)
subparsers.add_parser(
sp.add_argument('--id', help='load balancer ID', required=True)
sp.add_argument('--nodeid',
help='node ID to remove from load balancer',
required=True)
sp = subparsers.add_parser(
'node-add', help='add node to a load balancer'
)
subparsers.add_parser(
sp.add_argument('--id', help='load balancer ID', required=True)
sp.add_argument('--node', help='node to add in ip:port form',
required=True)
sp = subparsers.add_parser(
'node-modify', help='modify node in a load balancer'
)
subparsers.add_parser(
sp.add_argument('--id', help='load balancer ID', required=True)
sp.add_argument('--nodeid', help='node ID to modify', required=True)
sp.add_argument('--node', help='the new node address in ip:port form',
required=True)
sp = subparsers.add_parser(
'node-status', help='get status of a node in a load balancer'
)
sp.add_argument('--id', help='load balancer ID', required=True)
sp.add_argument('--nodeid', help='node ID to get status from',
required=True)
def run(self):
self._generate()