From b73fd1bb249d432f11f6cef171ad073b94ede192 Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Sun, 13 Oct 2019 09:26:41 +0300 Subject: [PATCH] Add caching for mdproxy & edge clusters for TZ validations Change-Id: I6d4be7a243dffce93941b979e944c718e5262deb --- vmware_nsxlib/v3/core_resources.py | 8 ++++++++ vmware_nsxlib/v3/policy/core_defs.py | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/vmware_nsxlib/v3/core_resources.py b/vmware_nsxlib/v3/core_resources.py index 342befa4..3db8d164 100644 --- a/vmware_nsxlib/v3/core_resources.py +++ b/vmware_nsxlib/v3/core_resources.py @@ -852,6 +852,10 @@ class NsxLibEdgeCluster(utils.NsxLibApiBase): def resource_type(self): return 'EdgeCluster' + @property + def use_cache_for_get(self): + return True + def get_transport_nodes(self, uuid): ec = self.get(uuid) members = [] @@ -970,6 +974,10 @@ class NsxLibMetadataProxy(utils.NsxLibApiBase): def resource_type(self): return 'MetadataProxy' + @property + def use_cache_for_get(self): + return True + def update(self, uuid, server_url=None, secret=None, edge_cluster_id=None): body = {} # update the relevant fields diff --git a/vmware_nsxlib/v3/policy/core_defs.py b/vmware_nsxlib/v3/policy/core_defs.py index ed6dfb25..0ad9f147 100644 --- a/vmware_nsxlib/v3/policy/core_defs.py +++ b/vmware_nsxlib/v3/policy/core_defs.py @@ -1897,6 +1897,10 @@ class MetadataProxyDef(ResourceDef): def resource_type(): return 'MetadataProxyConfig' + @staticmethod + def resource_use_cache(): + return True + def path_defs(self): return (TenantDef,)