Merge "Add floating IP network QoS field to floating IP definition"

This commit is contained in:
Zuul 2021-11-27 12:35:24 +00:00 committed by Gerrit Code Review
commit b96bf2ac08
10 changed files with 97 additions and 0 deletions

View File

@ -32,6 +32,13 @@ define QoS policies and associate these to the ports by introducing the
``qos_policy_id`` attribute. The policies should be created before they are
associated to the floating IPs.
QoS network policy
==================
The ``qos-fip`` extension adds the read only parameter
``qos_network_policy_id`` to the floating IP responses. This parameter contains
the QoS policy ID of the network where this floating IP is allocated.
Resource timestamps
===================
@ -114,6 +121,7 @@ Response Parameters
- dns_domain: dns_domain
- dns_name: dns_name
- port_details: floating_port_details
- qos_network_policy_id: qos_network_policy_id-floatingip-response
- qos_policy_id: qos_policy_id-floatingip-response
- floating_network_id: floating_network_id
- fixed_ip_address: floatingip-fixed_ip_address
@ -237,6 +245,7 @@ Response Parameters
- id: floatingip-id
- tags: tags
- port_forwardings: floatingip-port_forwardings
- qos_network_policy_id: qos_network_policy_id-floatingip-response
- qos_policy_id: qos_policy_id-floatingip-response
Response Example
@ -304,6 +313,7 @@ Response Parameters
- id: floatingip-id
- tags: tags
- port_forwardings: floatingip-port_forwardings
- qos_network_policy_id: qos_network_policy_id-floatingip-response
- qos_policy_id: qos_policy_id-floatingip-response
Response Example
@ -385,6 +395,7 @@ Response Parameters
- port_details: floating_port_details
- tags: tags
- port_forwardings: floatingip-port_forwardings
- qos_network_policy_id: qos_network_policy_id-floatingip-response
- qos_policy_id: qos_policy_id-floatingip-response
Response Example

View File

@ -5485,6 +5485,12 @@ qos_minimum_packet_rate_rule-id:
in: body
required: true
type: string
qos_network_policy_id-floatingip-response:
description: |
The ID of the QoS policy of the network where this floating IP is plugged.
in: body
required: true
type: string
qos_network_policy_id-port-response:
description: |
The ID of the QoS policy of the network where this port is plugged.

View File

@ -27,6 +27,7 @@
},
"tags": ["tag1,tag2"],
"port_forwardings": [],
"qos_network_policy_id": "174dd0c1-a4eb-49d4-a807-ae80246d82f4",
"qos_policy_id": "29d5e02e-d5ab-4929-bee4-4a9fc12e22ae"
},
@ -49,6 +50,7 @@
"port_details": null,
"tags": ["tag1,tag2"],
"port_forwardings": [],
"qos_network_policy_id": "174dd0c1-a4eb-49d4-a807-ae80246d82f4",
"qos_policy_id": "29d5e02e-d5ab-4929-bee4-4a9fc12e22ae"
},
{
@ -82,6 +84,7 @@
"external_port": 8786
}
],
"qos_network_policy_id": "174dd0c1-a4eb-49d4-a807-ae80246d82f4",
"qos_policy_id": "29d5e02e-d5ab-4929-bee4-4a9fc12e22ae"
}
]

View File

@ -26,6 +26,7 @@
},
"tags": ["tag1,tag2"],
"port_forwardings": [],
"qos_network_policy_id": "174dd0c1-a4eb-49d4-a807-ae80246d82f4",
"qos_policy_id": "29d5e02e-d5ab-4929-bee4-4a9fc12e22ae"
}

View File

@ -26,6 +26,7 @@
"device_id": "8e3941b4-a6e9-499f-a1ac-2a4662025cba"
},
"port_forwardings": [],
"qos_network_policy_id": "174dd0c1-a4eb-49d4-a807-ae80246d82f4",
"qos_policy_id": "29d5e02e-d5ab-4929-bee4-4a9fc12e22ae"
}
}

View File

@ -100,6 +100,7 @@ from neutron_lib.api.definitions import qos_bw_limit_direction
from neutron_lib.api.definitions import qos_bw_minimum_ingress
from neutron_lib.api.definitions import qos_default
from neutron_lib.api.definitions import qos_fip
from neutron_lib.api.definitions import qos_fip_network_policy
from neutron_lib.api.definitions import qos_gateway_ip
from neutron_lib.api.definitions import qos_port_network_policy
from neutron_lib.api.definitions import qos_pps_minimum_rule
@ -239,6 +240,7 @@ _ALL_API_DEFINITIONS = {
qos_bw_minimum_ingress,
qos_default,
qos_fip,
qos_fip_network_policy,
qos_gateway_ip,
qos_port_network_policy,
qos_pps_minimum_rule,

View File

@ -142,6 +142,7 @@ KNOWN_EXTENSIONS = (
'qos',
'qos-bw-limit-direction',
'qos-fip',
'qos-fip-network-policy',
'qos-gateway-ip',
'qos-port-network-policy',
'qos-pps-minimum',

View File

@ -0,0 +1,41 @@
# Copyright (c) 2021 Red Hat Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.api.definitions import l3 as l3_apidef
from neutron_lib.api.definitions import qos as qos_apidef
from neutron_lib.api.definitions import qos_fip as qos_fip_apidef
from neutron_lib.services.qos import constants as qos_consts
ALIAS = 'qos-fip-network-policy'
IS_SHIM_EXTENSION = False
IS_STANDARD_ATTR_EXTENSION = False
NAME = 'QoS floating IP network policy ID'
DESCRIPTION = 'Adds a the QoS network ID to the floating IP definition'
UPDATED_TIMESTAMP = '2021-11-15T10:00:00-00:00'
RESOURCE_ATTRIBUTE_MAP = {
l3_apidef.FLOATINGIPS: {
qos_consts.QOS_NETWORK_POLICY_ID: {
'allow_post': False,
'allow_put': False,
'is_visible': True,
'default': None
}
}
}
SUB_RESOURCE_ATTRIBUTE_MAP = {}
ACTION_MAP = {}
REQUIRED_EXTENSIONS = [l3_apidef.ALIAS, qos_apidef.ALIAS, qos_fip_apidef.ALIAS]
OPTIONAL_EXTENSIONS = []
ACTION_STATUS = {}

View File

@ -0,0 +1,25 @@
# Copyright (c) 2021 Red Hat Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.api.definitions import l3 as l3_apidef
from neutron_lib.api.definitions import qos_fip_network_policy
from neutron_lib.services.qos import constants as qos_const
from neutron_lib.tests.unit.api.definitions import base
class QosFipNetworkPolicyTestCase(base.DefinitionBaseTestCase):
extension_module = qos_fip_network_policy
extension_resources = (l3_apidef.FLOATINGIPS,)
extension_attributes = (qos_const.QOS_NETWORK_POLICY_ID,)

View File

@ -0,0 +1,6 @@
---
features:
- |
Added field ``qos_network_policy_id`` to the ``floatingip`` definition.
This read only parameter contains the QoS policy of the network where the
floating IP is plugged.