Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx> --- guests/quayadmin | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/guests/quayadmin b/guests/quayadmin index 465cd8d..c2ea2b7 100755 --- a/guests/quayadmin +++ b/guests/quayadmin @@ -180,6 +180,22 @@ def run_delete_repo(config, args): print("Repository {}/{} deleted".format(args.namespace, args.repo)) +def run_list_builds(config, args): + endpoint = "/repository/{}/{}/build".format(args.namespace, args.repo) + + res = get(config, endpoint, debug=args.debug) + + if has_error(args.quiet, res, 200, + "Cannot list builds for repository {}/{}" + .format(args.namespace, args.repo)): + return 1 + + info = res.json() + + for build in info["builds"]: + print(build["id"]) + + def run_list_triggers(config, args): endpoint = "/repository/{}/{}/trigger".format(args.namespace, args.repo) @@ -301,6 +317,15 @@ def build_parser_delete_repo(subparser): add_arg_repo(parser) +def build_parser_list_builds(subparser): + parser = subparser.add_parser("list-builds", help="List repository builds") + + parser.set_defaults(func=run_list_builds) + + add_arg_namespace(parser) + add_arg_repo(parser) + + def build_parser_list_triggers(subparser): parser = subparser.add_parser("list-triggers", help="List repository triggers") @@ -347,6 +372,8 @@ def build_parser(): build_parser_create_repo(subparser) build_parser_delete_repo(subparser) + build_parser_list_builds(subparser) + build_parser_list_triggers(subparser) build_parser_show_trigger(subparser) build_parser_activate_trigger(subparser) -- 2.21.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list