Merge "Add port property: port-resource-request"

This commit is contained in:
Zuul 2019-01-11 21:41:06 +00:00 committed by Gerrit Code Review
commit b843eef8d2
2 changed files with 11 additions and 0 deletions

View File

@ -107,6 +107,10 @@ class Port(resource.Resource, resource.TagMixin):
type=bool)
#: The ID of the QoS policy attached to the port.
qos_policy_id = resource.Body('qos_policy_id')
#: Read-only. The port-resource-request exposes Placement resources
# (i.e.: minimum-bandwidth) and traits (i.e.: vnic-type, physnet)
# requested by a port to Nova and Placement.
resource_request = resource.Body('resource_request', type=dict)
#: Revision number of the port. *Type: int*
revision_number = resource.Body('revision_number', type=int)
#: The IDs of any attached security groups.

View File

@ -40,6 +40,12 @@ EXAMPLE = {
'port_security_enabled': True,
'qos_policy_id': '21',
'propagate_uplink_status': False,
'resource_request': {
'required': [
'CUSTOM_PHYSNET_PUBLIC', 'CUSTOM_VNIC_TYPE_NORMAL'],
'resources': {
'NET_BW_EGR_KILOBIT_PER_SEC': 1,
'NET_BW_IGR_KILOBIT_PER_SEC': 2}},
'revision_number': 22,
'security_groups': ['23'],
'status': '25',
@ -124,6 +130,7 @@ class TestPort(base.TestCase):
self.assertEqual(EXAMPLE['qos_policy_id'], sot.qos_policy_id)
self.assertEqual(EXAMPLE['propagate_uplink_status'],
sot.propagate_uplink_status)
self.assertEqual(EXAMPLE['resource_request'], sot.resource_request)
self.assertEqual(EXAMPLE['revision_number'], sot.revision_number)
self.assertEqual(EXAMPLE['security_groups'], sot.security_group_ids)
self.assertEqual(EXAMPLE['status'], sot.status)