Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/quayadmin | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/guests/quayadmin b/guests/quayadmin
index dd612da..7cc9b5a 100755
--- a/guests/quayadmin
+++ b/guests/quayadmin
@@ -173,6 +173,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)
@@ -289,6 +305,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")
@@ -335,6 +360,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