diff --git a/vmware_nsxlib/tests/unit/v3/policy/test_resources.py b/vmware_nsxlib/tests/unit/v3/policy/test_resources.py index 98426fc3..2f1afef1 100644 --- a/vmware_nsxlib/tests/unit/v3/policy/test_resources.py +++ b/vmware_nsxlib/tests/unit/v3/policy/test_resources.py @@ -2637,12 +2637,14 @@ class TestPolicyTier1(NsxPolicyLibTestCase): segment_id = 'seg' ip_addr = '1.1.1.1' prefix_len = '24' + ndra_profile = 'slaac' subnet = core_defs.InterfaceSubnet([ip_addr], prefix_len) with mock.patch.object(self.policy_api, "create_or_update") as api_call: self.resourceApi.add_segment_interface( tier1_id, interface_id, segment_id, subnets=[subnet], + ipv6_ndra_profile_id=ndra_profile, tenant=TEST_TENANT) expected_def = core_defs.Tier1InterfaceDef( @@ -2651,6 +2653,7 @@ class TestPolicyTier1(NsxPolicyLibTestCase): interface_id=interface_id, segment_id=segment_id, subnets=[subnet], + ipv6_ndra_profile_id=ndra_profile, tenant=TEST_TENANT) self.assert_called_with_def(api_call, expected_def) diff --git a/vmware_nsxlib/v3/policy/core_defs.py b/vmware_nsxlib/v3/policy/core_defs.py index e898b646..003609e7 100644 --- a/vmware_nsxlib/v3/policy/core_defs.py +++ b/vmware_nsxlib/v3/policy/core_defs.py @@ -476,6 +476,18 @@ class Tier1InterfaceDef(ResourceDef): self._set_attr_if_specified(body, 'segment_id', body_attr='segment_path', value=path) + + if self.has_attr('ipv6_ndra_profile_id'): + paths = None + if self.get_attr('ipv6_ndra_profile_id'): + ndra_profile = Ipv6NdraProfileDef( + profile_id=self.get_attr('ipv6_ndra_profile_id'), + tenant=self.get_tenant()) + paths = [ndra_profile.get_resource_full_path()] + + self._set_attr_if_specified(body, 'ipv6_ndra_profile_id', + body_attr='ipv6_profile_paths', + value=paths) return body @property diff --git a/vmware_nsxlib/v3/policy/core_resources.py b/vmware_nsxlib/v3/policy/core_resources.py index 1c239acc..f619cc82 100644 --- a/vmware_nsxlib/v3/policy/core_resources.py +++ b/vmware_nsxlib/v3/policy/core_resources.py @@ -970,13 +970,15 @@ class NsxPolicyTier1Api(NsxPolicyResourceBase): return def add_segment_interface(self, tier1_id, interface_id, segment_id, - subnets, tenant=constants.POLICY_INFRA_TENANT): + subnets, ipv6_ndra_profile_id=IGNORE, + tenant=constants.POLICY_INFRA_TENANT): t1interface_def = core_defs.Tier1InterfaceDef( tier1_id=tier1_id, service_id=self._locale_service_id(tier1_id), interface_id=interface_id, segment_id=segment_id, subnets=subnets, + ipv6_ndra_profile_id=ipv6_ndra_profile_id, tenant=tenant) self.policy_api.create_or_update(t1interface_def)