From 6666aba8b7063d4475636336d7798a30c26dde92 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Wed, 22 May 2024 15:47:45 +0200 Subject: rest: add cache/list Add GET cache/list request to obtain information about the client's cache. Resquest payload structure: { 'clients': ['10.141.10.21', '10.141.10.22'] } Response's structure: { 'clients': [ { 'ip': '10.141.10.21', 'cache_size': 2894572304857, 'images': [ {name:'img1', size: 87283902343, checksum: '5d4dcc677bc19f40a647d0002f4ade90'}, {name:'img2', size: 894572304857, checksum: '3eb22f888f88a55ad954f55644e1192e'} ] }, { 'ip': '10.141.10.22', 'cache_size': 49872839023434, 'images': [ {name:'img2', size: 894572304857, checksum: '3eb22f888f88a55ad954f55644e1192e'} ] } ] } Both 'cache_size' and the values in 'image_sizes' are provided as bytes. If a client has no cache partition the payload will include it as: ... { 'ip': '10.141.10.22', 'cache_size': 0, 'images': [] } ... --- src/rest.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/rest.h') diff --git a/src/rest.h b/src/rest.h index e2e22ae..fbe0e43 100644 --- a/src/rest.h +++ b/src/rest.h @@ -116,6 +116,7 @@ enum og_rest_uri { OG_URI_IMAGE_UPDATE, OG_URI_IMAGE_RESTORE, OG_URI_IMAGE_DELETE, + OG_URI_CACHE_LIST, OG_URI_PART_SETUP, OG_URI_RUN_SCHEDULE, OG_URI_TASK_RUN, -- cgit v1.2.3-18-g5258