diff --git a/debian/cc-cli.1 b/debian/cc-cli.1 index 8b29b7f76d0559b69b047cd90eee7276aca0b9e2..3819b15530cda63c56ff8e1797f67e3d63a5358d 100644 --- a/debian/cc-cli.1 +++ b/debian/cc-cli.1 @@ -119,27 +119,27 @@ Each previous operators can be negated by adding \fB!\fP before it. \fB,n\fP limit from n object to last object .SS NUMBER FACILITY -\fB10k\fP = 1000 +\fB1k\fP = 1 000 .br -\fB10ki\fP = 1024 +\fB1ki\fP = 1 024 .br -\fB1m\fP = 1000 ^ 2 +\fB1m\fP = 1 000 ^ 2 .br -\fB1mi\fP = 1024 ^ 2 +\fB1mi\fP = 1 024 ^ 2 .br -\fB1g\fP = 1000 ^ 3 +\fB1g\fP = 1 000 ^ 3 .br -\fB1gi\fP = 1024 ^ 3 +\fB1gi\fP = 1 024 ^ 3 .SS EXAMPLE -For example, See the command \fBlist\fP +For examples, See the command \fBlist\fP .SH GENERIC COMMANDS .SS addaccount [\fIoptions\fP] \fI<account-name> <role>\fP [\fIpassword\fP] Create an account .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB-help\fP show this help message and exit @@ -159,7 +159,7 @@ No tagdisplay custom display \fB--no-color\fP No output coloration .TP -\fBExample:\fP +\fBExample :\fP .TP \fBaddacount toto cli azerty\fP Create account toto in role cli (user) whith password azerty @@ -171,7 +171,7 @@ All is deny by default .br When a user tape a command, cli check the rights from index 0 to the last, if the method and the right tql match whith command, right is applied, else it check the next rights, and if not found a matching rights, it deny the command .TP -Example: +\fBExample :\fP \fB[0] tql: method:* target:allow\fP .br \fB[1] tql: method:list target:deny\fP @@ -191,7 +191,7 @@ is the name of the rpc command to allow \fI<target>\fP can be allow or deny .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -217,29 +217,29 @@ No tagdisplay custom display \fB--no-color\fP No output coloration .TP -\fBExample\fP +\fBExample :\fP +.TP \fBaddright id=toto "" * allow 0\fP -.br - Allow all method whith all query tql in index 0 for account toto +Allow all method whith all query tql in index 0 for account toto \fBaddright id=toto "id=toto" list deny 0\fP -.br - Deny method list whith tql "id=toto" for account toto in index 0 (deny commands' example: list id=toto, list id:t*, ...) +Deny method list whith tql "id=toto" for account toto in index 0 (deny commands' example: list id=toto, list id:t*, ...) .SS alias [\fIoptions\fP] [\fIname\fP] [\fIvalue\fP] Show or create alias .TP CLI support aliasing. This is a very useful command substitution. Alias is stored in \fB~/.config/cc-cli/alias\fP .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit .TP -\fBExample:\fP +\fBExample :\fP .TP \fBalias w "list a&con!=offline&r=cli"\fP Setting an alias w, which list online client + .TP \fBalias vm "list r=vm&status=running$cpu"\fP Setting an alias vm, which list running vm (and show cpu) @@ -251,7 +251,7 @@ Clear tty .SS close [\fIoptions\fP] \fI<tql>\fP Disable accounts .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -280,7 +280,7 @@ No output coloration .SS declose [\fIoptions\fP] \fI<tql>\fP Enable accounts .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -309,7 +309,7 @@ No output coloration .SS delaccount [\fIoptions\fP] \fI<tql>\fP Delete an account .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -342,7 +342,7 @@ Delete account right \fI<index>\fP * means all .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -369,7 +369,7 @@ No tagdisplay custom display No output coloration .TP -\fBNotes:\fP +\fBNotes :\fP .TP if you have deny rights in the command list, for delete account right, you must use options --raw and -direct \fBdelright -r -d id=toto x\fP @@ -395,7 +395,7 @@ CLI history is stored in \fB~/.local/share/cc-cli/history\fP .SS kill [\fIoptions\fP] \fI<tql>\fP Kill a server connection .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -425,7 +425,7 @@ No output coloration .SS list [\fIoptions\fP] [\fItql\fP] List objects .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -452,8 +452,8 @@ column aligment display line aligment display .P -\fBExample:\fP -.br +\fBExample :\fP + \fBlist\fP .br list all accounts @@ -484,7 +484,7 @@ line aligment display \fBlist r=hv&cpu=2&mem>10g\fP .br - list hypervisor with no vm + list hypervisor with 2 cpu and 10G memory \fBlist cpu>=2$pop$alloc\fP .br @@ -502,7 +502,7 @@ line aligment display .SS passwd [\fIoptions\fP] [\fItql\fP] [\fIpassword\fP] Change account password .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -536,7 +536,7 @@ Quit application with respect .SS rights [\fIoptions\fP] [\fItql\fP] List account rights .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -550,7 +550,8 @@ Print TQL before sending to server \fB--no-tagdisplay\fP No tagdisplay custom display .TP -\fBExample:\fP +\fBExample :\fP + \fB>>right id=toto\fP .br a:toto @@ -564,7 +565,7 @@ The user toto doesn't have right use method list whith a tql conained "id=toto" .SS server \fI<options>\fP Server manipulation command .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -581,8 +582,10 @@ show server version .SS shutdown [\fIoptions\fP] \fI<tql>\fP Shutdown a physical host + +The command add tql \fB&con&r~'host|hv'\fP .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -615,13 +618,14 @@ Reboot after shutdown (default) Halt after shutdown .TP \fB-F\fP +.br do not go through init but go down real fast .SS unalias [\fIoptions\fP] [\fIname\fP] Remove an alias .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -666,103 +670,103 @@ Reserved tags are tags with a special meaning and cannot be set or remove direct \fBip\fP : ipv4 of connection .SS WELL KNOWN TAGS -\fBh\fP : hostname (eg: access) +\fBalloc\fP : host is allowed to be selected to a migration +.br +\fBarch\fP : hardware architecture (x86/x64) +.br +\fBchaasset\fP : blade chassis asset tag (dell tag) .br -\fBhv\fP : hypervisor name (eg: kvmlab-1) +\fBchaserial\fP : blade chassis serial number (dell tag) .br -\fBhtype\fP : hypervisor type (xen/kvm) +\fBcpu\fP : cpu count .br -\fBlibvirtver\fP : Libvirt version +\fBcpufreq\fP : cpu core frequency +.br +\fBcputhread\fP : total number of cpu thread .br -\fBstatus\fP : VM status (running/paused/stopped) +\fBcpuuse\fP : global cpu usage (percentage) +.br +\fBdisk\fP : disk index list (eg: 1 2 3 4) .br -\fBcpu\fP : cpu count +\fBdisk1_path\fP : disk 1 path (eg: /dev/vg/sex) .br -\fBrcpu\fP : reserved cpu count +\fBdisk1_pool\fP : storage pool back reference (eg: vg) [vmonly] +.br +\fBdisk1_size\fP : disk 1 size (eg: 1024) .br -\fBmem\fP : memory total size +\fBdisk1_vol\fP : storage pool volume back reference (eg: titi) [vmonly] +.br +\fBh\fP : hostname (eg: access) .br -\fBmemused\fP : memory used +\fBhbios\fP : host bios version and/or date (eg: A05 (01/09/2006)) .br -\fBmemfree\fP : memory free +\fBhmodel\fP : host model (eg: PowerEdge 2850) +.br +\fBhserial\fP : host serial number (eg: Dell service tag) .br -\fBarch\fP : hardware architecture (x86/x64) +\fBhtype\fP : hypervisor type (xen/kvm) .br -\fBuname\fP : output of uname command +\fBhv\fP : hypervisor name (eg: kvmlab-1) .br -\fBuptime\fP : uptime of hostname +\fBhvm\fP : hardware virtualisation enabled +.br +\fBhvendor\fP : host vendor (eg: Dell Computer Corporation) +.br +\fBhvver\fP : hypervisor version (eg: 0.14) +.br +\fBlibvirtver\fP : Libvirt version .br \fBload\fP : load average .br -\fBos\fP: operating system (linux/windows) +\fBmem\fP : memory total size .br -\fBalloc\fP : host is allowed to be selected to a migration +\fBmemfree\fP : memory free .br -\fBhvm\fP : hardware virtualisation enabled +\fBmemused\fP : memory used .br \fBnvm\fP : vm count on an hypervisor +.br +\fBos\fP : operating system (linux/windows) .br -\fBvmstarted\fP : started vm count on an hypervisor -.br -\fBvmstopped\fP : stopped vm count on an hypervisor -.br -\fBvmpaused\fP : paused vm count on an hypervisor -.br -\fBversion\fP : account reported version +\fBplatform\fP : python platform info .br +\fBrcpu\fP : reserved cpu count +.br +\fBstatus\fP : VM status (running/paused/stopped) +.br \fBsto\fP : storage pool names (eg: vg fg) +.br +\fBstovg_free\fP : vg storage pool free space (eg: 1041) .br -\fBstovg_type\fP : vg storage pool type (eg: lvm) -.br +\fBstovg_path\fP : vg storage pool path (eg: /dev/vg/) +.br \fBstovg_size\fP : vg storage pool size (eg: 1042) +.br +\fBstovg_type\fP : vg storage pool type (eg: lvm) .br \fBstovg_used\fP : vg storage pool used space (eg: 1) .br -\fBstovg_free\fP : vg storage pool free space (eg: 1041) -.br -\fBstovg_path\fP : vg storage pool path (eg: /dev/vg/) -.br \fBstovg_vol\fP : vg storage pool volume list (eg: sex titi toto) +.br +\fBuname\fP : output of uname command .br -\fBdisk: disk\fP index list (eg: 1 2 3 4) -.br -\fBdisk1_path\fP : disk 1 path (eg: /dev/vg/sex) -.br -\fBdisk1_size\fP : disk 1 size (eg: 1024) -.br -\fBdisk1_pool\fP : storage pool back reference (eg: vg) [vmonly] +\fBuptime\fP : uptime of hostname +.br +\fBversion\fP : account reported version +.br +\fBvmpaused\fP : paused vm count on an hypervisor +.br +\fBvmstarted\fP : started vm count on an hypervisor .br -\fBdisk1_vol\fP : storage pool volume back reference (eg: titi) [vmonly] +\fBvmstopped\fP : stopped vm count on an hypervisor .br \fBvncport\fP : vnc local port (eg: 5001) -.br -\fBhvver\fP : hypervisor version (eg: 0.14) -.br -\fBhserial\fP : host serial number (eg: Dell service tag) -.br -\fBhvendor\fP : host vendor (eg: Dell Computer Corporation) -.br -\fBhmodel\fP : host model (eg: PowerEdge 2850) -.br -\fBhbios\fP : host bios version and/or date (eg: A05 (01/09/2006)) -.br -\fBcputhread\fP : total number of cpu thread -.br -\fBcpufreq\fP : cpu core frequency -.br -\fBcpuuse\fP : global cpu usage (percentage) -.br -\fBplatform\fP : python platform info -.br -\fBchaserial\fP : blade chassis serial number (dell tag) -.br -\fBchaasset\fP : blade chassis asset tag (dell tag) - + .SS addtag [\fIoptions\fP] \fI<tql> <tag> <value>\fP Add/Modify a static tag on an account .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -788,19 +792,19 @@ No tagdisplay custom display \fB--no-color\fP No output coloration .TP -\fBExample:\fP +\fBExample :\fP .TP \fBaddtag id=toto hello foo\fP -Create tag hello whith value foo in the account toto +Create tag hello whith value foo for account toto .TP \fBaddtag r=vm hello foo\fP -Create tag hello whith value foo in all vm +Create tag hello whith value foo for all vm .SS deltag [\fIoptions\fP] \fI<tql> <tag>\fP Delete a static tag from an account .TP - \fBOptions:\fP + \fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -826,7 +830,7 @@ No tagdisplay custom display \fB--no-color\fP No output coloration .TP -\fBExample:\fP +\fBExample :\fP .TP \fBdeltag id=toto hello\fP Delete tag hello from account toto @@ -834,19 +838,31 @@ Delete tag hello from account toto .SS tagdisplay [\fIoptions\fP] [\fItag\fP] ... Tagdisplay tool .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit .TP \fB-c\fP \fISET-COLOR\fP -Set custom color on [\fItag\fP] +Set custom color on [\fItag\fP]. +.br +Color available : +.br + \fBregular :\fP + \fIblack\fP, \fIred\fP, \fIgreen\fP, \fIyellow\fP, \fIblue\fP, \fIpurple\fP, \fIcyan\fP, \fIwhite\fP + \fBlighted :\fP + \fIlgrey\fP, \fIlred\fP, \fIlgreen\fP, \fIlyellow\fP, \fIlblue\fP, \fIlpurple\fP, \fIlcyan\fP, \fIlwhite\fP + \fBunderline :\fP + \fIured\fP, \fIugreen\fP, \fIuyellow\fP, \fIublue\fP, \fIupurple\fP, \fIucyan\fP .TP \fB-C\fP Remove custom color on [\fItag\fP] .TP \fB-t\fP \fISET-TYPE\fP -Set custom type on [\fItag\fP] +Set custom type on [\fItag\fP]. +.br +Type available : + \fIstring\fP, \fIlower\fP, \fIupper\fP, \fIsi\fP (system international), \fIsecond\fP, \fIdate\fP, \fItime\fP, \fIdatetime\fP. .TP \fB-T\fP Remove custom type on [\fItag\fP] @@ -862,11 +878,16 @@ List allowed color .TP \fB--list-types\fP List allowed types +.TP +\fBExample :\fP +.TP + \fBtagdisplay -c red hv\fP +The tag hv is displayed with color red .SS tags [\fIoptions\fP] [\fItql\fP] List only static tags .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -886,12 +907,12 @@ No tagdisplay custom display \fB--no-color\fP No output coloration .TP -\fBExample:\fP +\fBExample :\fP \fB>>tags r=cli\fP id=\fBtoto\fP foo=bar hello=bye .br id=\fBtiti\fP az=qwerty -.br + List all clients' static tags .SH JOB COMMANDS @@ -899,7 +920,7 @@ List all clients' static tags .SS cancel [\fIoptions\fP] \fI<job_id>\fP ... Cancel a job .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -911,8 +932,10 @@ Immediately terminate the VM. This doesn't give the domain OS any chance to react, and it's the equivalent of ripping the power cord out on a physical machine. In most cases you will want to use the stop command instead. +The command add tql \fI&r=vm&status!=stopped\fP + .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -940,8 +963,10 @@ No output coloration .SS execute [\fIoptions\fP] \fI<tql> <command>\fP Execute a command on the remote host + +The command add tql \fI&con&r~'host|hv'\fP .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -967,19 +992,16 @@ No tagdisplay custom display \fB--no-color\fP No output coloration .TP -\fBExample:\fP +\fBExample :\fP .TP \fBexecute r=hv ls\fP Execute command ls in all hosts -.TP -.B BUG: -.br -Quand il y a une erreur, il manque un retour à la ligne apres le None + .SS jobs [\fIoptions\fP] [\fItql\fP] List jobs .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -1010,7 +1032,7 @@ Migrate vm Migrate vm from host [\fIsource-tql\fP] to another host [\fIdest-tql\fP]. Only \fBcold\fP (the virtual machine stop to execute any currently working program and copy the current page table to the machine where the virtual machine migrate) type migration and \fBfair\fP algorithm are available. .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -1036,15 +1058,18 @@ Selection migration type \fB-a\fP \fIALGO\fP, \fB--algo=\fP\fIALGO\fP Select migration algorithm .TP -\fBExample:\fP +\fBExample :\fP .TP \fBmigrate -t cold -a fair r=vm&p=host1 id=host2\fP Migrate all vm from host1 to host2 .SS pause [\fIoptions\fP] \fI<tql>\fP Pause a running vm + +The command add tql \fI&r=vm&status=running\fP + .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -1070,18 +1095,11 @@ No tagdisplay custom display \fB--no-color\fP No output coloration .TP -\fBExample\fP +\fBExample :\fP .TP \fBpause r=vm&status=running&p=host1\fP Pause all vm started in the hypervisor host1 -.TP -\fBBUG:\fP -.br -pause --print-tql r=vm&status=running&p=it-test-4 -.br -TQL: r=vm&status=running&p=it-test-4&r=vm&status=stopped -.br -le TQL devrait ressembler plus à : r=vm&status=running&p=it-test-4&r=vm&status!=stopped + .SS resume [\fIoptions\fP] \fI<tql>\fP @@ -1090,8 +1108,10 @@ Resume a paused vm This will allow a previously paused vm to now be eligible for scheduling by the underlying hypervisor. +The command add tql \fI&r=vm&status=paused\fP + .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -1119,8 +1139,10 @@ No output coloration .SS start [\fIoptions\fP] \fI<tql>\fP Start a stopped vm + +The command add tql \fI&r=vm&status=stopped\fP .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -1153,8 +1175,10 @@ This coordinates with the domain OS to perform graceful stop, so there is no guarantee that it will succeed, and may take a variable length of time depending on what services must be shutdown in the domain +The command add tql \fI&r=vm&status=running\fP + .TP -\fBOptions:\fP +\fBOptions :\fP .TP \fB-h\fP, \fB--help\fP show this help message and exit @@ -1184,15 +1208,77 @@ No output coloration .TP \fB~/.config/cc-cli/profile\fP file where cli profile is stored + + \fBExample :\fP + # Options in this section is loaded is each others section + [DEFAULT] + hsize = 1000 + #debug = true + + # This section is loaded at start + [cli] + profile = lab + + [lab] + login = snoopy + pass = toto + server = 192.168.0.162 + + [prod] + login = snoopy + pass = titi + server = 14.8.25.32 .TP \fB~/.local/share/cc-cli/history\fP file where cli history are stored .TP \fB~/.local/share/cc-cli/expert\fP file where expert mode history are stored +.TP +\fB~/.config/cc-cli/tagdisplay\fP +file where tagdisplay options are stored + + \fBExample :\fP + [color] + a = lpurple + h = lred + pop = lyellow + mem* = lyellow + r = red + id = lblue + cpu = lyellow + con = cyan + + [titlecolor] + h = red + id = cyan + + [type] + uptime = second + con = second + disk* = si + sto* = si + mem* = bit + + [option] + quotespace = 1 + .TP \fB~/.config/cc-cli/alias\fP file where alias are stored + + \fBExample :\fP + [alias] + zzz = list r=cli&idle>300 + versions = list -t version + hv = list r=hv&con$cpu$mem$arch%id + vm = list r=vm&status=running$h$cpu$mem$arch%h + userrights = rights r=cli + lt = list -t &con%r%h$h$cpu$r$os$version$-con$mem + ls = list &con$h$cpu$r$os$version + w = list -l r=cli&con$os + host = list r=host&con$cpu$mem + .SH ENVIRONNEMENT .TP @@ -1208,6 +1294,20 @@ file where alias are stored .TP \fBCC_PROFILE\fP +.SH BUG +.TP +\fBpause\fP +.br +pause --print-tql r=vm&status=running&p=it-test-4 +.br +TQL: r=vm&status=running&p=it-test-4&r=vm&status=stopped +.br +le TQL devrait ressembler plus à : r=vm&status=running&p=it-test-4&r=vm&status!=stopped + +.TP +\fBexecute\fP +Quand il y a une erreur, il manque un retour à la ligne apres le None + .SH AUTHOR SmartJog IT diff --git a/debian/cc-cli.manpages b/debian/cc-cli.manpages new file mode 100644 index 0000000000000000000000000000000000000000..50b39ce9bf9f540cba7c8003827e718b7c9b6fd7 --- /dev/null +++ b/debian/cc-cli.manpages @@ -0,0 +1 @@ +debian/cc-cli.1