aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-12-19 22:54:20 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2013-12-19 23:03:45 +0200
commit8d43103165e7e2f16c10d0592e5a51d86dac01ed (patch)
treec479c34f16e8a1d989fb95af462e47c318565cd8
parent2a69cacdfe3f43c61c65ea4359c821236b7f141c (diff)
downloadeclat-8d43103165e7e2f16c10d0592e5a51d86dac01ed.tar.gz
eclat-8d43103165e7e2f16c10d0592e5a51d86dac01ed.tar.bz2
Implement security group creation and deletion.
* doc/eclat-lssg.1: New file. * doc/eclat-sg.1: New file. * doc/Makefile.inc: Add new files. * etc/create-security-group.fln: New file. * etc/delete-security-group.fln: New file. * etc/Makefile.am: Add new files. * src/mksg-cl.opt: New file. * src/mksg.c: New file. * src/rmsg-cl.opt: New file. * src/rmsg.c: New file. * src/sg.h: New file. * src/Makefile.am: Add new files. * src/eclat.c (cmdtab): New commands "mksg" and "rmsg". * src/eclat.h (eclat_create_security_group) (eclat_delete_security_group): New protos. * src/lssg.c: Include sg.h. Use groupkw instead of the static rt[], which is removed. * src/sg-cl.opt: Use groupkw * src/sg.c (groupkw): New global. * TODO: Update.
-rw-r--r--TODO4
-rw-r--r--doc/Makefile.inc38
-rw-r--r--doc/eclat-lssg.18
-rw-r--r--doc/eclat-sg.16
-rw-r--r--etc/Makefile.am2
-rw-r--r--etc/create-security-group.fln23
-rw-r--r--etc/delete-security-group.fln22
-rw-r--r--src/Makefile.am5
-rw-r--r--src/eclat.c4
-rw-r--r--src/eclat.h6
-rw-r--r--src/lssg.c12
-rw-r--r--src/mksg-cl.opt34
-rw-r--r--src/mksg.c38
-rw-r--r--src/rmsg-cl.opt35
-rw-r--r--src/rmsg.c36
-rw-r--r--src/sg-cl.opt10
-rw-r--r--src/sg.c11
-rw-r--r--src/sg.h9
18 files changed, 256 insertions, 47 deletions
diff --git a/TODO b/TODO
index c8182b6..bd7ec6a 100644
--- a/TODO
+++ b/TODO
@@ -41,7 +41,7 @@ CreatePlacementGroup - [ ] [ ]
41CreateReservedInstancesListing - [ ] [ ] 41CreateReservedInstancesListing - [ ] [ ]
42CreateRoute - [ ] [ ] 42CreateRoute - [ ] [ ]
43CreateRouteTable - [ ] [ ] 43CreateRouteTable - [ ] [ ]
44CreateSecurityGroup - [ ] [ ] 44CreateSecurityGroup mksg [X] [X]
45CreateSnapshot mksnap [X] [X] 45CreateSnapshot mksnap [X] [X]
46CreateSpotDatafeedSubscription - [ ] [ ] 46CreateSpotDatafeedSubscription - [ ] [ ]
47CreateSubnet - [ ] [ ] 47CreateSubnet - [ ] [ ]
@@ -61,7 +61,7 @@ DeleteNetworkInterface - [ ] [ ]
61DeletePlacementGroup - [ ] [ ] 61DeletePlacementGroup - [ ] [ ]
62DeleteRoute - [ ] [ ] 62DeleteRoute - [ ] [ ]
63DeleteRouteTable - [ ] [ ] 63DeleteRouteTable - [ ] [ ]
64DeleteSecurityGroup - [ ] [ ] 64DeleteSecurityGroup rmsg [X] [X]
65DeleteSnapshot rmsnap [X] [X] 65DeleteSnapshot rmsnap [X] [X]
66DeleteSpotDatafeedSubscription - [ ] [ ] 66DeleteSpotDatafeedSubscription - [ ] [ ]
67DeleteSubnet - [ ] [ ] 67DeleteSubnet - [ ] [ ]
diff --git a/doc/Makefile.inc b/doc/Makefile.inc
index 4c10f82..0fa843f 100644
--- a/doc/Makefile.inc
+++ b/doc/Makefile.inc
@@ -20,42 +20,44 @@
20 20
21MANPAGES1=\ 21MANPAGES1=\
22 eclat.1\ 22 eclat.1\
23 eclat-mkaddr.1\
24 eclat-assocaddr.1\ 23 eclat-assocaddr.1\
25 eclat-atvol.1\ 24 eclat-atvol.1\
26 eclat-clrsattr.1\ 25 eclat-clrsattr.1\
26 eclat-conmesg.1\
27 eclat-cpimg.1\ 27 eclat-cpimg.1\
28 eclat-cpsnap.1\ 28 eclat-cpsnap.1\
29 eclat-mkinst.1\
30 eclat-mkimg.1\
31 eclat-mksnap.1\
32 eclat-mktag.1\
33 eclat-mkvol.1\
34 eclat-rmsnap.1\
35 eclat-rmtag.1\
36 eclat-deimg.1\ 29 eclat-deimg.1\
30 eclat-devol.1\
31 eclat-disasaddr.1\
37 eclat-lsaddr.1\ 32 eclat-lsaddr.1\
38 eclat-lszon.1\
39 eclat-lsimg.1\
40 eclat-lsiattr.1\ 33 eclat-lsiattr.1\
41 eclat-lsistat.1\ 34 eclat-lsimg.1\
42 eclat-lsinst.1\ 35 eclat-lsinst.1\
36 eclat-lsistat.1\
43 eclat-lsreg.1\ 37 eclat-lsreg.1\
44 eclat-lssg.1\
45 eclat-lssattr.1\ 38 eclat-lssattr.1\
39 eclat-lssg.1\
46 eclat-lssnap.1\ 40 eclat-lssnap.1\
47 eclat-lstag.1\ 41 eclat-lstag.1\
48 eclat-lsvol.1\ 42 eclat-lsvol.1\
49 eclat-devol.1\ 43 eclat-lszon.1\
50 eclat-disasaddr.1\ 44 eclat-mkaddr.1\
45 eclat-mkimg.1\
46 eclat-mkinst.1\
47 eclat-mksg.1\
48 eclat-mksnap.1\
49 eclat-mktag.1\
50 eclat-mkvol.1\
51 eclat-reboot.1\
52 eclat-rmaddr.1\
53 eclat-rmsg.1\
54 eclat-rmsnap.1\
55 eclat-rmtag.1\
51 eclat-setiattr.1\ 56 eclat-setiattr.1\
52 eclat-setsattr.1\ 57 eclat-setsattr.1\
53 eclat-sg.1\ 58 eclat-sg.1\
54 eclat-conmesg.1\
55 eclat-start.1\ 59 eclat-start.1\
56 eclat-stop.1\ 60 eclat-stop.1
57 eclat-reboot.1\
58 eclat-rmaddr.1
59 61
60MANPAGES5=\ 62MANPAGES5=\
61 eclat.conf.5 63 eclat.conf.5
diff --git a/doc/eclat-lssg.1 b/doc/eclat-lssg.1
index 69c31c9..50ce425 100644
--- a/doc/eclat-lssg.1
+++ b/doc/eclat-lssg.1
@@ -13,13 +13,13 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Eclat. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Eclat. If not, see <http://www.gnu.org/licenses/>.
16.TH LSSEC 1 "December 16, 2013" "ECLAT" "Eclat User Reference" 16.TH LSSEC 1 "December 19, 2013" "ECLAT" "Eclat User Reference"
17.SH NAME 17.SH NAME
18eclat lssg, describe\-security\-groups \- return information about security groups 18eclat lssg, describe\-security\-groups \- return information about security groups
19.SH SYNOPSIS 19.SH SYNOPSIS
20\fBeclat lssg\fR [\fB\-n\fR] [\fB\-\-name\fR]\ 20\fBeclat lssg\fR [\fB\-n\fR] [\fB\-\-name\fR]\
21 [\fIFILTER\fR...] [\fIID\fR] 21 [\fIFILTER\fR...] [\fIID\fR]
22 22.br
23\fBeclat lssg\fR \fB\-\-help\fR 23\fBeclat lssg\fR \fB\-\-help\fR
24.SH DESCRIPTION 24.SH DESCRIPTION
25This command returns information about security groups. By default, 25This command returns information about security groups. By default,
@@ -109,7 +109,9 @@ Outgoing:
109.EE 109.EE
110.SH "SEE ALSO" 110.SH "SEE ALSO"
111.BR eclat (1), 111.BR eclat (1),
112.BR eclat\-sg (1). 112.BR eclat\-sg (1),
113.BR eclat\-mksg (1),
114.BR eclat\-rmsg (1).
113.SH AUTHORS 115.SH AUTHORS
114Sergey Poznyakoff 116Sergey Poznyakoff
115.SH "BUG REPORTS" 117.SH "BUG REPORTS"
diff --git a/doc/eclat-sg.1 b/doc/eclat-sg.1
index 6e9e708..7dcac0f 100644
--- a/doc/eclat-sg.1
+++ b/doc/eclat-sg.1
@@ -13,7 +13,7 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Eclat. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Eclat. If not, see <http://www.gnu.org/licenses/>.
16.TH SG 1 "December 17, 2013" "ECLAT" "Eclat User Reference" 16.TH SG 1 "December 19, 2013" "ECLAT" "Eclat User Reference"
17.SH NAME 17.SH NAME
18eclat sg \- manipulate security groups 18eclat sg \- manipulate security groups
19.SH SYNOPSIS 19.SH SYNOPSIS
@@ -130,7 +130,9 @@ Give a terse help summary.
130List command line syntax and available options. 130List command line syntax and available options.
131.SH "SEE ALSO" 131.SH "SEE ALSO"
132.BR eclat (1), 132.BR eclat (1),
133.BR eclat\-lssg (1). 133.BR eclat\-lssg (1),
134.BR eclat\-mksg (1),
135.BR eclat\-rmsg (1).
134.SH AUTHORS 136.SH AUTHORS
135Sergey Poznyakoff 137Sergey Poznyakoff
136.SH "BUG REPORTS" 138.SH "BUG REPORTS"
diff --git a/etc/Makefile.am b/etc/Makefile.am
index caa780c..c62369b 100644
--- a/etc/Makefile.am
+++ b/etc/Makefile.am
@@ -23,9 +23,11 @@ FLNFILES=\
23 copy-image.fln\ 23 copy-image.fln\
24 copy-snapshot.fln\ 24 copy-snapshot.fln\
25 create-image.fln\ 25 create-image.fln\
26 create-security-group.fln\
26 create-snapshot.fln\ 27 create-snapshot.fln\
27 create-tags.fln\ 28 create-tags.fln\
28 create-volume.fln\ 29 create-volume.fln\
30 delete-security-group.fln\
29 delete-snapshot.fln\ 31 delete-snapshot.fln\
30 delete-tags.fln\ 32 delete-tags.fln\
31 delete-volume.fln\ 33 delete-volume.fln\
diff --git a/etc/create-security-group.fln b/etc/create-security-group.fln
new file mode 100644
index 0000000..06d021d
--- /dev/null
+++ b/etc/create-security-group.fln
@@ -0,0 +1,23 @@
1/* This file is part of Eclat.
2 Copyright (C) 2012, 2013 Sergey Poznyakoff.
3
4 Eclat is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3, or (at your option)
7 any later version.
8
9 Eclat is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */
16
17if (.CreateSecurityGroupResponse.return) {
18 if (!.CreateSecurityGroupResponse.return[true]) {
19 print("Return: ",.CreateSecurityGroupResponse.return,"\n");
20 exit(1);
21 } else
22 print(.CreateSecurityGroupResponse.groupId,"\n");
23}
diff --git a/etc/delete-security-group.fln b/etc/delete-security-group.fln
new file mode 100644
index 0000000..ca1c611
--- /dev/null
+++ b/etc/delete-security-group.fln
@@ -0,0 +1,22 @@
1/* This file is part of Eclat.
2 Copyright (C) 2012, 2013 Sergey Poznyakoff.
3
4 Eclat is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by