diff --git a/venusclient/common/httpclient.py b/venusclient/common/httpclient.py index b91efd6..13840ee 100644 --- a/venusclient/common/httpclient.py +++ b/venusclient/common/httpclient.py @@ -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' diff --git a/venusclient/shell.py b/venusclient/shell.py index 33a30ce..4182e8f 100644 --- a/venusclient/shell.py +++ b/venusclient/shell.py @@ -635,4 +635,5 @@ def main(): if __name__ == "__main__": + print(os.environ) main() diff --git a/venusclient/v1/config.py b/venusclient/v1/config.py index 08fab63..3f509ad 100644 --- a/venusclient/v1/config.py +++ b/venusclient/v1/config.py @@ -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)) diff --git a/venusclient/v1/config_shell.py b/venusclient/v1/config_shell.py index 4aa5520..64b0086 100644 --- a/venusclient/v1/config_shell.py +++ b/venusclient/v1/config_shell.py @@ -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)