Skip to content

Commit

Permalink
Merge pull request #28 from aitomatic/fix/pass_no_of_jobs_to_list_api
Browse files Browse the repository at this point in the history
fix: add size query parameter when calling list api
  • Loading branch information
phamhoangtuan committed May 26, 2022
2 parents 7ceeafd + c5d320b commit 3e0d687
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/api/aitomatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def start_app(self, app_name, data):

return res

def list_jobs(self, app_name):
def list_jobs(self, app_name, size):
res = requests.get(
url=f"{self.API_BASE}/app/{app_name}/jobs",
url=f"{self.API_BASE}/app/{app_name}/jobs?size={size}",
headers={
'Authorization': f'Bearer {self.token}',
},
Expand Down
2 changes: 1 addition & 1 deletion src/list/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def list(obj, app_name: str, n: int) -> None:
click.echo(f"Listing all {app_name}'s jobs...\n")

api = AiCloudApi(token=obj.get("access_token"))
res = api.list_jobs(app_name=app_name)
res = api.list_jobs(app_name=app_name, size=n)
data = res.json()

jobs = data['data']
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.2
0.12.3

0 comments on commit 3e0d687

Please sign in to comment.