Skip to content
cc-cli.1 25.3 KiB
Newer Older
.TH CC-CLI "MARCH 2011" LINUX "USER MAN"
gaetan deleaz's avatar
gaetan deleaz committed
.SH NAME
cc-cli - Command Line Interface to CloudControl
.SH SYNOPSIS
\fBcc-cli\fP [\fIOPTION\fP] [\fICOMMANDS\fP]

.SH DESCRIPTION
.TP
\fB--version\fP
show program's version number and exit
gaetan deleaz's avatar
gaetan deleaz committed
\fB-h\fP, \fB--help\fP
show this help message and exit
.TP
\fB-d\fP, \fB--debug\fP
Debug mode
.TP
\fB-D\fP, \fB--no-debug\fP
Unset debug mode
.TP
\fB-L\fP \fILOGIN\fP, \fB--login=\fP\fILOGIN\fP
Server login
.TP
\fB-H\fP \fISERVER\fP, \fB--hostname=\fP\fISERVER\fP
Server hostname
.TP
\fB-P\fP \fIPORT\fP, \fB--port=\fP\fIPORT\fP
Server port
.TP
\fB-t\fP \fITIMEOUT\fP, \fB--timeout=\fP\fITIMEOUT\fP
Connection timeout
.TP
\fB-p\fP \fIPROFILE\fP, \fB--profile=\fP\fIPROFILE\fP
Profile name
.TP
\fB-l\fP, \fB--list-profile\fP
List available profile
.TP
\fB--history-file=\fP\fIHISTORY\fP
History file
.TP
\fB--history-size=\fP\fIHSIZE\fP
History max entry count

.SS Loading procedure:
Configuration is loaded in this order:
.br
gaetan deleaz's avatar
gaetan deleaz committed
1 - Check \fBCC_DEBUG\fP, to set early debugging mode
gaetan deleaz's avatar
gaetan deleaz committed
.br
gaetan deleaz's avatar
gaetan deleaz committed
2 - load [cli] profile from \fB~/.config/cc-cli/profile\fP
gaetan deleaz's avatar
gaetan deleaz committed
.br
gaetan deleaz's avatar
gaetan deleaz committed
3 - load profile specified by option profile (arg line, env, cli profile)
gaetan deleaz's avatar
gaetan deleaz committed
.br
gaetan deleaz's avatar
gaetan deleaz committed
4 - load options from environment
gaetan deleaz's avatar
gaetan deleaz committed
.br
gaetan deleaz's avatar
gaetan deleaz committed
5 - load options from command line
gaetan deleaz's avatar
gaetan deleaz committed

.SH TQL
TQL (text query language)
.br
- TQL build a list of objects in one query
.br
- An object is a list of tags
.br
- TQL can select and sort object by tags
.br
- TQL can choose tags in object
.br
- TQL can limit number of objects to select
.br
- TQL is a list statement mixed by separators
.br
- TQL build his object list from left to right (left parenthesis)
.br
- Each statement update the builded list regarding his separators
.br
- Selecting, sorting and showing separators are followed by tags
.br
- Limiting separators are followed by limiting conditions
.br
- TQL always return id tag
.br
- By default separators is &
.br
- By default object list is sorted id
.br

.SS SEPERATORS
\fB&\fP selection intersection
.br
\fB|\fP selection union
.br
\fB^\fP selection limit
.br
\fB$\fP tag showing
.br
\fB%\fP tag sorting

.SS OPERATORS
\fB=\fP strict equality
.br
\fB:\fP globing matching (no case)
.br
\fB~\fP regex matching
.br
\fB>\fP superior strict
.br
\fB>=\fP superior
.br
gaetan deleaz's avatar
gaetan deleaz committed
\fB<\fP inferior strict
gaetan deleaz's avatar
gaetan deleaz committed
.br
\fB<=\fP inferior
gaetan deleaz's avatar
gaetan deleaz committed
.br
Each previous operators can be negated by adding \fB!\fP before it.

.SS LIMITING CONDITIONS
\fBn\fP limit to n first objects
.br
gaetan deleaz's avatar
gaetan deleaz committed
\fB,n\fP limit from n object to last object
gaetan deleaz's avatar
gaetan deleaz committed

.SS NUMBER FACILITY
gaetan deleaz's avatar
gaetan deleaz committed
.br
\fB1ki\fP = 1 024
gaetan deleaz's avatar
gaetan deleaz committed
.br
\fB1m\fP = 1 000 ^ 2
gaetan deleaz's avatar
gaetan deleaz committed
.br
\fB1mi\fP = 1 024 ^ 2
gaetan deleaz's avatar
gaetan deleaz committed
.br
\fB1g\fP = 1 000 ^ 3
gaetan deleaz's avatar
gaetan deleaz committed
.br
\fB1gi\fP = 1 024 ^ 3
gaetan deleaz's avatar
gaetan deleaz committed

.SS EXAMPLE
For examples, See the command \fBlist\fP
gaetan deleaz's avatar
gaetan deleaz committed

.SH GENERIC COMMANDS

.SS addaccount [\fIoptions\fP] \fI<account-name> <role>\fP [\fIpassword\fP]
Create an account
.TP
gaetan deleaz's avatar
gaetan deleaz committed
.TP
  \fB-h\fP, \fB-help\fP
show this help message and exit
.TP
  \fB-q\fP, \fB--quiet\fP
Don't status of call request
.TP
  \fB-i\fP, \fB--index\fP
Print TQL line index
.TP
  \fB--print-tql\fP
Print TQL before sending to server
.TP
  \fB--no-tagdisplay\fP
No tagdisplay custom display
.TP
  \fB--no-color\fP
No output coloration
.TP
gaetan deleaz's avatar
gaetan deleaz committed
.TP
  \fBaddacount toto cli azerty\fP
Create account toto in role cli (user) whith password azerty

.SS addright [\fIoptions\fP] \fI<account tql> <right tql> <method> <target>\fP [\fIindex\fP]
Add or edit account right
.br
All is deny by default
.br
gaetan deleaz's avatar
gaetan deleaz committed
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
gaetan deleaz's avatar
gaetan deleaz committed
.TP
gaetan deleaz's avatar
gaetan deleaz committed
\fB[0] tql: method:* target:allow\fP
.br
\fB[1] tql: method:list target:deny\fP
.br
  if the user tape the command \fBlist\fP whith any tql, the command will be allowed because it matches with index 0

\fB[0] tql: method:list target:deny\fP
.br
\fB[1] tql: method:* target:allow\fP
.br
  if the user tape the command \fBlist\fP whith any tql, the command will be denied because it matches with index 0

.TP
\fI<method>\fP
is the name of the rpc command to allow
.TP
\fI<target>\fP
can be allow or deny
.TP
gaetan deleaz's avatar
gaetan deleaz committed
.TP
  \fB-h\fP, \fB--help\fP
show this help message and exit
.TP
  \fB-r\fP, \fB--raw\fP
Don't append security filter to TQL
Loading full blame...