Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various improvements #351

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading