aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-12-07 14:57:32 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2012-12-07 15:16:14 +0200
commit5a7b73860974384d8e00065105435403b0842ab0 (patch)
tree3f029c22f0a29a842002279bb4b5561af61a8aa8 /doc
parentc12cd5695cf1a6c2c44100a68762ab66356f43b8 (diff)
downloadeclat-5a7b73860974384d8e00065105435403b0842ab0.tar.gz
eclat-5a7b73860974384d8e00065105435403b0842ab0.tar.bz2
Re-implement confirmation support.
* doc/eclat-delete-volume.1: Update. * doc/eclat-release-address.1: Update. * doc/eclat.1: Update. * doc/eclat.conf.5: New section "CONFIRMATION" * lib/getyn.c (eclat_vgetyn): Negative default stands for no default at all. * lib/confirm.c (eclat_confirm_mode): Remove. (eclat_confirm): Change signature. Act according to the first argument. * lib/libeclat.h (eclat_confirm_mode): New enum. (eclat_confirm): Change signature. * src/cmdline.opt: Change handling of -Y and -N options. * src/config.c: New statement "confirm". * src/cretags.c: Remove call to eclat_confirm. This is done by the caller. * src/delvol.c: Likewise. * src/reladdr.c: Likewise. * src/eclat.c (confirm_mode): New variable. (command) <flags>: New member. (cmdtab): Mark commands with appropriate flags. (main): Call eclat_confirm to confirm the command. * src/eclat.h (confirm_mode): New extern. (set_command_confirmation): New proto. * etc/eclat.cfin: Set a reasonably safe confirmation default. * lib/forlan.c (strtots): Remove unused variable.
Diffstat (limited to 'doc')
-rw-r--r--doc/eclat-delete-volume.114
-rw-r--r--doc/eclat-release-address.115
-rw-r--r--doc/eclat.134
-rw-r--r--doc/eclat.conf.588
4 files changed, 110 insertions, 41 deletions
diff --git a/doc/eclat-delete-volume.1 b/doc/eclat-delete-volume.1
index a9d7489..f467d91 100644
--- a/doc/eclat-delete-volume.1
+++ b/doc/eclat-delete-volume.1
@@ -29,20 +29,6 @@ in
.BR eclat (1)),
this command treats the \fBVOL\-ID\fR as volume names and translates
it to the AWS IDs using the \fBVolumeId\fR map.
-.PP
-Since this operation is destructive and may result in a loss of data
-if used carelessly,
-.B eclat
-will ask you for confirmation before actually deleting the volume.
-You can disable this feature by using the \fB\-Y\fR (\fB\-\-yes\fR)
-eclat option, e.g.:
-.nf
-.sp 2
-$ \fBeclat -Y delete-volume vol-d1234aef
-.fi
-.PP
-The use of one of this option is mandatory if this command is invoked
-from a shell script.
.SH "SEE ALSO"
.BR eclat (1),
.BR eclat\-create\-volume (1),
diff --git a/doc/eclat-release-address.1 b/doc/eclat-release-address.1
index 9ecefa5..b34b113 100644
--- a/doc/eclat-release-address.1
+++ b/doc/eclat-release-address.1
@@ -21,17 +21,10 @@ eclat release\-address [\fB\-\-vpc\fR] [\fB\-v\fR] IP\-OR\-ALLOCID
eclat release\-address \fB\-\-help\fR
.SH DESCRIPTION
-This command releases IP address. This is a destructive operation,
-beacause normally the released IP address cannot be recovered for your
-account. Therefore, before actually doing this,
-.B eclat
-will ask you for confirmation interactively. You can disable this by
-using the \fB\-Y\fR (\fB\-\-yes\fR) or \fB\-N\fR (\fB\-\-no\fR)
-option, for positive and negative answer, correspondingly.
-.PP
-The use of one of this options is mandatory if
-.B eclat
-is started from a shell script.
+This command releases an Elastic IP address. The address must have been
+previously allocated using the
+.B allocate-address
+command.
.SH OPTIONS
.TP
\fB\-v\fR, \fB\-\-vpc\fR
diff --git a/doc/eclat.1 b/doc/eclat.1
index 3b8a9ed..9fdabd0 100644
--- a/doc/eclat.1
+++ b/doc/eclat.1
@@ -13,7 +13,7 @@
.\"
.\" 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 "December 6, 2012" "ECLAT" "Eclat User Reference"
+.TH ECLAT 1 "December 7, 2012" "ECLAT" "Eclat User Reference"
.SH NAME
eclat \- EC2 Command Line Administrator Tool
.SH SYNOPSIS
@@ -322,13 +322,15 @@ Set AWS region name.
.SS Modifiers
.TP
\fB\-N\fR, \fB\-\-no\fR
-Some potentially dangerous and unrecoverable operations (such as
-.BR release-address )
-require confirmation. If started from the command line,
-.B eclat
-will ask for confirmation interactively. This option disables this
-behavior and instructs the program to assume negative answer to all
-confirmations. See also \fB\-Y\fR option below.
+.B Eclat
+can be configured to ask for confirmation before running
+a potentially dangerous and unrecoverable operation (see the
+section
+.B CONFIRMATION
+in
+.BR eclat.conf (5)).
+This option overrides this setting, assuming negative answer.
+See also \fB\-Y\fR option below.
.TP
\fB\-s\fR, \fB\-\-sort\fR
Sort the returned XML teee prior to outputting it.
@@ -337,13 +339,15 @@ Sort the returned XML teee prior to outputting it.
Use SSL (HTTPS) connection
.TP
\fB\-Y\fR, \fB\-\-yes\fR
-Some potentially dangerous and unrecoverable operations (such as
-.BR release-address )
-require confirmation. If started from the command line,
-.B eclat
-will ask for confirmation interactively. This option disables this
-behavior and instructs the program to assume positive answer to all
-confirmations. See also \fB\-N\fR option above.
+.B Eclat
+can be configured to ask for confirmation before running
+a potentially dangerous and unrecoverable operation (see the
+section
+.B CONFIRMATION
+in
+.BR eclat.conf (5)).
+This option overrides this setting, assuming positive answer.
+See also \fB\-N\fR option above.
.SS Mapping
.TP
\fB\-M\fR, \fB\-\-map\fR=\fIMAPNAME\fR
diff --git a/doc/eclat.conf.5 b/doc/eclat.conf.5
index 2a14e2e..d7599b7 100644
--- a/doc/eclat.conf.5
+++ b/doc/eclat.conf.5
@@ -13,7 +13,7 @@
.\"
.\" 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.CONF 5 "October 16, 2012" "ECLAT" "Eclat User Reference"
+.TH ECLAT.CONF 5 "December 7, 2012" "ECLAT" "Eclat User Reference"
.SH NAME
eclat.conf \- configuration file for
.BR eclat (1).
@@ -533,6 +533,92 @@ expansion.
.IP \n+[step].
If the format cannot determined by the above steps, an error is reported
and the program terminates.
+.SH CONFIRMATION
+Many
+.B eclat
+commands result in modification of your EC2 resources. Some of them
+are destructive, in the sense that such modifications cannot be undone
+(e.g. deleting of a volume or termination of an instance). To reduce
+the possibility of careless usage,
+.B eclat
+can be configured to interactively ask for a confirmation when such a
+command is requested. This is configured by the
+.B confirm
+statement:
+.PP
+.nf
+.in +2
+\fBconfirm\fR \fImode\fR \fBcommand\fR;
+\fBconfirm\fR \fImode\fR (\fBcommand\fR[, \fBcommand\fR...]);
+\fBconfirm\fR \fImode\fR \fIclass\fR;
+.fi
+.PP
+The \fImode\fR argument specifies the requested confirmation mode.
+Its valid values are:
+.TP
+.B tty
+Ask for confirmation if the controlling terminal is a tty, i.e. if
+.B eclat
+is started from the command line.
+.TP
+.B always
+Always ask for confirmation. If the controlling terminal is not a
+tty, abort the command.
+.TP
+.B positive
+Never ask. Assume positive confirmation. This is the default.
+.TP
+.B negative
+Never ask, assuming negative confirmation.
+.PP
+The second argument specifies the commands to which this mode is
+applied. It can be a single command name or tag, a comma-separated
+list of command names or tags, or a \fBclass\fR of commands. Valid
+values for \fIclass\fR are:
+.TP
+.B all
+All commands that modify EC2 resources.
+.TP
+.B destructive
+Commands that destructively modify resources.
+.PP
+Consider the following example:
+.PP
+.nf
+.in +2
+confirm tty destructive;
+confirm tty (StopInstance, StartInstance);
+.fi
+.PP
+It instructs
+.B eclat
+to ask for confirmation if one of the destructive commands is
+requested, or if the command is start-instance or stop-instance.
+.PP
+Here is an example of how this modifies the behavior of
+.B release-address
+command:
+.PP
+.nf
+.if +2
+$ \fBeclat release-address 192.168.0.1\fR
+Proceed with release-address [Y/n] _
+.fi
+.PP
+If the response begins with \fBY\fR (case-insensitive), it is taken
+for a positive answer, and the command will be executed. Otherwise,
+.B eclat
+exits returning code 16 to the shell.
+.PP
+The current confirmation setting can be overridden using the \fB\-Y\fR
+(\fB\-\-yes\fR) or \fB\-N\fR (\fB\-\-no\fR) command line option. The
+former forces \fBpositive\fN and the latter \fBnegative\fR
+confirmation mode for the requested command, e.g.:
+.PP
+.nf
+.in +2
+$ \fBeclat -Y delete-volume vol-d1234aef\fR
+.fi
.SH MAPS
Maps provide a way to translate arbitrary symbolic names to the Amazon
resource identifiers. See the section

Return to:

Send suggestions and report system problems to the System administrator.