30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
from cli import cli
|
|
|
|
# def main(args: list[str]) -> None:
|
|
# if args[1] == "status":
|
|
# elif args[1] == "cancel":
|
|
# if len(args) <= 2:
|
|
# logging.error("No job id to cancel supplied.")
|
|
# sys.exit(1)
|
|
# logging.info(f"requesting job {args[2]} cancellation...")
|
|
# response = requests.get(f"{status_endpoint}/{args[2]}", headers=headers)
|
|
# elif args[1] == "purge":
|
|
# logging.info("purging all jobs in queue...")
|
|
# response = requests.post(purge_endpoint, headers=headers)
|
|
#
|
|
# # the json will be similar to
|
|
# # {'id': 'e3d2e250-ea81-4074-9838-1c52d006ddcf', 'status': 'IN_QUEUE'}
|
|
#
|
|
# while "status" in json and (
|
|
# json["status"] == "IN_QUEUE" or json["status"] == "IN_PROGRESS"
|
|
# ):
|
|
# logging.info(f"{json['status']} for job {json['id']}, waiting...")
|
|
# time.sleep(3)
|
|
# response = requests.get(f"{status_endpoint}/{json['id']}", headers=headers)
|
|
# json = response.json()
|
|
#
|
|
# logging.info(json)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
cli(auto_envvar_prefix="VERBANOTE")
|