diff --git a/docs/release_notes/v07-v08.md b/docs/release_notes/v07-v08.md index b7cf29bcd..52434e921 100644 --- a/docs/release_notes/v07-v08.md +++ b/docs/release_notes/v07-v08.md @@ -2,8 +2,14 @@ ## Major changes +## REST API + +* There is now an API call (`GET /admin/resources`) which exposes the resource + utilization of the cluster to admin users. + ## Supported distributions +* Debian 12 is now supported as a host OS. * Ubuntu 22.04 is now supported as a host OS. * Fedora 34, 38, and 29, as well as Ubuntu 22.04 now have canned guest images. * Rocky 8 and 9 now have canned guest images. @@ -78,7 +84,8 @@ * We now use gRPC calls to compact etcd, instead of relying on a python client wrapper. This means we can now update our gRPC and protobuf dependencies to much more recent versions. -* etcd traffic levels are now monitored in CI. +* etcd traffic levels are now monitored in CI and we attempt to hold fewer + cluster level locks for local operations. ## Minor changes @@ -96,4 +103,5 @@ longer required, and is therefore more reliable. * The `qemu` commands generated now vary based on the version of `qemu` installed on the machine. This was required to support the newer `qemu` version in - Ubuntu 22.04. \ No newline at end of file + Ubuntu 22.04. +* The ansible modules have been rewritten to be more reliable. \ No newline at end of file diff --git a/shakenfist/external_api/admin.py b/shakenfist/external_api/admin.py index f44c11901..533e3d449 100644 --- a/shakenfist/external_api/admin.py +++ b/shakenfist/external_api/admin.py @@ -14,6 +14,7 @@ from shakenfist import etcd from shakenfist.external_api import base as api_base +from shakenfist import scheduler admin_locks_get_example = """{ @@ -61,3 +62,22 @@ def get(self): resp = flask.Response(cacert, mimetype='text/plain') resp.status_code = 200 return resp + + +admin_resources_get_example = """{ + ... +}""" + + +class AdminREsourcesEndpoint(sf_api.Resource): + @swag_from(api_base.swagger_helper( + 'admin', 'List resources currently available in the cluster.', [], + [(200, 'All summary of resource usage and availability in the cluster.', + admin_resources_get_example)], + requires_admin=True)) + @api_base.verify_token + @api_base.caller_is_admin + @api_base.log_token_use + def get(self): + s = scheduler.Scheduler() + return s.summarize_resources() diff --git a/shakenfist/external_api/app.py b/shakenfist/external_api/app.py index 9b34fe3be..1139271e7 100644 --- a/shakenfist/external_api/app.py +++ b/shakenfist/external_api/app.py @@ -121,7 +121,7 @@ def get(self): '

Shaken Fist REST API service

' '

You might be interested in the apidocs.

' '

Machine searchable API capabilities: