diff --git a/grafana_client/client.py b/grafana_client/client.py index 7ee3062..e892030 100644 --- a/grafana_client/client.py +++ b/grafana_client/client.py @@ -189,7 +189,7 @@ def _extract_from_response(r, accept_empty_json): raise def __getattr__(self, item): - def __request_runner(url, json=None, data=None, headers=None, accept_empty_json=False): + def __request_runner(url, json=None, data=None, params=None, headers=None, accept_empty_json=False): __url = self._make_url(url) # Sanity checks. self._ensure_valid_json_arg(json) @@ -200,6 +200,7 @@ def __request_runner(url, json=None, data=None, headers=None, accept_empty_json= __url, json=json, data=data, + params=params, headers=headers, auth=self.auth, verify=self.verify, @@ -244,7 +245,7 @@ def __init__( self.s.headers.setdefault("Connection", "keep-alive") def __getattr__(self, item): - async def __request_runner(url, json=None, data=None, headers=None, accept_empty_json=False): + async def __request_runner(url, json=None, data=None, params=None, headers=None, accept_empty_json=False): __url = self._make_url(url) # Sanity checks. self._ensure_valid_json_arg(json) @@ -255,6 +256,7 @@ async def __request_runner(url, json=None, data=None, headers=None, accept_empty __url, json=json, data=data, + params=params, headers=headers, auth=self.auth, verify=self.verify, diff --git a/grafana_client/elements/_async/folder.py b/grafana_client/elements/_async/folder.py index e60b3d0..e92fb9b 100644 --- a/grafana_client/elements/_async/folder.py +++ b/grafana_client/elements/_async/folder.py @@ -12,10 +12,10 @@ async def get_all_folders(self, parent_uid=None): :return: """ path = "/folders" - data = {} + params = {} if parent_uid: - data["parentUid"] = parent_uid - return await self.client.GET(path, data=data) + params["parentUid"] = parent_uid + return await self.client.GET(path, params=params) async def get_folder(self, uid): """ diff --git a/grafana_client/elements/folder.py b/grafana_client/elements/folder.py index 62f2e0d..5598bba 100644 --- a/grafana_client/elements/folder.py +++ b/grafana_client/elements/folder.py @@ -12,10 +12,10 @@ def get_all_folders(self, parent_uid=None): :return: """ path = "/folders" - data = {} + params = {} if parent_uid: - data["parentUid"] = parent_uid - return self.client.GET(path, data=data) + params["parentUid"] = parent_uid + return self.client.GET(path, params=params) def get_folder(self, uid): """