diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-10-02 22:41:18 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-10-02 22:42:55 +0300 |
commit | 288f5042062637a38710142594bdbe3b8d68fb27 (patch) | |
tree | 2e94c150240eb4aed3d9ebf3f9e8a22b5c0b3c46 | |
parent | 29c6d23356f9134d19b849be55e0a81c5a14fe35 (diff) | |
download | eclat-288f5042062637a38710142594bdbe3b8d68fb27.tar.gz eclat-288f5042062637a38710142594bdbe3b8d68fb27.tar.bz2 |
Implement delete-tags and create-tags.
-rw-r--r-- | README | 9 | ||||
-rw-r--r-- | TODO | 4 | ||||
-rw-r--r-- | doc/eclat.1 | 5 | ||||
-rw-r--r-- | etc/Makefile.am | 4 | ||||
-rw-r--r-- | etc/create-tags.fln | 22 | ||||
-rw-r--r-- | etc/delete-tags.fln | 22 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/eclat.c | 4 | ||||
-rw-r--r-- | src/eclat.h | 2 |
9 files changed, 69 insertions, 5 deletions
@@ -10,6 +10,15 @@ not require resource-consuming libraries. It is written in plain C, depends only on libraries which are always installed on any decent system, and has a tiny memory footprint. +* Actions + +So far only a small fraction of EC2 actions is implemented. The set +of actions is somewhat arbitrary and reflects my needs. See the file +TODO for the detailed list of actions and their states. I will be +adding new actions as the need arises and my time permits. If you +are interested in particular action, drop me a note and I ill try +to implement it. + * Documentation Several man pages are ready. Most are to be written yet. @@ -42,7 +42,7 @@ CreateSecurityGroup CRESECGRP [ ] [ ] CreateSnapshot CRESNAP [ ] [ ] CreateSpotDatafeedSubscription CRESPOTDFSSCR [ ] [ ] CreateSubnet CRESUB [ ] [ ] -CreateTags CRETAGS [ ] [ ] +CreateTags CRETAGS [X] [ ] CreateVolume CREVOL [ ] [ ] CreateVpc CREVPC [ ] [ ] CreateVpnConnection CREVPNCNCT [ ] [ ] @@ -62,7 +62,7 @@ DeleteSecurityGroup DELSECGRP [ ] [ ] DeleteSnapshot DELSNAP [ ] [ ] DeleteSpotDatafeedSubscription DELSPOTDFSSCR [ ] [ ] DeleteSubnet DELSUB [ ] [ ] -DeleteTags DELTAGS [ ] [ ] +DeleteTags DELTAGS [X] [ ] DeleteVolume DELVOL [ ] [ ] DeleteVpc DELVPC [ ] [ ] DeleteVpnConnection DELVPNCNCT [ ] [ ] diff --git a/doc/eclat.1 b/doc/eclat.1 index b346306..22a918f 100644 --- a/doc/eclat.1 +++ b/doc/eclat.1 @@ -161,8 +161,9 @@ 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 two command names: -\fBdescribe-instance-status\fR and \fBdescribe-instances\fR. +\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 diff --git a/etc/Makefile.am b/etc/Makefile.am index 8c4ff75..514993c 100644 --- a/etc/Makefile.am +++ b/etc/Makefile.am @@ -18,13 +18,15 @@ noinst_PROGRAMS = flncat FLNFILES=\ associate-address.fln\ - disassociate-address.fln\ + create-tags.fln\ + delete-tags.fln\ describe-addresses.fln\ describe-instance-attribute.fln\ describe-instance-status.fln\ describe-instances.fln\ describe-tags.fln\ describe-volumes.fln\ + disassociate-address.fln\ get-console-output.fln\ reboot-instances.fln\ start-instances.fln\ diff --git a/etc/create-tags.fln b/etc/create-tags.fln new file mode 100644 index 0000000..5605daf --- /dev/null +++ b/etc/create-tags.fln @@ -0,0 +1,22 @@ +/* This file is part of Eclat. + 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/>. */ + +if (.CreateTagsResponse.return) { + if (!.CreateTagsResponse.return[true]) { + error("Return: ",.CreateTagsResponse.return,"\n"); + exit(1); + } +} diff --git a/etc/delete-tags.fln b/etc/delete-tags.fln new file mode 100644 index 0000000..7a2c757 --- /dev/null +++ b/etc/delete-tags.fln @@ -0,0 +1,22 @@ +/* This file is part of Eclat. + 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/>. */ + +if (.DeleteTagsResponse.return) { + if (!.DeleteTagsResponse.return[true]) { + error("Return: ",.DeleteTagsResponse.return,"\n"); + exit(1); + } +} diff --git a/src/Makefile.am b/src/Makefile.am index 6ee37ef..de1c17b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,6 +21,8 @@ eclat_SOURCES=\ asscaddr.c\ cmdline.h\ config.c\ + cretags.c\ + deltags.c\ disassaddr.c\ dscraddrs.c\ dscrtags.c\ diff --git a/src/eclat.c b/src/eclat.c index 17a361c..2b0047e 100644 --- a/src/eclat.c +++ b/src/eclat.c @@ -239,6 +239,10 @@ struct command cmdtab[] = { eclat_associate_address }, { "disassociate-address", "DisassociateAddress", eclat_disassociate_address }, + { "create-tags", "CreateTags", + eclat_create_tags }, + { "delete-tags", "DeleteTags", + eclat_delete_tags }, { "get-console-output", "GetConsoleOutput", eclat_get_console_output } }; diff --git a/src/eclat.h b/src/eclat.h index 8c3b5f0..8d488f9 100644 --- a/src/eclat.h +++ b/src/eclat.h @@ -69,6 +69,8 @@ int eclat_describe_addresses(CURL *curl, int argc, char **argv); int eclat_describe_volumes(CURL *curl, int argc, char **argv); int eclat_get_console_output(CURL *curl, int argc, char **argv); int eclat_describe_instance_attribute(CURL *curl, int argc, char **argv); +int eclat_create_tags(CURL *curl, int argc, char **argv); +int eclat_delete_tags(CURL *curl, int argc, char **argv); char *region_to_endpoint(const char *region); |