Skip to content

Commit f0b0b7e

Browse files
authored
fix: use correct endpoint (#16)
2 parents aa062c8 + 3f08bf3 commit f0b0b7e

1 file changed

Lines changed: 4 additions & 18 deletions

File tree

labctl/commands/quota.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,37 +28,23 @@ def show_project_quota(project: str):
2828

2929
console.print(table)
3030

31-
# labctl openstack quota add PROJECT_NAME QUOTATYPE VALUE
3231
@cli_ready
33-
@app.command(name="add")
32+
@app.command(name="set")
3433
def add_quota(project: str, quota_type: str, quantity: int, comment: Optional[str] = None):
3534
"""
3635
Add quota to OpenStack project
3736
"""
3837
config = Config()
39-
console.print(f"[cyan]Adding {quota_type}={quantity} to OpenStack project {project}[/cyan]")
38+
console.print(f"[cyan]Setting {quota_type}={quantity} to OpenStack project {project}[/cyan]")
4039
payload = {
4140
"username": config.username,
4241
"project_name": project,
4342
"type": quota_type,
4443
"quantity": quantity,
4544
"comment": comment
4645
}
47-
call = APIDriver().post(f"/quota/adjust-project", json=payload)
46+
call = APIDriver().put(f"/quota/adjust-project", json=payload)
4847
if call.status_code >= 400:
4948
console.print(f"[red]Error: {call.text}[/red]")
5049
return
51-
console.print(f"[green]Quota {quota_type}={quantity} added to project {project}[/green]")
52-
53-
@cli_ready
54-
@app.command(name="del")
55-
def del_quota(id: int):
56-
"""
57-
Delete quota from OpenStack project
58-
"""
59-
console.print(f"[cyan]Deleting quota {id} from OpenStack project[/cyan]")
60-
call = APIDriver().delete(f"/quota/adjust-project/{id}/{Config().username}")
61-
if call.status_code >= 400:
62-
console.print(f"[red]Error: {call.text}[/red]")
63-
return
64-
console.print(f"[green]Quota {id} deleted from project[/green]")
50+
console.print(f"[green]Quota {quota_type}={quantity} set to project {project}[/green]")

0 commit comments

Comments
 (0)