summaryrefslogtreecommitdiffstats
path: root/cli/objects/repo.py
Commit message (Collapse)AuthorAgeFilesLines
* cli: ensure the program returns 0 on success and 1 on errorAlejandro Sirgo Rica2024-11-211-21/+42
| | | | | | | | | | 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.
* repo: server: replace --address with --ipAlejandro Sirgo Rica2024-09-121-21/+21
| | | | Make flag format uniform for all the commands.
* 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.
* repo: remove --centerv0.3.3-11OpenGnSys Support Team2024-09-021-12/+0
| | | | legacy option, never used, remove it
* repo: sync repo with new APIAlejandro Sirgo Rica2024-09-021-5/+36
| | | | | | | | 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.
* remove duplicated parse_args in repo.py and server.pyAlejandro Sirgo Rica2024-02-291-1/+0
| | | | | Remove the line 'parsed_args = parser.parse_args(args)' parsing the command line arguments a second time when it is not needed.
* ogcli: validate integer type in every --id argumentAlejandro Sirgo Rica2024-02-051-0/+2
| | | | missing validation of --id, user needs to supply an integer
* src: update copyright statementOpenGnSys Support Team2024-01-021-1/+1
| | | | use opengnsys@soleta.eu email instead of info@soleta.eu
* 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-301-0/+11
| | | | | | Allow to delete a repository with: $ ogcli delete repo --id 10
* repo: add add_repo functionJose M. Guisado2023-10-111-0/+25
| | | | | | | | | | | | | | | | | | User can add a new repository to the database using "ogcli add repo": $ ogcli add repo --name ogcli --address 10.10.10.10 { "center": 1, "id": 13, "ip": "10.10.10.10", "name": "ogcli" } The --center optional parameter is used to set the center column of "repositorios" table in the database to the specified value. If this parameter is missing ogServer API will default to center with id 1 (the default center). This is to not break the repository in the legacy webconsole users.
* cli: add repo.py objectJose M. Guisado2023-10-111-0/+55
A user can list repos using "ogcli list repos": $ ogcli list repos { "repositories": [ { "id": 1, "ip": "10.141.10.1", "name": "Repositorio (Default)" }, { "id": 3, "ip": "127.0.0.1", "name": "dummy" }, { "id": 4, "ip": "192.168.21.21", "name": "helloworld" } ] } The repository of a client or group of clients in a room is configured using "ogcli set repo --id <id> [--client-ip <ip address>, --room-id <room id>]: $ ogcli set repo --id 4 --room-id 1