summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2015-01-22 21:59:22 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2015-01-22 22:03:33 (GMT)
commitb1824338b366e25756e4c64f04e535684529832d (patch) (side-by-side diff)
tree2dcbf32e0b4fb06b1c4b0a992db882ba184bbd18
parent2beaaadb282bd4667e3af1ed65e3944960d1bd3e (diff)
downloadeclat-b1824338b366e25756e4c64f04e535684529832d.tar.gz
eclat-b1824338b366e25756e4c64f04e535684529832d.tar.bz2
Namespace fixup: use "request" consistently
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--lib/Makefile.am10
-rw-r--r--lib/libeclat.h24
-rw-r--r--lib/req2url.c (renamed from lib/q2url.c)6
-rw-r--r--lib/reqaddparm.c (renamed from lib/qaddparm.c)28
-rw-r--r--lib/reqcreat.c (renamed from lib/qcreat.c)26
-rw-r--r--lib/reqencode.c (renamed from lib/qencode.c)4
-rw-r--r--lib/reqfree.c (renamed from lib/qfree.c)10
-rw-r--r--lib/reqsign.c56
-rw-r--r--src/allocaddr.c2
-rw-r--r--src/asscaddr.c12
-rw-r--r--src/atvol.c6
-rw-r--r--src/cpimg.c10
-rw-r--r--src/cpsnap.c8
-rw-r--r--src/deimg.c2
-rw-r--r--src/devmap.c20
-rw-r--r--src/devol.c10
-rw-r--r--src/disasaddr.c4
-rw-r--r--src/ec2map.c14
-rw-r--r--src/eclat.c6
-rw-r--r--src/eclat.h10
-rw-r--r--src/getconout.c2
-rw-r--r--src/lsaattr.c6
-rw-r--r--src/lsaddr.c2
-rw-r--r--src/lsiattr.c6
-rw-r--r--src/lsimg-cl.opt8
-rw-r--r--src/lsimg.c2
-rw-r--r--src/lsinst.c2
-rw-r--r--src/lsistat.c4
-rw-r--r--src/lsreg.c2
-rw-r--r--src/lssattr.c18
-rw-r--r--src/lssg.c2
-rw-r--r--src/lssnap.c4
-rw-r--r--src/lstag.c6
-rw-r--r--src/lsvol.c2
-rw-r--r--src/lszon.c2
-rw-r--r--src/mkimg.c10
-rw-r--r--src/mkinst.c64
-rw-r--r--src/mksg.c8
-rw-r--r--src/mksnap.c4
-rw-r--r--src/mktags.c14
-rw-r--r--src/mkvol.c12
-rw-r--r--src/rmaddr.c2
-rw-r--r--src/rmsg.c4
-rw-r--r--src/rmsnap.c4
-rw-r--r--src/rmvol.c4
-rw-r--r--src/setaattr.c10
-rw-r--r--src/setiattr.c14
-rw-r--r--src/sg-cl.opt6
-rw-r--r--src/sg.c18
-rw-r--r--src/startstop.c4
-rw-r--r--src/util.c26
51 files changed, 271 insertions, 269 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index bdc7d76..5cfa67a 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -54,11 +54,11 @@ libeclat_a_SOURCES=\
libeclat.h\
map.c\
path.c\
- q2url.c\
- qaddparm.c\
- qcreat.c\
- qencode.c\
- qfree.c\
+ req2url.c\
+ reqaddparm.c\
+ reqcreat.c\
+ reqencode.c\
+ reqfree.c\
reqsign.c\
sha1.c\
sha1.h\
diff --git a/lib/libeclat.h b/lib/libeclat.h
index edd26eb..a5c8c79 100644
--- a/lib/libeclat.h
+++ b/lib/libeclat.h
@@ -85,11 +85,11 @@ struct ec2_param {
#define EC2_API_VERSION "2013-02-01"
-#define EC2_QF_HTTPS 0x01
-#define EC2_QF_POST 0x02
+#define EC2_RF_HTTPS 0x01
+#define EC2_RF_POST 0x02
-struct ec2_query {
- int flags; /* Composed from EC2_QF_* bits */
+struct ec2_request {
+ int flags; /* Composed from EC2_RF_* bits */
char *endpoint; /* endpoint */
char *uri; /* URI without parameters */
struct grecs_symtab *params; /* Query parameters */
@@ -100,22 +100,22 @@ struct ec2_query {
unsigned long ttl; /* Time-to-live in seconds */
};
-struct ec2_query *eclat_query_create(int flags, const char *endpoint,
+struct ec2_request *eclat_request_create(int flags, const char *endpoint,
const char *uri, char const *region,
char const *access_key, char const *token);
-void eclat_query_free(struct ec2_query *);
-void eclat_query_add_param(struct ec2_query *q, const char *name,
+void eclat_request_free(struct ec2_request *);
+void eclat_request_add_param(struct ec2_request *q, const char *name,
const char *value);
-void eclat_query_add_param_encoded(struct ec2_query *q, const char *name,
+void eclat_request_add_param_encoded(struct ec2_request *q, const char *name,
const char *value);
-void eclat_query_add_header(struct ec2_query *q, const char *name,
+void eclat_request_add_header(struct ec2_request *q, const char *name,
const char *value);
-void eclat_query_sign(struct ec2_query *req, char *secret, char *version);
+void eclat_request_sign(struct ec2_request *req, char *secret, char *version);
-char *eclat_query_to_url(struct ec2_query *req, char **post_params);
+char *eclat_request_to_url(struct ec2_request *req, char **post_params);
-void eclat_query_encode(struct ec2_query *q);
+void eclat_request_encode(struct ec2_request *q);
typedef struct eclat_partial_tree *eclat_partial_tree_t;
diff --git a/lib/q2url.c b/lib/req2url.c
index 6404f33..25277a2 100644
--- a/lib/q2url.c
+++ b/lib/req2url.c
@@ -43,7 +43,7 @@ add_param(void *sym, void *data)
}
char *
-eclat_query_to_url(struct ec2_query *req, char **post_params)
+eclat_request_to_url(struct ec2_request *req, char **post_params)
{
struct grecs_txtacc *acc;
char *ret = NULL, *p;
@@ -52,13 +52,13 @@ eclat_query_to_url(struct ec2_query *req, char **post_params)
acc = grecs_txtacc_create();
grecs_txtacc_grow(acc, "http", 4);
- if (req->flags & EC2_QF_HTTPS)
+ if (req->flags & EC2_RF_HTTPS)
grecs_txtacc_grow_char(acc, 's');
grecs_txtacc_grow(acc, "://", 3);
grecs_txtacc_grow(acc, req->endpoint, strlen(req->endpoint));
grecs_txtacc_grow(acc, req->uri, strlen(req->uri));
- if (req->flags & EC2_QF_POST) {
+ if (req->flags & EC2_RF_POST) {
grecs_txtacc_grow_char(acc, 0);
ret = grecs_txtacc_finish(acc, 1);
} else {
diff --git a/lib/qaddparm.c b/lib/reqaddparm.c
index 7328534..916bf92 100644
--- a/lib/qaddparm.c
+++ b/lib/reqaddparm.c
@@ -20,14 +20,14 @@
#include "grecs.h"
void
-eclat_query_add_param0(struct ec2_query *q, const char *name,
+eclat_request_add_param0(struct ec2_request *req, const char *name,
const char *value, int encoded)
{
struct ec2_param *p, key;
int install = 1;
key.name = (char*) name;
- p = grecs_symtab_lookup_or_install(q->params, &key, &install);
+ p = grecs_symtab_lookup_or_install(req->params, &key, &install);
if (!install)
free(p->value);
p->value = value ? grecs_strdup(value) : NULL;
@@ -35,22 +35,23 @@ eclat_query_add_param0(struct ec2_query *q, const char *name,
}
void
-eclat_query_add_param(struct ec2_query *q, const char *name, const char *value)
+eclat_request_add_param(struct ec2_request *req, const char *name,
+ const char *value)
{
- eclat_query_add_param0(q, name, value, 0);
+ eclat_request_add_param0(req, name, value, 0);
}
void
-eclat_query_add_param_encoded(struct ec2_query *q, const char *name,
- const char *value)
+eclat_request_add_param_encoded(struct ec2_request *req, const char *name,
+ const char *value)
{
if (value) {
char *str;
urlencode(value, strlen(value), &str, NULL);
- eclat_query_add_param0(q, name, str, 1);
+ eclat_request_add_param0(req, name, str, 1);
free(str);
} else
- eclat_query_add_param0(q, name, value, 1);
+ eclat_request_add_param0(req, name, value, 1);
}
@@ -64,13 +65,14 @@ free_header(void *data)
}
void
-eclat_query_add_header(struct ec2_query *q, const char *name, const char *value)
+eclat_request_add_header(struct ec2_request *req, const char *name,
+ const char *value)
{
struct ec2_param *ent;
- if (!q->headers) {
- q->headers = grecs_list_create();
- q->headers->free_entry = free_header;
+ if (!req->headers) {
+ req->headers = grecs_list_create();
+ req->headers->free_entry = free_header;
}
ent = grecs_malloc(sizeof(*ent));
ent->name = grecs_strdup(name);
@@ -87,5 +89,5 @@ eclat_query_add_header(struct ec2_query *q, const char *name, const char *value)
ent->value[len] = 0;
} else
ent->value = NULL;
- grecs_list_append(q->headers, ent);
+ grecs_list_append(req->headers, ent);
}
diff --git a/lib/qcreat.c b/lib/reqcreat.c
index 3028b4f..65f7880 100644
--- a/lib/qcreat.c
+++ b/lib/reqcreat.c
@@ -27,25 +27,25 @@ ec2_param_free(void *ptr)
free(p);
}
-struct ec2_query *
-eclat_query_create(int flags, const char *endpoint, const char *uri,
+struct ec2_request *
+eclat_request_create(int flags, const char *endpoint, const char *uri,
char const *region, char const *access_key,
char const *token)
{
- struct ec2_query *q = grecs_zalloc(sizeof(*q));
- q->flags = flags;
- q->params = grecs_symtab_create(sizeof(struct ec2_param),
+ struct ec2_request *req = grecs_zalloc(sizeof(*req));
+ req->flags = flags;
+ req->params = grecs_symtab_create(sizeof(struct ec2_param),
NULL,
NULL,
NULL,
NULL,
ec2_param_free);
- eclat_query_add_param(q, "Version", EC2_API_VERSION);
- q->endpoint = grecs_strdup(endpoint);
- q->uri = grecs_strdup(uri);
- q->ttl = 5;
- q->region = grecs_strdup(region ? region : "us-east-1");
- q->access_key = grecs_strdup(access_key);
- q->token = token ? grecs_strdup(token) : NULL;
- return q;
+ eclat_request_add_param(req, "Version", EC2_API_VERSION);
+ req->endpoint = grecs_strdup(endpoint);
+ req->uri = grecs_strdup(uri);
+ req->ttl = 5;
+ req->region = grecs_strdup(region ? region : "us-east-1");
+ req->access_key = grecs_strdup(access_key);
+ req->token = token ? grecs_strdup(token) : NULL;
+ return req;
}
diff --git a/lib/qencode.c b/lib/reqencode.c
index bb4284c..70ac16d 100644
--- a/lib/qencode.c
+++ b/lib/reqencode.c
@@ -35,8 +35,8 @@ encode_param(void *sym, void *data)
}
void
-eclat_query_encode(struct ec2_query *q)
+eclat_request_encode(struct ec2_request *req)
{
- grecs_symtab_enumerate(q->params, encode_param, NULL);
+ grecs_symtab_enumerate(req->params, encode_param, NULL);
}
diff --git a/lib/qfree.c b/lib/reqfree.c
index bbdc991..f5145a4 100644
--- a/lib/qfree.c
+++ b/lib/reqfree.c
@@ -19,11 +19,11 @@
#include "grecs.h"
void
-eclat_query_free(struct ec2_query *q)
+eclat_request_free(struct ec2_request *req)
{
- free(q->endpoint);
- free(q->uri);
- grecs_symtab_free(q->params);
- free(q);
+ free(req->endpoint);
+ free(req->uri);
+ grecs_symtab_free(req->params);
+ free(req);
}
diff --git a/lib/reqsign.c b/lib/reqsign.c
index 6acf80e..f3083c6 100644
--- a/lib/reqsign.c
+++ b/lib/reqsign.c
@@ -44,7 +44,7 @@ compnames(const void *a, const void *b)
}
static void
-querysign2(struct ec2_query *req, char *secret)
+requestsign2(struct ec2_request *req, char *secret)
{
char **pnames;
size_t i, n;
@@ -61,17 +61,17 @@ querysign2(struct ec2_query *req, char *secret)
acc = grecs_txtacc_create();
/* Add default parameters */
- eclat_query_add_param(req, "AWSAccessKeyId", req->access_key);
- eclat_query_add_param(req, "SignatureMethod", "HmacSHA256");
- eclat_query_add_param(req, "SignatureVersion", "2");
+ eclat_request_add_param(req, "AWSAccessKeyId", req->access_key);
+ eclat_request_add_param(req, "SignatureMethod", "HmacSHA256");
+ eclat_request_add_param(req, "SignatureVersion", "2");
if (req->token)
- eclat_query_add_param(req, "SecurityToken", req->token);
+ eclat_request_add_param(req, "SecurityToken", req->token);
time(&t);
strftime(tsbuf, sizeof(tsbuf), "%Y-%m-%dT%H:%M:%SZ", gmtime(&t));
- eclat_query_add_param(req, "Timestamp", tsbuf);
+ eclat_request_add_param(req, "Timestamp", tsbuf);
- eclat_query_encode(req);
+ eclat_request_encode(req);
/* Collect and sort parameter names */
n = grecs_symtab_count_entries(req->params);
@@ -81,7 +81,7 @@ querysign2(struct ec2_query *req, char *secret)
grecs_symtab_enumerate(req->params, get_param_name, &pn);
qsort(pnames, n, sizeof(pnames[0]), compnames);
- verb = (req->flags & EC2_QF_POST) ? "POST" : "GET";
+ verb = (req->flags & EC2_RF_POST) ? "POST" : "GET";
grecs_txtacc_grow_string(acc, verb);
grecs_txtacc_grow_char(acc, '\n');
grecs_txtacc_grow_string(acc, req->endpoint);
@@ -89,7 +89,7 @@ querysign2(struct ec2_query *req, char *secret)
grecs_txtacc_grow_string(acc, req->uri);
grecs_txtacc_grow_char(acc, '\n');
- /* Append a canonicalized query string */
+ /* Append a canonicalized request string */
for (i = 0; i < n; i++) {
struct ec2_param *p, key;
@@ -112,7 +112,7 @@ querysign2(struct ec2_query *req, char *secret)
eclat_base64_encode((unsigned char *)digest, sizeof(digest),
(unsigned char**) &signature, &siglen);
- eclat_query_add_param_encoded(req, "Signature", signature);
+ eclat_request_add_param_encoded(req, "Signature", signature);
free(signature);
grecs_txtacc_free(acc);
@@ -121,7 +121,7 @@ querysign2(struct ec2_query *req, char *secret)
/*FIXME
t += req->ttl;
strftime(tsbuf, sizeof(tsbuf), "%Y-%m-%dT%H:%M:%SZ", gmtime(&t));
- eclat_query_add_param(req, "Expires", tsbuf);
+ eclat_request_add_param(req, "Expires", tsbuf);
*/
}
@@ -148,7 +148,7 @@ eclat_hex_encode(unsigned char *input, size_t inlen,
/* Ref. http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
*/
static void
-querysign4(struct ec2_query *req, char *secret)
+requestsign4(struct ec2_request *req, char *secret)
{
char **pnames;
struct pname pn;
@@ -196,11 +196,11 @@ querysign4(struct ec2_query *req, char *secret)
grecs_txtacc_grow_char(acc, 0);
credential = grecs_txtacc_finish(acc, 0);
- eclat_query_add_header(req, "Host", req->endpoint);
- eclat_query_add_header(req, "X-Amz-Date", tsbuf);
+ eclat_request_add_header(req, "Host", req->endpoint);
+ eclat_request_add_header(req, "X-Amz-Date", tsbuf);
- /* Encode the query */
- eclat_query_encode(req);
+ /* Encode the request */
+ eclat_request_encode(req);
/* Collect and sort parameter names */
n = grecs_symtab_count_entries(req->params);
@@ -211,12 +211,12 @@ querysign4(struct ec2_query *req, char *secret)
qsort(pnames, n, sizeof(pnames[0]), compnames);
/* Create a canonical request */
- verb = (req->flags & EC2_QF_POST) ? "POST" : "GET";
+ verb = (req->flags & EC2_RF_POST) ? "POST" : "GET";
grecs_txtacc_grow_string(acc, verb);
grecs_txtacc_grow_char(acc, '\n');
grecs_txtacc_grow_string(acc, req->uri);
grecs_txtacc_grow_char(acc, '\n');
- /* Append a canonicalized query string */
+ /* Append a canonicalized request string */
for (i = 0; i < n; i++) {
struct ec2_param *p, key;
@@ -251,8 +251,8 @@ querysign4(struct ec2_query *req, char *secret)
grecs_txtacc_grow_string(acc, signed_headers);
grecs_txtacc_grow_char(acc, '\n');
/* Payload hash */
- if (req->flags & EC2_QF_POST) {
- /* FIXME: payload = req->query */
+ if (req->flags & EC2_RF_POST) {
+ /* FIXME: payload = req->request */
err("%s:%d: POST is not yet implemented", __FILE__, __LINE__);
abort();
} else
@@ -319,7 +319,7 @@ querysign4(struct ec2_query *req, char *secret)
&signature, &hashsize);
if (req->token)
- eclat_query_add_header(req, "X-Amz-Security-Token", req->token);
+ eclat_request_add_header(req, "X-Amz-Security-Token", req->token);
/* Build authorization header */
grecs_txtacc_grow_string(acc, algostr);
@@ -331,28 +331,28 @@ querysign4(struct ec2_query *req, char *secret)
grecs_txtacc_grow_string(acc, signature);
grecs_txtacc_grow_char(acc, 0);
p = grecs_txtacc_finish(acc, 0);
- eclat_query_add_header(req, "Authorization", p);
+ eclat_request_add_header(req, "Authorization", p);
free(signature);
grecs_txtacc_free(acc);
- /* Encode the query */
- eclat_query_encode(req);
+ /* Encode the request */
+ eclat_request_encode(req);
}
struct qsimpl {
char *qs_version;
- void (*qs_fun)(struct ec2_query *, char *);
+ void (*qs_fun)(struct ec2_request *, char *);
};
static struct qsimpl qstab[] = {
- { "2", querysign2 },
- { "4", querysign4 },
+ { "2", requestsign2 },
+ { "4", requestsign4 },
{ NULL }
};
void
-eclat_query_sign(struct ec2_query *req, char *secret, char *version)
+eclat_request_sign(struct ec2_request *req, char *secret, char *version)
{
struct qsimpl *qs;
diff --git a/src/allocaddr.c b/src/allocaddr.c
index 9d8d6d8..b6cf133 100644
--- a/src/allocaddr.c
+++ b/src/allocaddr.c
@@ -31,6 +31,6 @@ eclat_allocate_address(eclat_command_env_t *env, int argc, char **argv)
die(EX_USAGE, "wrong number of arguments to allocate-address");
if (vpc)
- eclat_query_add_param(env->query, "Domain", "vpc");
+ eclat_request_add_param(env->request, "Domain", "vpc");
return 0;
}
diff --git a/src/asscaddr.c b/src/asscaddr.c
index 3e6ca44..26e5d5c 100644
--- a/src/asscaddr.c
+++ b/src/asscaddr.c
@@ -34,21 +34,21 @@ eclat_associate_address(eclat_command_env_t *env, int argc, char **argv)
die(EX_USAGE, "wrong number of arguments to associate-address");
translate_ids(1, argv, MAP_INSTANCE);
- eclat_query_add_param(env->query, "InstanceId", argv[0]);
+ eclat_request_add_param(env->request, "InstanceId", argv[0]);
if (vpc) {
- eclat_query_add_param(env->query, "AllocationId", argv[1]);
+ eclat_request_add_param(env->request, "AllocationId", argv[1]);
if (iface)
- eclat_query_add_param(env->query, "NetworkInterfaceId",
+ eclat_request_add_param(env->request, "NetworkInterfaceId",
iface);
if (privaddr)
- eclat_query_add_param(env->query, "PrivateIpAddress",
+ eclat_request_add_param(env->request, "PrivateIpAddress",
privaddr);
if (reassoc)
- eclat_query_add_param(env->query, "AllowReassociation",
+ eclat_request_add_param(env->request, "AllowReassociation",
"true");
} else {
- eclat_query_add_param(env->query, "PublicIp", argv[1]);
+ eclat_request_add_param(env->request, "PublicIp", argv[1]);
}
return 0;
}
diff --git a/src/atvol.c b/src/atvol.c
index b07bea2..36abcb5 100644
--- a/src/atvol.c
+++ b/src/atvol.c
@@ -35,9 +35,9 @@ eclat_attach_volume(eclat_command_env_t *env, int argc, char **argv)
translate_ids(1, argv, MAP_VOLUME);
translate_ids(1, argv + 1, MAP_INSTANCE);
- eclat_query_add_param(env->query, "VolumeId", argv[0]);
- eclat_query_add_param(env->query, "InstanceId", argv[1]);
- eclat_query_add_param(env->query, "Device", argv[2]);
+ eclat_request_add_param(env->request, "VolumeId", argv[0]);
+ eclat_request_add_param(env->request, "InstanceId", argv[1]);
+ eclat_request_add_param(env->request, "Device", argv[2]);
return 0;
}
diff --git a/src/cpimg.c b/src/cpimg.c
index fa9db23..ef92ffb 100644
--- a/src/cpimg.c
+++ b/src/cpimg.c
@@ -20,14 +20,14 @@
int
eclat_copy_image(eclat_command_env_t *env, int argc, char **argv)
{
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
parse_options(env, argc, argv);
- eclat_query_add_param(q, "SourceRegion", region);
- eclat_query_add_param(q, "SourceImageId", image);
+ eclat_request_add_param(q, "SourceRegion", region);
+ eclat_request_add_param(q, "SourceImageId", image);
if (name)
- eclat_query_add_param(q, "Name", name);
+ eclat_request_add_param(q, "Name", name);
if (descr)
- eclat_query_add_param(q, "Description", descr);
+ eclat_request_add_param(q, "Description", descr);
return 0;
}
diff --git a/src/cpsnap.c b/src/cpsnap.c
index 16de3f2..93e6535 100644
--- a/src/cpsnap.c
+++ b/src/cpsnap.c
@@ -20,13 +20,13 @@
int
eclat_copy_snapshot(eclat_command_env_t *env, int argc, char **argv)
{
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
parse_options(env, argc, argv);
- eclat_query_add_param(q, "SourceRegion", region);
- eclat_query_add_param(q, "SourceSnapshotId", image);
+ eclat_request_add_param(q, "SourceRegion", region);
+ eclat_request_add_param(q, "SourceSnapshotId", image);
if (descr)
- eclat_query_add_param(q, "Description", descr);
+ eclat_request_add_param(q, "Description", descr);
return 0;
}
diff --git a/src/deimg.c b/src/deimg.c
index b607fd5..67e5444 100644
--- a/src/deimg.c
+++ b/src/deimg.c
@@ -30,7 +30,7 @@ eclat_deregister_image(eclat_command_env_t *env, int argc, char **argv)
die(EX_USAGE, "bad number of arguments");
translate_ids(argc, argv, MAP_IMAGE);
- eclat_query_add_param(env->query, "ImageId", argv[0]);
+ eclat_request_add_param(env->request, "ImageId", argv[0]);
return 0;
}
diff --git a/src/devmap.c b/src/devmap.c
index 9f9a85a..54308bc 100644
--- a/src/devmap.c
+++ b/src/devmap.c
@@ -26,7 +26,7 @@ isnumstr(const char *p)
}
void
-eclat_encode_devmap(struct ec2_query *q, struct grecs_list *list)
+eclat_encode_devmap(struct ec2_request *q, struct grecs_list *list)
{
int i;
char *bufptr = NULL;
@@ -46,18 +46,18 @@ eclat_encode_devmap(struct ec2_query *q, struct grecs_list *list)
grecs_asprintf(&bufptr, &bufsize,
"BlockDeviceMapping.%d.DeviceName",
i);
- eclat_query_add_param(q, bufptr, dev);
+ eclat_request_add_param(q, bufptr, dev);
if (strcmp(p, "none") == 0) {
grecs_asprintf(&bufptr, &bufsize,
"BlockDeviceMapping.%d.NoDevice",
i);
- eclat_query_add_param(q, bufptr, NULL);
+ eclat_request_add_param(q, bufptr, NULL);
} else if (strncmp(p, "ephemeral", 9) == 0) {
grecs_asprintf(&bufptr, &bufsize,
"BlockDeviceMapping.%d.VirtualName",
i);
- eclat_query_add_param(q, bufptr, p);
+ eclat_request_add_param(q, bufptr, p);
} else {
struct wordsplit ws;
@@ -95,7 +95,7 @@ eclat_encode_devmap(struct ec2_query *q, struct grecs_list *list)
ws.ws_wordv[0]);
}
}
- eclat_query_add_param(q, bufptr,
+ eclat_request_add_param(q, bufptr,
ws.ws_wordv[0]);
} else if (ws.ws_wordc < 2) {
die(EX_USAGE,
@@ -107,7 +107,7 @@ eclat_encode_devmap(struct ec2_query *q, struct grecs_list *list)
"BlockDeviceMapping.%d."
"Ebs.SnapshotId",
i);
- eclat_query_add_param(q, bufptr,
+ eclat_request_add_param(q, bufptr,
ws.ws_wordv[0]);
}
@@ -116,7 +116,7 @@ eclat_encode_devmap(struct ec2_query *q, struct grecs_list *list)
"BlockDeviceMapping.%d."
"Ebs.VolumeSize",
i);
- eclat_query_add_param(q, bufptr,
+ eclat_request_add_param(q, bufptr,
ws.ws_wordv[1]);
}
}
@@ -131,7 +131,7 @@ eclat_encode_devmap(struct ec2_query *q, struct grecs_list *list)
grecs_asprintf(&bufptr, &bufsize,
"BlockDeviceMapping.%d.Ebs.Iops",
i);
- eclat_query_add_param(q, bufptr,
+ eclat_request_add_param(q, bufptr,
ws.ws_wordv[4]);
}
/* fall through */
@@ -140,7 +140,7 @@ eclat_encode_devmap(struct ec2_query *q, struct grecs_list *list)
grecs_asprintf(&bufptr, &bufsize,
"BlockDeviceMapping.%d.Ebs.VolumeType",
i);
- eclat_query_add_param(q, bufptr,
+ eclat_request_add_param(q, bufptr,
ws.ws_wordv[3]);
}
/* fall through */
@@ -156,7 +156,7 @@ eclat_encode_devmap(struct ec2_query *q, struct grecs_list *list)
"BlockDeviceMapping.%d."
"Ebs.DeleteOnTermination",
i);
- eclat_query_add_param(q, bufptr,
+ eclat_request_add_param(q, bufptr,
ws.ws_wordv[2]);
}
case 2:
diff --git a/src/devol.c b/src/devol.c
index ceda9be..76a8423 100644
--- a/src/devol.c
+++ b/src/devol.c
@@ -22,7 +22,7 @@ int
eclat_detach_volume(eclat_command_env_t *env, int argc, char **argv)
{
int i;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
parse_options(env, argc, argv, &i);
argc -= i;
@@ -33,14 +33,14 @@ eclat_detach_volume(eclat_command_env_t *env, int argc, char **argv)
translate_ids(1, argv, MAP_VOLUME);
- eclat_query_add_param(q, "VolumeId", argv[0]);
+ eclat_request_add_param(q, "VolumeId", argv[0]);
if (argc > 1) {
translate_ids(1, argv + 1, MAP_INSTANCE);
- eclat_query_add_param(q, "InstanceId", argv[1]);
+ eclat_request_add_param(q, "InstanceId", argv[1]);
if (argc > 2)
- eclat_query_add_param(q, "Device", argv[2]);
+ eclat_request_add_param(q, "Device", argv[2]);
}
if (force)
- eclat_query_add_param(q, "Force", "true");
+ eclat_request_add_param(q, "Force", "true");
return 0;
}
diff --git a/src/disasaddr.c b/src/disasaddr.c
index 27711f6..8c6b88c 100644
--- a/src/disasaddr.c
+++ b/src/disasaddr.c
@@ -22,7 +22,7 @@ int
eclat_disassociate_address(eclat_command_env_t *env, int argc, char **argv)
{
int i;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
parse_options(env, argc, argv, &i);
argc -= i;
@@ -31,7 +31,7 @@ eclat_disassociate_address(eclat_command_env_t *env, int argc, char **argv)
if (argc != 1)
die(EX_USAGE, "wrong number of arguments to disassociate-address");
- eclat_query_add_param(q, vpc ? "AssociationId" : "PublicIp", argv[0]);
+ eclat_request_add_param(q, vpc ? "AssociationId" : "PublicIp", argv[0]);
return 0;
}
diff --git a/src/ec2map.c b/src/ec2map.c
index 943409c..6e2be10 100644
--- a/src/ec2map.c
+++ b/src/ec2map.c
@@ -138,7 +138,7 @@ static int
ec2_map_get(int dbg, int dir, void *data, const char *key, char **return_value)
{
struct ec2_map *map = data;
- struct ec2_query *q;
+ struct ec2_request *q;
struct grecs_list_entry *ep;
struct wordsplit ws;
int wsflags;
@@ -146,9 +146,9 @@ ec2_map_get(int dbg, int dir, void *data, const char *key, char **return_value)
struct grecs_node *tree, *node;
int rc;
- q = eclat_query_create(use_ssl ? EC2_QF_HTTPS : 0, endpoint, "/",
+ q = eclat_request_create(use_ssl ? EC2_RF_HTTPS : 0, endpoint, "/",
region_name, access_key, security_token);
- eclat_query_add_param(q, "Action", map->action);
+ eclat_request_add_param(q, "Action", map->action);
env[0] = "key";
env[1] = key;
@@ -171,20 +171,20 @@ ec2_map_get(int dbg, int dir, void *data, const char *key, char **return_value)
p = strchr(ws.ws_wordv[0], '=');
if (p) {
*p++ = 0;
- eclat_query_add_param(q, ws.ws_wordv[0], p);
+ eclat_request_add_param(q, ws.ws_wordv[0], p);
} else
- eclat_query_add_param(q, ws.ws_wordv[0], "");
+ eclat_request_add_param(q, ws.ws_wordv[0], "");
}
if (wsflags & WRDSF_REUSE)
wordsplit_free(&ws);
if (rc) {
- eclat_query_free(q);
+ eclat_request_free(q);
return eclat_map_failure;
}
- rc = eclat_send_query(map->io->curl, q);
+ rc = eclat_send_request(map->io->curl, q);
if (rc)
return eclat_map_failure;
diff --git a/src/eclat.c b/src/eclat.c
index 66cabdc..beaa934 100644
--- a/src/eclat.c
+++ b/src/eclat.c
@@ -646,14 +646,14 @@ eclat_do_command(eclat_command_env_t *env, struct eclat_command *command,
int rc;
if (!(command->flags & CMD_NOQRY)) {
- env->query = eclat_query_create(use_ssl ? EC2_QF_HTTPS : 0,
+ env->request = eclat_request_create(use_ssl ? EC2_RF_HTTPS : 0,
endpoint, "/",
region_name, access_key,
security_token);
}
if (command->tag)
- eclat_query_add_param(env->query, "Action", command->tag);
+ eclat_request_add_param(env->request, "Action", command->tag);
rc = command->handler(env, argc, argv);
@@ -661,7 +661,7 @@ eclat_do_command(eclat_command_env_t *env, struct eclat_command *command,
if (!eclat_confirm(confirm_mode,
"Proceed with %s", command->ident))
die(EX_CANCELLED, "command not confirmed");
- rc = eclat_send_query(env->curl, env->query);
+ rc = eclat_send_request(env->curl, env->request);
}
return rc;
}
diff --git a/src/eclat.h b/src/eclat.h
index 28fcaf0..a8ac2a0 100644
--- a/src/eclat.h
+++ b/src/eclat.h
@@ -81,7 +81,7 @@ int run_config_finish_hooks(void);
struct eclat_command_env {
struct eclat_command const *cmd;
CURL *curl;
- struct ec2_query *query;
+ struct ec2_request *request;
};
typedef struct eclat_command_env eclat_command_env_t;
@@ -180,12 +180,12 @@ void define_format(const char *name, const char *format, grecs_locus_t *locus);
void set_command_format(const char *name, const char *format,
grecs_locus_t *locus);
-void describe_query_create(eclat_command_env_t *env, int argc, char **argv,
+void describe_request_create(eclat_command_env_t *env, int argc, char **argv,
const char *uparm);
-void describe_query_update(eclat_command_env_t *env, int argc, char **argv,
+void describe_request_update(eclat_command_env_t *env, int argc, char **argv,
const char *uparm, int n_in, int *n_out);
-int eclat_send_query(CURL *curl, struct ec2_query *q);
+int eclat_send_request(CURL *curl, struct ec2_request *q);
char *eclat_get_instance_zone(void);
void eclat_get_instance_creds(char *id,
char **access_key_ptr, char **secret_key_ptr,
@@ -230,7 +230,7 @@ int get_scr_cols(void);
void translate_ids(int argc, char **argv, const char *map);
void translate_resource_ids(int argc, char **argv);
-void eclat_encode_devmap(struct ec2_query *q, struct grecs_list *list);
+void eclat_encode_devmap(struct ec2_request *q, struct grecs_list *list);
int get_access_creds(const char *id, char **access_key_ptr,
char **secret_key_ptr);
diff --git a/src/getconout.c b/src/getconout.c
index 28527d7..f294866 100644
--- a/src/getconout.c
+++ b/src/getconout.c
@@ -35,6 +35,6 @@ eclat_get_console_output(eclat_command_env_t *env, int argc, char **argv)
die(EX_USAGE, "only one argument is allowed");
translate_ids(argc, argv, MAP_INSTANCE);
- describe_query_create(env, argc, argv, "InstanceId");
+ describe_request_create(env, argc, argv, "InstanceId");
return 0;
}
diff --git a/src/lsaattr.c b/src/lsaattr.c
index b3c729a..9ab8547 100644
--- a/src/lsaattr.c
+++ b/src/lsaattr.c
@@ -31,7 +31,7 @@ int
eclat_describe_image_attribute(eclat_command_env_t *env, int argc, char **argv)
{
int i;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
const char *attrname;
generic_proginfo->args_doc = "AMI-ID [ATTR]";
@@ -56,8 +56,8 @@ eclat_describe_image_attribute(eclat_command_env_t *env, int argc, char **argv)
}
translate_ids(1, argv, MAP_IMAGE);
- eclat_query_add_param(q, "ImageId", argv[0]);
- eclat_query_add_param(q, "Attribute", attrname);
+ eclat_request_add_param(q, "ImageId", argv[0]);
+ eclat_request_add_param(q, "Attribute", attrname);
return 0;
}
diff --git a/src/lsaddr.c b/src/lsaddr.c
index e008856..edc9729 100644
--- a/src/lsaddr.c
+++ b/src/lsaddr.c
@@ -27,7 +27,7 @@ eclat_describe_addresses(eclat_command_env_t *env, int argc, char **argv)
argv += i;
argc -= i;
- describe_query_create(env, argc, argv,
+ describe_request_create(env, argc, argv,
vpc ? "AllocationId" : "PublicIp");
return 0;
}
diff --git a/src/lsiattr.c b/src/lsiattr.c
index 62b1dfb..6301588 100644
--- a/src/lsiattr.c
+++ b/src/lsiattr.c
@@ -36,7 +36,7 @@ int
eclat_describe_instance_attribute(eclat_command_env_t *env, int argc, char **argv)
{
int i;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
char *attrname;
generic_proginfo->args_doc = "INST-ID ATTR";
@@ -56,8 +56,8 @@ eclat_describe_instance_attribute(eclat_command_env_t *env, int argc, char **arg
if (!attrname)
die(EX_USAGE, "unrecognized attribute name");
- eclat_query_add_param(q, "InstanceId", argv[0]);
- eclat_query_add_param(q, "Attribute", attrname);
+ eclat_request_add_param(q, "InstanceId", argv[0]);
+ eclat_request_add_param(q, "Attribute", attrname);
return 0;
}
diff --git a/src/lsimg-cl.opt b/src/lsimg-cl.opt
index 9d3a026..5bde0d1 100644
--- a/src/lsimg-cl.opt
+++ b/src/lsimg-cl.opt
@@ -24,28 +24,28 @@ OPTION(all,a,,
[<describe all images>])
BEGIN
grecs_asprintf(&bufptr, &bufsize, "Owner.%d", ++owner_n);
- eclat_query_add_param(q, bufptr, "all");
+ eclat_request_add_param(q, bufptr, "all");
END
OPTION(owner,u,[<ID|amazon|aws-marketplace|self|all>],
[<select AMIs with a particular owner>])
BEGIN
grecs_asprintf(&bufptr, &bufsize, "Owner.%d", ++owner_n);
- eclat_query_add_param(q, bufptr, optarg);
+ eclat_request_add_param(q, bufptr, optarg);
END
OPTION(executable-by, x, [<ID|all|self>],
[<select images executable by the given user>])
BEGIN
grecs_asprintf(&bufptr, &bufsize, "ExecutableBy.%d", ++xby_n);
- eclat_query_add_param(q, bufptr, optarg);
+ eclat_request_add_param(q, bufptr, optarg);
END
ECLAT_CL_END
ECLAT_CL_PARSER(parse_options,[<int argc, char *argv[], int *idx>], [<
{
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
char *bufptr = NULL;
size_t bufsize = 0;
static char *arch[] = { "i386", "x86_64", NULL };
diff --git a/src/lsimg.c b/src/lsimg.c
index 4129a1e..2a2776c 100644
--- a/src/lsimg.c
+++ b/src/lsimg.c
@@ -28,7 +28,7 @@ eclat_describe_images(eclat_command_env_t *env, int argc, char **argv)
argv += i;
translate_ids(argc, argv, MAP_IMAGE);
- describe_query_create(env, argc, argv, "ImageId");
+ describe_request_create(env, argc, argv, "ImageId");
return 0;
}
diff --git a/src/lsinst.c b/src/lsinst.c
index ccf433f..7c65495 100644
--- a/src/lsinst.c
+++ b/src/lsinst.c
@@ -147,6 +147,6 @@ eclat_describe_instances(eclat_command_env_t *env, int argc, char **argv)
argc -= i;
translate_ids(argc, argv, MAP_INSTANCE);
- describe_query_create(env, argc, argv, "InstanceId");
+ describe_request_create(env, argc, argv, "InstanceId");
return 0;
}
diff --git a/src/lsistat.c b/src/lsistat.c
index 3638db7..3866384 100644
--- a/src/lsistat.c
+++ b/src/lsistat.c
@@ -28,9 +28,9 @@ eclat_describe_instance_status(eclat_command_env_t *env, int argc, char **argv)
argc -= i;
translate_ids(argc, argv, MAP_INSTANCE);
- describe_query_create(env, argc, argv, "InstanceId");
+ describe_request_create(env, argc, argv, "InstanceId");
if (all_option)
- eclat_query_add_param(env->query, "IncludeAllInstances", "1");
+ eclat_request_add_param(env->request, "IncludeAllInstances", "1");
return 0;
}
diff --git a/src/lsreg.c b/src/lsreg.c
index 94acf86..11c8203 100644
--- a/src/lsreg.c
+++ b/src/lsreg.c
@@ -44,6 +44,6 @@ eclat_describe_regions(eclat_command_env_t *env, int argc, char **argv)
argc -= i;
translate_ids(argc, argv, MAP_REG);
- describe_query_create(env, argc, argv, "RegionName");
+ describe_request_create(env, argc, argv, "RegionName");
return 0;
}
diff --git a/src/lssattr.c b/src/lssattr.c
index febf425..66ed07f 100644
--- a/src/lssattr.c
+++ b/src/lssattr.c
@@ -27,7 +27,7 @@ eclat_describe_snapshot_attribute(eclat_command_env_t *env,
int argc, char **argv)
{
int i;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
const char *attrname;
generic_proginfo->args_doc = "SNAP-ID [ATTR]";
@@ -52,8 +52,8 @@ eclat_describe_snapshot_attribute(eclat_command_env_t *env,
}
translate_ids(1, argv, MAP_SNAPSHOT);
- eclat_query_add_param(q, "SnapshotId", argv[0]);
- eclat_query_add_param(q, "Attribute", attrname);
+ eclat_request_add_param(q, "SnapshotId", argv[0]);
+ eclat_request_add_param(q, "Attribute", attrname);
return 0;
}
@@ -79,7 +79,7 @@ eclat_modify_snapshot_attribute(eclat_command_env_t *env,
int argc, char **argv)
{
int i;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
char *bufptr = NULL;
size_t bufsize = 0;
@@ -123,12 +123,12 @@ eclat_modify_snapshot_attribute(eclat_command_env_t *env,
if (argv[i][0] == 'u')
remdash(argv[i] + 2);
- eclat_query_add_param(q, bufptr, argv[i] + 2);
+ eclat_request_add_param(q, bufptr, argv[i] + 2);
}
free(bufptr);
translate_ids(1, argv + i, MAP_SNAPSHOT);
- eclat_query_add_param(q, "SnapshotId", argv[i]);
+ eclat_request_add_param(q, "SnapshotId", argv[i]);
return 0;
}
@@ -138,7 +138,7 @@ eclat_reset_snapshot_attribute(eclat_command_env_t *env,
int argc, char **argv)
{
int i;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
generic_proginfo->args_doc = "SNAP-ID";
generic_parse_options(env->cmd,
@@ -151,8 +151,8 @@ eclat_reset_snapshot_attribute(eclat_command_env_t *env,
die(EX_USAGE, "wrong number of arguments");
translate_ids(1, argv, MAP_SNAPSHOT);
- eclat_query_add_param(q, "SnapshotId", argv[0]);
- eclat_query_add_param(q, "Attribute", "CreateVolumePermission");
+ eclat_request_add_param(q, "SnapshotId", argv[0]);
+ eclat_request_add_param(q, "Attribute", "CreateVolumePermission");
return 0;
}
diff --git a/src/lssg.c b/src/lssg.c
index 9c60798..1d043c8 100644
--- a/src/lssg.c
+++ b/src/lssg.c
@@ -29,7 +29,7 @@ eclat_describe_security_groups(eclat_command_env_t *env, int argc, char **argv)
argc -= i;
translate_ids(argc, argv, groupkw[name_option].map);
- describe_query_create(env, argc, argv, groupkw[name_option].resid);
+ describe_request_create(env, argc, argv, groupkw[name_option].resid);
return 0;
}
diff --git a/src/lssnap.c b/src/lssnap.c
index 544c0a3..d78ac84 100644
--- a/src/lssnap.c
+++ b/src/lssnap.c
@@ -53,14 +53,14 @@ eclat_describe_snapshots(eclat_command_env_t *env, int argc, char **argv)
argv += i;
translate_ids(argc, argv, MAP_SNAPSHOT);
- describe_query_create(env, argc, argv, "SnapshotId");
+ describe_request_create(env, argc, argv, "SnapshotId");
if (parmlist) {
for (ep = parmlist->head; ep; ep = ep->next) {
struct param *param = ep->data;
grecs_asprintf(&buf, &size, "%s.%u",
param->name, param->idx);
- eclat_query_add_param(env->query, buf, param->value);
+ eclat_request_add_param(env->request, buf, param->value);
}
}
grecs_list_free(parmlist);
diff --git a/src/lstag.c b/src/lstag.c
index d0eb30e..2a39868 100644
--- a/src/lstag.c
+++ b/src/lstag.c
@@ -32,7 +32,7 @@ eclat_describe_tags(eclat_command_env_t *env, int argc, char **argv)
translate_resource_ids(argc, argv);
if (reslist->head) {
- eclat_query_add_param(env->query,
+ eclat_request_add_param(env->request,
"Filter.1.Name", "resource-id");
for (ep = reslist->head, i = 1; ep; ep = ep->next, i++) {
struct resource *res = ep->data;
@@ -40,11 +40,11 @@ eclat_describe_tags(eclat_command_env_t *env, int argc, char **argv)
translate_ids(1, &res->resid, res->map);
grecs_asprintf(&bufptr, &bufsize,
"Filter.1.Value.%d", i);
- eclat_query_add_param(env->query, bufptr, res->resid);
+ eclat_request_add_param(env->request, bufptr, res->resid);
}
n++;
}
- describe_query_update(env, argc, argv, NULL, n, NULL);
+ describe_request_update(env, argc, argv, NULL, n, NULL);
return 0;
}
diff --git a/src/lsvol.c b/src/lsvol.c
index 44cab84..47e8960 100644
--- a/src/lsvol.c
+++ b/src/lsvol.c
@@ -58,6 +58,6 @@ eclat_describe_volumes(eclat_command_env_t *env, int argc, char **argv)
argc -= i;
translate_ids(argc, argv, MAP_VOLUME);
- describe_query_create(env, argc, argv, "VolumeId");
+ describe_request_create(env, argc, argv, "VolumeId");
return 0;
}
diff --git a/src/lszon.c b/src/lszon.c
index 653b482..e9673c9 100644
--- a/src/lszon.c
+++ b/src/lszon.c
@@ -51,6 +51,6 @@ eclat_describe_avaialbility_zones(eclat_command_env_t *env,
argc -= i;
translate_ids(argc, argv, MAP_AZ);
- describe_query_create(env, argc, argv, "ZoneName");
+ describe_request_create(env, argc, argv, "ZoneName");
return 0;
}
diff --git a/src/mkimg.c b/src/mkimg.c
index 26aa0b5..21a4f86 100644
--- a/src/mkimg.c
+++ b/src/mkimg.c
@@ -24,7 +24,7 @@ int
eclat_create_image(eclat_command_env_t *env, int argc, char **argv)
{
int i;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
parse_options(env, argc, argv, &i);
argc -= i;
@@ -33,14 +33,14 @@ eclat_create_image(eclat_command_env_t *env, int argc, char **argv)
die(EX_USAGE, "wrong number of arguments");
translate_ids(1, argv+1, MAP_INSTANCE);
- eclat_query_add_param(q, "Name", argv[0]);
- eclat_query_add_param(q, "InstanceId", argv[1]);
+ eclat_request_add_param(q, "Name", argv[0]);
+ eclat_request_add_param(q, "InstanceId", argv[1]);
if (descr)
- eclat_query_add_param(q, "Description", descr);
+ eclat_request_add_param(q, "Description", descr);
if (noreboot)
- eclat_query_add_param(q, "NoReboot", "True");
+ eclat_request_add_param(q, "NoReboot", "True");
if (devmap)
eclat_encode_devmap(q, devmap);
diff --git a/src/mkinst.c b/src/mkinst.c
index cea7680..eb74acd 100644
--- a/src/mkinst.c
+++ b/src/mkinst.c
@@ -35,7 +35,7 @@
either sip-count or sips can be specified, but not both.
*/
void
-add_iface(struct ec2_query *q, int ifno, char *ifspec)
+add_iface(struct ec2_request *q, int ifno, char *ifspec)
{
struct wordsplit ws;
char *bufptr = NULL;
@@ -62,7 +62,7 @@ add_iface(struct ec2_query *q, int ifno, char *ifspec)
"NetworkInterface.%d."
"PrivateIpAddresses.%d.PrivateIpAddress",
ifno, i);
- eclat_query_add_param(q, bufptr, p);
+ eclat_request_add_param(q, bufptr, p);
}
/* fall through */
case 7:
@@ -71,7 +71,7 @@ add_iface(struct ec2_query *q, int ifno, char *ifspec)
"NetworkInterface.%d."
"SecondaryPrivateIpAddressCount",
ifno);
- eclat_query_add_param(q, bufptr, ws.ws_wordv[6]);
+ eclat_request_add_param(q, bufptr, ws.ws_wordv[6]);
}
case 6:
if (ws.ws_wordv[5][0]) {
@@ -79,7 +79,7 @@ add_iface(struct ec2_query *q, int ifno, char *ifspec)
"NetworkInterface.%d."
"DeleteOnTermination",
ifno);
- eclat_query_add_param(q, bufptr, ws.ws_wordv[5]);
+ eclat_request_add_param(q, bufptr, ws.ws_wordv[5]);
}
case 5:
if (ws.ws_wordv[4])
@@ -89,21 +89,21 @@ add_iface(struct ec2_query *q, int ifno, char *ifspec)
"NetworkInterface.%d."
"SecurityGroupId.%d",
ifno, i);
- eclat_query_add_param(q, bufptr, p);
+ eclat_request_add_param(q, bufptr, p);
}
case 4:
if (ws.ws_wordv[3]) {
grecs_asprintf(&bufptr, &bufsize,
"NetworkInterface.%d.PrivateIpAddress",
ifno);
- eclat_query_add_param(q, bufptr, ws.ws_wordv[3]);
+ eclat_request_add_param(q, bufptr, ws.ws_wordv[3]);
}
case 3:
if (ws.ws_wordv[2]) {
grecs_asprintf(&bufptr, &bufsize,
"NetworkInterface.%d.Description",
ifno);
- eclat_query_add_param(q, bufptr, ws.ws_wordv[2]);
+ eclat_request_add_param(q, bufptr, ws.ws_wordv[2]);
}
case 2:
if (!ws.ws_wordv[1][0])
@@ -113,14 +113,14 @@ add_iface(struct ec2_query *q, int ifno, char *ifspec)
}
grecs_asprintf(&bufptr, &bufsize, "NetworkInterface.%d.SubnetId",
ifno);
- eclat_query_add_param(q, bufptr,
+ eclat_request_add_param(q, bufptr,
ws.ws_wordv[1][0] ? ws.ws_wordv[1] : "0");
if (ws.ws_wordv[0][0]) {
grecs_asprintf(&bufptr, &bufsize,
"NetworkInterface.%d.DeviceIndex",
ifno);
- eclat_query_add_param(q, bufptr, ws.ws_wordv[0]);
+ eclat_request_add_param(q, bufptr, ws.ws_wordv[0]);
}
wordsplit_free(&ws);
@@ -134,68 +134,68 @@ eclat_run_instances(eclat_command_env_t *env, int argc, char **argv)
char *bufptr = NULL;
size_t bufsize = 0;
struct grecs_list_entry *ep;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
char *p;
int iface_no = 1;
parse_options(env, argc, argv);
- eclat_query_add_param(q, "ImageId", ami);
+ eclat_request_add_param(q, "ImageId", ami);
p = strchr(instance_count, '-');
- eclat_query_add_param(q, "MinCount", instance_count);
+ eclat_request_add_param(q, "MinCount", instance_count);
if (p) {
*p++ = 0;
- eclat_query_add_param(q, "MaxCount", p);
+ eclat_request_add_param(q, "MaxCount", p);
} else
- eclat_query_add_param(q, "MaxCount", instance_count);
+ eclat_request_add_param(q, "MaxCount", instance_count);
if (keypair)
- eclat_query_add_param(q, "KeyName", keypair);
+ eclat_request_add_param(q, "KeyName", keypair);
if (secgrp) {
for (i = 1, ep = secgrp->head; ep; ep = ep->next, i++) {
grecs_asprintf(&bufptr, &bufsize,
"SecurityGroup.%d", i);
- eclat_query_add_param(q, bufptr, ep->data);
+ eclat_request_add_param(q, bufptr, ep->data);
}
}
if (type)
- eclat_query_add_param(q, "InstanceType", type);
+ eclat_request_add_param(q, "InstanceType", type);
if (zone)
- eclat_query_add_param(q, "Placement.AvailabilityZone", zone);
+ eclat_request_add_param(q, "Placement.AvailabilityZone", zone);
if (kernel)
- eclat_query_add_param(q, "KernelId", kernel);
+ eclat_request_add_param(q, "KernelId", kernel);
if (ramdisk)
- eclat_query_add_param(q, "RamdiskId", ramdisk);
+ eclat_request_add_param(q, "RamdiskId", ramdisk);
if (devmap)
eclat_encode_devmap(q, devmap);
if (monitor)
- eclat_query_add_param(q, "Monitoring.Enabled", "true");
+ eclat_request_add_param(q, "Monitoring.Enabled", "true");
if (disable_term)
- eclat_query_add_param(q, "DisableApiTermination", "true");
+ eclat_request_add_param(q, "DisableApiTermination", "true");
if (shutdown_behavior)
- eclat_query_add_param(q, "InstanceInitiatedShutdownBehavior",
+ eclat_request_add_param(q, "InstanceInitiatedShutdownBehavior",
"true");
if (placement_group)
- eclat_query_add_param(q, "Placement.GroupName",
+ eclat_request_add_param(q, "Placement.GroupName",
placement_group);
if (tenancy)
- eclat_query_add_param(q, "Placement.Tenancy", tenancy);
+ eclat_request_add_param(q, "Placement.Tenancy", tenancy);
if (subnet)
- eclat_query_add_param(q, "SubnetId", subnet);
+ eclat_request_add_param(q, "SubnetId", subnet);
if (private_ip)
- eclat_query_add_param(q, "PrivateIpAddress", private_ip);
+ eclat_request_add_param(q, "PrivateIpAddress", private_ip);
/* FIXME: I'm not at all sure whether this is the right way of
doing it. */
@@ -205,11 +205,11 @@ eclat_run_instances(eclat_command_env_t *env, int argc, char **argv)
"NetworkInterface.1."
"PrivateIpAddresses.%d.PrivateIpAddress",
i);
- eclat_query_add_param(q, bufptr, ep->data);
+ eclat_request_add_param(q, bufptr, ep->data);
}
iface_no++;
} else if (secipcount) {
- eclat_query_add_param(q,
+ eclat_request_add_param(q,
"NetworkInterface.1."
"SecondaryPrivateIpAddressCount",
secipcount);
@@ -221,14 +221,14 @@ eclat_run_instances(eclat_command_env_t *env, int argc, char **argv)
add_iface(q, iface_no++, ep->data);
if (profile_name)
- eclat_query_add_param(q,
+ eclat_request_add_param(q,
strncmp(profile_name, "arn:", 4) == 0 ?
"IamInstanceProfile.Arn" :
"IamInstanceProfile.Name",
profile_name);
if (ebs_opt)
- eclat_query_add_param(q, "EbsOptimized", "true");
+ eclat_request_add_param(q, "EbsOptimized", "true");
if (user_data) {
size_t enclen;
@@ -237,7 +237,7 @@ eclat_run_instances(eclat_command_env_t *env, int argc, char **argv)
strlen(user_data),
(unsigned char**) &p, &enclen);
- eclat_query_add_param(q, "UserData", p);
+ eclat_request_add_param(q, "UserData", p);
free(p);
}
diff --git a/src/mksg.c b/src/mksg.c
index f69adc1..11aa2fb 100644
--- a/src/mksg.c
+++ b/src/mksg.c
@@ -21,7 +21,7 @@ int
eclat_create_security_group(eclat_command_env_t *env, int argc, char **argv)
{
int i;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
parse_options(env, argc, argv, &i);
argc -= i;
@@ -29,10 +29,10 @@ eclat_create_security_group(eclat_command_env_t *env, int argc, char **argv)
if (argc != 2)
die(EX_USAGE, "wrong number of arguments");
- eclat_query_add_param(q, "GroupName", argv[0]);
- eclat_query_add_param(q, "GroupDescription", argv[1]);
+ eclat_request_add_param(q, "GroupName", argv[0]);
+ eclat_request_add_param(q, "GroupDescription", argv[1]);
if (vpcid)
- eclat_query_add_param(q, "VpcId", vpcid);
+ eclat_request_add_param(q, "VpcId", vpcid);
return 0;
}
diff --git a/src/mksnap.c b/src/mksnap.c
index 9b72c03..5b51c12 100644
--- a/src/mksnap.c
+++ b/src/mksnap.c
@@ -46,9 +46,9 @@ eclat_create_snapshot(eclat_command_env_t *env, int argc, char **argv)
descr = grecs_txtacc_finish(acc, 0);
}
- eclat_query_add_param(env->query, "VolumeId", argv[0]);
+ eclat_request_add_param(env->request, "VolumeId", argv[0]);
if (descr)
- eclat_query_add_param(env->query, "Description", descr);
+ eclat_request_add_param(env->request, "Description", descr);
if (acc)
grecs_txtacc_free(acc);
return 0;
diff --git a/src/mktags.c b/src/mktags.c
index dceb7eb..6fb3b10 100644
--- a/src/mktags.c
+++ b/src/mktags.c
@@ -21,7 +21,7 @@ static int
process_tags(eclat_command_env_t *env, int argc, char **argv, int require_tags)
{
int i, j;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
char *bufptr = NULL;
size_t bufsize = 0;
struct grecs_list_entry *ep;
@@ -42,7 +42,7 @@ process_tags(eclat_command_env_t *env, int argc, char **argv, int require_tags)
grecs_asprintf(&bufptr, &bufsize, "ResourceId.%d", i);
if (res->map)
translate_ids(1, &res->resid, res->map);
- eclat_query_add_param(q, bufptr, res->resid);
+ eclat_request_add_param(q, bufptr, res->resid);
}
j = 1;
@@ -71,7 +71,7 @@ process_tags(eclat_command_env_t *env, int argc, char **argv, int require_tags)
if (p)
*p++ = 0;
grecs_asprintf(&bufptr, &bufsize, "Tag.%d.Key", j);
- eclat_query_add_param(q, bufptr, inbuf);
+ eclat_request_add_param(q, bufptr, inbuf);
if (p) {
grecs_asprintf(&bufptr, &bufsize,
"Tag.%d.Value", j);
@@ -81,11 +81,11 @@ process_tags(eclat_command_env_t *env, int argc, char **argv, int require_tags)
wordsplit_c_unquote_copy(copy, p + 1,
len - 2);
- eclat_query_add_param(q, bufptr,
+ eclat_request_add_param(q, bufptr,
copy);
free(copy);
} else
- eclat_query_add_param(q, bufptr, p);
+ eclat_request_add_param(q, bufptr, p);
}
++j;
}
@@ -99,10 +99,10 @@ process_tags(eclat_command_env_t *env, int argc, char **argv, int require_tags)
if (p)
*p++ = 0;
grecs_asprintf(&bufptr, &bufsize, "Tag.%d.Key", j);
- eclat_query_add_param(q, bufptr, argv[i]);
+ eclat_request_add_param(q, bufptr, argv[i]);
if (p) {
grecs_asprintf(&bufptr, &bufsize, "Tag.%d.Value", j);
- eclat_query_add_param(q, bufptr, p);
+ eclat_request_add_param(q, bufptr, p);
}
}
free(bufptr);
diff --git a/src/mkvol.c b/src/mkvol.c
index 1f47097..0d5f05c 100644
--- a/src/mkvol.c
+++ b/src/mkvol.c
@@ -24,7 +24,7 @@ int
eclat_create_volume(eclat_command_env_t *env, int argc, char **argv)
{
int i;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
parse_options(env, argc, argv, &i);
argc -= i;
@@ -32,13 +32,13 @@ eclat_create_volume(eclat_command_env_t *env, int argc, char **argv)
if (argc != 2)
die(EX_USAGE, "wrong number of arguments");
- eclat_query_add_param(q, "Size", argv[0]);
- eclat_query_add_param(q, "AvailabilityZone", argv[1]);
+ eclat_request_add_param(q, "Size", argv[0]);
+ eclat_request_add_param(q, "AvailabilityZone", argv[1]);
if (snapshot)
- eclat_query_add_param(q, "SnapshotId", snapshot);
+ eclat_request_add_param(q, "SnapshotId", snapshot);
if (iops) {
- eclat_query_add_param(q, "VolumeType", "io1");
- eclat_query_add_param(q, "Iops", iops);
+ eclat_request_add_param(q, "VolumeType", "io1");
+ eclat_request_add_param(q, "Iops", iops);
}
return 0;
}
diff --git a/src/rmaddr.c b/src/rmaddr.c
index 4cb1389..d01718a 100644
--- a/src/rmaddr.c
+++ b/src/rmaddr.c
@@ -30,7 +30,7 @@ eclat_release_address(eclat_command_env_t *env, int argc, char **argv)
if (argc != 1)
die(EX_USAGE, "wrong number of arguments to release-address");
- eclat_query_add_param(env->query, vpc ? "AssociationId" : "PublicIp",
+ eclat_request_add_param(env->request, vpc ? "AssociationId" : "PublicIp",
argv[0]);
return 0;
diff --git a/src/rmsg.c b/src/rmsg.c
index f4ec416..4d6e458 100644
--- a/src/rmsg.c
+++ b/src/rmsg.c
@@ -21,7 +21,7 @@ int
eclat_delete_security_group(eclat_command_env_t *env, int argc, char **argv)
{
int i;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
parse_options(env, argc, argv, &i);
argc -= i;
@@ -29,7 +29,7 @@ eclat_delete_security_group(eclat_command_env_t *env, int argc, char **argv)
if (argc != 1)
die(EX_USAGE, "bad number of arguments");
translate_ids(1, &argv[0], groupkw[group_n].map);
- eclat_query_add_param(q, groupkw[group_n].resid, argv[0]);
+ eclat_request_add_param(q, groupkw[group_n].resid, argv[0]);
return 0;
}
diff --git a/src/rmsnap.c b/src/rmsnap.c
index d259694..3987fbb 100644
--- a/src/rmsnap.c
+++ b/src/rmsnap.c
@@ -20,7 +20,7 @@ int
eclat_delete_snapshot(eclat_command_env_t *env, int argc, char **argv)
{
int i;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
generic_proginfo->args_doc = "SNAP-ID";
generic_parse_options(env->cmd,
@@ -31,7 +31,7 @@ eclat_delete_snapshot(eclat_command_env_t *env, int argc, char **argv)
if (argc != 1)
die(EX_USAGE, "bad number of arguments");
translate_ids(argc, argv, MAP_SNAPSHOT);
- eclat_query_add_param(q, "SnapshotId", argv[0]);
+ eclat_request_add_param(q, "SnapshotId", argv[0]);
return 0;
}
diff --git a/src/rmvol.c b/src/rmvol.c
index 9e2ed16..b2c9881 100644
--- a/src/rmvol.c
+++ b/src/rmvol.c
@@ -20,7 +20,7 @@ int
eclat_delete_volume(eclat_command_env_t *env, int argc, char **argv)
{
int i;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
generic_proginfo->args_doc = "VOL-ID";
generic_parse_options(env->cmd,
@@ -32,7 +32,7 @@ eclat_delete_volume(eclat_command_env_t *env, int argc, char **argv)
if (argc != 1)
die(EX_USAGE, "bad number of arguments");
translate_ids(argc, argv, MAP_VOLUME);
- eclat_query_add_param(q, "VolumeId", argv[0]);
+ eclat_request_add_param(q, "VolumeId", argv[0]);
return 0;
}
diff --git a/src/setaattr.c b/src/setaattr.c
index 189834d..949facb 100644
--- a/src/setaattr.c
+++ b/src/setaattr.c
@@ -56,7 +56,7 @@ eclat_modify_image_attribute(eclat_command_env_t *env,
int argc, char **argv)
{
int i;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
const char *attrname;
char *bufptr = NULL;
size_t bufsize = 0;
@@ -75,7 +75,7 @@ eclat_modify_image_attribute(eclat_command_env_t *env,
if (!attrname)
die(EX_USAGE, "unrecognized attribute name");
- eclat_query_add_param(q, "ImageId", argv[0]);
+ eclat_request_add_param(q, "ImageId", argv[0]);
argv++;
argc--;
@@ -84,13 +84,13 @@ eclat_modify_image_attribute(eclat_command_env_t *env,
if (strcmp(attrname, "description") == 0) {
if (argc != 2)
die(EX_USAGE, "only one description is allowed");
- eclat_query_add_param(q, "Description.Value", argv[1]);
+ eclat_request_add_param(q, "Description.Value", argv[1]);
} else if (strcmp(attrname, "ProductCode") == 0) {
for (i = 1; i < argc; i++) {
grecs_asprintf(&bufptr, &bufsize,
"ProductCode.%d",
i);
- eclat_query_add_param(q, bufptr, argv[i]);
+ eclat_request_add_param(q, bufptr, argv[i]);
}
} else {
int j = 1;
@@ -106,7 +106,7 @@ eclat_modify_image_attribute(eclat_command_env_t *env,
"LaunchPermission.%s.%d.%s",
action_string[action], j++,
acct_string[acctype]);
- eclat_query_add_param(q, bufptr,
+ eclat_request_add_param(q, bufptr,
canonuserid(argv[0]));
}
}
diff --git a/src/setiattr.c b/src/setiattr.c
index e799bc7..f7c7cd1 100644
--- a/src/setiattr.c
+++ b/src/setiattr.c
@@ -62,7 +62,7 @@ int
eclat_modify_instance_attribute(eclat_command_env_t *env, int argc, char **argv)
{
int i;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
const char *canonattr;
size_t canonlen;
char *bufptr = NULL;
@@ -76,7 +76,7 @@ eclat_modify_instance_attribute(eclat_command_env_t *env, int argc, char **argv)
die(EX_USAGE, "wrong number of arguments");
translate_ids(1, argv, MAP_INSTANCE);
- eclat_query_add_param(q, "InstanceId", argv[0]);
+ eclat_request_add_param(q, "InstanceId", argv[0]);
canonattr = canonattrname(attrs, argv[1], ".", &canonlen);
if (!canonattr)
@@ -86,7 +86,7 @@ eclat_modify_instance_attribute(eclat_command_env_t *env, int argc, char **argv)
strcmp(canonattr+canonlen+1, "%d") == 0) {
for (i = 2; i < argc; i++) {
grecs_asprintf(&bufptr, &bufsize, canonattr, i - 1);
- eclat_query_add_param(q, bufptr, argv[i]);
+ eclat_request_add_param(q, bufptr, argv[i]);
}
} else if (canonattr[canonlen] == '.' &&
strcmp(canonattr+canonlen, ".ebs") == 0) {
@@ -99,7 +99,7 @@ eclat_modify_instance_attribute(eclat_command_env_t *env, int argc, char **argv)
grecs_asprintf(&bufptr, &bufsize,
"%*.*s.%d.DeviceName",
canonlen, canonlen, canonattr, i - 1);
- eclat_query_add_param(q, bufptr, argv[i]);
+ eclat_request_add_param(q, bufptr, argv[i]);
grecs_asprintf(&bufptr,
&bufsize,
@@ -109,7 +109,7 @@ eclat_modify_instance_attribute(eclat_command_env_t *env, int argc, char **argv)
if (strcmp(p, "false") && strcmp(p, "true"))
die(EX_USAGE, "not a valid boolean in %s",
argv[i]);
- eclat_query_add_param(q, bufptr, p);
+ eclat_request_add_param(q, bufptr, p);
}
} else if (strcmp(canonattr, "UserData.Value") == 0) {
char *input = from_file ? read_file(argv[2]) : argv[2];
@@ -122,11 +122,11 @@ eclat_modify_instance_attribute(eclat_command_env_t *env, int argc, char **argv)
eclat_base64_encode((unsigned char *)input,
strlen(input),
(unsigned char**) &data, &enclen);
- eclat_query_add_param(q, canonattr, data);
+ eclat_request_add_param(q, canonattr, data);
if (enclen)
free(data);
} else
- eclat_query_add_param(q, canonattr, argv[2]);
+ eclat_request_add_param(q, canonattr, argv[2]);
free(bufptr);
return 0;
}
diff --git a/src/sg-cl.opt b/src/sg-cl.opt
index 5bcba0a..d361d00 100644
--- a/src/sg-cl.opt
+++ b/src/sg-cl.opt
@@ -133,15 +133,15 @@ ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[]>],[<
die(EX_USAGE, "bad number of arguments");
translate_ids(argc, argv, groupkw[dest_n].map);
- eclat_query_add_param(env->query, "Action", command);
+ eclat_request_add_param(env->request, "Action", command);
if (list_option)
- describe_query_create(env, argc, argv, groupkw[dest_n].resid);
+ describe_request_create(env, argc, argv, groupkw[dest_n].resid);
else {
if (group_list || source_list || from_port || to_port || proto)
flush_rule();
if (rule_n == 1)
die(EX_USAGE, "no rules");
- eclat_query_add_param(query, groupkw[dest_n].resid, argv[0]);
+ eclat_request_add_param(request, groupkw[dest_n].resid, argv[0]);
}
}>])
diff --git a/src/sg.c b/src/sg.c
index 8166f18..c8e6af1 100644
--- a/src/sg.c
+++ b/src/sg.c
@@ -25,7 +25,7 @@ struct groupkw groupkw[] = {
{ "GroupName", MAP_GROUPNAME }
};
-static struct ec2_query *query;
+static struct ec2_request *request;
static char *command;
static int list_option;
static int dest_n = GROUP_ID;
@@ -121,7 +121,7 @@ add_source_cidr(char *str, int i)
grecs_asprintf(&bufptr, &bufsize,
"IpPermissions.%d.IpRanges.%d.CidrIp",
rule_n, i);
- eclat_query_add_param(query, bufptr, cidrbuf);
+ eclat_request_add_param(request, bufptr, cidrbuf);
i++;
}
}
@@ -162,7 +162,7 @@ flush_rule()
grecs_asprintf(&bufptr, &bufsize, "IpPermissions.%d.IpProtocol",
rule_n);
- eclat_query_add_param(query, bufptr, proto);
+ eclat_request_add_param(request, bufptr, proto);
if (group_list) {
for (i = 1, ep = group_list->head; ep; ep = ep->next, i++) {
@@ -172,12 +172,12 @@ flush_rule()
"IpPermissions.%d.Groups.%d.%s",
rule_n, i,
groupkw[a->type].resid);
- eclat_query_add_param(query, bufptr, a->str);
+ eclat_request_add_param(request, bufptr, a->str);
if (a->usr) {
grecs_asprintf(&bufptr, &bufsize,
"IpPermissions.%d.Groups.%d.UserId",
rule_n, i);
- eclat_query_add_param(query, bufptr, a->usr);
+ eclat_request_add_param(request, bufptr, a->usr);
}
}
grecs_list_clear(group_list);
@@ -192,7 +192,7 @@ flush_rule()
grecs_asprintf(&bufptr, &bufsize,
"IpPermissions.%d.IpRanges.1.CidrIp",
rule_n);
- eclat_query_add_param(query, bufptr, "0.0.0.0/0");
+ eclat_request_add_param(request, bufptr, "0.0.0.0/0");
}
if (from_port) {
@@ -201,11 +201,11 @@ flush_rule()
grecs_asprintf(&bufptr, &bufsize, "IpPermissions.%d.FromPort",
rule_n);
- eclat_query_add_param(query, bufptr,
+ eclat_request_add_param(request, bufptr,
str2port(from_port, &pbuf, &psize));
grecs_asprintf(&bufptr, &bufsize, "IpPermissions.%d.ToPort",
rule_n);
- eclat_query_add_param(query, bufptr,
+ eclat_request_add_param(request, bufptr,
str2port(to_port, &pbuf, &psize));
free(pbuf);
}
@@ -218,7 +218,7 @@ flush_rule()
int
eclat_sg(eclat_command_env_t *env, int argc, char **argv)
{
- query = env->query;
+ request = env->request;
parse_options(env, argc, argv);
return 0;
}
diff --git a/src/startstop.c b/src/startstop.c
index 49c5baf..f5346c4 100644
--- a/src/startstop.c
+++ b/src/startstop.c
@@ -29,7 +29,7 @@ static int
start_stop_instance(eclat_command_env_t *env, int argc, char **argv)
{
int i;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
char buf[128], *bend;
size_t bs;
@@ -42,7 +42,7 @@ start_stop_instance(eclat_command_env_t *env, int argc, char **argv)
bs = sizeof(buf) - strlen(buf);
for (i = 0; i < argc; i++) {
snprintf(bend, bs, "%lu", (unsigned long)(i + 1));
- eclat_query_add_param(q, buf, argv[i]);
+ eclat_request_add_param(q, buf, argv[i]);
}
return 0;
diff --git a/src/util.c b/src/util.c
index ecd3173..92532f0 100644
--- a/src/util.c
+++ b/src/util.c
@@ -164,11 +164,11 @@ get_scr_cols()
void
-describe_query_update(eclat_command_env_t *env, int argc, char **argv,
+describe_request_update(eclat_command_env_t *env, int argc, char **argv,
const char *uparm, int n_in, int *n_out)
{
int i, j, k;
- struct ec2_query *q = env->query;
+ struct ec2_request *q = env->request;
char *bufptr = NULL;
size_t bufsize = 0;
struct wordsplit ws;
@@ -183,14 +183,14 @@ describe_query_update(eclat_command_env_t *env, int argc, char **argv,
if (uparm) {
grecs_asprintf(&bufptr, &bufsize,
"%s.%d", uparm, upn++);
- eclat_query_add_param(q, bufptr, argv[i]);
+ eclat_request_add_param(q, bufptr, argv[i]);
continue;
}
die(EX_USAGE, "malformed filter: %s", argv[i]);
}
*p++ = 0;
grecs_asprintf(&bufptr, &bufsize, "Filter.%d.Name", j);
- eclat_query_add_param(q, bufptr, argv[i]);
+ eclat_request_add_param(q, bufptr, argv[i]);
if (wordsplit(p, &ws, wsflags))
die(EX_SOFTWARE, "wordsplit failed at \"%s\": %s",
@@ -200,7 +200,7 @@ describe_query_update(eclat_command_env_t *env, int argc, char **argv,
for (k = 0; k < ws.ws_wordc; k++) {
grecs_asprintf(&bufptr, &bufsize, "Filter.%d.Value.%d",
j, k+1);
- eclat_query_add_param(q, bufptr, ws.ws_wordv[k]);
+ eclat_request_add_param(q, bufptr, ws.ws_wordv[k]);
}
++j;
}
@@ -212,14 +212,14 @@ describe_query_update(eclat_command_env_t *env, int argc, char **argv,
}
void
-describe_query_create(eclat_command_env_t *env, int argc, char **argv,
+describe_request_create(eclat_command_env_t *env, int argc, char **argv,
const char *uparm)
{
- describe_query_update(env, argc, argv, uparm, 1, NULL);
+ describe_request_update(env, argc, argv, uparm, 1, NULL);
}
int
-eclat_send_query(CURL *curl, struct ec2_query *q)
+eclat_send_request(CURL *curl, struct ec2_request *req)
{
char *url;
CURLcode res;
@@ -227,19 +227,19 @@ eclat_send_query(CURL *curl, struct ec2_query *q)
struct curl_slist *headers = NULL;
/* Prepare the request */
- eclat_query_sign(q, secret_key, signature_version);
- url = eclat_query_to_url(q, NULL);
+ eclat_request_sign(req, secret_key, signature_version);
+ url = eclat_request_to_url(req, NULL);
curl_easy_setopt(curl, CURLOPT_URL, url);
debug(ECLAT_DEBCAT_MAIN, 1, ("using URL: %s", url));
free(url);
- if (q->headers) {
+ if (req->headers) {
struct grecs_list_entry *ep;
struct grecs_txtacc *acc;
int rc;
acc = grecs_txtacc_create();
- for (ep = q->headers->head; ep; ep = ep->next) {
+ for (ep = req->headers->head; ep; ep = ep->next) {
struct ec2_param *p = ep->data;
char *str;
@@ -273,7 +273,7 @@ eclat_send_query(CURL *curl, struct ec2_query *q)
rc = 1;
}
}
- eclat_query_free(q);
+ eclat_request_free(req);
curl_slist_free_all(headers);
return rc;
}

Return to:

Send suggestions and report system problems to the System administrator.