add new interface

Change-Id: I646a0a2613aa5fda60cb4a69da15db7f093f3346
This commit is contained in:
jiasirui
2021-06-07 14:13:37 +08:00
parent 7041cdd22d
commit 6cc55a8842
4 changed files with 16 additions and 1 deletions

View File

@@ -36,7 +36,7 @@ LOG = logging.getLogger(__name__)
USER_AGENT = 'python-venusclient'
CHUNKSIZE = 1024 * 64 # 64kB
API_VERSION = '/v1'
API_VERSION = '/v1.0'
DEFAULT_API_VERSION = 'latest'

View File

@@ -635,4 +635,5 @@ def main():
if __name__ == "__main__":
print(os.environ)
main()

View File

@@ -33,3 +33,11 @@ class ConfigManager(basemodels.BaseModelManager):
resp, body = self.api.json_request('GET', url)
except Exception as e:
raise RuntimeError(str(e))
def get_logs(self, args):
print(args)
url = '/v1/search/logs'
try:
resp, body = self.api.json_request('GET', url)
except Exception as e:
raise RuntimeError(str(e))

View File

@@ -17,3 +17,9 @@ def do_get_log_storage_days(cs, args):
"""get the days of saved logs in elasticsearch(unit day)."""
endpoint = cs.config.get_days()
print(endpoint)
def do_get_log(cs, args):
"""get log content"""
endpoint = cs.config.search_logs(args)
print(endpoint)