diff --git a/gazu/client.py b/gazu/client.py index d707496..bc029f9 100644 --- a/gazu/client.py +++ b/gazu/client.py @@ -464,7 +464,7 @@ def fetch_first(path, params=None, client=default_client): return None -def fetch_one(model_name, id, client=default_client): +def fetch_one(model_name, id, params=None, client=default_client): """ Function dedicated at targeting routes that returns a single model instance. @@ -476,7 +476,9 @@ def fetch_one(model_name, id, client=default_client): Returns: dict: The model instance matching id and model name. """ - return get(url_path_join("data", model_name, id), client=client) + return get( + url_path_join("data", model_name, id), params=params, client=client + ) def create(model_name, data, client=default_client): diff --git a/gazu/sync.py b/gazu/sync.py index 225a4ca..9e81be1 100644 --- a/gazu/sync.py +++ b/gazu/sync.py @@ -17,7 +17,7 @@ def get_last_events( - page_size=20000, + limit=20000, project=None, after=None, before=None, @@ -29,7 +29,7 @@ def get_last_events( Get last events that occured on the machine. Args: - page_size (int): Number of events to retrieve. + limit (int): Number of events to retrieve. project (dict/id): Get only events related to this project. after (dict/id): Get only events occuring after given date. before (dict/id): Get only events occuring before given date. @@ -39,7 +39,7 @@ def get_last_events( dict: Last events matching criterions. """ path = "/data/events/last" - params = {"page_size": page_size, "only_files": only_files} + params = {"limit": limit, "only_files": only_files} if project is not None: project = normalize_model_parameter(project) params["project_id"] = project["id"]