summaryrefslogtreecommitdiffabout
path: root/src
Side-by-side diff
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/eclat.c4
-rw-r--r--src/eclat.h1
-rw-r--r--src/startstop.c14
3 files changed, 18 insertions, 1 deletions
diff --git a/src/eclat.c b/src/eclat.c
index 12b4dd1..26a8f9f 100644
--- a/src/eclat.c
+++ b/src/eclat.c
@@ -90,6 +90,9 @@ struct eclat_command cmdtab[] = {
CMD_MOD },
{ "reboot", "reboot-instances", "RebootInstances", eclat_reboot_instance,
CMD_MOD },
+ { "terminate", "terminate-instances", "TerminateInstances",
+ eclat_terminate_instances, CMD_MOD|CMD_DESTR },
+
{ "lsaddr", "describe-addresses", "DescribeAddresses",
eclat_describe_addresses },
{ "lstag", "describe-tags", "DescribeTags", eclat_describe_tags },
@@ -205,6 +208,7 @@ struct eclat_command cmdtab[] = {
{ "disasrtab", "disassociate-route-table", "DisassociateRouteTable",
eclat_disassociate_route_table, CMD_MOD },
{ "route", NULL, NULL, eclat_route },
+
};
size_t cmdcnt = sizeof(cmdtab) / sizeof(cmdtab[0]);
diff --git a/src/eclat.h b/src/eclat.h
index 21e89e1..1948234 100644
--- a/src/eclat.h
+++ b/src/eclat.h
@@ -126,6 +126,7 @@ int eclat_trace_fun(CURL *handle, curl_infotype type,
int eclat_start_instance(eclat_command_env_t *env, int argc, char **argv);
int eclat_stop_instance(eclat_command_env_t *env, int argc, char **argv);
int eclat_reboot_instance(eclat_command_env_t *env, int argc, char **argv);
+int eclat_terminate_instances(eclat_command_env_t *env, int argc, char **argv);
int eclat_describe_tags(eclat_command_env_t *env, int argc, char **argv);
int eclat_describe_instance_status(eclat_command_env_t *env, int argc, char **argv);
int eclat_describe_instances(eclat_command_env_t *env, int argc, char **argv);
diff --git a/src/startstop.c b/src/startstop.c
index 2460682..78c581c 100644
--- a/src/startstop.c
+++ b/src/startstop.c
@@ -44,7 +44,6 @@ start_stop_instance(eclat_command_env_t *env, int argc, char **argv)
snprintf(bend, bs, "%lu", (unsigned long)(i + 1));
eclat_request_add_param(q, buf, argv[i]);
}
-
return 0;
}
@@ -90,3 +89,16 @@ eclat_reboot_instance(eclat_command_env_t *env, int argc, char **argv)
debug(ECLAT_DEBCAT_MAIN, 1, ("rebooting instances"));
return start_stop_instance(env, argc - i, argv + i);
}
+
+int
+eclat_terminate_instances(eclat_command_env_t *env, int argc, char **argv)
+{
+ int i;
+
+ parse_options(env->cmd,
+ "Terminate named instances",
+ argc, argv, &i);
+
+ debug(ECLAT_DEBCAT_MAIN, 1, ("terminate instances"));
+ return start_stop_instance(env, argc - i, argv + i);
+}

Return to:

Send suggestions and report system problems to the System administrator.