Merge "Improve help message of loadbalancer commands"
This commit is contained in:
@@ -71,13 +71,12 @@ class CreateHealthMonitor(neutronV20.CreateCommand):
|
||||
parser.add_argument(
|
||||
'--delay',
|
||||
required=True,
|
||||
help='the minimum time in seconds between regular connections '
|
||||
'of the member.')
|
||||
help='the time in seconds between sending probes to members.')
|
||||
parser.add_argument(
|
||||
'--max-retries',
|
||||
required=True,
|
||||
help='number of permissible connection failures before changing '
|
||||
'the member status to INACTIVE.')
|
||||
'the member status to INACTIVE. [1..10]')
|
||||
parser.add_argument(
|
||||
'--timeout',
|
||||
required=True,
|
||||
@@ -86,8 +85,8 @@ class CreateHealthMonitor(neutronV20.CreateCommand):
|
||||
'value must be less than the delay value.')
|
||||
parser.add_argument(
|
||||
'--type',
|
||||
required=True,
|
||||
help='one of predefined health monitor types, e.g. RoundRobin')
|
||||
required=True, choices=['PING', 'TCP', 'HTTP', 'HTTPS'],
|
||||
help='one of predefined health monitor types')
|
||||
|
||||
def args2body(self, parsed_args):
|
||||
body = {
|
||||
@@ -128,10 +127,10 @@ class AssociateHealthMonitor(neutronV20.NeutronCommand):
|
||||
def get_parser(self, prog_name):
|
||||
parser = super(AssociateHealthMonitor, self).get_parser(prog_name)
|
||||
parser.add_argument(
|
||||
'health_monitor_id',
|
||||
'health_monitor_id', metavar='HEALTH_MONITOR_ID',
|
||||
help='Health monitor to associate')
|
||||
parser.add_argument(
|
||||
'pool_id',
|
||||
'pool_id', metavar='POOL',
|
||||
help='ID of the pool to be associated with the health monitor')
|
||||
return parser
|
||||
|
||||
@@ -155,10 +154,10 @@ class DisassociateHealthMonitor(neutronV20.NeutronCommand):
|
||||
def get_parser(self, prog_name):
|
||||
parser = super(DisassociateHealthMonitor, self).get_parser(prog_name)
|
||||
parser.add_argument(
|
||||
'health_monitor_id',
|
||||
'health_monitor_id', metavar='HEALTH_MONITOR_ID',
|
||||
help='Health monitor to associate')
|
||||
parser.add_argument(
|
||||
'pool_id',
|
||||
'pool_id', metavar='POOL',
|
||||
help='ID of the pool to be associated with the health monitor')
|
||||
return parser
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class CreateMember(neutronV20.CreateCommand):
|
||||
|
||||
def add_known_arguments(self, parser):
|
||||
parser.add_argument(
|
||||
'pool_id', metavar='pool',
|
||||
'pool_id', metavar='POOL',
|
||||
help='Pool id or name this vip belongs to')
|
||||
parser.add_argument(
|
||||
'--admin-state-down',
|
||||
@@ -57,7 +57,7 @@ class CreateMember(neutronV20.CreateCommand):
|
||||
help='set admin state up to false')
|
||||
parser.add_argument(
|
||||
'--weight',
|
||||
help='weight of pool member in the pool')
|
||||
help='weight of pool member in the pool (default:1, [0..256])')
|
||||
parser.add_argument(
|
||||
'--address',
|
||||
required=True,
|
||||
|
||||
@@ -57,6 +57,7 @@ class CreatePool(neutronV20.CreateCommand):
|
||||
parser.add_argument(
|
||||
'--lb-method',
|
||||
required=True,
|
||||
choices=['ROUND_ROBIN', 'LEAST_CONNECTIONS', 'SOURCE_IP'],
|
||||
help='the algorithm used to distribute load between the members '
|
||||
'of the pool')
|
||||
parser.add_argument(
|
||||
@@ -66,9 +67,10 @@ class CreatePool(neutronV20.CreateCommand):
|
||||
parser.add_argument(
|
||||
'--protocol',
|
||||
required=True,
|
||||
choices=['HTTP', 'HTTPS', 'TCP'],
|
||||
help='protocol for balancing')
|
||||
parser.add_argument(
|
||||
'--subnet-id',
|
||||
'--subnet-id', metavar='SUBNET',
|
||||
required=True,
|
||||
help='the subnet on which the members of the pool will be located')
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class CreateVip(neutronV20.CreateCommand):
|
||||
|
||||
def add_known_arguments(self, parser):
|
||||
parser.add_argument(
|
||||
'pool_id', metavar='pool',
|
||||
'pool_id', metavar='POOL',
|
||||
help='Pool id or name this vip belongs to')
|
||||
parser.add_argument(
|
||||
'--address',
|
||||
@@ -60,7 +60,7 @@ class CreateVip(neutronV20.CreateCommand):
|
||||
parser.add_argument(
|
||||
'--connection-limit',
|
||||
help='the maximum number of connections per second allowed for '
|
||||
'the vip')
|
||||
'the vip. Positive integer or -1 for unlimited (default)')
|
||||
parser.add_argument(
|
||||
'--description',
|
||||
help='description of the vip')
|
||||
@@ -75,10 +75,10 @@ class CreateVip(neutronV20.CreateCommand):
|
||||
'associated with the vip address')
|
||||
parser.add_argument(
|
||||
'--protocol',
|
||||
required=True,
|
||||
required=True, choices=['TCP', 'HTTP', 'HTTPS'],
|
||||
help='protocol for balancing')
|
||||
parser.add_argument(
|
||||
'--subnet-id',
|
||||
'--subnet-id', metavar='SUBNET',
|
||||
required=True,
|
||||
help='the subnet on which to allocate the vip address')
|
||||
|
||||
@@ -87,6 +87,7 @@ class CreateVip(neutronV20.CreateCommand):
|
||||
self.get_client(), 'pool', parsed_args.pool_id)
|
||||
_subnet_id = neutronV20.find_resourceid_by_name_or_id(
|
||||
self.get_client(), 'subnet', parsed_args.subnet_id)
|
||||
|
||||
body = {
|
||||
self.resource: {
|
||||
'pool_id': _pool_id,
|
||||
|
||||
@@ -35,7 +35,7 @@ class CLITestV20LbHealthmonitorJSON(test_cli20.CLITestV20Base):
|
||||
delay = '60'
|
||||
max_retries = '2'
|
||||
timeout = '10'
|
||||
type = 'tcp'
|
||||
type = 'TCP'
|
||||
tenant_id = 'my-tenant'
|
||||
my_id = 'my-id'
|
||||
args = ['--admin-state-down',
|
||||
@@ -62,7 +62,7 @@ class CLITestV20LbHealthmonitorJSON(test_cli20.CLITestV20Base):
|
||||
http_method = 'HEAD'
|
||||
max_retries = '2'
|
||||
timeout = '10'
|
||||
type = 'tcp'
|
||||
type = 'TCP'
|
||||
tenant_id = 'my-tenant'
|
||||
url_path = '/health'
|
||||
my_id = 'my-id'
|
||||
|
||||
@@ -32,8 +32,8 @@ class CLITestV20LbPoolJSON(test_cli20.CLITestV20Base):
|
||||
resource = 'pool'
|
||||
cmd = pool.CreatePool(test_cli20.MyApp(sys.stdout), None)
|
||||
name = 'my-name'
|
||||
lb_method = 'round-robin'
|
||||
protocol = 'http'
|
||||
lb_method = 'ROUND_ROBIN'
|
||||
protocol = 'HTTP'
|
||||
subnet_id = 'subnet-id'
|
||||
tenant_id = 'my-tenant'
|
||||
my_id = 'my-id'
|
||||
@@ -55,8 +55,8 @@ class CLITestV20LbPoolJSON(test_cli20.CLITestV20Base):
|
||||
cmd = pool.CreatePool(test_cli20.MyApp(sys.stdout), None)
|
||||
name = 'my-name'
|
||||
description = 'my-desc'
|
||||
lb_method = 'round-robin'
|
||||
protocol = 'http'
|
||||
lb_method = 'ROUND_ROBIN'
|
||||
protocol = 'HTTP'
|
||||
subnet_id = 'subnet-id'
|
||||
tenant_id = 'my-tenant'
|
||||
my_id = 'my-id'
|
||||
|
||||
@@ -35,7 +35,7 @@ class CLITestV20LbVipJSON(test_cli20.CLITestV20Base):
|
||||
name = 'my-name'
|
||||
subnet_id = 'subnet-id'
|
||||
protocol_port = '1000'
|
||||
protocol = 'tcp'
|
||||
protocol = 'TCP'
|
||||
tenant_id = 'my-tenant'
|
||||
my_id = 'my-id'
|
||||
args = ['--name', name,
|
||||
@@ -64,7 +64,7 @@ class CLITestV20LbVipJSON(test_cli20.CLITestV20Base):
|
||||
connection_limit = '1000'
|
||||
subnet_id = 'subnet-id'
|
||||
protocol_port = '80'
|
||||
protocol = 'tcp'
|
||||
protocol = 'TCP'
|
||||
tenant_id = 'my-tenant'
|
||||
my_id = 'my-id'
|
||||
args = ['--name', name,
|
||||
@@ -96,7 +96,7 @@ class CLITestV20LbVipJSON(test_cli20.CLITestV20Base):
|
||||
name = 'my-name'
|
||||
subnet_id = 'subnet-id'
|
||||
protocol_port = '1000'
|
||||
protocol = 'tcp'
|
||||
protocol = 'TCP'
|
||||
tenant_id = 'my-tenant'
|
||||
my_id = 'my-id'
|
||||
args = ['--name', name,
|
||||
|
||||
Reference in New Issue
Block a user