code: def _save_or_update(self):
          
          with self._resource_lock:
              if not self._config or not self._config._storage_path:
                  raise Exception("self._config._storage path is undefined")
              if not self._config._base_name:
                  raise Exception("self._config._base_name is undefined")
              if not os.path.exists(self._config._storage_path):
                  os.makedirs(self._config._storage_path)
              path = self._get_cloud_provider_storage_path()
              with open(path, 'wb') as storage:
                  pickle.dump(self._config, storage, pickle.HIGHEST_PROTOCOL)
                  pickle.dump(self._subscriptions, storage,
                              pickle.HIGHEST_PROTOCOL)
docs: Save or update the private state needed by the cloud provider.