diff --git a/COGNAC b/COGNAC index 5746272..4921386 160000 --- a/COGNAC +++ b/COGNAC @@ -1 +1 @@ -Subproject commit 5746272ebee097892780a2cbd4bf339bba8e40ef +Subproject commit 49213862a7317fbf52fd27578b2afc975e445ad8 diff --git a/main.c b/main.c index 3bea2e3..8cb61b4 100644 --- a/main.c +++ b/main.c @@ -47,7 +47,7 @@ #define OAPI_RAW_OUTPUT 1 -#define OAPI_CLI_VERSION "0.8.0" +#define OAPI_CLI_VERSION "0.9.0" #define OAPI_CLI_UAGENT "oapi-cli/"OAPI_CLI_VERSION"; osc-sdk-c/" @@ -259,6 +259,7 @@ int access_key_parser(void *s, char *str, char *aa, struct ptr_array *pa); int access_key_secret_key_parser(void *s, char *str, char *aa, struct ptr_array *pa); int access_log_parser(void *s, char *str, char *aa, struct ptr_array *pa); int account_parser(void *s, char *str, char *aa, struct ptr_array *pa); +int actions_on_next_boot_parser(void *s, char *str, char *aa, struct ptr_array *pa); int api_access_policy_parser(void *s, char *str, char *aa, struct ptr_array *pa); int api_access_rule_parser(void *s, char *str, char *aa, struct ptr_array *pa); int application_sticky_cookie_policy_parser(void *s, char *str, char *aa, struct ptr_array *pa); @@ -675,6 +676,21 @@ int account_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { return 0; } +int actions_on_next_boot_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { + struct actions_on_next_boot *s = v_s; + int aret = 0; + if ((aret = argcmp(str, "SecureBoot")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "SecureBoot argument missing\n"); + s->secure_boot = aa; // string string + + } else + { + fprintf(stderr, "'%s' not an argumemt of 'ActionsOnNextBoot'\n", str); + return -1; + } + return 0; +} + int api_access_policy_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { struct api_access_policy *s = v_s; int aret = 0; @@ -3522,6 +3538,34 @@ int filters_image_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { TRY(!aa, "BlockDeviceMappingVolumeTypes[] argument missing\n"); SET_NEXT(s->block_device_mapping_volume_types, (aa), pa); } else + if ((aret = argcmp(str, "BootModes")) == 0 || aret == '=' || aret == '.') { + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "BootModes argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "BootModes require an index\n"); + if (s->boot_modes) { + for (; s->boot_modes[last]; ++last); + } + if (pos < last) { + s->boot_modes[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->boot_modes, "", pa); + SET_NEXT(s->boot_modes, (aa), pa); + } + } else { + TRY(!aa, "BootModes argument missing\n"); + s->boot_modes_str = aa; + } + } else if (!(aret = argcmp(str, "BootModes[]")) || aret == '=') { + TRY(!aa, "BootModes[] argument missing\n"); + SET_NEXT(s->boot_modes, (aa), pa); + } else if ((aret = argcmp(str, "Descriptions")) == 0 || aret == '=' || aret == '.') { if (aret == '.') { int pos; @@ -3812,6 +3856,16 @@ int filters_image_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { TRY(!aa, "RootDeviceTypes[] argument missing\n"); SET_NEXT(s->root_device_types, (aa), pa); } else + if ((aret = argcmp(str, "SecureBoot")) == 0 || aret == '=' || aret == '.') { + s->is_set_secure_boot = 1; + if (!aa || !strcasecmp(aa, "true")) { + s->secure_boot = 1; + } else if (!strcasecmp(aa, "false")) { + s->secure_boot = 0; + } else { + BAD_RET("SecureBoot require true/false\n"); + } + } else if ((aret = argcmp(str, "States")) == 0 || aret == '=' || aret == '.') { if (aret == '.') { int pos; @@ -7924,6 +7978,34 @@ int filters_snapshot_parser(void *v_s, char *str, char *aa, struct ptr_array *pa TRY(!aa, "AccountIds[] argument missing\n"); SET_NEXT(s->account_ids, (aa), pa); } else + if ((aret = argcmp(str, "ClientTokens")) == 0 || aret == '=' || aret == '.') { + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "ClientTokens argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "ClientTokens require an index\n"); + if (s->client_tokens) { + for (; s->client_tokens[last]; ++last); + } + if (pos < last) { + s->client_tokens[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->client_tokens, "", pa); + SET_NEXT(s->client_tokens, (aa), pa); + } + } else { + TRY(!aa, "ClientTokens argument missing\n"); + s->client_tokens_str = aa; + } + } else if (!(aret = argcmp(str, "ClientTokens[]")) || aret == '=') { + TRY(!aa, "ClientTokens[] argument missing\n"); + SET_NEXT(s->client_tokens, (aa), pa); + } else if ((aret = argcmp(str, "Descriptions")) == 0 || aret == '=' || aret == '.') { if (aret == '.') { int pos; @@ -9177,6 +9259,34 @@ int filters_vm_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { TRY(!aa, "BlockDeviceMappingVolumeIds[] argument missing\n"); SET_NEXT(s->block_device_mapping_volume_ids, (aa), pa); } else + if ((aret = argcmp(str, "BootModes")) == 0 || aret == '=' || aret == '.') { + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "BootModes argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "BootModes require an index\n"); + if (s->boot_modes) { + for (; s->boot_modes[last]; ++last); + } + if (pos < last) { + s->boot_modes[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->boot_modes, "", pa); + SET_NEXT(s->boot_modes, (aa), pa); + } + } else { + TRY(!aa, "BootModes argument missing\n"); + s->boot_modes_str = aa; + } + } else if (!(aret = argcmp(str, "BootModes[]")) || aret == '=') { + TRY(!aa, "BootModes[] argument missing\n"); + SET_NEXT(s->boot_modes, (aa), pa); + } else if ((aret = argcmp(str, "ClientTokens")) == 0 || aret == '=' || aret == '.') { if (aret == '.') { int pos; @@ -11825,6 +11935,34 @@ int filters_vms_state_parser(void *v_s, char *str, char *aa, struct ptr_array *p int filters_volume_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { struct filters_volume *s = v_s; int aret = 0; + if ((aret = argcmp(str, "ClientTokens")) == 0 || aret == '=' || aret == '.') { + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "ClientTokens argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "ClientTokens require an index\n"); + if (s->client_tokens) { + for (; s->client_tokens[last]; ++last); + } + if (pos < last) { + s->client_tokens[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->client_tokens, "", pa); + SET_NEXT(s->client_tokens, (aa), pa); + } + } else { + TRY(!aa, "ClientTokens argument missing\n"); + s->client_tokens_str = aa; + } + } else if (!(aret = argcmp(str, "ClientTokens[]")) || aret == '=') { + TRY(!aa, "ClientTokens[] argument missing\n"); + SET_NEXT(s->client_tokens, (aa), pa); + } else if ((aret = argcmp(str, "CreationDates")) == 0 || aret == '=' || aret == '.') { if (aret == '.') { int pos; @@ -12730,6 +12868,34 @@ int image_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { s->block_device_mappings_str = aa; // array ref BlockDeviceMappingImage ref } } else + if ((aret = argcmp(str, "BootModes")) == 0 || aret == '=' || aret == '.') { + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "BootModes argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "BootModes require an index\n"); + if (s->boot_modes) { + for (; s->boot_modes[last]; ++last); + } + if (pos < last) { + s->boot_modes[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->boot_modes, "", pa); + SET_NEXT(s->boot_modes, (aa), pa); + } + } else { + TRY(!aa, "BootModes argument missing\n"); + s->boot_modes_str = aa; + } + } else if (!(aret = argcmp(str, "BootModes[]")) || aret == '=') { + TRY(!aa, "BootModes[] argument missing\n"); + SET_NEXT(s->boot_modes, (aa), pa); + } else if ((aret = argcmp(str, "CreationDate")) == 0 || aret == '=' || aret == '.') { TRY(!aa, "CreationDate argument missing\n"); s->creation_date = aa; // string string @@ -12815,6 +12981,16 @@ int image_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { s->root_device_type = aa; // string string } else + if ((aret = argcmp(str, "SecureBoot")) == 0 || aret == '=' || aret == '.') { + s->is_set_secure_boot = 1; + if (!aa || !strcasecmp(aa, "true")) { + s->secure_boot = 1; + } else if (!strcasecmp(aa, "false")) { + s->secure_boot = 0; + } else { + BAD_RET("SecureBoot require true/false\n"); + } + } else if ((aret = argcmp(str, "State")) == 0 || aret == '=' || aret == '.') { TRY(!aa, "State argument missing\n"); s->state = aa; // string string @@ -16668,6 +16844,11 @@ int snapshot_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { TRY(!aa, "AccountId argument missing\n"); s->account_id = aa; // string string + } else + if ((aret = argcmp(str, "ClientToken")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "ClientToken argument missing\n"); + s->client_token = aa; // string string + } else if ((aret = argcmp(str, "CreationDate")) == 0 || aret == '=' || aret == '.') { TRY(!aa, "CreationDate argument missing\n"); @@ -17263,6 +17444,23 @@ int virtual_gateway_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) int vm_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { struct vm *s = v_s; int aret = 0; + if ((aret = argcmp(str, "ActionsOnNextBoot")) == 0 || aret == '=' || aret == '.') { + char *dot_pos; + + TRY(!aa, "ActionsOnNextBoot argument missing\n"); + dot_pos = strchr(str, '.'); + if (dot_pos++) { + cascade_struct = &s->actions_on_next_boot; + cascade_parser = actions_on_next_boot_parser; + if (*dot_pos == '.') { + ++dot_pos; + } + STRY(actions_on_next_boot_parser(&s->actions_on_next_boot, dot_pos, aa, pa)); + s->is_set_actions_on_next_boot = 1; + } else { + s->actions_on_next_boot_str = aa; + } + } else if ((aret = argcmp(str, "Architecture")) == 0 || aret == '=' || aret == '.') { TRY(!aa, "Architecture argument missing\n"); s->architecture = aa; // string string @@ -17293,6 +17491,11 @@ int vm_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { s->block_device_mappings_str = aa; // array ref BlockDeviceMappingCreated ref } } else + if ((aret = argcmp(str, "BootMode")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "BootMode argument missing\n"); + s->boot_mode = aa; // string string + + } else if ((aret = argcmp(str, "BsuOptimized")) == 0 || aret == '=' || aret == '.') { s->is_set_bsu_optimized = 1; if (!aa || !strcasecmp(aa, "true")) { @@ -17939,6 +18142,11 @@ int vm_type_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { int volume_parser(void *v_s, char *str, char *aa, struct ptr_array *pa) { struct volume *s = v_s; int aret = 0; + if ((aret = argcmp(str, "ClientToken")) == 0 || aret == '=' || aret == '.') { + TRY(!aa, "ClientToken argument missing\n"); + s->client_token = aa; // string string + + } else if ((aret = argcmp(str, "CreationDate")) == 0 || aret == '=' || aret == '.') { TRY(!aa, "CreationDate argument missing\n"); s->creation_date = aa; // string string @@ -20795,6 +21003,40 @@ int main(int ac, char **av) s->block_device_mappings_str = aa; // array ref BlockDeviceMappingImage ref } } else + if ((aret = argcmp(next_a, "BootModes")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "BootModes argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "BootModes argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "BootModes require an index\n"); + if (s->boot_modes) { + for (; s->boot_modes[last]; ++last); + } + if (pos < last) { + s->boot_modes[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->boot_modes, "", pa); + SET_NEXT(s->boot_modes, (aa), pa); + } + } else { + TRY(!aa, "BootModes argument missing\n"); + s->boot_modes_str = aa; + } + } else if (!(aret = argcmp(str, "BootModes[]")) || aret == '=') { + TRY(!aa, "BootModes[] argument missing\n"); + SET_NEXT(s->boot_modes, (aa), pa); + } else if ((aret = argcmp(next_a, "Description")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { @@ -24216,6 +24458,17 @@ int main(int ac, char **av) if (aa && aa[0] == '-' && aa[1] == '-' && aa[2] != '-') { META_ARGS({ aa = 0; incr = 1; }); } + if ((aret = argcmp(next_a, "ClientToken")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "ClientToken argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "ClientToken argument missing\n"); + s->client_token = aa; // string string + + } else if ((aret = argcmp(next_a, "Description")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { @@ -25456,6 +25709,29 @@ int main(int ac, char **av) if (aa && aa[0] == '-' && aa[1] == '-' && aa[2] != '-') { META_ARGS({ aa = 0; incr = 1; }); } + if ((aret = argcmp(next_a, "ActionsOnNextBoot")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "ActionsOnNextBoot argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + char *dot_pos; + + TRY(!aa, "ActionsOnNextBoot argument missing\n"); + dot_pos = strchr(str, '.'); + if (dot_pos++) { + cascade_struct = &s->actions_on_next_boot; + cascade_parser = actions_on_next_boot_parser; + if (*dot_pos == '.') { + ++dot_pos; + } + STRY(actions_on_next_boot_parser(&s->actions_on_next_boot, dot_pos, aa, pa)); + s->is_set_actions_on_next_boot = 1; + } else { + s->actions_on_next_boot_str = aa; + } + } else if ((aret = argcmp(next_a, "BlockDeviceMappings")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { @@ -25487,6 +25763,17 @@ int main(int ac, char **av) s->block_device_mappings_str = aa; // array ref BlockDeviceMappingVmCreation ref } } else + if ((aret = argcmp(next_a, "BootMode")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "BootMode argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "BootMode argument missing\n"); + s->boot_mode = aa; // string string + + } else if ((aret = argcmp(next_a, "BootOnCreation")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { @@ -25912,6 +26199,17 @@ int main(int ac, char **av) if (aa && aa[0] == '-' && aa[1] == '-' && aa[2] != '-') { META_ARGS({ aa = 0; incr = 1; }); } + if ((aret = argcmp(next_a, "ClientToken")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "ClientToken argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "ClientToken argument missing\n"); + s->client_token = aa; // string string + + } else if ((aret = argcmp(next_a, "DryRun")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { @@ -37953,6 +38251,28 @@ int main(int ac, char **av) s->filters_str = aa; } } else + if ((aret = argcmp(next_a, "NextPageToken")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "NextPageToken argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "NextPageToken argument missing\n"); + s->next_page_token = aa; // string string + + } else + if ((aret = argcmp(next_a, "ResultsPerPage")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "ResultsPerPage argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + TRY(!aa, "ResultsPerPage argument missing\n"); + s->is_set_results_per_page = 1; + s->results_per_page = atoll(aa); + } else { BAD_RET("'%s' is not a valide argument for 'ReadNics'\n", next_a); } @@ -46385,6 +46705,40 @@ int main(int ac, char **av) s->permissions_to_launch_str = aa; } } else + if ((aret = argcmp(next_a, "ProductCodes")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "ProductCodes argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + if (aret == '.') { + int pos; + char *endptr; + int last = 0; + char *dot_pos = strchr(str, '.'); + + TRY(!(dot_pos++), "ProductCodes argument missing\n"); + pos = strtoul(dot_pos, &endptr, 0); + TRY(endptr == dot_pos, "ProductCodes require an index\n"); + if (s->product_codes) { + for (; s->product_codes[last]; ++last); + } + if (pos < last) { + s->product_codes[pos] = (aa); + } else { + for (int i = last; i < pos; ++i) + SET_NEXT(s->product_codes, "", pa); + SET_NEXT(s->product_codes, (aa), pa); + } + } else { + TRY(!aa, "ProductCodes argument missing\n"); + s->product_codes_str = aa; + } + } else if (!(aret = argcmp(str, "ProductCodes[]")) || aret == '=') { + TRY(!aa, "ProductCodes[] argument missing\n"); + SET_NEXT(s->product_codes, (aa), pa); + } else { BAD_RET("'%s' is not a valide argument for 'UpdateImage'\n", next_a); } @@ -48575,6 +48929,29 @@ int main(int ac, char **av) if (aa && aa[0] == '-' && aa[1] == '-' && aa[2] != '-') { META_ARGS({ aa = 0; incr = 1; }); } + if ((aret = argcmp(next_a, "ActionsOnNextBoot")) == 0 || aret == '=' || aret == '.') { + char *eq_ptr = strchr(next_a, '='); + if (eq_ptr) { + TRY((!*eq_ptr), "ActionsOnNextBoot argument missing\n"); + aa = eq_ptr + 1; + incr = 1; + } + char *dot_pos; + + TRY(!aa, "ActionsOnNextBoot argument missing\n"); + dot_pos = strchr(str, '.'); + if (dot_pos++) { + cascade_struct = &s->actions_on_next_boot; + cascade_parser = actions_on_next_boot_parser; + if (*dot_pos == '.') { + ++dot_pos; + } + STRY(actions_on_next_boot_parser(&s->actions_on_next_boot, dot_pos, aa, pa)); + s->is_set_actions_on_next_boot = 1; + } else { + s->actions_on_next_boot_str = aa; + } + } else if ((aret = argcmp(next_a, "BlockDeviceMappings")) == 0 || aret == '=' || aret == '.') { char *eq_ptr = strchr(next_a, '='); if (eq_ptr) { diff --git a/osc-sdk-C b/osc-sdk-C index e8ce26d..9715eaa 160000 --- a/osc-sdk-C +++ b/osc-sdk-C @@ -1 +1 @@ -Subproject commit e8ce26dcb3232373c71d1e7b3d350bdb054aafb0 +Subproject commit 9715eaa3ca72be1e6bc9a26672ad2402e0fc66bc diff --git a/osc_sdk.c b/osc_sdk.c index a94b678..cd29d7f 100644 --- a/osc_sdk.c +++ b/osc_sdk.c @@ -756,7 +756,7 @@ static const char *calls_descriptions[] = { , "Usage: oapi-cli UpdateVmGroup --VmGroupId=vmgroupid [OPTIONS]\n" "> [WARNING]\n> This feature is currently under development and may not function \n" "properly.\n\nModifies the specified attributes of a group of virtual machines \n" "(VMs).\n" "\nRequired Argument: VmGroupId \n" , - "Usage: oapi-cli UpdateVm --VmId=vmid [OPTIONS]\n" "Modifies the specified attributes of a virtual machine (VM).\nYou must stop the \n" "VM before modifying the following attributes:\n* `NestedVirtualization`\n* \n" "`Performance`\n* `UserData`\n* `VmType`\n" "\nRequired Argument: VmId \n" + "Usage: oapi-cli UpdateVm --VmId=vmid [OPTIONS]\n" "Modifies the specified attributes of a virtual machine (VM).\nYou must stop the \n" "VM before modifying the following attributes:\n* `NestedVirtualization`\n* \n" "`Performance`\n* `UserData`\n* `VmType`\n\nTo complete the update of secure \n" "boot, you need to do a stop/start of the VM. A simple restart is not \n" "sufficient, as the update is done when the VM goes through the stopped state. \n" "For the difference between stop/start and restart, see [About VM \n" "Lifecycle](https://docs.outscale.com/en/userguide/About-VM-Lifecycle.html).\n" "\nRequired Argument: VmId \n" , "Usage: oapi-cli UpdateVmTemplate --VmTemplateId=vmtemplateid [OPTIONS]\n" "> [WARNING]\n> This feature is currently under development and may not function \n" "properly.\n\nModifies the specified attributes of a template of virtual \n" "machines (VMs).\n" "\nRequired Argument: VmTemplateId \n" , @@ -1007,6 +1007,8 @@ static const char *calls_args_descriptions[] = { " and `z`, and the second `X` is a letter between `a` and `z`).\n" " --BlockDeviceMappings.INDEX.VirtualDeviceName: string\n" " The name of the virtual device (`ephemeralN`).\n" +"--BootModes: array string\n" + " The boot modes compatible with the OMI (`legacy` and/or `uefi`).\n" "--Description: string\n" " A description for the new OMI.\n" "--DryRun: bool\n" @@ -1415,7 +1417,9 @@ static const char *calls_args_descriptions[] = { "--SnapshotId: string\n" " The ID of the snapshot to export.\n" , - "--Description: string\n" + "--ClientToken: string\n" + " A unique identifier which enables you to manage the idempotency.\n" +"--Description: string\n" " A description for the snapshot.\n" "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" @@ -1539,7 +1543,12 @@ static const char *calls_args_descriptions[] = { "--VmTemplateName: string\n" " The name of the VM template.\n" , - "--BlockDeviceMappings: array ref BlockDeviceMappingVmCreation\n" + "--ActionsOnNextBoot: ref ActionsOnNextBoot\n" + " The action to perform on the next boot of the VM.\n" + " --ActionsOnNextBoot.SecureBoot: string\n" + " One action to perform on the next boot of the VM (`enable` | `disable` | \n" + " `setup-mode` |`none`).\n" +"--BlockDeviceMappings: array ref BlockDeviceMappingVmCreation\n" " One or more block device mappings.\n" " Information about the block device mapping.\n" " --BlockDeviceMappings.INDEX.Bsu: ref BsuToCreate\n" @@ -1575,6 +1584,8 @@ static const char *calls_args_descriptions[] = { " OMI.\n" " --BlockDeviceMappings.INDEX.VirtualDeviceName: string\n" " The name of the virtual device (`ephemeralN`).\n" +"--BootMode: string\n" + " Information about the boot mode of the OMI (`legacy` and/or `uefi`).\n" "--BootOnCreation: bool\n" " By default or if true, the VM is started on creation. If false, the VM is stopped on \n" " creation.\n" @@ -1677,7 +1688,9 @@ static const char *calls_args_descriptions[] = { " provided in the `Performance` parameter. For more information, see [VM \n" " Types](https://docs.outscale.com/en/userguide/VM-Types.html).\n" , - "--DryRun: bool\n" + "--ClientToken: string\n" + " A unique identifier which enables you to manage the idempotency.\n" +"--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" "--Iops: long long int\n" " The number of I/O operations per second (IOPS). This parameter must be specified only if \n" @@ -1823,7 +1836,7 @@ static const char *calls_args_descriptions[] = { " One or more tags to delete from the load balancers.\n" " Information about the tag.\n" " --Tags.INDEX.Key: string\n" - " The key of the tag, with a minimum of 1 character.\n" + " The key of the tag, between 1 and 128 characters.\n" , "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" @@ -2538,6 +2551,8 @@ static const char *calls_args_descriptions[] = { " The sizes of the volumes, in gibibytes (GiB).\n" " --Filters.BlockDeviceMappingVolumeTypes: array string\n" " The types of volumes (`standard` \\| `gp2` \\| `io1`).\n" + " --Filters.BootModes: array string\n" + " The boot modes compatible with the OMIs (`legacy` and/or `uefi`).\n" " --Filters.Descriptions: array string\n" " The descriptions of the OMIs, provided when they were created.\n" " --Filters.FileLocations: array string\n" @@ -2560,6 +2575,8 @@ static const char *calls_args_descriptions[] = { " The name of the root device. This value must be /dev/sda1.\n" " --Filters.RootDeviceTypes: array string\n" " The types of root device used by the OMIs (`bsu` or `ebs`).\n" + " --Filters.SecureBoot: bool\n" + " Whether secure boot is activated or not.\n" " --Filters.States: array string\n" " The states of the OMIs (`pending` \\| `available` \\| `failed`).\n" " --Filters.TagKeys: array string\n" @@ -2899,6 +2916,11 @@ static const char *calls_args_descriptions[] = { " The key/value combination of the tags associated with the NICs, in the \n" " following format: \n" " \"Filters\":{\"Tags\":[\"TAGKEY=TAGVALUE\"]}.\n" +"--NextPageToken: string\n" + " The token to request the next page of results. Each token refers to a specific page.\n" +"--ResultsPerPage: long long int\n" + " The maximum number of logs returned in a single response (between `1` and `1000`, both \n" + " included). By default, `100`.\n" , "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" @@ -3150,6 +3172,8 @@ static const char *calls_args_descriptions[] = { " The account aliases of the owners of the snapshots.\n" " --Filters.AccountIds: array string\n" " The account IDs of the owners of the snapshots.\n" + " --Filters.ClientTokens: array string\n" + " The idempotency tokens provided when creating the snapshots.\n" " --Filters.Descriptions: array string\n" " The descriptions of the snapshots.\n" " --Filters.FromCreationDate: string\n" @@ -3485,6 +3509,8 @@ static const char *calls_args_descriptions[] = { " `detaching` \\| `detached`).\n" " --Filters.BlockDeviceMappingVolumeIds: array string\n" " The volume IDs of the BSU volumes.\n" + " --Filters.BootModes: array string\n" + " The boot modes of the VMs (`legacy` \\| `uefi`).\n" " --Filters.ClientTokens: array string\n" " The idempotency tokens provided when launching the VMs.\n" " --Filters.CreationDates: array string\n" @@ -3658,6 +3684,8 @@ static const char *calls_args_descriptions[] = { " If true, checks whether you have the required permissions to perform the action.\n" "--Filters: ref FiltersVolume\n" " One or more filters.\n" + " --Filters.ClientTokens: array string\n" + " The idempotency tokens provided when creating the volumes.\n" " --Filters.CreationDates: array string\n" " The dates and times at which the volumes were created, in ISO 8601 \n" " date-time format (for example, `2020-06-30T00:00:00.000Z`).\n" @@ -4014,6 +4042,9 @@ static const char *calls_args_descriptions[] = { " `Additions`) or to make the resource private (if the parent parameter is \n" " `Removals`).\n(Response) If true, the resource is public. If false, \n" " the resource is private.\n" +"--ProductCodes: array string\n" + " The product codes associated with the OMI. Any previously set value is deleted. Make sure \n" + " to specify all product codes you want to associate with the OMI.\n" , "--DryRun: bool\n" " If true, checks whether you have the required permissions to perform the action.\n" @@ -4053,7 +4084,8 @@ static const char *calls_args_descriptions[] = { " The number of consecutive successful requests before considering the VM \n" " as healthy (between `2` and `10` both included).\n" " --HealthCheck.Path: string\n" - " If you use the HTTP or HTTPS protocols, the request URL path.\n" + " If you use the HTTP or HTTPS protocols, the request URL path. Always \n" + " starts with a slash (`/`).\n" " --HealthCheck.Port: long long int\n" " The port number (between `1` and `65535`, both included).\n" " --HealthCheck.Protocol: string\n" @@ -4245,7 +4277,12 @@ static const char *calls_args_descriptions[] = { "--VmTemplateId: string\n" " A new VM template ID for your VM group.\n" , - "--BlockDeviceMappings: array ref BlockDeviceMappingVmUpdate\n" + "--ActionsOnNextBoot: ref ActionsOnNextBoot\n" + " The action to perform on the next boot of the VM.\n" + " --ActionsOnNextBoot.SecureBoot: string\n" + " One action to perform on the next boot of the VM (`enable` | `disable` | \n" + " `setup-mode` |`none`).\n" +"--BlockDeviceMappings: array ref BlockDeviceMappingVmUpdate\n" " One or more block device mappings of the VM.\n" " Information about the block device mapping.\n" " --BlockDeviceMappings.INDEX.Bsu: ref BsuToUpdateVm\n" @@ -4824,6 +4861,7 @@ static int access_key_setter(struct access_key *args, struct osc_str *data); static int access_key_secret_key_setter(struct access_key_secret_key *args, struct osc_str *data); static int access_log_setter(struct access_log *args, struct osc_str *data); static int account_setter(struct account *args, struct osc_str *data); +static int actions_on_next_boot_setter(struct actions_on_next_boot *args, struct osc_str *data); static int api_access_policy_setter(struct api_access_policy *args, struct osc_str *data); static int api_access_rule_setter(struct api_access_rule *args, struct osc_str *data); static int application_sticky_cookie_policy_setter(struct application_sticky_cookie_policy *args, struct osc_str *data); @@ -5200,6 +5238,17 @@ static int account_setter(struct account *args, struct osc_str *data) { return !!ret; } +static int actions_on_next_boot_setter(struct actions_on_next_boot *args, struct osc_str *data) { + int count_args = 0; + int ret = 0; + if (args->secure_boot) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"SecureBoot\":", args->secure_boot); + ret += 1; + } + + return !!ret; +} static int api_access_policy_setter(struct api_access_policy *args, struct osc_str *data) { int count_args = 0; int ret = 0; @@ -7039,6 +7088,22 @@ static int filters_image_setter(struct filters_image *args, struct osc_str *data ARG_TO_JSON(BlockDeviceMappingVolumeTypes, string, args->block_device_mapping_volume_types_str); ret += 1; } + if (args->boot_modes) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"BootModes\":[" )); + for (as = args->boot_modes; *as; ++as) { + if (as != args->boot_modes) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->boot_modes_str) { + ARG_TO_JSON(BootModes, string, args->boot_modes_str); + ret += 1; + } if (args->descriptions) { char **as; @@ -7203,6 +7268,10 @@ static int filters_image_setter(struct filters_image *args, struct osc_str *data ARG_TO_JSON(RootDeviceTypes, string, args->root_device_types_str); ret += 1; } + if (args->is_set_secure_boot) { + ARG_TO_JSON(SecureBoot, bool, args->secure_boot); + ret += 1; + } if (args->states) { char **as; @@ -9549,6 +9618,22 @@ static int filters_snapshot_setter(struct filters_snapshot *args, struct osc_str ARG_TO_JSON(AccountIds, string, args->account_ids_str); ret += 1; } + if (args->client_tokens) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"ClientTokens\":[" )); + for (as = args->client_tokens; *as; ++as) { + if (as != args->client_tokens) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->client_tokens_str) { + ARG_TO_JSON(ClientTokens, string, args->client_tokens_str); + ret += 1; + } if (args->descriptions) { char **as; @@ -10270,6 +10355,22 @@ static int filters_vm_setter(struct filters_vm *args, struct osc_str *data) { ARG_TO_JSON(BlockDeviceMappingVolumeIds, string, args->block_device_mapping_volume_ids_str); ret += 1; } + if (args->boot_modes) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"BootModes\":[" )); + for (as = args->boot_modes; *as; ++as) { + if (as != args->boot_modes) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->boot_modes_str) { + ARG_TO_JSON(BootModes, string, args->boot_modes_str); + ret += 1; + } if (args->client_tokens) { char **as; @@ -11776,6 +11877,22 @@ static int filters_vms_state_setter(struct filters_vms_state *args, struct osc_s static int filters_volume_setter(struct filters_volume *args, struct osc_str *data) { int count_args = 0; int ret = 0; + if (args->client_tokens) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"ClientTokens\":[" )); + for (as = args->client_tokens; *as; ++as) { + if (as != args->client_tokens) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->client_tokens_str) { + ARG_TO_JSON(ClientTokens, string, args->client_tokens_str); + ret += 1; + } if (args->creation_dates) { char **as; @@ -12328,6 +12445,22 @@ static int image_setter(struct image *args, struct osc_str *data) { ARG_TO_JSON(BlockDeviceMappings, string, args->block_device_mappings_str); ret += 1; } + if (args->boot_modes) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"BootModes\":[" )); + for (as = args->boot_modes; *as; ++as) { + if (as != args->boot_modes) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->boot_modes_str) { + ARG_TO_JSON(BootModes, string, args->boot_modes_str); + ret += 1; + } if (args->creation_date) { TRY_APPEND_COL(count_args, data); ARG_TO_JSON_STR("\"CreationDate\":", args->creation_date); @@ -12394,6 +12527,10 @@ static int image_setter(struct image *args, struct osc_str *data) { ARG_TO_JSON_STR("\"RootDeviceType\":", args->root_device_type); ret += 1; } + if (args->is_set_secure_boot) { + ARG_TO_JSON(SecureBoot, bool, args->secure_boot); + ret += 1; + } if (args->state) { TRY_APPEND_COL(count_args, data); ARG_TO_JSON_STR("\"State\":", args->state); @@ -15239,6 +15376,11 @@ static int snapshot_setter(struct snapshot *args, struct osc_str *data) { ARG_TO_JSON_STR("\"AccountId\":", args->account_id); ret += 1; } + if (args->client_token) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"ClientToken\":", args->client_token); + ret += 1; + } if (args->creation_date) { TRY_APPEND_COL(count_args, data); ARG_TO_JSON_STR("\"CreationDate\":", args->creation_date); @@ -15720,6 +15862,16 @@ static int virtual_gateway_setter(struct virtual_gateway *args, struct osc_str * static int vm_setter(struct vm *args, struct osc_str *data) { int count_args = 0; int ret = 0; + if (args->actions_on_next_boot_str) { + ARG_TO_JSON(ActionsOnNextBoot, string, args->actions_on_next_boot_str); + ret += 1; + } else if (args->is_set_actions_on_next_boot) { + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"ActionsOnNextBoot\": { " )); + STRY(actions_on_next_boot_setter(&args->actions_on_next_boot, data) < 0); + STRY(osc_str_append_string(data, "}" )); + ret += 1; + } if (args->architecture) { TRY_APPEND_COL(count_args, data); ARG_TO_JSON_STR("\"Architecture\":", args->architecture); @@ -15743,6 +15895,11 @@ static int vm_setter(struct vm *args, struct osc_str *data) { ARG_TO_JSON(BlockDeviceMappings, string, args->block_device_mappings_str); ret += 1; } + if (args->boot_mode) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"BootMode\":", args->boot_mode); + ret += 1; + } if (args->is_set_bsu_optimized) { ARG_TO_JSON(BsuOptimized, bool, args->bsu_optimized); ret += 1; @@ -16239,6 +16396,11 @@ static int vm_type_setter(struct vm_type *args, struct osc_str *data) { static int volume_setter(struct volume *args, struct osc_str *data) { int count_args = 0; int ret = 0; + if (args->client_token) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"ClientToken\":", args->client_token); + ret += 1; + } if (args->creation_date) { TRY_APPEND_COL(count_args, data); ARG_TO_JSON_STR("\"CreationDate\":", args->creation_date); @@ -17555,6 +17717,22 @@ static int create_image_data(struct osc_env *e, struct osc_create_image_arg *ar ARG_TO_JSON(BlockDeviceMappings, string, args->block_device_mappings_str); ret += 1; } + if (args->boot_modes) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"BootModes\":[" )); + for (as = args->boot_modes; *as; ++as) { + if (as != args->boot_modes) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->boot_modes_str) { + ARG_TO_JSON(BootModes, string, args->boot_modes_str); + ret += 1; + } if (args->description) { TRY_APPEND_COL(count_args, data); ARG_TO_JSON_STR("\"Description\":", args->description); @@ -19218,6 +19396,11 @@ static int create_snapshot_data(struct osc_env *e, struct osc_create_snapshot_a goto no_data; osc_str_append_string(data, "{"); + if (args->client_token) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"ClientToken\":", args->client_token); + ret += 1; + } if (args->description) { TRY_APPEND_COL(count_args, data); ARG_TO_JSON_STR("\"Description\":", args->description); @@ -19821,6 +20004,16 @@ static int create_vms_data(struct osc_env *e, struct osc_create_vms_arg *args, goto no_data; osc_str_append_string(data, "{"); + if (args->actions_on_next_boot_str) { + ARG_TO_JSON(ActionsOnNextBoot, string, args->actions_on_next_boot_str); + ret += 1; + } else if (args->is_set_actions_on_next_boot) { + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"ActionsOnNextBoot\": { " )); + STRY(actions_on_next_boot_setter(&args->actions_on_next_boot, data) < 0); + STRY(osc_str_append_string(data, "}" )); + ret += 1; + } if (args->block_device_mappings) { TRY_APPEND_COL(count_args, data); STRY(osc_str_append_string(data, "\"BlockDeviceMappings\":[" )); @@ -19839,6 +20032,11 @@ static int create_vms_data(struct osc_env *e, struct osc_create_vms_arg *args, ARG_TO_JSON(BlockDeviceMappings, string, args->block_device_mappings_str); ret += 1; } + if (args->boot_mode) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"BootMode\":", args->boot_mode); + ret += 1; + } if (args->is_set_boot_on_creation) { ARG_TO_JSON(BootOnCreation, bool, args->boot_on_creation); ret += 1; @@ -20026,6 +20224,11 @@ static int create_volume_data(struct osc_env *e, struct osc_create_volume_arg * goto no_data; osc_str_append_string(data, "{"); + if (args->client_token) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"ClientToken\":", args->client_token); + ret += 1; + } if (args->is_set_dry_run) { ARG_TO_JSON(DryRun, bool, args->dry_run); ret += 1; @@ -25824,6 +26027,15 @@ static int read_nics_data(struct osc_env *e, struct osc_read_nics_arg *args, st STRY(osc_str_append_string(data, "}" )); ret += 1; } + if (args->next_page_token) { + TRY_APPEND_COL(count_args, data); + ARG_TO_JSON_STR("\"NextPageToken\":", args->next_page_token); + ret += 1; + } + if (args->is_set_results_per_page || args->results_per_page) { + ARG_TO_JSON(ResultsPerPage, int, args->results_per_page); + ret += 1; + } osc_str_append_string(data, "}"); no_data: @@ -29870,6 +30082,22 @@ static int update_image_data(struct osc_env *e, struct osc_update_image_arg *ar STRY(osc_str_append_string(data, "}" )); ret += 1; } + if (args->product_codes) { + char **as; + + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"ProductCodes\":[" )); + for (as = args->product_codes; *as; ++as) { + if (as != args->product_codes) + STRY(osc_str_append_string(data, "," )); + ARG_TO_JSON_STR("", *as); + } + STRY(osc_str_append_string(data, "]" )); + ret += 1; + } else if (args->product_codes_str) { + ARG_TO_JSON(ProductCodes, string, args->product_codes_str); + ret += 1; + } osc_str_append_string(data, "}"); no_data: @@ -30920,6 +31148,16 @@ static int update_vm_data(struct osc_env *e, struct osc_update_vm_arg *args, st goto no_data; osc_str_append_string(data, "{"); + if (args->actions_on_next_boot_str) { + ARG_TO_JSON(ActionsOnNextBoot, string, args->actions_on_next_boot_str); + ret += 1; + } else if (args->is_set_actions_on_next_boot) { + TRY_APPEND_COL(count_args, data); + STRY(osc_str_append_string(data, "\"ActionsOnNextBoot\": { " )); + STRY(actions_on_next_boot_setter(&args->actions_on_next_boot, data) < 0); + STRY(osc_str_append_string(data, "}" )); + ret += 1; + } if (args->block_device_mappings) { TRY_APPEND_COL(count_args, data); STRY(osc_str_append_string(data, "\"BlockDeviceMappings\":[" )); diff --git a/osc_sdk.h b/osc_sdk.h index d6196d2..4f84712 100644 --- a/osc_sdk.h +++ b/osc_sdk.h @@ -77,8 +77,8 @@ struct osc_str { #define OSC_ENV_FREE_AK_SK (OSC_ENV_FREE_AK | OSC_ENV_FREE_SK) -#define OSC_API_VERSION "1.34.3" -#define OSC_SDK_VERSION 0X001400 +#define OSC_API_VERSION "1.35.3" +#define OSC_SDK_VERSION 0X001500 enum osc_auth_method { OSC_AKSK_METHOD, @@ -300,6 +300,15 @@ struct account { char *zip_code; }; +struct actions_on_next_boot { + /* + * One action to perform on the next boot of the VM (`enable` | + * `disable` | + * `setup-mode` |`none`). + */ + char *secure_boot; +}; + struct api_access_policy { /* * The maximum possible lifetime for your access keys, in seconds. If @@ -1465,6 +1474,11 @@ struct filters_image { */ char *block_device_mapping_volume_types_str; char **block_device_mapping_volume_types; + /* + * The boot modes compatible with the OMIs (`legacy` and/or `uefi`). + */ + char *boot_modes_str; + char **boot_modes; /* * The descriptions of the OMIs, provided when they were created. */ @@ -1520,6 +1534,11 @@ struct filters_image { */ char *root_device_types_str; char **root_device_types; + /* + * Whether secure boot is activated or not. + */ + int is_set_secure_boot; + int secure_boot; /* * The states of the OMIs (`pending` \\| `available` \\| `failed`). */ @@ -2339,6 +2358,11 @@ struct filters_snapshot { */ char *account_ids_str; char **account_ids; + /* + * The idempotency tokens provided when creating the snapshots. + */ + char *client_tokens_str; + char **client_tokens; /* * The descriptions of the snapshots. */ @@ -2617,6 +2641,11 @@ struct filters_vm { */ char *block_device_mapping_volume_ids_str; char **block_device_mapping_volume_ids; + /* + * The boot modes of the VMs (`legacy` \\| `uefi`). + */ + char *boot_modes_str; + char **boot_modes; /* * The idempotency tokens provided when launching the VMs. */ @@ -3139,6 +3168,11 @@ struct filters_vms_state { }; struct filters_volume { + /* + * The idempotency tokens provided when creating the volumes. + */ + char *client_tokens_str; + char **client_tokens; /* * The dates and times at which the volumes were created, in ISO 8601 * date-time format (for example, `2020-06-30T00:00:00.000Z`). @@ -3364,7 +3398,8 @@ struct health_check { int is_set_healthy_threshold; long long int healthy_threshold; /* - * If you use the HTTP or HTTPS protocols, the request URL path. + * If you use the HTTP or HTTPS protocols, the request URL path. Always + * starts with a slash (`/`). */ char *path; /* @@ -3486,6 +3521,11 @@ struct image { char *block_device_mappings_str; int nb_block_device_mappings; struct block_device_mapping_image *block_device_mappings; + /* + * The boot modes compatible with the OMI (`legacy` and/or `uefi`). + */ + char *boot_modes_str; + char **boot_modes; /* * The date and time (UTC) at which the OMI was created. */ @@ -3540,6 +3580,11 @@ struct image { * The type of root device used by the OMI (always `bsu`). */ char *root_device_type; + /* + * Whether secure boot is activated or not. + */ + int is_set_secure_boot; + int secure_boot; /* * The state of the OMI (`pending` \\| `available` \\| `failed`). */ @@ -4151,7 +4196,9 @@ struct load_balancer { * the VM * as healthy (between `2` and `10` both included). * --HealthCheck.Path: string - * If you use the HTTP or HTTPS protocols, the request URL path. + * If you use the HTTP or HTTPS protocols, the request URL path. + * Always + * starts with a slash (`/`). * --HealthCheck.Port: long long int * The port number (between `1` and `65535`, both included). * --HealthCheck.Protocol: string @@ -5562,7 +5609,7 @@ struct region { struct resource_load_balancer_tag { /* - * The key of the tag, with a minimum of 1 character. + * The key of the tag, between 1 and 128 characters. */ char *key; }; @@ -6013,6 +6060,10 @@ struct snapshot { * The account ID of the owner of the snapshot. */ char *account_id; + /* + * The idempotency token provided when creating the snapshot. + */ + char *client_token; /* * The date and time (UTC) at which the snapshot was created. */ @@ -6370,6 +6421,16 @@ struct virtual_gateway { }; struct vm { + /* + * The action to perform on the next boot of the VM. + * --ActionsOnNextBoot.SecureBoot: string + * One action to perform on the next boot of the VM (`enable` | + * `disable` | + * `setup-mode` |`none`). + */ + char *actions_on_next_boot_str; + int is_set_actions_on_next_boot; + struct actions_on_next_boot actions_on_next_boot; /* * The architecture of the VM (`i386` \\| `x86_64`). */ @@ -6397,6 +6458,9 @@ struct vm { char *block_device_mappings_str; int nb_block_device_mappings; struct block_device_mapping_created *block_device_mappings; + /* + */ + char *boot_mode; /* * This parameter is not available. It is present in our API for the * sake of historical compatibility with AWS. @@ -6862,6 +6926,10 @@ struct vm_type { }; struct volume { + /* + * The idempotency token provided when creating the volume. + */ + char *client_token; /* * The date and time (UTC) at which the volume was created. */ @@ -7760,6 +7828,11 @@ struct osc_create_image_arg { char *block_device_mappings_str; int nb_block_device_mappings; struct block_device_mapping_image *block_device_mappings; + /* + * The boot modes compatible with the OMI (`legacy` and/or `uefi`). + */ + char *boot_modes_str; + char **boot_modes; /* * A description for the new OMI. */ @@ -8606,6 +8679,10 @@ struct osc_create_snapshot_export_task_arg { struct osc_create_snapshot_arg { /* Required: null */ + /* + * A unique identifier which enables you to manage the idempotency. + */ + char *client_token; /* * A description for the snapshot. */ @@ -8883,6 +8960,16 @@ struct osc_create_vm_template_arg { struct osc_create_vms_arg { /* Required: ImageId */ + /* + * The action to perform on the next boot of the VM. + * --ActionsOnNextBoot.SecureBoot: string + * One action to perform on the next boot of the VM (`enable` | + * `disable` | + * `setup-mode` |`none`). + */ + char *actions_on_next_boot_str; + int is_set_actions_on_next_boot; + struct actions_on_next_boot actions_on_next_boot; /* * One or more block device mappings. * Information about the block device mapping. @@ -8939,6 +9026,10 @@ struct osc_create_vms_arg { char *block_device_mappings_str; int nb_block_device_mappings; struct block_device_mapping_vm_creation *block_device_mappings; + /* + * Information about the boot mode of the OMI (`legacy` and/or `uefi`). + */ + char *boot_mode; /* * By default or if true, the VM is started on creation. If false, the * VM is stopped on creation. @@ -9121,6 +9212,10 @@ struct osc_create_vms_arg { struct osc_create_volume_arg { /* Required: SubregionName */ + /* + * A unique identifier which enables you to manage the idempotency. + */ + char *client_token; /* * If true, checks whether you have the required permissions to perform * the action. @@ -9512,7 +9607,7 @@ struct osc_delete_load_balancer_tags_arg { * One or more tags to delete from the load balancers. * Information about the tag. * --Tags.INDEX.Key: string - * The key of the tag, with a minimum of 1 character. + * The key of the tag, between 1 and 128 characters. */ char *tags_str; int nb_tags; @@ -11123,6 +11218,8 @@ struct osc_read_images_arg { * The sizes of the volumes, in gibibytes (GiB). * --Filters.BlockDeviceMappingVolumeTypes: array string * The types of volumes (`standard` \\| `gp2` \\| `io1`). + * --Filters.BootModes: array string + * The boot modes compatible with the OMIs (`legacy` and/or `uefi`). * --Filters.Descriptions: array string * The descriptions of the OMIs, provided when they were created. * --Filters.FileLocations: array string @@ -11145,6 +11242,8 @@ struct osc_read_images_arg { * The name of the root device. This value must be /dev/sda1. * --Filters.RootDeviceTypes: array string * The types of root device used by the OMIs (`bsu` or `ebs`). + * --Filters.SecureBoot: bool + * Whether secure boot is activated or not. * --Filters.States: array string * The states of the OMIs (`pending` \\| `available` \\| `failed`). * --Filters.TagKeys: array string @@ -11753,6 +11852,17 @@ struct osc_read_nics_arg { char *filters_str; int is_set_filters; struct filters_nic filters; + /* + * The token to request the next page of results. Each token refers to a + * specific page. + */ + char *next_page_token; + /* + * The maximum number of logs returned in a single response (between `1` + * and `1000`, both included). By default, `100`. + */ + int is_set_results_per_page; + long long int results_per_page; }; struct osc_read_policies_arg { @@ -12238,6 +12348,8 @@ struct osc_read_snapshots_arg { * The account aliases of the owners of the snapshots. * --Filters.AccountIds: array string * The account IDs of the owners of the snapshots. + * --Filters.ClientTokens: array string + * The idempotency tokens provided when creating the snapshots. * --Filters.Descriptions: array string * The descriptions of the snapshots. * --Filters.FromCreationDate: string @@ -12877,6 +12989,8 @@ struct osc_read_vms_arg { * `detaching` \\| `detached`). * --Filters.BlockDeviceMappingVolumeIds: array string * The volume IDs of the BSU volumes. + * --Filters.BootModes: array string + * The boot modes of the VMs (`legacy` \\| `uefi`). * --Filters.ClientTokens: array string * The idempotency tokens provided when launching the VMs. * --Filters.CreationDates: array string @@ -13111,6 +13225,8 @@ struct osc_read_volumes_arg { int dry_run; /* * One or more filters. + * --Filters.ClientTokens: array string + * The idempotency tokens provided when creating the volumes. * --Filters.CreationDates: array string * The dates and times at which the volumes were created, in ISO * 8601 @@ -13923,6 +14039,13 @@ struct osc_update_image_arg { char *permissions_to_launch_str; int is_set_permissions_to_launch; struct permissions_on_resource_creation permissions_to_launch; + /* + * The product codes associated with the OMI. Any previously set value + * is deleted. Make sure to specify all product codes you want to + * associate with the OMI. + */ + char *product_codes_str; + char **product_codes; }; struct osc_update_listener_rule_arg { @@ -13994,7 +14117,9 @@ struct osc_update_load_balancer_arg { * the VM * as healthy (between `2` and `10` both included). * --HealthCheck.Path: string - * If you use the HTTP or HTTPS protocols, the request URL path. + * If you use the HTTP or HTTPS protocols, the request URL path. + * Always + * starts with a slash (`/`). * --HealthCheck.Port: long long int * The port number (between `1` and `65535`, both included). * --HealthCheck.Protocol: string @@ -14424,6 +14549,16 @@ struct osc_update_vm_group_arg { struct osc_update_vm_arg { /* Required: VmId */ + /* + * The action to perform on the next boot of the VM. + * --ActionsOnNextBoot.SecureBoot: string + * One action to perform on the next boot of the VM (`enable` | + * `disable` | + * `setup-mode` |`none`). + */ + char *actions_on_next_boot_str; + int is_set_actions_on_next_boot; + struct actions_on_next_boot actions_on_next_boot; /* * One or more block device mappings of the VM. * Information about the block device mapping. diff --git a/version b/version index a3df0a6..ac39a10 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.8.0 +0.9.0