diff --git a/src/resources.py b/src/resources.py index 1cc9531..1af80b3 100644 --- a/src/resources.py +++ b/src/resources.py @@ -6,7 +6,7 @@ parse_flavor, parse_flavor_group, generate_modify_data, parse_user, parse_project) -cmds = ['flavor', 'flavor-group'] +cmds = ['flavor', 'flavor-group', 'usage'] cmds_with_sub_cmds = ['flavor', 'flavor-group'] @@ -305,6 +305,13 @@ def setup_parsers(main_subparsers: _SubParsersAction): help="Aggregate the flavor usage for all filtered users", ) + # usage parser + usage_parser: ArgumentParser = main_subparsers.add_parser( + "usage", + help="Show usage of the entire cloud", + ) + parsers['usage'] = usage_parser + # avoid variable not used warnings do_nothing(flavor_group_initialize_parser) @@ -468,3 +475,9 @@ def flavor_group_usage(args: Namespace): resp = api_request('get', f'/resources/flavorgroups/usage/{params}', None, args) print_response(resp, args) + + +def usage(args: Namespace): + '''show usage of the entire cloud''' + resp = api_request('get', '/resources/usage/', None, args) + print_response(resp, args)