Commit Graph

8 Commits (fe40f9c5d66916cad4cee8d5b2d9e172fc1c0477)

Author SHA1 Message Date
Alejandro Sirgo Rica fe40f9c5d6 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'}
    ]
}
2024-08-09 11:04:56 +02:00
OpenGnSys Support Team 1c9a13cd96 rest: add cmd field to POST /shell/run
echo command that has been run for storage in ogserver, until GET /shell/output
is invoked.
2024-06-21 14:59:48 +02:00
OpenGnSys Support Team 19cd1b9a78 rest: add retcode field to POST /shell/run
provide return code as result to ogserver.

Update virtual mode driver to return dummy value, although this command
is unimplemented, this seems to be broken due to possible TypeError when
accessing result from caller.
2024-06-21 14:47:30 +02:00
Alejandro Sirgo Rica 8de2b785a9 src: add POST cache/delete method
Add API REST method to delete cache contents.

Resquest payload structure:
{
    'images': ['windows.img', 'linux.img']
}

The client will try to delete as many images in cache as available
with names matching the list of filenames in the 'images' field.

Resquest response structure:
{
    'cache': [
        {'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'},
        {'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'}
    ]
}
2024-05-30 17:22:23 +02:00
Jose M. Guisado 355e6caad3 #1065 windows: use shutdown for poweroff and reboot operations
Running ogClient as a service (non interactive user) breaks
poweroff and reboot using ExitWindowsEx function in user32.dll.

Spawn a subshell using os.system and use the 'shutdown' command
instead.

This is a terminating command, we don't need fine grain from
subprocess module.
2021-12-10 12:56:50 +01:00
Jose M. Guisado b5d5d29d31 #1065 Support pyinstaller for Windows
Add required function call before running any process with
multiprocessing. This is required for windows executables to
work properly when using pyinstaller.

See:
https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Multiprocessing
2021-11-22 09:07:15 +01:00
Jose M. Guisado 2e9e5bcb3d #1065 windows: add poweroff and reboot
Uses ExitWindowsEx from user32.dll. Library is loaded using ctypes.

See https://stackoverflow.com/a/50824776
2021-11-19 11:13:05 +01:00
Jose M. Guisado f9511932ad #1065 Add windows mode
Add agent mode for windows platform.

Subprocess module for shell/run is cross-platform an no change was
needed. The subprocess will run with the same privilege as its parent,
ogclient.

TODO: Provide a windows installer. As of now,  an administrator
needs to install python and required libraries for this mode to be
usable.
2021-11-18 13:50:16 +01:00