diff --git a/openstack/network/v2/port.py b/openstack/network/v2/port.py index e3290aef2..fba887d33 100644 --- a/openstack/network/v2/port.py +++ b/openstack/network/v2/port.py @@ -103,6 +103,9 @@ class Port(resource.Resource, tag.TagMixin): #: The ID of the project who owns the network. Only administrative #: users can specify a project ID other than their own. project_id = resource.Body('tenant_id') + #: Whether to propagate uplink status of the port. *Type: bool* + propagate_uplink_status = resource.Body('propagate_uplink_status', + type=bool) #: The ID of the QoS policy attached to the port. qos_policy_id = resource.Body('qos_policy_id') #: Revision number of the port. *Type: int* diff --git a/openstack/tests/unit/network/v2/test_port.py b/openstack/tests/unit/network/v2/test_port.py index f2c798ddf..c9c8686a4 100644 --- a/openstack/tests/unit/network/v2/test_port.py +++ b/openstack/tests/unit/network/v2/test_port.py @@ -39,6 +39,7 @@ EXAMPLE = { 'network_id': '18', 'port_security_enabled': True, 'qos_policy_id': '21', + 'propagate_uplink_status': False, 'revision_number': 22, 'security_groups': ['23'], 'status': '25', @@ -121,6 +122,8 @@ class TestPort(base.TestCase): self.assertEqual(EXAMPLE['network_id'], sot.network_id) self.assertTrue(sot.is_port_security_enabled) self.assertEqual(EXAMPLE['qos_policy_id'], sot.qos_policy_id) + self.assertEqual(EXAMPLE['propagate_uplink_status'], + sot.propagate_uplink_status) self.assertEqual(EXAMPLE['revision_number'], sot.revision_number) self.assertEqual(EXAMPLE['security_groups'], sot.security_group_ids) self.assertEqual(EXAMPLE['status'], sot.status) diff --git a/releasenotes/notes/add-propagate_uplink_status-to-port-0152d476c65979e3.yaml b/releasenotes/notes/add-propagate_uplink_status-to-port-0152d476c65979e3.yaml new file mode 100644 index 000000000..28bf68160 --- /dev/null +++ b/releasenotes/notes/add-propagate_uplink_status-to-port-0152d476c65979e3.yaml @@ -0,0 +1,12 @@ +--- +features: + - | + Add ``propagate_uplink_status`` attribute to ``port`` resource. + Users can set this attribute to ``True`` or ``False``. + If it is set to ``True``, uplink status propagation is enabled. + Otherwise, it is disabled. + Neutron server needs to have the API extension + ``uplink-status-propagation`` in order to support this feature. + This feature can be used in SRIOV scenario, in which users + enable uplink status propagation of the SRIOV port + so that the link status of the VF will follow the PF.