From fe40f9c5d66916cad4cee8d5b2d9e172fc1c0477 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Thu, 8 Aug 2024 10:26:06 +0200 Subject: src: add POST cache/fetch method Add API REST method to fetch an image. Consolidate image fetch loging for cache/fetch and image/restore. Resquest payload structure: { 'image': 'linux.img' 'type': 'TIPTORRENT' 'repository': '12.141.10.2' } The client will try to fetch'image' from 'repository' into cache. Resquest response structure: { 'cache': [ {'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'}, {'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'} ] } --- src/virtual/ogOperations.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/virtual') diff --git a/src/virtual/ogOperations.py b/src/virtual/ogOperations.py index 34ba9fd..c17bfb4 100644 --- a/src/virtual/ogOperations.py +++ b/src/virtual/ogOperations.py @@ -469,6 +469,9 @@ class OgVirtualOperations: def cache_delete(self, request, ogRest): raise NotImplementedError + def cache_fetch(self, request, ogRest): + raise NotImplementedError + def software(self, request, path, ogRest): DPKG_PATH = '/var/lib/dpkg/status' -- cgit v1.2.3-18-g5258