From f4518f6702bcf28a86d4516e2976bfad5c4761a6 Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Tue, 16 Oct 2012 14:42:53 -0700 Subject: [PATCH] Add some client documentation --- .gitignore | 1 + doc/client.rst | 111 ++++++++++++++++++++++++++++++++++ doc/index.rst | 2 + libra/client/clientoptions.py | 4 +- 4 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 doc/client.rst diff --git a/.gitignore b/.gitignore index b0f9693f..54699044 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ dist build .cache *.swp +doc/html diff --git a/doc/client.rst b/doc/client.rst new file mode 100644 index 00000000..27309b66 --- /dev/null +++ b/doc/client.rst @@ -0,0 +1,111 @@ +Libra Client +============ + +Synopsis +-------- + +Description +----------- + +:program:`libra_client.py` [:ref:`OPTIONS `] [:ref:`COMMAND `] + +.. _libra_client-options: + +Global Options +-------------- + +.. program:: libra_client.py + +.. option:: --help, -h + + Show help message and exit + +.. option:: --os_auth_url + + The OpenStack authentication URL + +.. option:: --os_username + + The user name to use for authentication + +.. option:: --os_password + + The password to use for authentication + +.. option:: --os_tenant_name + + The tenant to authenticate to + +.. option:: --os_region_name + + The region the load balancer is located + +.. _libra_client-commands: + +Client Commands +--------------- + +======= ================== +Command Required Parameter +======= ================== +list +create loadbalancerID +modify loadbalancerID +status loadbalancerID +======= ================== + +.. program:: libra_client.py create + +create +^^^^^^ + +Create a load balancer + +.. option:: --name + + The name of the node to be created + +.. option:: --port + + The port the load balancer will listen on + +.. option:: --protocol + + The protocol type for the load balancer (HTTP or TCP) + +.. option:: --node + + The IP and port for a load balancer node (can be used multiple times) + +.. option:: --vip + + The virtual IP ID of an existing load balancer to attach to + +.. program:: libra_client.py modify + +modify +^^^^^^ + +Update a load balancer's configuration + +.. option:: --name + + A new name for the load balancer + +.. option:: --algorithm + + A new algorithm for the load balancer + +.. program:: libra_clien.py list + +list +^^^^ + +List all load balancers + +.. program:: libra_client.py status + +status +^^^^^^ + +Get the status of a single load balancer diff --git a/doc/index.rst b/doc/index.rst index 6fd21965..710f5096 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -3,3 +3,5 @@ Load Balancer as a Service Device Tools .. toctree:: :maxdepth: 2 + + client diff --git a/libra/client/clientoptions.py b/libra/client/clientoptions.py index b53dd564..f3290744 100644 --- a/libra/client/clientoptions.py +++ b/libra/client/clientoptions.py @@ -77,7 +77,7 @@ class ClientOptions(object): sp = subparsers.add_parser( 'modify', help='modify a load balancer' ) - sp.add_argument('lbid', help='load balancer ID', required=True) + sp.add_argument('lbid', help='load balancer ID') sp.add_argument('--name', help='new name for the load balancer') sp.add_argument('--algorithm', help='new algorithm for the load balancer', @@ -85,7 +85,7 @@ class ClientOptions(object): sp = subparsers.add_parser( 'status', help='get status of a load balancer' ) - sp.add_argument('lbid', help='load balancer ID', required=True) + sp.add_argument('lbid', help='load balancer ID') subparsers.add_parser( 'node-list', help='list nodes in a load balancer' )