summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* cli: cleanup http error handlingv0.3.3-15Alejandro Sirgo Rica6 days1-35/+24
| | | | | | | | Use more specific exception request exception handling to provide better error messages. Define an interal request function for get, post and delete to reuse code.
* cli: add lives alias to the live command argumentAlejandro Sirgo Rica9 days1-8/+10
|
* live: use human readable date in live listAlejandro Sirgo Rica9 days2-3/+19
| | | | | | | | Parse the unix timestamp into a human readable format like "2024-11-25 12:28:19". Make print_json() print from string and from a json object to enable manipulation of data before printing.
* cli: improve HTTP status code error loggingAlejandro Sirgo Rica13 days1-3/+21
| | | | | Use a different message for each status code when the request is not successful.
* folder: fix add folder commandAlejandro Sirgo Rica13 days1-1/+1
| | | | Fix typo causing an error in the add folder command.
* cli: add live set --default commandAlejandro Sirgo Rica2024-12-052-1/+25
| | | | | | | Add command to set a new default live. Command example: ogcli set live --default --name ogLive-5.4.0-r20220408
* cli: add live management commandsv0.3.3-14Alejandro Sirgo Rica2024-11-213-3/+309
| | | | | | | | | | | | | | | | | | | Add new parameters to the config file ogcli.json with the following default values: 'local_live': '/var/www/html/ogrelive' 'server_live': 'https://opengnsys.soleta.eu/ogrelive' Add command to install the files of a live system. Example: ogcli install live --name ogrelive-6.1.0-26 Perform an update if live files are already present. Add command to delete the files of a live system. Example: ogcli delete live --name ogrelive-6.1.0-26 Update ogcli list live to show the lives in the server when invoked with the --remote flag. Example: ogcli list live --remote
* ogcli: move configuration data into a different fileAlejandro Sirgo Rica2024-11-213-18/+34
| | | | | Move the configuration into its own file so it is easier to access from multiple files.
* cli: ensure the program returns 0 on success and 1 on errorAlejandro Sirgo Rica2024-11-2117-196/+332
| | | | | | | | | | propagate a returncode in each operation and make it the returncode of the program. Prevent sys.exit calls in post(), get() and delete() request handlers to enable cleanup code and error handling. Keep a basic error log inside the request functions if the connection can't be established or if the response contains an error code.
* Revert "cli: rename ogcli list scopes to ogcli list scope"OpenGnSys Support Team2024-11-213-4/+4
| | | | This reverts commit 8f5b709212aa1ea28e85a0367747976cf81e0f3a.
* scopes: add scope filtering by namev0.3.3-13Alejandro Sirgo Rica2024-09-121-17/+30
| | | | | | | Implement the --name flag in scope list to filter by client name. Example usage: ogcli list scope --name test
* cli: rename ogcli list scopes to ogcli list scopeAlejandro Sirgo Rica2024-09-123-4/+4
| | | | | Use the word "scope" to keep the format coherent with the other commands.
* repo: server: replace --address with --ipAlejandro Sirgo Rica2024-09-122-25/+25
| | | | Make flag format uniform for all the commands.
* server: validate IP addressAlejandro Sirgo Rica2024-09-121-0/+5
| | | | Add IP validation after input parsing.
* repo: overload delete and add repo to modify the addressesAlejandro Sirgo Rica2024-09-121-12/+102
| | | | | | | | | | | | | | | | | Overload the add repo and delete repo commands to have different functionality based on the flags. Add a repo: ogcli add repo --name test2 --address 192.168.9.140 Add addresses to repo with id 27: ogcli add repo --address 192.168.9.141 192.168.9.142 --id 27 Delete address from repo with id 27: ogcli delete repo --address 192.168.9.141 --id 27 Delete repo: ogcli delete repo --id 27
* repo: fix repo update command prefixAlejandro Sirgo Rica2024-09-111-1/+1
| | | | Use the correct command prefix in the command function.
* images: missing curly brace in image commandv0.3.3-12OpenGnSys Support Team2024-09-031-1/+1
|
* repo: remove --centerv0.3.3-11OpenGnSys Support Team2024-09-021-12/+0
| | | | legacy option, never used, remove it
* images: remove --repo for image createOpenGnSys Support Team2024-09-021-10/+9
| | | | | get repository id through GET /client/info, check that all the clients belong to the same repository.
* server: remove 'set server' commandOpenGnSys Support Team2024-09-022-41/+1
| | | | | | server IP is now inferred from what it is reachable, remove this command. this revisits a721957cc469 ('cli: add server commands')
* repo: sync repo with new APIAlejandro Sirgo Rica2024-09-022-6/+39
| | | | | | | | Add repo update. Example command: update repo --id 20 --address 192.168.1.189 192.168.1.191 --name test --center 1 Use addr instead of ip to pass a list of addresses.
* cli: remove accents in image namev0.3.3-10Alejandro Sirgo Rica2024-08-212-1/+6
| | | | Remove accents in the --name argument of the create image command.
* utils: print readable output for escaped non-ascii charactersv0.3.3-9OpenGnSys Support Team2024-08-061-1/+1
| | | | | disable ascii_ensure in json dumps so listing of non-ascii characters is human readable.
* disk: use NTFS for partition codev0.3.3-8OpenGnSys Support Team2024-08-061-1/+1
| | | | ogclient supports NTFS partition code.
* utils: place dictionary and list at the end of the json treeAlejandro Sirgo Rica2024-07-091-1/+18
| | | | | | | | | | Place dictionaries and lists at the end of the payload to improve readability when it has a lot of nested components. Remove and add again every element of type list or dict within a dict or list in the payload. Python dictionaries preserve insertion order from 3.7 onwardsi so it is safe to reorder them by removing and readding an element.
* objects: fix restore image default repo valueAlejandro Sirgo Rica2024-07-041-1/+25
| | | | | Obtain the image's repository from the API REST. Don't send 127.0.0.1 as image server when --repo is not defined.
* images: update command requires string id in serverOpenGnSys Support Team2024-06-171-1/+1
| | | | ogserver expects a string as an id, otherwise it fails to parse it.
* cli: objects: unbreak ogcli with python 3.80.3.3-7Alejandro Sirgo Rica2024-06-032-3/+3
| | | | | | Older versions of Python can't handle interleaved quote types. Use single quotes as external string delimiter and double quotes in every part of the strings when quotation is needed.
* disk: improve disk setup command validationv0.3.3-6Alejandro Sirgo Rica2024-06-031-7/+30
| | | | | | | | | | | | Checks: --type is gpt or dos. --num must have numeric argument. --part defines 4 coma-separated values. --part number must be an integer. --part number is not repeated between partitions. --part partition type is a known type. --part filesystem type is a known type. --part size has a valid format.
* disk: use proper partition sizesAlejandro Sirgo Rica2024-06-031-1/+1
| | | | | Use base 2 size units for the partition configuration units. Using base 10 units causes incoherency with the web.
* cli: add list scopes --client-ipAlejandro Sirgo Rica2024-06-032-3/+50
| | | | | | | | | | Implement a --client-ip filter to ease the task of finding the hierarchy associated to a client or list of clients. Usage: /ogcli list scopes --client-ip 10.141.10.23 /ogcli list scopes --client-ip 10.141.10.23 --client-ip 10.141.10.22
* remove whitespace printed after every command executionAlejandro Sirgo Rica2024-03-041-1/+3
| | | | | | The POST handling logic didn't check for empty responses before printing its contents resulting in a line of whitespace being written in the output of the program.
* improve missing clients error reporting in multiple commandsAlejandro Sirgo Rica2024-03-048-8/+8
| | | | | All the commands that need target clients now have a more descriptive error message when the clients of the command are missing.
* rename argument of 'restore' command to 'restore_obj'Alejandro Sirgo Rica2024-03-041-2/+2
| | | | | The argument was called 'send_obj' probably due to copypaste. The rename aims to provide a better name for the command.
* change 'ogcli send' command into 'ogcli request'Alejandro Sirgo Rica2024-03-048-29/+29
| | | | | | By using the word 'request' the command becomes more semantic and represents the 'best effort' nature of the communication with ogserver.
* add 'send session' to request the boot from a client's partitionAlejandro Sirgo Rica2024-02-292-1/+73
| | | | | | example to boot OS from 10.141.10.22 disk 1 partition 2 send session --client-ip 10.141.10.22 --disk 1 --part 2
* remove duplicated parse_args in repo.py and server.pyAlejandro Sirgo Rica2024-02-292-2/+0
| | | | | Remove the line 'parsed_args = parser.parse_args(args)' parsing the command line arguments a second time when it is not needed.
* ogcli: add update command for folder, room and centerAlejandro Sirgo Rica2024-02-134-4/+97
| | | | | Expand of the update command to be able to modify the values of previous folder, room and center configurations.
* repository: improve .gitignore syntaxAlejandro Sirgo Rica2024-02-131-1/+1
| | | | the __pycache__ folder will now be ignored by git in every folder.
* ogcli: validate integer type in every --id argumentAlejandro Sirgo Rica2024-02-054-0/+6
| | | | missing validation of --id, user needs to supply an integer
* folder: add commands to create and delete foldersAlejandro Sirgo Rica2024-02-052-2/+61
| | | | | | | | | | | | add command to add folders add folder --name test --room-id 123 to delete delete folder --id 456 you can fetch the id with 'list scopes'
* room: use room_id field in jsonJavier Hernandez2024-01-111-1/+1
| | | | instead of group, which is not used by the ogserver anymore.
* ogcli: really ignore SIGPIPEv0.3.3-5OpenGnSys Support Team2024-01-041-1/+1
| | | | SIG_DFL needs to be used to disable SIGPIPE in python, SIG_IGN does not work.
* src: update copyright statementOpenGnSys Support Team2024-01-0216-14/+28
| | | | use opengnsys@soleta.eu email instead of info@soleta.eu
* live: add command to list available live imagesOpenGnSys Support Team2024-01-022-1/+21
| | | | | | Add new command to display the available live images: # ogcli list live
* cli: remove 'list server'OpenGnSys Support Team2024-01-021-3/+2
| | | | list servers already provides the same.
* images: Remove option to specify repoJavier Hernandez2023-12-211-13/+4
| | | | | | | | | | | Remove option to specify a repository when creating an image. Remove option to specify a repository when updating an image. These features is are not yet supported in ogserver. With this commit, the image that is created/updated is assigned to the same repo the client is assigned
* images: use new POST image/updatev0.3.3-4OpenGnSys Support Team2023-12-191-1/+1
| | | | use POST image/update when updating an image.
* repository: fix incorrect helpOpenGnSys Support Team2023-12-011-1/+1
| | | | | | | | # ogcli delete repo -h [...] --id [ID] room id in scopes this is not the room id, it should be the repo id.
* repository: delete commandv0.3.3-3OpenGnSys Support Team2023-11-302-1/+14
| | | | | | Allow to delete a repository with: $ ogcli delete repo --id 10