Rehome QoS floating IP extension
Related-Bug: #1596611 Change-Id: Ida281a0a4fa8001e117f4803c55314595bc06c18
This commit is contained in:
parent
b35ba2fe95
commit
8736420eea
@ -24,6 +24,14 @@ The ``expose-port-forwarding-in-fip`` extension adds the ``port_forwardings``
|
||||
attribute to floating IPs. The value of this attribute contains the
|
||||
information of associated port forwarding resources.
|
||||
|
||||
QoS extension
|
||||
=============
|
||||
|
||||
The :ref:`QoS <quality-of-service>` extension (``qos``) makes it possible to
|
||||
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.
|
||||
|
||||
Resource timestamps
|
||||
===================
|
||||
|
||||
@ -106,6 +114,7 @@ Response Parameters
|
||||
- dns_domain: dns_domain
|
||||
- dns_name: dns_name
|
||||
- port_details: floating_port_details
|
||||
- qos_policy_id: qos_policy_id-floatingip-response
|
||||
- floating_network_id: floating_network_id
|
||||
- fixed_ip_address: floatingip-fixed_ip_address
|
||||
- floating_ip_address: floating_ip_address
|
||||
@ -196,6 +205,7 @@ Request
|
||||
- description: description-request
|
||||
- dns_domain: dns_domain-request
|
||||
- dns_name: dns_name-request
|
||||
- qos_policy_id: qos_policy_id-floatingip-request
|
||||
|
||||
Request Example
|
||||
---------------
|
||||
@ -227,6 +237,7 @@ Response Parameters
|
||||
- id: floatingip-id
|
||||
- tags: tags
|
||||
- port_forwardings: floatingip-port_forwardings
|
||||
- qos_policy_id: qos_policy_id-floatingip-response
|
||||
|
||||
Response Example
|
||||
----------------
|
||||
@ -293,6 +304,7 @@ Response Parameters
|
||||
- id: floatingip-id
|
||||
- tags: tags
|
||||
- port_forwardings: floatingip-port_forwardings
|
||||
- qos_policy_id: qos_policy_id-floatingip-response
|
||||
|
||||
Response Example
|
||||
----------------
|
||||
@ -373,6 +385,7 @@ Response Parameters
|
||||
- port_details: floating_port_details
|
||||
- tags: tags
|
||||
- port_forwardings: floatingip-port_forwardings
|
||||
- qos_policy_id: qos_policy_id-floatingip-response
|
||||
|
||||
Response Example
|
||||
----------------
|
||||
|
@ -5509,6 +5509,18 @@ qos_policy_id:
|
||||
in: body
|
||||
required: true
|
||||
type: string
|
||||
qos_policy_id-floatingip-request:
|
||||
description: |
|
||||
The ID of the QoS policy associated with the floating IP.
|
||||
in: body
|
||||
required: false
|
||||
type: string
|
||||
qos_policy_id-floatingip-response:
|
||||
description: |
|
||||
The ID of the QoS policy associated with the floating IP.
|
||||
in: body
|
||||
required: true
|
||||
type: string
|
||||
qos_policy_id-network-request:
|
||||
description: |
|
||||
The ID of the QoS policy associated with the network.
|
||||
|
@ -26,7 +26,9 @@
|
||||
"device_id": "8e3941b4-a6e9-499f-a1ac-2a4662025cba"
|
||||
},
|
||||
"tags": ["tag1,tag2"],
|
||||
"port_forwardings": []
|
||||
"port_forwardings": [],
|
||||
"qos_policy_id": "29d5e02e-d5ab-4929-bee4-4a9fc12e22ae"
|
||||
|
||||
},
|
||||
{
|
||||
"router_id": null,
|
||||
@ -46,7 +48,8 @@
|
||||
"status": "DOWN",
|
||||
"port_details": null,
|
||||
"tags": ["tag1,tag2"],
|
||||
"port_forwardings": []
|
||||
"port_forwardings": [],
|
||||
"qos_policy_id": "29d5e02e-d5ab-4929-bee4-4a9fc12e22ae"
|
||||
},
|
||||
{
|
||||
"router_id": "0303bf18-2c52-479c-bd68-e0ad712a1639",
|
||||
@ -78,7 +81,8 @@
|
||||
"internal_port": 16666,
|
||||
"external_port": 8786
|
||||
}
|
||||
]
|
||||
],
|
||||
"qos_policy_id": "29d5e02e-d5ab-4929-bee4-4a9fc12e22ae"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
"floating_ip_address": "172.24.4.228",
|
||||
"description": "floating ip for testing",
|
||||
"dns_domain": "my-domain.org.",
|
||||
"dns_name": "myfip"
|
||||
"dns_name": "myfip",
|
||||
"qos_policy_id": "29d5e02e-d5ab-4929-bee4-4a9fc12e22ae"
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
"device_id": "8e3941b4-a6e9-499f-a1ac-2a4662025cba"
|
||||
},
|
||||
"tags": ["tag1,tag2"],
|
||||
"port_forwardings": []
|
||||
"port_forwardings": [],
|
||||
"qos_policy_id": "29d5e02e-d5ab-4929-bee4-4a9fc12e22ae"
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,8 @@
|
||||
"device_id": "8e3941b4-a6e9-499f-a1ac-2a4662025cba"
|
||||
},
|
||||
"tags": ["tag1,tag2"],
|
||||
"port_forwardings": []
|
||||
"port_forwardings": [],
|
||||
"qos_policy_id": "29d5e02e-d5ab-4929-bee4-4a9fc12e22ae"
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
"mac_address": "fa:16:3e:b1:3b:30",
|
||||
"device_id": "8e3941b4-a6e9-499f-a1ac-2a4662025cba"
|
||||
},
|
||||
"port_forwardings": []
|
||||
"port_forwardings": [],
|
||||
"qos_policy_id": "29d5e02e-d5ab-4929-bee4-4a9fc12e22ae"
|
||||
}
|
||||
}
|
||||
|
@ -99,6 +99,7 @@ from neutron_lib.api.definitions import qos
|
||||
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_gateway_ip
|
||||
from neutron_lib.api.definitions import qos_port_network_policy
|
||||
from neutron_lib.api.definitions import qos_pps_minimum_rule
|
||||
@ -237,6 +238,7 @@ _ALL_API_DEFINITIONS = {
|
||||
qos_bw_limit_direction,
|
||||
qos_bw_minimum_ingress,
|
||||
qos_default,
|
||||
qos_fip,
|
||||
qos_gateway_ip,
|
||||
qos_port_network_policy,
|
||||
qos_pps_minimum_rule,
|
||||
|
@ -141,6 +141,7 @@ KNOWN_EXTENSIONS = (
|
||||
'provider',
|
||||
'qos',
|
||||
'qos-bw-limit-direction',
|
||||
'qos-fip',
|
||||
'qos-gateway-ip',
|
||||
'qos-port-network-policy',
|
||||
'qos-pps-minimum',
|
||||
|
41
neutron_lib/api/definitions/qos_fip.py
Normal file
41
neutron_lib/api/definitions/qos_fip.py
Normal file
@ -0,0 +1,41 @@
|
||||
# Copyright 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.services.qos import constants as qos_consts
|
||||
|
||||
ALIAS = 'qos-fip'
|
||||
IS_SHIM_EXTENSION = False
|
||||
IS_STANDARD_ATTR_EXTENSION = False
|
||||
NAME = 'Floating IP QoS'
|
||||
API_PREFIX = ''
|
||||
DESCRIPTION = 'The floating IP Quality of Service extension'
|
||||
UPDATED_TIMESTAMP = '2017-07-20T00:00:00-00:00'
|
||||
RESOURCE_ATTRIBUTE_MAP = {
|
||||
l3_apidef.FLOATINGIPS: {
|
||||
qos_consts.QOS_POLICY_ID: {
|
||||
'allow_post': True,
|
||||
'allow_put': True,
|
||||
'is_visible': True,
|
||||
'default': None,
|
||||
'validate': {'type:uuid_or_none': None}}
|
||||
}
|
||||
}
|
||||
SUB_RESOURCE_ATTRIBUTE_MAP = {}
|
||||
ACTION_MAP = {}
|
||||
REQUIRED_EXTENSIONS = [l3_apidef.ALIAS, qos_apidef.ALIAS]
|
||||
OPTIONAL_EXTENSIONS = []
|
||||
ACTION_STATUS = {}
|
20
neutron_lib/tests/unit/api/definitions/test_qos_fip.py
Normal file
20
neutron_lib/tests/unit/api/definitions/test_qos_fip.py
Normal file
@ -0,0 +1,20 @@
|
||||
# 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 as qos_fip_apidef
|
||||
from neutron_lib.tests.unit.api.definitions import base
|
||||
|
||||
|
||||
class QoSFIPTestCase(base.DefinitionBaseTestCase):
|
||||
extension_module = qos_fip_apidef
|
||||
extension_resources = (l3_apidef.FLOATINGIPS, )
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- The ``qos-fip`` extension's API definition is now available in
|
||||
``neutron_lib.api.definitions.qos_fip``.
|
||||
|
Loading…
x
Reference in New Issue
Block a user