File tree Expand file tree Collapse file tree
src/aleph/vm/orchestrator Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747 status_check_version ,
4848 status_public_config ,
4949 update_allocations ,
50+ list_executions_resources ,
5051)
5152from .views .operator import (
5253 operate_confidential_initialize ,
@@ -128,6 +129,7 @@ def setup_webapp(pool: VmPool | None):
128129 web .get ("/about/login" , about_login ),
129130 web .get ("/about/executions/list" , list_executions ),
130131 web .get ("/v2/about/executions/list" , list_executions_v2 ),
132+ web .get ("/about/executions/resources" , list_executions_resources ),
131133 web .get ("/about/executions/details" , about_executions ),
132134 web .get ("/about/executions/records" , about_execution_records ),
133135 web .get ("/about/usage/system" , about_system_usage ),
Original file line number Diff line number Diff line change @@ -228,6 +228,37 @@ async def list_executions_v2(request: web.Request) -> web.Response:
228228 )
229229
230230
231+
232+ @cors_allow_all
233+ async def list_executions_resources (request : web .Request ) -> web .Response :
234+ """List all executions with detail on their resource usage"""
235+ pool : VmPool = request .app ["vm_pool" ]
236+
237+ return web .json_response (
238+ {
239+ item_hash : {
240+ "networking" : (
241+ {
242+ "ipv4_network" : execution .vm .tap_interface .ip_network ,
243+ "host_ipv4" : pool .network .host_ipv4 ,
244+ "ipv6_network" : execution .vm .tap_interface .ipv6_network ,
245+ "ipv6_ip" : execution .vm .tap_interface .guest_ipv6 .ip ,
246+ "ipv4_ip" : execution .vm .tap_interface .guest_ip .ip ,
247+ "mapped_ports" : execution .mapped_ports ,
248+ }
249+ if execution .vm and execution .vm .tap_interface
250+ else {}
251+ ),
252+ "status" : execution .times ,
253+ "message" : execution .message ,
254+ "resources" : execution .resources ,
255+ }
256+ for item_hash , execution in pool .executions .items ()
257+ },
258+ dumps = dumps_for_json ,
259+ )
260+
261+
231262@cors_allow_all
232263async def about_config (request : web .Request ) -> web .Response :
233264 authenticate_request (request )
You can’t perform that action at this time.
0 commit comments