summaryrefslogtreecommitdiffstats
path: root/cli/objects/disks.py
Commit message (Collapse)AuthorAgeFilesLines
* src: update copyright statementOpenGnSys Support Team2024-01-021-1/+1
| | | | use opengnsys@soleta.eu email instead of info@soleta.eu
* disks: remove --format parameter in setup diskv0.3.2Jose M. Guisado2023-10-091-12/+1
| | | | | | | | | | | | | Every partition will be formatted since disk setup command was rewritten into Python code in ogClient. This makes "ogcli setup disk" --format parameter unusable. As the time of this commit, for backward compatibility (with the legacy web console interface) ogServer expects the "format" field inside the partition json objects conforming the "partition_setup" array. For this reason, ogCLI still adds the "format" field into the partition objects present in the partition_setup array, but using a default value which will have no effect whatsoever.
* objects: add missing prog parameter in subcommandsJose M. Guisado2023-10-051-2/+2
| | | | | | | | | | | | | The specific subcommand name is missing in some of the subcommands help message. For example: $ ogcli list hardware usage: ogcli [-h] --client-ip CLIENT_IP ogcli: error: the following arguments are required: --client-ip Fix this by adding the missing prog= parameter so argparse use this instead of argv[0]. If no prog parameter is specified then argv[0] is printed (i.e: "ogcli").
* format: use autopep8Jose M. Guisado2022-05-201-131/+135
| | | | | | | | | | | | | | Use autopep8 for coding format, and only for whitespace changes. This change drops use of tabs in favor of spaces. Doesn't use autopep8 --aggresive option. Format command: $ autopep8 --inline --recursive . When using git-blame, use --ignore-rev in order to ignore this reformatting commit.
* setup disk: fix paddingv0.1Jose M. Guisado2022-05-171-1/+2
| | | | | | | ogServer expects a 4-partition setup. When specifying less than that, the partition setup needs to be padded with EMPTY partitions. Fixes a bug in which this padding is not valid.
* utils: add print_jsonJose M. Guisado2022-05-171-1/+3
| | | | | | | | | Adds a pretty printing function for JSON data. Replaces print for print_json in corresponding cli objects. Follows commit 828d6c0ce7d4a6b4bcd95e97155460fd59856bdd ("list scopes: pretty print scope tree")
* ogCLI is AGPLv3+OpenGnSys Support Team2021-05-141-4/+3
| | | | Update license header in files.
* Add "setup disk" commandJose M. Guisado2021-04-071-0/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enables sending format and partition commands to the ogServer. Syntax: ogcli setup disk {options} Options are: --type [{dos,gpt}] Disk partition scheme --num [NUM] Disk number (defaults to 1) --format [FORMAT] Indicates which partitions to reformat if they are already present. Use --part alone to mean all partitions. --part PART [PART ...] Partition definition (syntax: "num,part_scheme,fs,size") size is specified as a positive digit followed by a size unit like [MGT] 512M, 50G, 1T, etc. ogcli accepts {LINUX,WINDOWS,EFI,CACHE} as part types and {EXT4, NTFS, FAT32, CACHE} as filesystem types inside the partition definition string 1,LINUX,EXT4,50G => partition 1, of type linux with ext4 fs of 50 GB size If you wanted to add a partition cache (OpenGnsys usually mandates this partition to be number 4) you can omit partitions up to that number and ogcli will fill with EMPTY partitions. So if you define the following parts: --part 1,... --part 4,... ogcli will fill parts 2 and 3 with EMPTY part type and fs. Client selection argument follow previous used options --center-id CENTER_ID --room-id ROOM_ID --client-ip CLIENT_IP
* Add 'list disks'Jose M. Guisado2021-04-061-0/+24
Enables consuming /client/setup API from ogServer in order to fetch partition and disk setup information from a given client. Example, if pc11 is a client with 1 disk, 4 part (1:linux,2-3:empty,4:cache): ogcli list disk --client-ip 192.168.56.11 { "partitions": [ { "disk": 1, "partition": 0, "code": 1, "size": 52428800, "used_size": 0, "filesystem": 0, "os": 0, "image": 0, "software": 0 }, { "disk": 1, "partition": 1, "code": 131, "size": 40000000, "used_size": 4, "filesystem": 6, "os": 8, "image": 0, "software": 0 }, { "disk": 1, "partition": 2, "code": 0, "size": 0, "used_size": 0, "filesystem": 1, "os": 0, "image": 0, "software": 0 }, { "disk": 1, "partition": 3, "code": 0, "size": 0, "used_size": 0, "filesystem": 1, "os": 0, "image": 0, "software": 0 }, { "disk": 1, "partition": 4, "code": 202, "size": 10000000, "used_size": 1, "filesystem": 2, "os": 0, "image": 0, "software": 0 } ] }