From f7165d387e9a9538dccd811f48eab597b7e90628 Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Tue, 8 Jan 2019 13:14:31 +0200 Subject: [PATCH] Enable router standby relocation for policy tier1 using the passthrough api Change-Id: I89748a78719576286975d7976b58b1b41b401add --- vmware_nsxlib/v3/policy/core_resources.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/vmware_nsxlib/v3/policy/core_resources.py b/vmware_nsxlib/v3/policy/core_resources.py index d2ee78ef..58f947e0 100644 --- a/vmware_nsxlib/v3/policy/core_resources.py +++ b/vmware_nsxlib/v3/policy/core_resources.py @@ -886,6 +886,23 @@ class NsxPolicyTier1Api(NsxPolicyResourceBase): self.nsx_api.logical_router_port.update( downlink_port_id, relay_service_uuid=relay_service_uuid) + @check_allowed_passthrough + def set_standby_relocation(self, tier1_id, + enable_standby_relocation=True, + tenant=constants.POLICY_INFRA_TENANT): + """Set the flag for standby relocation on the nsx logical router port + + Using passthrough api, as the policy api does not support this yet + """ + realization_info = self.wait_until_realized( + tier1_id, entity_type='RealizedLogicalRouter', tenant=tenant) + + nsx_router_uuid = self.get_realized_id( + tier1_id, tenant=tenant, realization_info=realization_info) + self.nsx_api.logical_router.update( + nsx_router_uuid, + enable_standby_relocation=enable_standby_relocation) + class NsxPolicyTier0Api(NsxPolicyResourceBase): """NSX Tier0 API """