def all_stanzas(self, conf_name, do_reload=False, ret_metadata=False): """ :return: a list of dict stanza objects if successful. Otherwise raise exception """ if do_reload: self.reload_conf(conf_name) stanzas = scmc.get_conf(self.splunkd_uri, self.session_key, "-", "-", conf_name) return self._delete_metadata(stanzas, ret_metadata)
def get_stanza(self, conf_name, stanza, do_reload=False, ret_metadata=False): """ @return dict if success otherwise raise exception """ if do_reload: self.reload_conf(conf_name) stanzas = scmc.get_conf(self.splunkd_uri, self.session_key, "-", "-", conf_name, stanza) stanzas = self._delete_metadata(stanzas, ret_metadata) return stanzas[0]