diff options
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | doc/Makefile.inc | 4 | ||||
-rw-r--r-- | doc/eclat-addr2ec2.1 | 66 | ||||
-rw-r--r-- | doc/eclat-addr2vpc.1 | 59 | ||||
-rw-r--r-- | etc/Makefile.am | 2 | ||||
-rw-r--r-- | etc/describe-images.fln | 1 | ||||
-rw-r--r-- | etc/move-address-to-vpc.fln | 23 | ||||
-rw-r--r-- | etc/restore-address-to-classic.fln | 22 | ||||
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/eclat.c | 6 | ||||
-rw-r--r-- | src/eclat.h | 1 | ||||
-rw-r--r-- | src/mvaddr.c | 39 |
12 files changed, 224 insertions, 2 deletions
@@ -134,6 +134,7 @@ ModifyVolume chvol [X] [X] | |||
134 | ModifyVolumeAttribute - [ ] [ ] | 134 | ModifyVolumeAttribute - [ ] [ ] |
135 | ModifyVpcAttribute setvpcattr [X] [ ] | 135 | ModifyVpcAttribute setvpcattr [X] [ ] |
136 | MonitorInstances - [ ] [ ] | 136 | MonitorInstances - [ ] [ ] |
137 | MoveAddressToVpc addr2vpc [X] [X] | ||
137 | PurchaseReservedInstancesOffering - [ ] [ ] | 138 | PurchaseReservedInstancesOffering - [ ] [ ] |
138 | RebootInstances reboot [X] [X] | 139 | RebootInstances reboot [X] [X] |
139 | RegisterImage - [ ] [ ] | 140 | RegisterImage - [ ] [ ] |
@@ -148,6 +149,7 @@ ResetImageAttribute - [ ] [ ] | |||
148 | ResetInstanceAttribute - [ ] [ ] | 149 | ResetInstanceAttribute - [ ] [ ] |
149 | ResetNetworkInterfaceAttribute - [ ] [ ] | 150 | ResetNetworkInterfaceAttribute - [ ] [ ] |
150 | ResetSnapshotAttribute clrsattr [X] [X] | 151 | ResetSnapshotAttribute clrsattr [X] [X] |
152 | RestoreAddressToClassic addr2ec2 [X] [X] | ||
151 | RevokeSecurityGroupEgress sg [X] [X] | 153 | RevokeSecurityGroupEgress sg [X] [X] |
152 | RevokeSecurityGroupIngress sg [X] [X] | 154 | RevokeSecurityGroupIngress sg [X] [X] |
153 | RunInstances mkinst [X] [X] | 155 | RunInstances mkinst [X] [X] |
diff --git a/doc/Makefile.inc b/doc/Makefile.inc index e55c607..ab6c2a7 100644 --- a/doc/Makefile.inc +++ b/doc/Makefile.inc | |||
@@ -1,5 +1,5 @@ | |||
1 | # This file is part of Eclat -*- Makefile -*- | 1 | # This file is part of Eclat -*- Makefile -*- |
2 | # Copyright (C) 2012-2018 Sergey Poznyakoff | 2 | # Copyright (C) 2012-2019 Sergey Poznyakoff |
3 | # | 3 | # |
4 | # Eclat is free software; you can redistribute it and/or modify | 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 | 5 | # it under the terms of the GNU General Public License as published by |
@@ -20,6 +20,8 @@ | |||
20 | 20 | ||
21 | MANPAGES1=\ | 21 | MANPAGES1=\ |
22 | eclat.1\ | 22 | eclat.1\ |
23 | eclat-addr2ec2.1\ | ||
24 | eclat-addr2vpc.1\ | ||
23 | eclat-assocaddr.1\ | 25 | eclat-assocaddr.1\ |
24 | eclat-atvol.1\ | 26 | eclat-atvol.1\ |
25 | eclat-chvol.1\ | 27 | eclat-chvol.1\ |
diff --git a/doc/eclat-addr2ec2.1 b/doc/eclat-addr2ec2.1 new file mode 100644 index 0000000..983fc8f --- /dev/null +++ b/doc/eclat-addr2ec2.1 | |||
@@ -0,0 +1,66 @@ | |||
1 | .\" This file is part of Eclat -*- nroff -*- | ||
2 | .\" Copyright (C) 2012-2019 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 | .TH ECLAT-ADDR2EC2 1 "November 26, 2019" "ECLAT" "Eclat User Reference" | ||
17 | .SH NAME | ||
18 | eclat-addr2ec2 \- Move VPC IP address back to EC2 Classic | ||
19 | .SH SYNOPSIS | ||
20 | .nh | ||
21 | .na | ||
22 | \fBeclat addr2ec2\fR \fIIP\fR | ||
23 | .PP | ||
24 | \fBeclat restore-address-to-classic\fR \fIIP\fR | ||
25 | .PP | ||
26 | \fBeclat addr2ec2\fR \fB\-\-help\fR | ||
27 | .ad | ||
28 | .hy | ||
29 | .SH DESCRIPTION | ||
30 | Restores an Elastic IP address that was previously moved to the | ||
31 | EC2-VPC platform back to the EC2-Classic platform (addresses are | ||
32 | moved to EC2-VPC using the | ||
33 | .BR eclat\-addr2vpc (1) | ||
34 | command). | ||
35 | You cannot move an | ||
36 | Elastic IP address that was originally allocated for use in | ||
37 | EC2-VPC. The Elastic IP address must not be associated with an | ||
38 | instance or network interface. | ||
39 | .PP | ||
40 | .PP | ||
41 | To move the address back to EC2 classic, use | ||
42 | .BR "eclat addr2ec2". | ||
43 | .SH "SEE ALSO" | ||
44 | .BR eclat (1), | ||
45 | .BR eclat\-addr2vpc (1). | ||
46 | .SH AUTHORS | ||
47 | Sergey Poznyakoff | ||
48 | .SH "BUG REPORTS" | ||
49 | Report bugs to <bug\-eclat@gnu.org.ua>. | ||
50 | .SH COPYRIGHT | ||
51 | Copyright \(co 2012-2019 Sergey Poznyakoff | ||
52 | .br | ||
53 | .na | ||
54 | License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | ||
55 | .br | ||
56 | .ad | ||
57 | This is free software: you are free to change and redistribute it. | ||
58 | There is NO WARRANTY, to the extent permitted by law. | ||
59 | .\" Local variables: | ||
60 | .\" eval: (add-hook 'write-file-hooks 'time-stamp) | ||
61 | .\" time-stamp-start: ".TH [A-Z_][A-Z0-9_.\\-]* [0-9] \"" | ||
62 | .\" time-stamp-format: "%:B %:d, %:y" | ||
63 | .\" time-stamp-end: "\"" | ||
64 | .\" time-stamp-line-limit: 20 | ||
65 | .\" end: | ||
66 | |||
diff --git a/doc/eclat-addr2vpc.1 b/doc/eclat-addr2vpc.1 new file mode 100644 index 0000000..dec6bda --- /dev/null +++ b/doc/eclat-addr2vpc.1 | |||
@@ -0,0 +1,59 @@ | |||
1 | .\" This file is part of Eclat -*- nroff -*- | ||
2 | .\" Copyright (C) 2012-2019 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 | .TH ECLAT-ADDR2VPC 1 "November 26, 2019" "ECLAT" "Eclat User Reference" | ||
17 | .SH NAME | ||
18 | eclat-addr2vpc \- Move IP address from EC2 to EC2-VPC | ||
19 | .SH SYNOPSIS | ||
20 | .nh | ||
21 | .na | ||
22 | \fBeclat addr2vpc\fR \fIIP\fR | ||
23 | .PP | ||
24 | \fBeclat move-address-to-vpc\fR \fIIP\fR | ||
25 | .PP | ||
26 | \fBeclat addr2vpc\fR \fB\-\-help\fR | ||
27 | .ad | ||
28 | .hy | ||
29 | .SH DESCRIPTION | ||
30 | Moves the Elastic IP address \fIIP\fR from the EC2-Classic platform to | ||
31 | the EC2-VPC platform. \fIIP\fR must be allocated to your account for | ||
32 | more than 24 hours, and it must not be associated with an instance. | ||
33 | .PP | ||
34 | To move the address back to EC2 classic, use | ||
35 | .BR "eclat addr2ec2". | ||
36 | .SH "SEE ALSO" | ||
37 | .BR eclat (1), | ||
38 | .BR eclat\-addr2ec2 (1). | ||
39 | .SH AUTHORS | ||
40 | Sergey Poznyakoff | ||
41 | .SH "BUG REPORTS" | ||
42 | Report bugs to <bug\-eclat@gnu.org.ua>. | ||
43 | .SH COPYRIGHT | ||
44 | Copyright \(co 2012-2019 Sergey Poznyakoff | ||
45 | .br | ||
46 | .na | ||
47 | License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | ||
48 | .br | ||
49 | .ad | ||
50 | This is free software: you are free to change and redistribute it. | ||
51 | There is NO WARRANTY, to the extent permitted by law. | ||
52 | .\" Local variables: | ||
53 | .\" eval: (add-hook 'write-file-hooks 'time-stamp) | ||
54 | .\" time-stamp-start: ".TH [A-Z_][A-Z0-9_.\\-]* [0-9] \"" | ||
55 | .\" time-stamp-format: "%:B %:d, %:y" | ||
56 | .\" time-stamp-end: "\"" | ||
57 | .\" time-stamp-line-limit: 20 | ||
58 | .\" end: | ||
59 | |||
diff --git a/etc/Makefile.am b/etc/Makefile.am index 7d0b355..d508fbf 100644 --- a/etc/Makefile.am +++ b/etc/Makefile.am | |||
@@ -75,9 +75,11 @@ FLNFILES=\ | |||
75 | modify-subnet-attribute.fln\ | 75 | modify-subnet-attribute.fln\ |
76 | modify-volume.fln\ | 76 | modify-volume.fln\ |
77 | modify-vpc-attribute.fln\ | 77 | modify-vpc-attribute.fln\ |
78 | move-address-to-vpc.fln\ | ||
78 | reboot-instances.fln\ | 79 | reboot-instances.fln\ |
79 | release-address.fln\ | 80 | release-address.fln\ |
80 | replace-route.fln\ | 81 | replace-route.fln\ |
82 | restore-address-to-classic.fln\ | ||
81 | route.fln\ | 83 | route.fln\ |
82 | reset-snapshot-attribute.fln\ | 84 | reset-snapshot-attribute.fln\ |
83 | run-instances.fln\ | 85 | run-instances.fln\ |
diff --git a/etc/describe-images.fln b/etc/describe-images.fln index ac2fc79..01ebd5f 100644 --- a/etc/describe-images.fln +++ b/etc/describe-images.fln | |||
@@ -17,6 +17,7 @@ | |||
17 | if (.DescribeImagesResponse.imagesSet) { | 17 | if (.DescribeImagesResponse.imagesSet) { |
18 | for (var in .DescribeImagesResponse.imagesSet.item) { | 18 | for (var in .DescribeImagesResponse.imagesSet.item) { |
19 | print("\nImage ID: ", var.imageId, "\n"); | 19 | print("\nImage ID: ", var.imageId, "\n"); |
20 | print("\tCreated on: ", var.creationDate, "\n"); | ||
20 | print("\tName: ", var.name, "\n"); | 21 | print("\tName: ", var.name, "\n"); |
21 | print("\tDescription: ", var.description, "\n"); | 22 | print("\tDescription: ", var.description, "\n"); |
22 | print("\tOwner: ", var.imageOwnerId, "\n"); | 23 | print("\tOwner: ", var.imageOwnerId, "\n"); |
diff --git a/etc/move-address-to-vpc.fln b/etc/move-address-to-vpc.fln new file mode 100644 index 0000000..24dab40 --- /dev/null +++ b/etc/move-address-to-vpc.fln | |||
@@ -0,0 +1,23 @@ | |||
1 | /* This file is part of Eclat. | ||
2 | Copyright (C) 2019 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 | |||
17 | if (.MoveAddressToVpcResponse.status) { | ||
18 | print(.MoveAddressToVpcResponse.status); | ||
19 | if (.MoveAddressToVpcResponse.allocationId) | ||
20 | print("\t", .MoveAddressToVpcResponse.allocationId); | ||
21 | print("\n"); | ||
22 | } | ||
23 | |||
diff --git a/etc/restore-address-to-classic.fln b/etc/restore-address-to-classic.fln new file mode 100644 index 0000000..4750d63 --- /dev/null +++ b/etc/restore-address-to-classic.fln | |||
@@ -0,0 +1,22 @@ | |||
1 | /* This file is part of Eclat. | ||
2 | Copyright (C) 2019 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 | |||
17 | if (.RestoreAddressToClassicResponse.status) { | ||
18 | print(.RestoreAddressToClassicResponse.status); | ||
19 | if (.RestoreAddressToClassicResponse.publicIp) | ||
20 | print("\t", .RestoreAddressToClassicResponse.publicIp); | ||
21 | print("\n"); | ||
22 | } | ||
diff --git a/src/Makefile.am b/src/Makefile.am index c4fc211..637beb2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am | |||
@@ -60,6 +60,7 @@ eclat_SOURCES=\ | |||
60 | mktags.c\ | 60 | mktags.c\ |
61 | mkvol.c\ | 61 | mkvol.c\ |
62 | mkvpc.c\ | 62 | mkvpc.c\ |
63 | mvaddr.c\ | ||
63 | rmaddr.c\ | 64 | rmaddr.c\ |
64 | rmsg.c\ | 65 | rmsg.c\ |
65 | rmsnap.c\ | 66 | rmsnap.c\ |
diff --git a/src/eclat.c b/src/eclat.c index 43387be..1c87314 100644 --- a/src/eclat.c +++ b/src/eclat.c | |||
@@ -211,7 +211,11 @@ struct eclat_command cmdtab[] = { | |||
211 | { "chvol", "modify-volume", "ModifyVolume", | 211 | { "chvol", "modify-volume", "ModifyVolume", |
212 | eclat_modify_volume }, | 212 | eclat_modify_volume }, |
213 | { "lschvol", "describe-volumes-modifications", "DescribeVolumesModifications", | 213 | { "lschvol", "describe-volumes-modifications", "DescribeVolumesModifications", |
214 | eclat_describe_volumes_modifications } | 214 | eclat_describe_volumes_modifications }, |
215 | { "addr2vpc", "move-address-to-vpc", "MoveAddressToVpc", | ||
216 | eclat_move_address }, | ||
217 | { "addr2ec2", "restore-address-to-classic", "RestoreAddressToClassic", | ||
218 | eclat_move_address }, | ||
215 | }; | 219 | }; |
216 | size_t cmdcnt = sizeof(cmdtab) / sizeof(cmdtab[0]); | 220 | size_t cmdcnt = sizeof(cmdtab) / sizeof(cmdtab[0]); |
217 | 221 | ||
diff --git a/src/eclat.h b/src/eclat.h index f314476..d0f47a1 100644 --- a/src/eclat.h +++ b/src/eclat.h | |||
@@ -135,6 +135,7 @@ int eclat_release_address(eclat_command_env_t *env, int argc, char **argv); | |||
135 | int eclat_associate_address(eclat_command_env_t *env, int argc, char **argv); | 135 | int eclat_associate_address(eclat_command_env_t *env, int argc, char **argv); |
136 | int eclat_disassociate_address(eclat_command_env_t *env, int argc, char **argv); | 136 | int eclat_disassociate_address(eclat_command_env_t *env, int argc, char **argv); |
137 | int eclat_describe_addresses(eclat_command_env_t *env, int argc, char **argv); | 137 | int eclat_describe_addresses(eclat_command_env_t *env, int argc, char **argv); |
138 | int eclat_move_address(eclat_command_env_t *env, int argc, char **argv); | ||
138 | int eclat_describe_volumes(eclat_command_env_t *env, int argc, char **argv); | 139 | int eclat_describe_volumes(eclat_command_env_t *env, int argc, char **argv); |
139 | int eclat_get_console_output(eclat_command_env_t *env, int argc, char **argv); | 140 | int eclat_get_console_output(eclat_command_env_t *env, int argc, char **argv); |
140 | int eclat_describe_instance_attribute(eclat_command_env_t *env, int argc, char **argv); | 141 | int eclat_describe_instance_attribute(eclat_command_env_t *env, int argc, char **argv); |
diff --git a/src/mvaddr.c b/src/mvaddr.c new file mode 100644 index 0000000..dbe9986 --- /dev/null +++ b/src/mvaddr.c | |||
@@ -0,0 +1,39 @@ | |||
1 | /* This file is part of Eclat. | ||
2 | Copyright (C) 2019 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 | |||
17 | #include "eclat.h" | ||
18 | |||
19 | int | ||
20 | eclat_move_address(eclat_command_env_t *env, int argc, char **argv) | ||
21 | { | ||
22 | int i; | ||
23 | |||
24 | generic_proginfo->args_doc = "IP"; | ||
25 | generic_parse_options(env->cmd, | ||
26 | strcmp(env->cmd->tag, "MoveAddressToVpc") == 0 | ||
27 | ? "Move IP address from EC2-Classic to EC2-VPC" | ||
28 | : "Restore a VPC address back to EC2-Classic", | ||
29 | argc, argv, &i); | ||
30 | argc -= i; | ||
31 | argv += i; | ||
32 | |||
33 | if (argc != 1) | ||
34 | die(EX_USAGE, "wrong number of arguments to move-address-to-vpc"); | ||
35 | |||
36 | eclat_request_add_param(env->request, "PublicIp", argv[0]); | ||
37 | |||
38 | return 0; | ||
39 | } | ||