Add extra_configs in SegmentPort api

Add extra_configs attribute in segment port api to support enabling
security policy sync feature.

Change-Id: Ibc2d171f1adea4fa0496b2ee67f47cb364d454ad
changes/65/744865/3
sean 2 years ago
parent 849d2c0e5a
commit db8bc2abf1
  1. 1
      vmware_nsxlib/v3/nsx_constants.py
  2. 7
      vmware_nsxlib/v3/policy/core_defs.py
  3. 6
      vmware_nsxlib/v3/policy/core_resources.py

@ -149,6 +149,7 @@ NSX_VERSION_2_3_0 = '2.3.0'
NSX_VERSION_2_4_0 = '2.4.0'
NSX_VERSION_2_5_0 = '2.5.0'
NSX_VERSION_3_0_0 = '3.0.0'
NSX_VERSION_3_0_2 = '3.0.2'
NSX_VERSION_3_1_0 = '3.1.0'
# Features available depending on the NSX Manager backend version

@ -1173,13 +1173,18 @@ class SegmentPortDef(ResourceDef):
arg_name='init_state')
self._set_attr_if_specified(body, 'init_state')
if (self.has_attr('extra_configs') and
self._version_dependant_attr_supported('extra_configs')):
self._set_attr_if_specified(body, 'extra_configs')
return body
@property
def version_dependant_attr_map(self):
return {'hyperbus_mode': nsx_constants.NSX_VERSION_3_0_0,
'admin_state': nsx_constants.NSX_VERSION_3_0_0,
'init_state': nsx_constants.NSX_VERSION_3_1_0}
'init_state': nsx_constants.NSX_VERSION_3_1_0,
'extra_configs': nsx_constants.NSX_VERSION_3_0_2}
class SegmentBindingMapDefBase(ResourceDef):

@ -2153,6 +2153,7 @@ class NsxPolicySegmentPortApi(NsxPolicyResourceBase):
hyperbus_mode=IGNORE,
admin_state=IGNORE,
init_state=IGNORE,
extra_configs=IGNORE,
tags=IGNORE,
tenant=constants.POLICY_INFRA_TENANT):
@ -2171,6 +2172,7 @@ class NsxPolicySegmentPortApi(NsxPolicyResourceBase):
hyperbus_mode=hyperbus_mode,
admin_state=admin_state,
init_state=init_state,
extra_configs=extra_configs,
tags=tags,
tenant=tenant)
self._create_or_store(port_def)
@ -2201,6 +2203,7 @@ class NsxPolicySegmentPortApi(NsxPolicyResourceBase):
address_bindings=IGNORE,
hyperbus_mode=IGNORE,
admin_state=IGNORE,
extra_configs=IGNORE,
tags=IGNORE,
tenant=constants.POLICY_INFRA_TENANT):
@ -2211,6 +2214,7 @@ class NsxPolicySegmentPortApi(NsxPolicyResourceBase):
address_bindings=address_bindings,
hyperbus_mode=hyperbus_mode,
admin_state=admin_state,
extra_configs=extra_configs,
tags=tags,
tenant=tenant)
@ -2247,6 +2251,7 @@ class NsxPolicySegmentPortApi(NsxPolicyResourceBase):
context_id=None,
traffic_tag=None,
hyperbus_mode=IGNORE,
extra_configs=IGNORE,
tags=IGNORE,
tenant=constants.POLICY_INFRA_TENANT):
@ -2259,6 +2264,7 @@ class NsxPolicySegmentPortApi(NsxPolicyResourceBase):
context_id=context_id,
traffic_tag=traffic_tag,
hyperbus_mode=hyperbus_mode,
extra_configs=extra_configs,
tags=tags,
tenant=tenant)

Loading…
Cancel
Save