Skip to content

Commit

Permalink
Merge pull request #351 from EvanBldy/main
Browse files Browse the repository at this point in the history
various improvements
  • Loading branch information
frankrousseau authored Dec 11, 2024
2 parents 6352393 + baae872 commit 27d2c05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions gazu/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions gazu/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


def get_last_events(
page_size=20000,
limit=20000,
project=None,
after=None,
before=None,
Expand All @@ -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.
Expand All @@ -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"]
Expand Down

0 comments on commit 27d2c05

Please sign in to comment.