summaryrefslogtreecommitdiff
path: root/openstackclient/network
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-10-13 12:21:15 +0000
committerGerrit Code Review <review@openstack.org>2020-10-13 12:21:15 +0000
commit375fe315255535ad0a6451aa0d9270ca5c3ba3b9 (patch)
tree82a1052b8a7df8d89305681dc56c04dffa9c4eaa /openstackclient/network
parent1a0bf014979df54e6556c04fa4d08072032b7d3f (diff)
parent58f1c90971969ee12089c2e5aeea4993d8c095d9 (diff)
downloadpython-openstackclient-375fe315255535ad0a6451aa0d9270ca5c3ba3b9.tar.gz
Merge "Add source_ip_prefix and destination_ip_prefix to metering label rules"
Diffstat (limited to 'openstackclient/network')
-rw-r--r--openstackclient/network/v2/network_meter_rule.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/openstackclient/network/v2/network_meter_rule.py b/openstackclient/network/v2/network_meter_rule.py
index 49ff9e1b..1cf0395f 100644
--- a/openstackclient/network/v2/network_meter_rule.py
+++ b/openstackclient/network/v2/network_meter_rule.py
@@ -46,6 +46,10 @@ def _get_attrs(client_manager, parsed_args):
attrs['direction'] = 'egress'
if parsed_args.remote_ip_prefix is not None:
attrs['remote_ip_prefix'] = parsed_args.remote_ip_prefix
+ if parsed_args.source_ip_prefix is not None:
+ attrs['source_ip_prefix'] = parsed_args.source_ip_prefix
+ if parsed_args.destination_ip_prefix is not None:
+ attrs['destination_ip_prefix'] = parsed_args.destination_ip_prefix
if parsed_args.meter is not None:
attrs['metering_label_id'] = parsed_args.meter
if parsed_args.project is not None:
@@ -97,10 +101,22 @@ class CreateMeterRule(command.ShowOne):
parser.add_argument(
'--remote-ip-prefix',
metavar='<remote-ip-prefix>',
- required=True,
+ required=False,
help=_('The remote IP prefix to associate with this rule'),
)
parser.add_argument(
+ '--source-ip-prefix',
+ metavar='<remote-ip-prefix>',
+ required=False,
+ help=_('The source IP prefix to associate with this rule'),
+ )
+ parser.add_argument(
+ '--destination-ip-prefix',
+ metavar='<remote-ip-prefix>',
+ required=False,
+ help=_('The destination IP prefix to associate with this rule'),
+ )
+ parser.add_argument(
'meter',
metavar='<meter>',
help=_('Label to associate with this metering rule (name or ID)'),
@@ -168,12 +184,16 @@ class ListMeterRule(command.Lister):
'excluded',
'direction',
'remote_ip_prefix',
+ 'source_ip_prefix',
+ 'destination_ip_prefix',
)
column_headers = (
'ID',
'Excluded',
'Direction',
'Remote IP Prefix',
+ 'Source IP Prefix',
+ 'Destination IP Prefix',
)
data = client.metering_label_rules()
return (column_headers,