diff --git a/masakariclient/osc/v1/host.py b/masakariclient/osc/v1/host.py index cdd2813..4d44734 100644 --- a/masakariclient/osc/v1/host.py +++ b/masakariclient/osc/v1/host.py @@ -136,12 +136,16 @@ class CreateHost(command.ShowOne): parser.add_argument( '--reserved', metavar='', - help=_('Host reservation. True or False.') + choices=['True', 'False'], + help=_('Host reservation. The supported options are: ' + 'True, False.') ) parser.add_argument( '--on_maintenance', metavar='', - help=_('Maintenance status of host. True or False.') + choices=['True', 'False'], + help=_('Maintenance status of host. The supported options are: ' + 'True, False.') ) return parser @@ -184,6 +188,20 @@ class UpdateHost(command.ShowOne): metavar='', help='Name or ID of the Host', ) + parser.add_argument( + '--reserved', + metavar='', + choices=['True', 'False'], + help=_('Host reservation. The supported options are: ' + 'True, False.') + ) + parser.add_argument( + '--on_maintenance', + metavar='', + choices=['True', 'False'], + help=_('Maintenance status of host. The supported options are: ' + 'True, False.') + ) parser.add_argument( '--name', metavar='', @@ -199,16 +217,6 @@ class UpdateHost(command.ShowOne): metavar='', help=_('Attributes about control.') ) - parser.add_argument( - '--reserved', - metavar='', - help=_('Host reservation. True or False.') - ) - parser.add_argument( - '--on_maintenance', - metavar='', - help=_('Maintenance status of host. True or False.') - ) return parser def take_action(self, parsed_args): diff --git a/masakariclient/osc/v1/notification.py b/masakariclient/osc/v1/notification.py index 3d289e8..32c0e47 100644 --- a/masakariclient/osc/v1/notification.py +++ b/masakariclient/osc/v1/notification.py @@ -99,7 +99,9 @@ class CreateNotification(command.ShowOne): parser.add_argument( 'type', metavar='', - help=_('Type of failure.') + choices=['COMPUTE_HOST', 'VM', 'PROCESS'], + help=_('Type of failure. The supported options are: ' + 'COMPUTE_HOST, VM, PROCESS.') ) parser.add_argument( 'hostname', diff --git a/masakariclient/osc/v1/segment.py b/masakariclient/osc/v1/segment.py index eefbd28..81af87a 100644 --- a/masakariclient/osc/v1/segment.py +++ b/masakariclient/osc/v1/segment.py @@ -109,7 +109,9 @@ class CreateSegment(command.ShowOne): parser.add_argument( 'recovery_method', metavar='', - help=_('Recovery method of segment.') + choices=['auto', 'reserved_host'], + help=_('Recovery method of segment. The supported options are: ' + 'auto, reserved_host.') ) parser.add_argument( 'service_type', @@ -158,21 +160,23 @@ class UpdateSegment(command.ShowOne): metavar='', help=_('Name of segment.') ) - parser.add_argument( - '--description', - metavar='', - help=_('Description of segment.') - ) parser.add_argument( '--recovery_method', metavar='', - help=_('Recovery method of segment.') + choices=['auto', 'reserved_host'], + help=_('Recovery method of segment. The supported options are: ' + 'auto, reserved_host') ) parser.add_argument( '--service_type', metavar='', help=_('Service type of segment.') ) + parser.add_argument( + '--description', + metavar='', + help=_('Description of segment.') + ) return parser def take_action(self, parsed_args): diff --git a/masakariclient/v1/shell.py b/masakariclient/v1/shell.py index 5fc97d4..64dd8ff 100644 --- a/masakariclient/v1/shell.py +++ b/masakariclient/v1/shell.py @@ -48,7 +48,9 @@ def do_notification_show(service, args): @utils.arg('--type', metavar='', required=True, - help='Type of failure.') + choices=['COMPUTE_HOST', 'VM', 'PROCESS'], + help='Type of failure. The supported options are: ' + 'COMPUTE_HOST, VM, PROCESS.') @utils.arg('--hostname', metavar='', required=True, help='Hostname of notification.') @utils.arg('--generated-time', metavar='', required=True, @@ -97,12 +99,14 @@ def do_segment_show(service, args): @utils.arg('--name', metavar='', required=True, help='Name of segment.') -@utils.arg('--description', metavar='', required=True, - help='Description of segment.') @utils.arg('--recovery-method', metavar='', required=True, - help='JSON string about recovery method.') + choices=['auto', 'reserved_host'], + help='Recovery method. ' + 'The supported options are: auto, reserved_host.') @utils.arg('--service-type', metavar='', required=True, help='Service type of segment.') +@utils.arg('--description', metavar='', required=False, + help='Description of segment.') def do_segment_create(service, args): """Create segment.""" try: @@ -122,12 +126,15 @@ def do_segment_create(service, args): required=True, help='Name or ID of segment.') @utils.arg('--name', metavar='', required=False, help='Name of segment.') -@utils.arg('--description', metavar='', - required=False, help='Description of segment.') @utils.arg('--recovery-method', metavar='', - required=False, help='JSON string about recovery method.') + choices=['auto', 'reserved_host'], + required=False, + help='Recovery method. ' + 'The supported options are: auto, reserved_host.') @utils.arg('--service-type', metavar='', required=False, help='Service type of segment.') +@utils.arg('--description', metavar='', + required=False, help='Description of segment.') def do_segment_update(service, args): """Update a segment.""" try: @@ -182,18 +189,21 @@ def do_host_show(service, args): print(e) -@utils.arg('--segment-id', metavar='', required=True, - help='Name or ID of segment.') @utils.arg('--name', metavar='', required=True, help='Name of host.') @utils.arg('--type', metavar='', required=True, help='Type of host.') @utils.arg('--control-attributes', metavar='', required=True, help='Control attributes of host.') +@utils.arg('--segment-id', metavar='', required=True, + help='Name or ID of segment.') @utils.arg('--reserved', metavar='', required=False, - help='') + choices=['True', 'False'], + help='Host reservation. The supported options are: True, False.') @utils.arg('--on-maintenance', metavar='', required=False, - help='') + choices=['True', 'False'], + help='Maintenance status of host. The supported options are: ' + 'True, False.') def do_host_create(service, args): """Create a host.""" try: @@ -214,15 +224,19 @@ def do_host_create(service, args): help='Name or ID of segment.') @utils.arg('--id', metavar='', required=True, help='Name or ID of host.') +@utils.arg('--reserved', metavar='', required=False, + choices=['True', 'False'], + help='Host reservation. The supported options are: True, False.') +@utils.arg('--on-maintenance', metavar='', + required=False, choices=['True', 'False'], + help='Maintenance status of host. The supported options are: ' + 'True, False.') @utils.arg('--name', metavar='', required=False, help='Name of host.') @utils.arg('--type', metavar='', required=False, help='Type of host.') @utils.arg('--control-attributes', metavar='', required=False, help='Control attributes of host.') -@utils.arg('--reserved', metavar='', required=False, help='') -@utils.arg('--on-maintenance', metavar='', - required=False, help='') def do_host_update(service, args): """Update a host.""" try: