aboutsummaryrefslogtreecommitdiff
path: root/doc/eclat.1
blob: d2af06fbcb6b26218a3c688a0f8830e835e2eeb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
.\" This file is part of Eclat -*- nroff -*-
.\" Copyright (C) 2012 Sergey Poznyakoff
.\"
.\" Eclat is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 3, or (at your option)
.\" any later version.
.\"
.\" Eclat is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with Eclat.  If not, see <http://www.gnu.org/licenses/>.
.TH ECLAT 1 "October 11, 2012" "ECLAT" "Eclat User Reference"
.SH NAME
eclat \- EC2 Command Line Administrator Tool
.SH SYNOPSIS
.B eclat
[\fIOPTIONS\fR]
.B command
[\fIARGS\fR]
.SH DESCRIPTION
.B Eclat
is a tool that makes it possible to manage Amazon EC2 services from
the command line.  In contrast to the tools provided by Amazon itself,
.B Eclat
does not require tons of resource-consuming libraries (\fBJava
madness\fR), is very fast and efficient.
.PP
All administrative tasks are invoked through the single binary,
.BR eclat .
The task is identified by
.B command
given to it in the command line.  Options preceding the command
configure the general behavior of the tool itself.  Any options and
arguments following the command alter the behavior of that particular
command.
.PP
Upon invocation
.B eclat
reads its configuration file
.BR eclat.conf .
The default location of this file is determined when compiling the
package.  Normally it is
.BR /etc or /usr/local/etc .
This file provides the default configuration settings for the program,
such as the location of Amazon endpoints, default availability region,
etc.  See
.BR eclat.conf (5),
for a detailed description of its syntax.  By default this file is
preprocessed using
.BR m4 (1).
A set of command line options is provided to control this
feature (see subsection
.BR "Preprocessor control" ,
below).
.PP
Once the configuration file is read, the tool processes its command
line options.  These options, when present, modify the default
settings read from the configuration file.
.PP
Finally, the program uses its
.B command
argument to identify the action to be performed.  It then forms an
Amazon request using the rest arguments supplied to the command, and
sends it to the selected endpoint.
.PP
An \fBendpoint\fR is a URI of the Amazon server which is supposed to
handle the request.  It is selected according to availability region,
as set in the configuration file (the \fBdefault-region\fR statement),
or in the command line (the \fB\-\-region\fR option).  If neither of
these is set, the endpoint specified by the \fBdefault-endpoint\fR
configuration statement is used.
.PP
Upon completion of the action, Amazon sends back a
.BR response :
an XML document containing details about the result of the operation
performed.  This document is displayed using a special format, expressed
in eclat formatting language (\fBforlan\fR for short).  A set of
default formats for each request is shipped with the package.
.PP
The format to use for each particular request is selected using the
following algorithm.  If the \fB\-\-format-expression\fR option is
given, its argument is treated as a
.B forlan
text to use as a format.  Otherwise, if the \fB\-\-format-file\fR
option is supplied, the format to use is read from the file given as
an argument to that option.  Otherwise, if the \fB\-\-format\fR option
is used, the format is searched among the user-defined formats, using
the option argument as its name.  User-defined formats are declared in
the configuration file using the \fBdefine-format\fR statement.
.PP
If none of these options is given, the request
.B action name
is used to look up the default format to use.  A default format is
defined in the configuration file using the \fBformat\fR statement.
.PP
Finally, if the default format is not defined as well, the format is
read from the file specified by the \fBformat-file\fR configuration
file statement.
.PP
If
.B eclat
fails to select appropriate format using this procedure, it dumps the
contents of the response on the standard output using
.BR "path notation" ,
where each tag is identified by its name and the names of parent tags,
separated by dots.
.SH AUTHENTICATION
Requests are authenticated using a pair of strings: access-key and
secret-key.  Their function is similar to that of username/password in
traditional authentication schemes.  Both keys can be specified in the
command line, but such usage is insecure as the arguments can easily
be seen by other users (e.g. in the
.BR ps (1)
output).  The preferred way is to store them in a file protected by
appropriate permissions.  Each line in such a file (named for short
\fBaccess-file\fR) lists access-key and the corresponding secret-key,
separated by a colon.  Empty lines are ignored, as well as lines
starting with a \fB#\fR sign, except as immediately followed by a
colon.  In the latter case, such a line introduces a tag, which
can be used to identify this line.  The tag consists of all the
characters following the \fB#:\fR marker up to the first whitespace
character (newline being counted as a white space).
.PP
The access file is set up using the \fBaccess-file\fR configuration
file statement.  The argument to this statement is treated as a shell
globbing pattern: all files matching this pattern are attempted in
turn, until a keypair is identified, using the algorithm described
below.  If an access file cannot be opened due to insufficient
privileges, no error message is issued (unless the debugging level
\fBmain.1\fR or higher is requested).  This allows you to have different
access files for use by different groups of users.
.PP
If the \fB\-\-access\-key\fR option is used, its argument is the
access-key or tag to look for in the access file.  Otherwise,
.B eclat
selects the first available key pair.
.SH MAPS
Each amazon resource has a unique string associated with it, called
its
.BR identifier .
Identifiers provide a means for indicating the resource to operate
upon.  For example, the command
.sp
.nf
.in +2
eclat start i-1234beef 
.in
.fi
.sp
would start the instance \fIi-1234beef\fR.  It can be noted, that
identifiers are rather machine- than human-oriented.  If you
have a number of resources, it is not easy to remember which
identifier corresponds to which resource.  In the example above, one
would rather prefer to identify the instance to be started by its
functional name (say, "dbserver") or its DNS name, than by its ID.  To
make this possible,
.B eclat
provides a mapping feature.
.PP
A
.B map
is a kind of dictionary that can be used to translate
human-understandable resource names to their corresponding
identifiers.  Various backends can be used for storing the
data.
.B Eclat
is shipped with the support for the following storage mechanisms:
plaintext files, GDBM databases and LDAP databases.  The actual set of
supported backends depends on the compilation options.
.PP
The mapping  feature is enabled when the \fB\-\-translate\fR
(\fB\-x\fR) command line option is used.
.PP
Maps are defined in the configuration file and are assigned unique
names.  When running a command,
.B eclat
will by default select a map named by the resource in question.  For
example, when operating on an instance, the \fIInstanceId\fR map will
be used.
.PP
For commands that support the \fRresource-id\fB filter, identifiers
listed in that filter can be prefixed with the map name in order to
request their translation.  For example,
.sp
.nf
.in +2
eclat -x describe-tags resource-id=InstanceId:webserver
.in
.fi
.sp
will first translate the name "webserver" using the "InstanceId" map,
and then will replace the entier "InstanceId:webserver" construct with
the obtained identifier.  See also
.BR eclat-describe-tags (1).
.PP
The name of the map to use can also be supplied explicitly, using the
\fI\-\-map\fR (\fI\-M\fR) option.
.PP
For a detailed description of maps, see the section
.B MAPS
in
.BR eclat.conf (5).
.SH COMMANDS
To get a help on a particular command, refer to \fBeclat-\fIcommand\fR
(1), where \fIcommand\fR is the command name.  Currently the following
commands are implemented:
.BR associate-address ,
.BR create-tags ,
.BR delete-tags ,
.BR describe-addresses ,
.BR describe-instance-attribute ,
.BR describe-instance-status ,
.BR describe-instances ,
.BR describe-security-groups ,
.BR describe-tags ,
.BR describe-volumes ,
.BR disassociate-address ,
.BR get-console-output ,
.BR reboot-instances ,
.BR start-instances ,
.BR stop-instances .
.PP
Each command understands a \fB\-\-help\fR (\fB\-h\fR) command line
option which outputs a terse summary on using this particular command.
.PP
Any non-ambiguous abbreviation can be used in place of
.BR command .
Moreover, each segment (i.e. the sequence of characters delimited by
dashes), can be abbreviated independently.  For example, \fBd-t\fR matches
\fBdescribe-tags\fR, whereas \fBd-i\fR matches three command names:
\fBdescribe-instance-attribute\fR, \fBdescribe-instance-status\fR and
\fBdescribe-instances\fR.
.PP
If an ambiguous abbreviation is supplied,
.B eclat
will print a list of matching command names on the standard error and
exit with the code 64 (see the section \fBEXIT CODES\fR).
.PP
If you use
.BR bash (1),
you might consider using the command completion facility provided with
the package.  To do so, source the file
.B compl.sh
from your profile or bash startup file (either per-user or system-wide
one, at your option).  This file is installed (along with the format
files) in
.BR pkgdatadir .
For example, if your package is installed to the
.B /usr
prefix, include this line in your bash startup:
.sp
.nf
.in +2
 \. /usr/share/eclat/compl.sh
.in
.fi
.sp
With the completion facility enabled, hitting
.B TAB
after a partial command name will show you the list of possible
completions.  If there is only one completion, it will be used in
place of the partial name.
.SH OPTIONS
.SS Selecting program mode
.TP
\fB\-E\fR
Preprocess configuration and exit.
.TP
\fB\-c\fR, \fB\-\-config\-file\fR=\fIFILE\fR
Use \fIFILE\fR instead of the default configuration.
.TP
\fB\-\-match\-commands\fR, \fB-m\fR
Print matching command names and exit.  This option is intended for
use in completion facilities, such as Programmable Completion Builtins
in
.BR bash (1).
.TP
\fB\-\-test\-map\fR=\fIMAPNAME\fR
Test the translation map.  In this mode
.B eclat
treats arguments as symbolic names to be translated.  It attempts to
translate each name using the map \fIMAPNAME\fR and prints out
corresponding Amazon identifiers on the standard output.
.SS Configuration and Format Selection
.TP
\fB\-t\fR, \fB\-\-lint\fR
Parse configuration file and exit.
.TP
\fB\-F\fR, \fB\-\-format\-file\fR, \fB\-\-formfile\fR=\fIFILE\fR
Use \fIFILE\fR to format the output.
.TP
\fB\-H\fR, \fB\-\-format\fR=\fINAME\fR
Use the user-defined format \fINAME\fR for output.
.TP
\fB\-e\fR, \fB\-\-format\-expression\fR=\fIEXPR\fR
Format expression.
.SS Access credentials
.TP
\fB\-O\fR, \fB\-\-access\-key\fR=\fISTRING\fR
Set access key to use.
.TP
\fB\-W\fR, \fB\-\-secret\-key\fR=\fISTRING\fR
Set secret key to use.
.TP
\fB\-a\fR, \fB\-\-access\-file\fR=\fINAME\fR
Set access file.
.TP
\fB\-\-region\fR=\fINAME\fR
Set AWS region name.
.SS Modifiers
.TP
\fB\-s\fR, \fB\-\-sort\fR
Sort the returned XML teee prior to outputting it.
.TP
\fB\-\-ssl\fR
Use SSL (HTTPS) connection
.SS Mapping
.TP
\fB\-M\fR, \fB\-\-map\fR=\fIMAPNAME\fR
Use this map instead of the default one (implies \fB\-\-translate\fR).
.TP
\fB\-x\fR, \fB\-\-translate\fR
Translate symbolic names encountered in the command line to the
corresponding resource IDs.
.SS Preprocessor control
.TP
\fB\-D\fR, \fB\-\-define\fR=\fISYMBOL\fR[=\fIVALUE\fB]
Define a preprocessor symbol.
.TP
\fB\-I\fR, \fB\-\-include\-directory\fR=\fIDIR\fR
Add include directory.
.TP
\fB\-\-no\-preprocessor\fR
Disable preprocessing.
.TP
\fB\-\-preprocessor\fR=\fICOMMAND\fR
Use \fICOMMAND\fR instead of the default preprocessor.
.SS Debugging
.TP
\fB\-n\fR, \fB\-\-dry\-run\fR
Do nothing, print almost everything.
.TP
\fB\-d\fR, \fB\-\-debug\fR=\fICAT\fR[.\fILEVEL\fR]
Set debugging level.
.TP
\fB\-\-dump\-grammar\-trace\fR
Dump configuration grammar traces.
.TP
\fB\-\-dump\-lex\-trace\fR
Dump lexical analyzer traces.
.SS Help and additional information
.TP
\fB\-\-config\-help
Show configuration file summary.
.TP
\fB\-V\fR, \fB\-\-version\fR
Print program version.
.TP
\fB\-h\fR, \fB\-\-help\fR
Give a concise help summary.
.TP
\fB\-\-usage\fR
Give a short usage message.
.SH "EXIT CODES"
The
.B eclat
utility indicates the success or failure of the operation by issuing a
diagnostic message and returning exit code to the shell.  The following
exit codes are used:
.TP
.BR 0 " (" EX_OK ")"
Success.
.TP
.BR 70 " (" EX_SOFTWARE ")"
Internal software error occurred.
.TP
.BR 64 " (" EX_USAGE ")"
Command line usage error, e.g. an unrecognized option has been
encountered, the command given does not correspond to any of the
known commands, or the like.
.TP
.BR 69 " (" EX_UNAVAILABLE ")"
Something went wrong.  This is a catch-all error code, used when no
other exit code is deemed suitable.
.TP
.BR 72 " (" EX_OSFILE ")"
Cannot open configuration or format file.
.TP
.BR 77 " (" EX_NOPERM ")"
Permission denied.  This code usually indicates that the configuration
file cannot be opened because of insufficient permissions.
.TP
.BR 78 " (" EX_CONFIG ")"
Error in the configuration file.
.PP
Another exit code means it has been set as a result of the
.B exit()
call in the format file.
.SH EXAMPLE
.SH "SEE ALSO"
.BR eclat.conf (5),
.BR forlan (5).
For a detailed description of a particular \fIcommand\fR, see
\fBeclat-\fIcommand\fR (1).
.SH AUTHORS
Sergey Poznyakoff
.SH "BUG REPORTS"
Report bugs to <bug-eclat@gnu.org.ua>.
.SH COPYRIGHT
Copyright \(co 2012 Sergey Poznyakoff
.br
.na
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
.br
.ad
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.\" Local variables:
.\" eval: (add-hook 'write-file-hooks 'time-stamp)
.\" time-stamp-start: ".TH [A-Z_][A-Z0-9_]* [0-9] \""
.\" time-stamp-format: "%:B %:d, %:y"
.\" time-stamp-end: "\""
.\" time-stamp-line-limit: 20
.\" end:

Return to:

Send suggestions and report system problems to the System administrator.