Add SR-IOV support for members
This patch adds the "vnic_type" field to member outputs and adds a new option "--request-sriov" for member create commands. Change-Id: Ie157247609dc761f9a7645a4297b80a8a3c1f559
This commit is contained in:
parent
b9d8f34e60
commit
58c32db454
|
@ -149,7 +149,8 @@ MEMBER_ROWS = (
|
||||||
'monitor_port',
|
'monitor_port',
|
||||||
'monitor_address',
|
'monitor_address',
|
||||||
'backup',
|
'backup',
|
||||||
'tags')
|
'tags',
|
||||||
|
'vnic_type')
|
||||||
|
|
||||||
MEMBER_COLUMNS = (
|
MEMBER_COLUMNS = (
|
||||||
'id',
|
'id',
|
||||||
|
|
|
@ -99,6 +99,10 @@ class ShowMember(command.ShowOne):
|
||||||
data = self.app.client_manager.load_balancer.member_show(
|
data = self.app.client_manager.load_balancer.member_show(
|
||||||
pool_id=pool_id, member_id=member_id)
|
pool_id=pool_id, member_id=member_id)
|
||||||
|
|
||||||
|
# Handle older API versions that did not have the vnic_type
|
||||||
|
if not data.get('vnic_type', False):
|
||||||
|
data['vnic_type'] = 'normal'
|
||||||
|
|
||||||
formatters = {'tags': v2_utils.format_list_flat}
|
formatters = {'tags': v2_utils.format_list_flat}
|
||||||
|
|
||||||
return (rows, (utils.get_dict_properties(
|
return (rows, (utils.get_dict_properties(
|
||||||
|
@ -192,6 +196,12 @@ class CreateMember(command.ShowOne):
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help='Wait for action to complete.',
|
help='Wait for action to complete.',
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'--request-sriov',
|
||||||
|
action='store_true',
|
||||||
|
default=None,
|
||||||
|
help='Request that the member port be created using an SR-IOV VF.',
|
||||||
|
)
|
||||||
|
|
||||||
_tag.add_tag_option_to_parser_for_create(
|
_tag.add_tag_option_to_parser_for_create(
|
||||||
parser, 'member')
|
parser, 'member')
|
||||||
|
@ -225,6 +235,10 @@ class CreateMember(command.ShowOne):
|
||||||
pool_id, data['member']['id']))
|
pool_id, data['member']['id']))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Handle older API versions that did not have the vnic_type
|
||||||
|
if not data.get('vnic_type', False):
|
||||||
|
data['vnic_type'] = 'normal'
|
||||||
|
|
||||||
formatters = {'tags': v2_utils.format_list_flat}
|
formatters = {'tags': v2_utils.format_list_flat}
|
||||||
|
|
||||||
return (rows,
|
return (rows,
|
||||||
|
|
|
@ -418,6 +418,8 @@ def get_member_attrs(client_manager, parsed_args):
|
||||||
'monitor_address': ('monitor_address', str),
|
'monitor_address': ('monitor_address', str),
|
||||||
'enable': ('admin_state_up', lambda x: True),
|
'enable': ('admin_state_up', lambda x: True),
|
||||||
'disable': ('admin_state_up', lambda x: False),
|
'disable': ('admin_state_up', lambda x: False),
|
||||||
|
'request_sriov': ('request_sriov', lambda x: True),
|
||||||
|
'vnic_type': ('vnic_type', str),
|
||||||
}
|
}
|
||||||
add_tags_attr_map(attr_map)
|
add_tags_attr_map(attr_map)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Added SR-IOV support for members to the client. This adds a "vnic_type"
|
||||||
|
field to the member output and a new option "--request-sriov" for the
|
||||||
|
member create command.
|
Loading…
Reference in New Issue