diff --git a/openstack/network/v2/port.py b/openstack/network/v2/port.py index 33ea63e69..7be8cea21 100644 --- a/openstack/network/v2/port.py +++ b/openstack/network/v2/port.py @@ -112,6 +112,9 @@ class Port(_base.NetworkResource, tag.TagMixin): extra_dhcp_opts = resource.Body('extra_dhcp_opts', type=list) #: IP addresses for the port. Includes the IP address and subnet ID. fixed_ips = resource.Body('fixed_ips', type=list) + #: The type of hardware offload this port will request when attached to the + # network backend. + hardware_offload_type = resource.Body('hardware_offload_type') #: Read-only. The ip_allocation indicates when ports use deferred, # immediate or no IP allocation. ip_allocation = resource.Body('ip_allocation') diff --git a/openstack/tests/unit/network/v2/test_port.py b/openstack/tests/unit/network/v2/test_port.py index 8e06a9f35..3547485f3 100644 --- a/openstack/tests/unit/network/v2/test_port.py +++ b/openstack/tests/unit/network/v2/test_port.py @@ -34,6 +34,7 @@ EXAMPLE = { 'dns_name': '12', 'extra_dhcp_opts': [{'13': 13}], 'fixed_ips': [{'14': '14'}], + 'hardware_offload_type': None, 'id': IDENTIFIER, 'ip_allocation': 'immediate', 'mac_address': '16', diff --git a/releasenotes/notes/add-port-hardware-offload-type-1232c5ae3f62d7df.yaml b/releasenotes/notes/add-port-hardware-offload-type-1232c5ae3f62d7df.yaml new file mode 100644 index 000000000..b53e6765a --- /dev/null +++ b/releasenotes/notes/add-port-hardware-offload-type-1232c5ae3f62d7df.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Add ``hardware_offload_type`` attribute to ``port`` resource. Users + can set this attribute to a valid value defined in + ``neutron_lib.constants.VALID_HWOL_TYPES``, set "None" or leave it + undefined.