diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2015-11-19 22:39:11 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2015-11-19 22:39:11 +0200 |
commit | ae194ce922bff039e9003f1e84d44132aab63c3e (patch) | |
tree | 020a24e010ee9d73e251396dac415748e545180d | |
parent | 962330ecbabd621de10aa7858d8034dabf0b1d36 (diff) | |
download | eclat-ae194ce922bff039e9003f1e84d44132aab63c3e.tar.gz eclat-ae194ce922bff039e9003f1e84d44132aab63c3e.tar.bz2 |
Restore missing translation maps
-rw-r--r-- | doc/eclat.1man | 10 | ||||
-rw-r--r-- | doc/eclat.conf.5 | 16 | ||||
-rw-r--r-- | src/eclat.h | 22 | ||||
-rw-r--r-- | src/routetable.c | 8 | ||||
-rw-r--r-- | src/subnet.c | 6 |
5 files changed, 38 insertions, 24 deletions
diff --git a/doc/eclat.1man b/doc/eclat.1man index 829bec6..7d416c4 100644 --- a/doc/eclat.1man +++ b/doc/eclat.1man @@ -10,13 +10,13 @@ .\" 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 "February 2, 2015" "ECLAT" "Eclat User Reference" +.TH ECLAT 1 "November 19, 2015" "ECLAT" "Eclat User Reference" .SH NAME eclat \- EC2 Command Line Administrator Tool .SH SYNOPSIS .B eclat [\fIOPTIONS\fR] .B command @@ -117,13 +117,13 @@ contents of the response on the standard output using 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. These values are obtained from -.IR authentication provider . +.IR "authentication provider" . There are three types of authentication providers: .IR immediate , .IR file , and .IR instance\-store . .SS Immediate Provider @@ -133,22 +133,22 @@ and .BR \-W " (" \-\-secret\-key ) options. This usage is insecure as the arguments can easily be seen by other users (e.g. in the .BR ps (1) output). .SS File Provider -The \Ifile\fR provider is requested by the following statement in +The \fIfile\fR provider is requested by the following statement in the configuration file: .PP .EX authentication\-provider file \fIFILENAME\fR; .EE .PP -The credentials are stored them in a file protected by appropriate +The credentials are stored 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, +\fBaccess\-file\fR) lists the 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). diff --git a/doc/eclat.conf.5 b/doc/eclat.conf.5 index 3597309..c896dba 100644 --- a/doc/eclat.conf.5 +++ b/doc/eclat.conf.5 @@ -10,13 +10,13 @@ .\" 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.CONF 5 "February 26, 2015" "ECLAT" "Eclat User Reference" +.TH ECLAT.CONF 5 "November 19, 2015" "ECLAT" "Eclat User Reference" .SH NAME eclat.conf \- configuration file for .BR eclat (1). .SH DESCRIPTION .PP .B Eclat @@ -716,12 +716,24 @@ Translates security group names to Amazon names. .B SnapshotId Translates snapshot names to IDs. .TP .B VolumeId Translates volume names to IDs. .TP +.B VpcId +Translates VPC names to IDs. +.TP +.B InternetGatewayId +Translates internet gateway names to IDs. +.TP +.B SubnetId +Translates subnet names to IDs. +.TP +.B RouteTableId +Translates route table names to IDs. +.TP .B AZ Translates availability region names to Amazon names. .TP .B reg Translates region names to Amazon region names. .PP @@ -814,13 +826,13 @@ last map in sequence. .EE .TP \fBsequence\fR \fImaps\fR This statement defines the sequence of maps to query. Its argument is a list of map names. The maps it references must be declared elsewhere in the configuration file (not necessarily before the -sequence map that references them. +sequence map that references them). .PP For example: .PP .EX map InstanceId { type sequence; diff --git a/src/eclat.h b/src/eclat.h index fcd9f13..5a067f4 100644 --- a/src/eclat.h +++ b/src/eclat.h @@ -252,22 +252,24 @@ void list_attrs(FILE *fp); char *canonattrname(char **attrs, const char *arg, char *delim, size_t *plen); char *read_file(const char *file); int get_scr_cols(void); -#define MAP_IMAGE "ImageId" -#define MAP_INSTANCE "InstanceId" -#define MAP_GROUPID "GroupId" -#define MAP_GROUPNAME "GroupName" -#define MAP_SNAPSHOT "SnapshotId" -#define MAP_VOLUME "VolumeId" -#define MAP_AZ "AZ" -#define MAP_REG "reg" -#define MAP_VPC "VpcId" -#define MAP_IGW "InternetGatewayId" +#define MAP_IMAGE "ImageId" +#define MAP_INSTANCE "InstanceId" +#define MAP_GROUPID "GroupId" +#define MAP_GROUPNAME "GroupName" +#define MAP_SNAPSHOT "SnapshotId" +#define MAP_VOLUME "VolumeId" +#define MAP_AZ "AZ" +#define MAP_REG "reg" +#define MAP_VPC "VpcId" +#define MAP_IGW "InternetGatewayId" +#define MAP_SUBNET "SubnetId" +#define MAP_ROUTE_TABLE "RouteTableId" void translate_ids(int argc, char **argv, const char *map); void translate_resource_ids(int argc, char **argv); void eclat_encode_devmap(struct ec2_request *q, struct grecs_list *list); int get_access_creds(const char *id, char **access_key_ptr, diff --git a/src/routetable.c b/src/routetable.c index 05d4be3..9b0c577 100644 --- a/src/routetable.c +++ b/src/routetable.c @@ -87,13 +87,13 @@ eclat_describe_route_tables(eclat_command_env_t *env, generic_proginfo->args_doc = "[FILTER...] [ID...]"; generic_parse_options(env->cmd, "describe route tables", argc, argv, &i); argv += i; argc -= i; - //FIXME: translate_ids(argc, argv, MAP_ROUTE_TABLE); + translate_ids(argc, argv, MAP_ROUTE_TABLE); describe_request_create(env, argc, argv, "RouteTableId"); return 0; } int @@ -109,16 +109,14 @@ eclat_associate_route_table(eclat_command_env_t *env, argc, argv, &i); argv += i; argc -= i; if (argc != 2) die(EX_USAGE, "wrong number of arguments"); -/*FIXME: translate_ids(1, argv, MAP_ROUTE_TABLE); translate_ids(1, argv+1, MAP_SUBNET); -*/ eclat_request_add_param(q, "RouteTableId", argv[0]); eclat_request_add_param(q, "SubnetId", argv[1]); return 0; } @@ -165,12 +163,13 @@ route_create_request(struct ec2_request *req, int argc, char **argv) for (p = idtab; p->name; p++) if (strcmp (id, p->name) == 0) { id = p->id; break; } + translate_ids(1, argv+1, id); eclat_request_add_param(req, id, argv[1]); } int eclat_route(eclat_command_env_t *env, int argc, char **argv) { @@ -187,13 +186,14 @@ eclat_route(eclat_command_env_t *env, int argc, char **argv) argc, argv, &i); argv += i; argc -= i; if (argc < 3) die(EX_USAGE, "wrong number of arguments"); - //FIXME: translate_ids(1, argv, MAP_ROUTE_TABLE); + + translate_ids(1, argv, MAP_ROUTE_TABLE); rtb_id = argv[0]; op = argv[1]; cidr = argv[2]; argc -= 3; diff --git a/src/subnet.c b/src/subnet.c index 2e56c79..382f62b 100644 --- a/src/subnet.c +++ b/src/subnet.c @@ -69,13 +69,13 @@ eclat_describe_subnets(eclat_command_env_t *env, generic_proginfo->args_doc = "[FILTER...] [ID...]"; generic_parse_options(env->cmd, "describe subnets", argc, argv, &i); argv += i; argc -= i; - //FIXME: translate_ids(argc, argv, MAP_SUBNET); + translate_ids(argc, argv, MAP_SUBNET); describe_request_create(env, argc, argv, "SubnetId"); return 0; } int @@ -103,13 +103,13 @@ eclat_modify_subnet_attribute(eclat_command_env_t *env, int argc, char **argv) die(EX_USAGE, "wrong number of arguments"); attrname = canonattrname(attrs, argv[1], NULL, NULL); if (!attrname) die(EX_USAGE, "unrecognized attribute name"); - //FIXME: translate_ids(1, argv, MAP_SUBNET); + translate_ids(1, argv, MAP_SUBNET); eclat_request_add_param(q, "SubnetId", argv[0]); grecs_asprintf(&bufptr, &bufsize, "%s.Value", attrname); eclat_request_add_param(q, bufptr, argv[2]); free(bufptr); return 0; } @@ -127,11 +127,11 @@ eclat_delete_subnet(eclat_command_env_t *env, int argc, char **argv) argv += i; argc -= i; if (argc != 1) die(EX_USAGE, "wrong number of arguments"); - //FIXME: translate_ids(1, argv, MAP_SUBNET); + translate_ids(1, argv, MAP_SUBNET); eclat_request_add_param(q, "SubnetId", argv[0]); return 0; } |